1
0
Fork 0
forked from len0rd/rockbox

Karl Kurbjun's patch #1407719:

Here's another patch for rockboy that adds automatic frameskip (it's pretty
rough as I haven't figured out an accurate timer), fullscreen support on the
H300, and a bit of assembly and some IRAM stuff. I'm not sure if I'm doing the
IRAM stuff correct though as it doesn't seem to make much of a difference if
any. I've also added a statistics option that will show how many frames per
second the gameboy is seeing (not what the player is getting) and what the
frameskip is at. When you enable stats sometimes you have to go back into the
menu and then come out to clear erronous values.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8397 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Daniel Stenberg 2006-01-20 13:05:52 +00:00
parent c05cd1676f
commit 137fb6cb9f
27 changed files with 490 additions and 213 deletions

View file

@ -69,6 +69,9 @@ static const char *slot_menu[] = {
typedef enum {
OM_ITEM_FS,
OM_ITEM_SOUND,
OM_ITEM_STATS,
OM_ITEM_FULLSCREEN,
OM_ITEM_KEYS,
OM_ITEM_BACK,
OM_MENU_LAST
} OptMenuItem;
@ -76,6 +79,9 @@ typedef enum {
static const char *opt_menu[] = {
"Frameskip",
"Sound ON/OFF",
"Stats ON/OFF",
"Fullscreen ON/OFF",
"Set Keys (BUGGY)",
"Previous Menu..."
};
@ -90,13 +96,50 @@ typedef enum {
} FSMenuItem;
static const char *fs_menu[] = {
"Skip 0 Frames",
"Skip 1 Frames",
"Skip 2 Frames",
"Skip 3 Frames",
"Frameskip 3 Max",
"Frameskip 4 Max",
"Frameskip 5 Max",
"Frameskip 7 Max",
"Previous Menu..."
};
int getbutton(char *text)
{
rb->lcd_putsxy(0, 0, text);
rb->lcd_update();
rb->sleep(30);
while (rb->button_get(false) != BUTTON_NONE)
rb->yield();
int button;
while(true){
button = rb->button_get(true);
button=button&0x00000FFF;
switch(button) {
case BUTTON_LEFT:
case BUTTON_RIGHT:
case BUTTON_UP:
case BUTTON_DOWN:
break;
default:
return button;
break;
}
}
}
void setupkeys(void)
{
options.A=getbutton("Press A");
options.B=getbutton("Press B");
options.START=getbutton("Press Start");
options.SELECT=getbutton("Press Select");
options.MENU=getbutton("Press Menu");
}
/*
* do_user_menu - create the user menu on the screen.
*
@ -144,6 +187,7 @@ int do_user_menu(void) {
}
}
rb->lcd_clear_display();
rb->lcd_update();
/* return somethin' */
return ret;
}
@ -359,16 +403,16 @@ static void do_fs_menu(void) {
done = true;
break;
case FS_ITEM_FS0:
frameskip=0;
options.maxskip=3;
break;
case FS_ITEM_FS1:
frameskip=1;
options.maxskip=4;
break;
case FS_ITEM_FS2:
frameskip=2;
options.maxskip=5;
break;
case FS_ITEM_FS3:
frameskip=3;
options.maxskip=7;
break;
}
}
@ -389,8 +433,17 @@ static void do_opt_menu(void) {
do_fs_menu();
break;
case OM_ITEM_SOUND:
sound=!sound;
options.sound=!options.sound;
break;
case OM_ITEM_STATS:
options.showstats=!options.showstats;
break;
case OM_ITEM_FULLSCREEN:
options.fullscreen=!options.fullscreen;
break;
case OM_ITEM_KEYS:
setupkeys();
break;
case MENU_CANCEL:
case OM_ITEM_BACK:
done = true;