diff options
author | Daniel Stenberg <daniel@haxx.se> | 2002-05-17 12:22:24 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2002-05-17 12:22:24 +0000 |
commit | 1c0c861451caf00d5f8205fe71dcc79cd52dbe5b (patch) | |
tree | 8cdbc1ba9f1334b631db057531e3ab5300700015 /apps/app.c | |
parent | 470478f0e689440b493367b5b4da251168579da8 (diff) | |
download | rockbox-1c0c861451caf00d5f8205fe71dcc79cd52dbe5b.tar.gz rockbox-1c0c861451caf00d5f8205fe71dcc79cd52dbe5b.zip |
moved from the simulator dir
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@614 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/app.c')
-rw-r--r-- | apps/app.c | 104 |
1 files changed, 104 insertions, 0 deletions
diff --git a/apps/app.c b/apps/app.c new file mode 100644 index 0000000000..c5149d8171 --- /dev/null +++ b/apps/app.c | |||
@@ -0,0 +1,104 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2002 Daniel Stenberg | ||
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 "lcd.h" | ||
21 | #include "button.h" | ||
22 | #include "kernel.h" | ||
23 | #include "menu.h" | ||
24 | |||
25 | /* Apps to include */ | ||
26 | #include "tree.h" | ||
27 | |||
28 | #ifdef HAVE_LCD_BITMAP | ||
29 | |||
30 | /*#include "screensaver.h"*/ | ||
31 | |||
32 | /*extern void tetris(void);*/ | ||
33 | |||
34 | void app_main(void) | ||
35 | { | ||
36 | int key; | ||
37 | |||
38 | menu_init(); | ||
39 | menu_draw(); | ||
40 | put_cursor_menu_top(); | ||
41 | |||
42 | while(1) { | ||
43 | key = button_get(); | ||
44 | |||
45 | if(!key) { | ||
46 | sleep(1); | ||
47 | continue; | ||
48 | } | ||
49 | |||
50 | switch(key) { | ||
51 | case BUTTON_UP: | ||
52 | if(is_cursor_menu_top()){ | ||
53 | /* wrap around to menu bottom */ | ||
54 | put_cursor_menu_bottom(); | ||
55 | } else { | ||
56 | /* move up */ | ||
57 | move_cursor_up(); | ||
58 | } | ||
59 | break; | ||
60 | case BUTTON_DOWN: | ||
61 | if(is_cursor_menu_bottom() ){ | ||
62 | /* wrap around to menu top */ | ||
63 | put_cursor_menu_top(); | ||
64 | } else { | ||
65 | /* move down */ | ||
66 | move_cursor_down(); | ||
67 | } | ||
68 | break; | ||
69 | case BUTTON_RIGHT: | ||
70 | case BUTTON_PLAY: | ||
71 | /* Erase current display state */ | ||
72 | lcd_clear_display(); | ||
73 | |||
74 | execute_menu_item(); | ||
75 | |||
76 | /* Return to previous display state */ | ||
77 | lcd_clear_display(); | ||
78 | menu_draw(); | ||
79 | break; | ||
80 | case BUTTON_OFF: | ||
81 | return; | ||
82 | default: | ||
83 | break; | ||
84 | } | ||
85 | |||
86 | lcd_update(); | ||
87 | } | ||
88 | } | ||
89 | |||
90 | #else | ||
91 | |||
92 | void app_main(void) | ||
93 | { | ||
94 | int key; | ||
95 | int cursor = 0; | ||
96 | |||
97 | lcd_puts(0,0, "Mooo!"); | ||
98 | lcd_puts(1,1, " Rockbox!"); | ||
99 | |||
100 | browse_root(); | ||
101 | |||
102 | } | ||
103 | |||
104 | #endif | ||