summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/demo_menu.c (renamed from apps/screensavers_menu.c)12
-rw-r--r--apps/demo_menu.h (renamed from apps/screensavers_menu.h)6
-rw-r--r--apps/main_menu.c12
-rw-r--r--apps/options.h6
-rw-r--r--apps/recorder/blank.c96
-rw-r--r--apps/recorder/bounce.c2
-rw-r--r--apps/recorder/boxes.c129
-rw-r--r--apps/recorder/boxes.h28
8 files changed, 18 insertions, 273 deletions
diff --git a/apps/screensavers_menu.c b/apps/demo_menu.c
index 3d43347362..cbd5742c7c 100644
--- a/apps/screensavers_menu.c
+++ b/apps/demo_menu.c
@@ -20,30 +20,28 @@
20#include "options.h" 20#include "options.h"
21 21
22#ifdef HAVE_LCD_BITMAP 22#ifdef HAVE_LCD_BITMAP
23#ifdef USE_SCREENSAVERS 23#ifdef USE_DEMOS
24 24
25#include <stdio.h> 25#include <stdio.h>
26#include <stdbool.h> 26#include <stdbool.h>
27#include "lcd.h" 27#include "lcd.h"
28#include "menu.h" 28#include "menu.h"
29#include "screensavers_menu.h" 29#include "demo_menu.h"
30#include "button.h" 30#include "button.h"
31#include "kernel.h" 31#include "kernel.h"
32#include "sprintf.h" 32#include "sprintf.h"
33 33
34#include "boxes.h"
35extern Menu bounce(void); 34extern Menu bounce(void);
36extern Menu blank(void); 35extern Menu snow(void);
37 36
38Menu screensavers_menu(void) 37Menu demo_menu(void)
39{ 38{
40 int m; 39 int m;
41 Menu result; 40 Menu result;
42 41
43 struct menu_items items[] = { 42 struct menu_items items[] = {
44 { "Boxes", boxes },
45 { "Bounce", bounce }, 43 { "Bounce", bounce },
46 { "Blank", blank }, 44 { "Snow", snow },
47 }; 45 };
48 46
49 m=menu_init( items, sizeof items / sizeof(struct menu_items) ); 47 m=menu_init( items, sizeof items / sizeof(struct menu_items) );
diff --git a/apps/screensavers_menu.h b/apps/demo_menu.h
index cac4c43cc9..13c315dd82 100644
--- a/apps/screensavers_menu.h
+++ b/apps/demo_menu.h
@@ -16,10 +16,10 @@
16 * KIND, either express or implied. 16 * KIND, either express or implied.
17 * 17 *
18 ****************************************************************************/ 18 ****************************************************************************/
19#ifndef _SCREENSAVERS_MENU_H 19#ifndef _DEMOS_MENU_H
20#define _SCREENSAVERS_MENU_H 20#define _DEMOS_MENU_H
21 21
22Menu screensavers_menu(void); 22Menu demo_menu(void);
23 23
24#endif 24#endif
25 25
diff --git a/apps/main_menu.c b/apps/main_menu.c
index c9c17b59de..464b514bc3 100644
--- a/apps/main_menu.c
+++ b/apps/main_menu.c
@@ -45,9 +45,9 @@
45#include "games_menu.h" 45#include "games_menu.h"
46#endif /* End USE_GAMES */ 46#endif /* End USE_GAMES */
47 47
48#ifdef USE_SCREENSAVERS 48#ifdef USE_DEMOS
49#include "screensavers_menu.h" 49#include "demo_menu.h"
50#endif /* End USE_SCREENSAVERS */ 50#endif /* End USE_DEMOS */
51 51
52#endif /* End HAVE_LCD_BITMAP */ 52#endif /* End HAVE_LCD_BITMAP */
53 53
@@ -211,9 +211,9 @@ Menu main_menu(void)
211#ifdef USE_GAMES 211#ifdef USE_GAMES
212 { "Games", games_menu }, 212 { "Games", games_menu },
213#endif 213#endif
214#ifdef USE_SCREENSAVERS 214#ifdef USE_DEMOS
215 { "Screensavers", screensavers_menu }, 215 { "Demos", demo_menu },
216#endif /* end USE_SCREENSAVERS */ 216#endif /* end USE_DEMOS */
217#endif 217#endif
218 { "Info", show_info }, 218 { "Info", show_info },
219 { "Version", show_credits }, 219 { "Version", show_credits },
diff --git a/apps/options.h b/apps/options.h
index de7b94b112..24cd2ad58c 100644
--- a/apps/options.h
+++ b/apps/options.h
@@ -20,9 +20,9 @@
20#ifndef __OPTIONS_H__ 20#ifndef __OPTIONS_H__
21#define __OPTIONS_H__ 21#define __OPTIONS_H__
22 22
23#ifndef DISABLE_SCREENSAVERS 23#ifndef DISABLE_DEMOS
24#undef USE_SCREENSAVERS /* since older Makefiles set the define */ 24#undef USE_DEMOS /* since older Makefiles set the define */
25#define USE_SCREENSAVERS 25#define USE_DEMOS
26#endif 26#endif
27 27
28#ifndef DISABLE_GAMES 28#ifndef DISABLE_GAMES
diff --git a/apps/recorder/blank.c b/apps/recorder/blank.c
deleted file mode 100644
index 78cc093622..0000000000
--- a/apps/recorder/blank.c
+++ /dev/null
@@ -1,96 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2002 Robert E. Hak
11 *
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
14 *
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
17 *
18 ****************************************************************************/
19
20#include "config.h"
21#include "options.h"
22
23#ifdef USE_SCREENSAVERS
24
25#include "lcd.h"
26#include "button.h"
27#include "kernel.h"
28#include "menu.h"
29
30#ifdef SIMULATOR
31#include <stdio.h>
32#endif
33#include <string.h>
34
35#define SS_TITLE "Blank"
36#define SS_TITLE_FONT 2
37
38Menu blank(void)
39{
40 int w, h;
41 char *off = "[Off] to stop";
42 int len = strlen(SS_TITLE);
43
44 lcd_getfontsize(SS_TITLE_FONT, &w, &h);
45
46 /* Get horizontel centering for text */
47 len *= w;
48 if (len%2 != 0)
49 len = ((len+1)/2)+(w/2);
50 else
51 len /= 2;
52
53 if (h%2 != 0)
54 h = (h/2)+1;
55 else
56 h /= 2;
57
58 lcd_clear_display();
59 lcd_putsxy(LCD_WIDTH/2-len, (LCD_HEIGHT/2)-h, SS_TITLE, SS_TITLE_FONT);
60
61 len = strlen(off);
62 lcd_getfontsize(0, &w, &h);
63
64 /* Get horizontel centering for text */
65 len *= w;
66 if (len%2 != 0)
67 len = ((len+1)/2)+(w/2);
68 else
69 len /= 2;
70
71 if (h%2 != 0)
72 h = (h/2)+1;
73 else
74 h /= 2;
75
76 lcd_putsxy(LCD_WIDTH/2-len, LCD_HEIGHT-(2*h), off, 0);
77
78 lcd_update();
79 sleep(HZ);
80
81 lcd_clear_display();
82 lcd_update();
83
84 while(1) {
85 if(button_get(false))
86 return MENU_OK;
87 sleep(HZ/10);
88 }
89
90 return MENU_OK;
91}
92
93#endif
94
95
96
diff --git a/apps/recorder/bounce.c b/apps/recorder/bounce.c
index 8f6ffe6226..96291066e5 100644
--- a/apps/recorder/bounce.c
+++ b/apps/recorder/bounce.c
@@ -20,7 +20,7 @@
20#include "config.h" 20#include "config.h"
21#include "options.h" 21#include "options.h"
22 22
23#ifdef USE_SCREENSAVERS 23#ifdef USE_DEMOS
24 24
25#include "lcd.h" 25#include "lcd.h"
26#include "button.h" 26#include "button.h"
diff --git a/apps/recorder/boxes.c b/apps/recorder/boxes.c
deleted file mode 100644
index 8e80006953..0000000000
--- a/apps/recorder/boxes.c
+++ /dev/null
@@ -1,129 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2002 Robert E. Hak (rhak at ramapo.edu)
11 *
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
14 *
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
17 *
18 ****************************************************************************/
19
20#include "config.h"
21#include "options.h"
22
23#ifdef USE_SCREENSAVERS
24
25#include "boxes.h"
26#include "lcd.h"
27#include "button.h"
28#include "kernel.h"
29#include "menu.h"
30
31#ifdef SIMULATOR
32#include <stdio.h>
33#endif
34#include <string.h>
35
36#define SS_TITLE "Boxes"
37#define SS_TITLE_FONT 2
38
39static void ss_loop(void)
40{
41 int b;
42 int x = LCD_WIDTH/2;
43 int y = LCD_HEIGHT/2;
44 int i = 0;
45 int center = 0;
46 int factor = 0;
47
48 if (LCD_HEIGHT < LCD_WIDTH)
49 center = LCD_HEIGHT/2;
50 else
51 center = LCD_WIDTH/2;
52
53 i = center+1;
54 while(1)
55 {
56 /* Grow */
57 if ( i < 0 ) {
58 factor = 1;
59 i = 1;
60 }
61
62 /* Shrink */
63 if (i >= center) {
64 factor = -1;
65 i = center;
66 }
67
68 b = button_get(false);
69 if ( b & BUTTON_OFF )
70 return;
71
72 lcd_clear_display();
73 lcd_drawrect(x-i, y-i, 2*i+1, 2*i+1);
74 lcd_update();
75
76 i+=factor;
77
78 sleep(HZ/10);
79 }
80}
81
82Menu boxes(void)
83{
84 int w, h;
85 char *off = "[Off] to stop";
86 int len = strlen(SS_TITLE);
87
88 lcd_getfontsize(SS_TITLE_FONT, &w, &h);
89
90 /* Get horizontel centering for text */
91 len *= w;
92 if (len%2 != 0)
93 len = ((len+1)/2)+(w/2);
94 else
95 len /= 2;
96
97 if (h%2 != 0)
98 h = (h/2)+1;
99 else
100 h /= 2;
101
102 lcd_clear_display();
103 lcd_putsxy(LCD_WIDTH/2-len, (LCD_HEIGHT/2)-h, SS_TITLE, SS_TITLE_FONT);
104
105 len = strlen(off);
106 lcd_getfontsize(0, &w, &h);
107
108 /* Get horizontel centering for text */
109 len *= w;
110 if (len%2 != 0)
111 len = ((len+1)/2)+(w/2);
112 else
113 len /= 2;
114
115 if (h%2 != 0)
116 h = (h/2)+1;
117 else
118 h /= 2;
119
120 lcd_putsxy(LCD_WIDTH/2-len, LCD_HEIGHT-(2*h), off,0);
121
122 lcd_update();
123 sleep(HZ/2);
124 ss_loop();
125
126 return MENU_OK;
127}
128
129#endif
diff --git a/apps/recorder/boxes.h b/apps/recorder/boxes.h
deleted file mode 100644
index 2defb0bbfc..0000000000
--- a/apps/recorder/boxes.h
+++ /dev/null
@@ -1,28 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2002 Robert E. Hak
11 *
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
14 *
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
17 *
18 ****************************************************************************/
19
20#ifndef __BOXES_H__
21#define __BOXES_H__
22
23#include "menu.h"
24
25Menu boxes(void);
26
27#endif /* __BOXES_H__ */
28