forked from len0rd/rockbox
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
This commit is contained in:
parent
eac0a5b840
commit
e2e7ecf350
9 changed files with 106 additions and 57 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue