diff options
Diffstat (limited to 'apps/plugins/rockboy/menu.c')
-rw-r--r-- | apps/plugins/rockboy/menu.c | 71 |
1 files changed, 62 insertions, 9 deletions
diff --git a/apps/plugins/rockboy/menu.c b/apps/plugins/rockboy/menu.c index 140e7a28b1..a22aef46f8 100644 --- a/apps/plugins/rockboy/menu.c +++ b/apps/plugins/rockboy/menu.c | |||
@@ -69,6 +69,9 @@ static const char *slot_menu[] = { | |||
69 | typedef enum { | 69 | typedef enum { |
70 | OM_ITEM_FS, | 70 | OM_ITEM_FS, |
71 | OM_ITEM_SOUND, | 71 | OM_ITEM_SOUND, |
72 | OM_ITEM_STATS, | ||
73 | OM_ITEM_FULLSCREEN, | ||
74 | OM_ITEM_KEYS, | ||
72 | OM_ITEM_BACK, | 75 | OM_ITEM_BACK, |
73 | OM_MENU_LAST | 76 | OM_MENU_LAST |
74 | } OptMenuItem; | 77 | } OptMenuItem; |
@@ -76,6 +79,9 @@ typedef enum { | |||
76 | static const char *opt_menu[] = { | 79 | static const char *opt_menu[] = { |
77 | "Frameskip", | 80 | "Frameskip", |
78 | "Sound ON/OFF", | 81 | "Sound ON/OFF", |
82 | "Stats ON/OFF", | ||
83 | "Fullscreen ON/OFF", | ||
84 | "Set Keys (BUGGY)", | ||
79 | "Previous Menu..." | 85 | "Previous Menu..." |
80 | }; | 86 | }; |
81 | 87 | ||
@@ -90,13 +96,50 @@ typedef enum { | |||
90 | } FSMenuItem; | 96 | } FSMenuItem; |
91 | 97 | ||
92 | static const char *fs_menu[] = { | 98 | static const char *fs_menu[] = { |
93 | "Skip 0 Frames", | 99 | "Frameskip 3 Max", |
94 | "Skip 1 Frames", | 100 | "Frameskip 4 Max", |
95 | "Skip 2 Frames", | 101 | "Frameskip 5 Max", |
96 | "Skip 3 Frames", | 102 | "Frameskip 7 Max", |
97 | "Previous Menu..." | 103 | "Previous Menu..." |
98 | }; | 104 | }; |
99 | 105 | ||
106 | int getbutton(char *text) | ||
107 | { | ||
108 | rb->lcd_putsxy(0, 0, text); | ||
109 | rb->lcd_update(); | ||
110 | rb->sleep(30); | ||
111 | while (rb->button_get(false) != BUTTON_NONE) | ||
112 | rb->yield(); | ||
113 | int button; | ||
114 | while(true){ | ||
115 | button = rb->button_get(true); | ||
116 | button=button&0x00000FFF; | ||
117 | switch(button) { | ||
118 | case BUTTON_LEFT: | ||
119 | case BUTTON_RIGHT: | ||
120 | case BUTTON_UP: | ||
121 | case BUTTON_DOWN: | ||
122 | break; | ||
123 | default: | ||
124 | return button; | ||
125 | break; | ||
126 | } | ||
127 | } | ||
128 | } | ||
129 | |||
130 | void setupkeys(void) | ||
131 | { | ||
132 | options.A=getbutton("Press A"); | ||
133 | |||
134 | options.B=getbutton("Press B"); | ||
135 | |||
136 | options.START=getbutton("Press Start"); | ||
137 | |||
138 | options.SELECT=getbutton("Press Select"); | ||
139 | |||
140 | options.MENU=getbutton("Press Menu"); | ||
141 | } | ||
142 | |||
100 | /* | 143 | /* |
101 | * do_user_menu - create the user menu on the screen. | 144 | * do_user_menu - create the user menu on the screen. |
102 | * | 145 | * |
@@ -144,6 +187,7 @@ int do_user_menu(void) { | |||
144 | } | 187 | } |
145 | } | 188 | } |
146 | rb->lcd_clear_display(); | 189 | rb->lcd_clear_display(); |
190 | rb->lcd_update(); | ||
147 | /* return somethin' */ | 191 | /* return somethin' */ |
148 | return ret; | 192 | return ret; |
149 | } | 193 | } |
@@ -359,16 +403,16 @@ static void do_fs_menu(void) { | |||
359 | done = true; | 403 | done = true; |
360 | break; | 404 | break; |
361 | case FS_ITEM_FS0: | 405 | case FS_ITEM_FS0: |
362 | frameskip=0; | 406 | options.maxskip=3; |
363 | break; | 407 | break; |
364 | case FS_ITEM_FS1: | 408 | case FS_ITEM_FS1: |
365 | frameskip=1; | 409 | options.maxskip=4; |
366 | break; | 410 | break; |
367 | case FS_ITEM_FS2: | 411 | case FS_ITEM_FS2: |
368 | frameskip=2; | 412 | options.maxskip=5; |
369 | break; | 413 | break; |
370 | case FS_ITEM_FS3: | 414 | case FS_ITEM_FS3: |
371 | frameskip=3; | 415 | options.maxskip=7; |
372 | break; | 416 | break; |
373 | } | 417 | } |
374 | } | 418 | } |
@@ -389,8 +433,17 @@ static void do_opt_menu(void) { | |||
389 | do_fs_menu(); | 433 | do_fs_menu(); |
390 | break; | 434 | break; |
391 | case OM_ITEM_SOUND: | 435 | case OM_ITEM_SOUND: |
392 | sound=!sound; | 436 | options.sound=!options.sound; |
437 | break; | ||
438 | case OM_ITEM_STATS: | ||
439 | options.showstats=!options.showstats; | ||
393 | break; | 440 | break; |
441 | case OM_ITEM_FULLSCREEN: | ||
442 | options.fullscreen=!options.fullscreen; | ||
443 | break; | ||
444 | case OM_ITEM_KEYS: | ||
445 | setupkeys(); | ||
446 | break; | ||
394 | case MENU_CANCEL: | 447 | case MENU_CANCEL: |
395 | case OM_ITEM_BACK: | 448 | case OM_ITEM_BACK: |
396 | done = true; | 449 | done = true; |