summaryrefslogtreecommitdiff
path: root/uisimulator/app.c
diff options
context:
space:
mode:
Diffstat (limited to 'uisimulator/app.c')
-rw-r--r--uisimulator/app.c28
1 files changed, 17 insertions, 11 deletions
diff --git a/uisimulator/app.c b/uisimulator/app.c
index 5875ac2262..bb0c831729 100644
--- a/uisimulator/app.c
+++ b/uisimulator/app.c
@@ -22,6 +22,8 @@
22#include "button.h" 22#include "button.h"
23#include "kernel.h" 23#include "kernel.h"
24 24
25#include "tree.h"
26
25#ifdef SIMULATOR 27#ifdef SIMULATOR
26#include <stdio.h> 28#include <stdio.h>
27#endif 29#endif
@@ -39,8 +41,10 @@ void menu_init(void)
39{ 41{
40 lcd_puts(6, 0, "Rockabox", 0); 42 lcd_puts(6, 0, "Rockabox", 0);
41 lcd_puts(6, 8, "Boxrock", 0); 43 lcd_puts(6, 8, "Boxrock", 0);
42 lcd_puts(6, 16, "Robkoxx", 0); 44 lcd_puts(6, 16, "Browse", 0);
45#define LINE_BROWSE 2
43 lcd_puts(6, 24, "Tetris", 0); 46 lcd_puts(6, 24, "Tetris", 0);
47#define LINE_TETRIS 3
44 lcd_puts(8, 38, "Rockbox!", 2); 48 lcd_puts(8, 38, "Rockbox!", 2);
45 49
46 lcd_puts(0, cursor, "-", 0); 50 lcd_puts(0, cursor, "-", 0);
@@ -75,23 +79,25 @@ void app_main(void)
75 } 79 }
76 break; 80 break;
77 case BUTTON_RIGHT: 81 case BUTTON_RIGHT:
78 if(cursor == (MAX_LINE * LINE_HEIGHT)) { 82 case BUTTON_PLAY:
83 switch(cursor) {
84 case (LINE_TETRIS * LINE_HEIGHT):
79 lcd_clearrect(0, 0, LCD_WIDTH, LCD_HEIGHT); 85 lcd_clearrect(0, 0, LCD_WIDTH, LCD_HEIGHT);
80 tetris(); 86 tetris();
81 lcd_clearrect(0, 0, LCD_WIDTH, LCD_HEIGHT); 87 lcd_clearrect(0, 0, LCD_WIDTH, LCD_HEIGHT);
82 menu_init(); 88 menu_init();
89 break;
90 case (LINE_BROWSE * LINE_HEIGHT):
91 lcd_clearrect(0, 0, LCD_WIDTH, LCD_HEIGHT);
92 dirbrowse("/");
93 lcd_update();
94 while((!button_get()));
95 lcd_clearrect(0, 0, LCD_WIDTH, LCD_HEIGHT);
96 menu_init();
97 break;
83 } 98 }
84 break; 99 break;
85 } 100 }
86 lcd_update(); 101 lcd_update();
87 } 102 }
88} 103}
89
90
91#ifdef _WIN32
92// for win32 simulator compability
93void main (void)
94{
95 app_main ();
96}
97#endif