summaryrefslogtreecommitdiff
path: root/apps/plugins/pacbox
diff options
context:
space:
mode:
authorTeruaki Kawashima <teru@rockbox.org>2009-08-05 14:29:29 +0000
committerTeruaki Kawashima <teru@rockbox.org>2009-08-05 14:29:29 +0000
commite2e7ecf350a4d085f6f58052f55ba29e8fe77718 (patch)
treed5abd6a205b9d32cb11e1c2d0ea08602812248d4 /apps/plugins/pacbox
parenteac0a5b840571a11b181fdfd463be61aca466976 (diff)
downloadrockbox-e2e7ecf350a4d085f6f58052f55ba29e8fe77718.zip
rockbox-e2e7ecf350a4d085f6f58052f55ba29e8fe77718.tar.gz
rockbox-e2e7ecf350a4d085f6f58052f55ba29e8fe77718.tar.bz2
rockbox-e2e7ecf350a4d085f6f58052f55ba29e8fe77718.tar.xz
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.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/apps/plugins/pacbox/pacbox.c b/apps/plugins/pacbox/pacbox.c
index e7b92c3..0e33432 100644
--- a/apps/plugins/pacbox/pacbox.c
+++ b/apps/plugins/pacbox/pacbox.c
@@ -29,6 +29,7 @@
#include "pacbox.h"
#include "pacbox_lcd.h"
#include "lib/configfile.h"
+#include "lib/playback_control.h"
PLUGIN_HEADER
PLUGIN_IRAM_DECLARE
@@ -78,9 +79,9 @@ static bool loadFile( const char * name, unsigned char * buf, int len )
if( fd < 0 ) {
return false;
}
-
+
int n = rb->read( fd, buf, len);
-
+
rb->close( fd );
if( n != len ) {
@@ -174,7 +175,8 @@ static bool pacbox_menu(void)
MENUITEM_STRINGLIST(menu, "Pacbox Menu", NULL,
"Difficulty", "Pacmen Per Game", "Bonus Life",
- "Ghost Names", "Display FPS", "Restart", "Quit");
+ "Ghost Names", "Display FPS",
+ "Playback Control", "Restart", "Quit");
rb->button_clear_queue();
@@ -220,10 +222,13 @@ static bool pacbox_menu(void)
}
break;
case 4: /* Show FPS */
- rb->set_option("Display FPS",&settings.showfps,INT,
+ rb->set_option("Display FPS",&settings.showfps,INT,
noyes, 2, NULL);
break;
- case 5: /* Restart */
+ case 5: /* playback control */
+ playback_control(NULL);
+ break;
+ case 6: /* Restart */
need_restart=true;
menu_quit=1;
break;
@@ -323,7 +328,7 @@ static int gameProc( void )
yield_counter = 0;
rb->yield ();
}
-
+
/* The following functions render the Pacman screen from the
contents of the video and color ram. We first update the
background, and then draw the Sprites on top.
@@ -343,10 +348,10 @@ static int gameProc( void )
rb->lcd_update();
- /* Keep the framerate at Pacman's 60fps */
+ /* Keep the framerate at Pacman's 60fps */
end_time = start_time + (video_frames*HZ)/FPS;
while (TIME_BEFORE(*rb->current_tick,end_time)) {
- rb->sleep(1);
+ rb->sleep(1);
}
}
}