diff options
author | Teruaki Kawashima <teru@rockbox.org> | 2009-08-05 14:29:29 +0000 |
---|---|---|
committer | Teruaki Kawashima <teru@rockbox.org> | 2009-08-05 14:29:29 +0000 |
commit | e2e7ecf350a4d085f6f58052f55ba29e8fe77718 (patch) | |
tree | d5abd6a205b9d32cb11e1c2d0ea08602812248d4 /apps/plugins/pacbox | |
parent | eac0a5b840571a11b181fdfd463be61aca466976 (diff) | |
download | rockbox-e2e7ecf350a4d085f6f58052f55ba29e8fe77718.tar.gz rockbox-e2e7ecf350a4d085f6f58052f55ba29e8fe77718.zip |
add playback control to more menu of plugins.
although it doesn't make much sense for some plugins like dice as the menu is only shown when you start that plugin.
change star plugin to go back to menu when exit game instead of closing plugin so that above change makes useful.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22171 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/pacbox')
-rw-r--r-- | apps/plugins/pacbox/pacbox.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/apps/plugins/pacbox/pacbox.c b/apps/plugins/pacbox/pacbox.c index e7b92c38cf..0e3343252f 100644 --- a/apps/plugins/pacbox/pacbox.c +++ b/apps/plugins/pacbox/pacbox.c | |||
@@ -29,6 +29,7 @@ | |||
29 | #include "pacbox.h" | 29 | #include "pacbox.h" |
30 | #include "pacbox_lcd.h" | 30 | #include "pacbox_lcd.h" |
31 | #include "lib/configfile.h" | 31 | #include "lib/configfile.h" |
32 | #include "lib/playback_control.h" | ||
32 | 33 | ||
33 | PLUGIN_HEADER | 34 | PLUGIN_HEADER |
34 | PLUGIN_IRAM_DECLARE | 35 | PLUGIN_IRAM_DECLARE |
@@ -78,9 +79,9 @@ static bool loadFile( const char * name, unsigned char * buf, int len ) | |||
78 | if( fd < 0 ) { | 79 | if( fd < 0 ) { |
79 | return false; | 80 | return false; |
80 | } | 81 | } |
81 | 82 | ||
82 | int n = rb->read( fd, buf, len); | 83 | int n = rb->read( fd, buf, len); |
83 | 84 | ||
84 | rb->close( fd ); | 85 | rb->close( fd ); |
85 | 86 | ||
86 | if( n != len ) { | 87 | if( n != len ) { |
@@ -174,7 +175,8 @@ static bool pacbox_menu(void) | |||
174 | 175 | ||
175 | MENUITEM_STRINGLIST(menu, "Pacbox Menu", NULL, | 176 | MENUITEM_STRINGLIST(menu, "Pacbox Menu", NULL, |
176 | "Difficulty", "Pacmen Per Game", "Bonus Life", | 177 | "Difficulty", "Pacmen Per Game", "Bonus Life", |
177 | "Ghost Names", "Display FPS", "Restart", "Quit"); | 178 | "Ghost Names", "Display FPS", |
179 | "Playback Control", "Restart", "Quit"); | ||
178 | 180 | ||
179 | rb->button_clear_queue(); | 181 | rb->button_clear_queue(); |
180 | 182 | ||
@@ -220,10 +222,13 @@ static bool pacbox_menu(void) | |||
220 | } | 222 | } |
221 | break; | 223 | break; |
222 | case 4: /* Show FPS */ | 224 | case 4: /* Show FPS */ |
223 | rb->set_option("Display FPS",&settings.showfps,INT, | 225 | rb->set_option("Display FPS",&settings.showfps,INT, |
224 | noyes, 2, NULL); | 226 | noyes, 2, NULL); |
225 | break; | 227 | break; |
226 | case 5: /* Restart */ | 228 | case 5: /* playback control */ |
229 | playback_control(NULL); | ||
230 | break; | ||
231 | case 6: /* Restart */ | ||
227 | need_restart=true; | 232 | need_restart=true; |
228 | menu_quit=1; | 233 | menu_quit=1; |
229 | break; | 234 | break; |
@@ -323,7 +328,7 @@ static int gameProc( void ) | |||
323 | yield_counter = 0; | 328 | yield_counter = 0; |
324 | rb->yield (); | 329 | rb->yield (); |
325 | } | 330 | } |
326 | 331 | ||
327 | /* The following functions render the Pacman screen from the | 332 | /* The following functions render the Pacman screen from the |
328 | contents of the video and color ram. We first update the | 333 | contents of the video and color ram. We first update the |
329 | background, and then draw the Sprites on top. | 334 | background, and then draw the Sprites on top. |
@@ -343,10 +348,10 @@ static int gameProc( void ) | |||
343 | 348 | ||
344 | rb->lcd_update(); | 349 | rb->lcd_update(); |
345 | 350 | ||
346 | /* Keep the framerate at Pacman's 60fps */ | 351 | /* Keep the framerate at Pacman's 60fps */ |
347 | end_time = start_time + (video_frames*HZ)/FPS; | 352 | end_time = start_time + (video_frames*HZ)/FPS; |
348 | while (TIME_BEFORE(*rb->current_tick,end_time)) { | 353 | while (TIME_BEFORE(*rb->current_tick,end_time)) { |
349 | rb->sleep(1); | 354 | rb->sleep(1); |
350 | } | 355 | } |
351 | } | 356 | } |
352 | } | 357 | } |