summaryrefslogtreecommitdiff
path: root/apps/plugins/rockboy/menu.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2006-01-20 13:05:52 +0000
committerDaniel Stenberg <daniel@haxx.se>2006-01-20 13:05:52 +0000
commit137fb6cb9f0478303610443b95ae0a106f0a17d1 (patch)
tree9ac6685589536bc7c84962db8398fddf9d2b3154 /apps/plugins/rockboy/menu.c
parentc05cd1676f323f1346099f436aaa0212fd18e178 (diff)
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
Diffstat (limited to 'apps/plugins/rockboy/menu.c')
-rw-r--r--apps/plugins/rockboy/menu.c71
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[] = {
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;