for (;;)\r
{\r
draw_dirlist(curr_path, namelist, n, sel);\r
- inp = wait_for_input(GP2X_UP|GP2X_DOWN|GP2X_LEFT|GP2X_RIGHT|GP2X_B|GP2X_X);\r
+ inp = wait_for_input(GP2X_UP|GP2X_DOWN|GP2X_LEFT|GP2X_RIGHT|GP2X_L|GP2X_R|GP2X_B|GP2X_X);\r
if(inp & GP2X_UP ) { sel--; if (sel < 0) sel = n-2; }\r
if(inp & GP2X_DOWN) { sel++; if (sel > n-2) sel = 0; }\r
- if(inp & GP2X_LEFT) { sel-=10; if (sel < 0) sel = 0; }\r
- if(inp & GP2X_RIGHT) { sel+=10; if (sel > n-2) sel = n-2; }\r
+ if(inp &(GP2X_LEFT|GP2X_L)) { sel-=10; if (sel < 0) sel = 0; }\r
+ if(inp &(GP2X_RIGHT|GP2X_R)) { sel+=10; if (sel > n-2) sel = n-2; }\r
if(inp & GP2X_B) { // enter dir/select\r
again:\r
if (namelist[sel+1]->d_type == DT_REG) {\r
\r
\r
\r
+// --------- sega/mega cd options ----------\r
+\r
+static void draw_cd_menu_options(int menu_sel, char *b_us, char *b_eu, char *b_jp)\r
+{\r
+ int tl_x = 25, tl_y = 60, y;\r
+\r
+ y = tl_y;\r
+ memset(gp2x_screen, 0, 320*240);\r
+ gp2x_text_out8(tl_x, y, "USA BIOS: %s", b_us); // 0\r
+ gp2x_text_out8(tl_x, (y+=10), "EUR BIOS: %s", b_eu); // 1\r
+ gp2x_text_out8(tl_x, (y+=10), "JAP BIOS: %s", b_jp); // 2\r
+ gp2x_text_out8(tl_x, (y+=10), "CD LEDs %s", (currentConfig.EmuOpt &0x400)?"ON":"OFF"); // 3\r
+ gp2x_text_out8(tl_x, (y+=10), "CDDA audio (using mp3s) %s", (currentConfig.PicoOpt&0x800)?"ON":"OFF"); // 4\r
+ gp2x_text_out8(tl_x, (y+=10), "PCM audio %s", (currentConfig.PicoOpt&0x400)?"ON":"OFF"); // 5\r
+ gp2x_text_out8(tl_x, (y+=10), "Done");\r
+\r
+ // draw cursor\r
+ gp2x_text_out8(tl_x - 16, tl_y + menu_sel*10, ">");\r
+\r
+ if ((menu_sel == 0 && strcmp(b_us, "NOT FOUND")) ||\r
+ (menu_sel == 1 && strcmp(b_eu, "NOT FOUND")) ||\r
+ (menu_sel == 2 && strcmp(b_jp, "NOT FOUND")))\r
+ gp2x_text_out8(tl_x, 220, "Press start to test selected BIOS");\r
+\r
+ gp2x_video_flip();\r
+}\r
+\r
+static void cd_menu_loop_options(void)\r
+{\r
+ int menu_sel = 0, menu_sel_max = 6;\r
+ unsigned long inp = 0;\r
+ char bios_us[32], bios_eu[32], bios_jp[32], *bios, *p;\r
+\r
+ if (find_bios(4, &bios)) { // US\r
+ for (p = bios+strlen(bios)-1; p > bios && *p != '/'; p--); p++;\r
+ strncpy(bios_us, p, 31); bios_us[31] = 0;\r
+ } else strcpy(bios_us, "NOT FOUND");\r
+\r
+ if (find_bios(8, &bios)) { // EU\r
+ for (p = bios+strlen(bios)-1; p > bios && *p != '/'; p--); p++;\r
+ strncpy(bios_eu, p, 31); bios_eu[31] = 0;\r
+ } else strcpy(bios_eu, "NOT FOUND");\r
+\r
+ if (find_bios(1, &bios)) { // JP\r
+ for (p = bios+strlen(bios)-1; p > bios && *p != '/'; p--); p++;\r
+ strncpy(bios_jp, p, 31); bios_jp[31] = 0;\r
+ } else strcpy(bios_jp, "NOT FOUND");\r
+\r
+ for(;;)\r
+ {\r
+ draw_cd_menu_options(menu_sel, bios_us, bios_eu, bios_jp);\r
+ inp = wait_for_input(GP2X_UP|GP2X_DOWN|GP2X_LEFT|GP2X_RIGHT|GP2X_B|GP2X_X|GP2X_A|GP2X_START);\r
+ if(inp & GP2X_UP ) { menu_sel--; if (menu_sel < 0) menu_sel = menu_sel_max; }\r
+ if(inp & GP2X_DOWN) { menu_sel++; if (menu_sel > menu_sel_max) menu_sel = 0; }\r
+ if((inp& GP2X_B)||(inp&GP2X_LEFT)||(inp&GP2X_RIGHT)) { // toggleable options\r
+ switch (menu_sel) {\r
+ case 3: currentConfig.EmuOpt ^=0x400; break;\r
+ case 4: currentConfig.PicoOpt^=0x800; break;\r
+ case 5: currentConfig.PicoOpt^=0x400; break;\r
+ case 6: return;\r
+ }\r
+ }\r
+ if(inp & (GP2X_X|GP2X_A)) return;\r
+ if(inp & GP2X_START) { // BIOS testers\r
+ switch (menu_sel) {\r
+ case 0: if (find_bios(4, &bios)) { // test US\r
+ strcpy(romFileName, bios);\r
+ engineState = PGS_ReloadRom;\r
+ return;\r
+ }\r
+ break;\r
+ case 1: if (find_bios(8, &bios)) { // test EU\r
+ strcpy(romFileName, bios);\r
+ engineState = PGS_ReloadRom;\r
+ return;\r
+ }\r
+ break;\r
+ case 2: if (find_bios(1, &bios)) { // test JP\r
+ strcpy(romFileName, bios);\r
+ engineState = PGS_ReloadRom;\r
+ return;\r
+ }\r
+ break;\r
+ }\r
+ }\r
+ }\r
+}\r
\r
-// --------- advanced options ----------\r
\r
-// order must match that of currentConfig_t\r
-struct {\r
- int EmuOpt;\r
- int PicoOpt;\r
- int PsndRate;\r
- int PicoRegion;\r
- int Frameskip;\r
- int CPUclock;\r
-} tmp_opts;\r
-int tmp_gamma;\r
+// --------- advanced options ----------\r
\r
static void draw_amenu_options(int menu_sel)\r
{\r
\r
y = tl_y;\r
memset(gp2x_screen, 0, 320*240);\r
- gp2x_text_out8(tl_x, y, "Scale 32 column mode %s", (tmp_opts.PicoOpt&0x100)?"ON":"OFF"); // 0\r
- gp2x_text_out8(tl_x, (y+=10), "Gamma correction %i.%02i", tmp_gamma / 100, tmp_gamma%100); // 1\r
- gp2x_text_out8(tl_x, (y+=10), "Emulate Z80 %s", (tmp_opts.PicoOpt&0x004)?"ON":"OFF"); // 2\r
- gp2x_text_out8(tl_x, (y+=10), "Emulate YM2612 (FM) %s", (tmp_opts.PicoOpt&0x001)?"ON":"OFF"); // 3\r
- gp2x_text_out8(tl_x, (y+=10), "Emulate SN76496 (PSG) %s", (tmp_opts.PicoOpt&0x002)?"ON":"OFF"); // 4\r
- gp2x_text_out8(tl_x, (y+=10), "gzip savestates %s", (tmp_opts.EmuOpt &0x008)?"ON":"OFF"); // 5\r
- gp2x_text_out8(tl_x, (y+=10), "Don't save config on exit %s", (tmp_opts.EmuOpt &0x020)?"ON":"OFF"); // 6\r
+ gp2x_text_out8(tl_x, y, "Scale 32 column mode %s", (currentConfig.PicoOpt&0x100)?"ON":"OFF"); // 0\r
+ gp2x_text_out8(tl_x, (y+=10), "Gamma correction %i.%02i", currentConfig.gamma / 100, currentConfig.gamma%100); // 1\r
+ gp2x_text_out8(tl_x, (y+=10), "Emulate Z80 %s", (currentConfig.PicoOpt&0x004)?"ON":"OFF"); // 2\r
+ gp2x_text_out8(tl_x, (y+=10), "Emulate YM2612 (FM) %s", (currentConfig.PicoOpt&0x001)?"ON":"OFF"); // 3\r
+ gp2x_text_out8(tl_x, (y+=10), "Emulate SN76496 (PSG) %s", (currentConfig.PicoOpt&0x002)?"ON":"OFF"); // 4\r
+ gp2x_text_out8(tl_x, (y+=10), "gzip savestates %s", (currentConfig.EmuOpt &0x008)?"ON":"OFF"); // 5\r
+ gp2x_text_out8(tl_x, (y+=10), "Don't save config on exit %s", (currentConfig.EmuOpt &0x020)?"ON":"OFF"); // 6\r
gp2x_text_out8(tl_x, (y+=10), "needs restart:");\r
- gp2x_text_out8(tl_x, (y+=10), "craigix's RAM timings %s", (tmp_opts.EmuOpt &0x100)?"ON":"OFF"); // 8\r
- gp2x_text_out8(tl_x, (y+=10), "squidgehack (now %s %s", mms, (tmp_opts.EmuOpt &0x010)?"ON":"OFF"); // 9\r
+ gp2x_text_out8(tl_x, (y+=10), "craigix's RAM timings %s", (currentConfig.EmuOpt &0x100)?"ON":"OFF"); // 8\r
+ gp2x_text_out8(tl_x, (y+=10), "squidgehack (now %s %s", mms, (currentConfig.EmuOpt &0x010)?"ON":"OFF"); // 9\r
gp2x_text_out8(tl_x, (y+=10), "Done");\r
\r
// draw cursor\r
\r
static void amenu_loop_options(void)\r
{\r
- int menu_sel = 0, menu_sel_max = 11;\r
+ int menu_sel = 0, menu_sel_max = 10;\r
unsigned long inp = 0;\r
\r
for(;;)\r
if(inp & GP2X_DOWN) { menu_sel++; if (menu_sel > menu_sel_max) menu_sel = 0; }\r
if((inp& GP2X_B)||(inp&GP2X_LEFT)||(inp&GP2X_RIGHT)) { // toggleable options\r
switch (menu_sel) {\r
- case 0: tmp_opts.PicoOpt^=0x100; break;\r
- case 2: tmp_opts.PicoOpt^=0x004; break;\r
- case 3: tmp_opts.PicoOpt^=0x001; break;\r
- case 4: tmp_opts.PicoOpt^=0x002; break;\r
- case 5: tmp_opts.EmuOpt ^=0x008; break;\r
- case 6: tmp_opts.EmuOpt ^=0x020; break;\r
- case 8: tmp_opts.EmuOpt ^=0x100; break;\r
- case 9: tmp_opts.EmuOpt ^=0x010; break;\r
+ case 0: currentConfig.PicoOpt^=0x100; break;\r
+ case 2: currentConfig.PicoOpt^=0x004; break;\r
+ case 3: currentConfig.PicoOpt^=0x001; break;\r
+ case 4: currentConfig.PicoOpt^=0x002; break;\r
+ case 5: currentConfig.EmuOpt ^=0x008; break;\r
+ case 6: currentConfig.EmuOpt ^=0x020; break;\r
+ case 8: currentConfig.EmuOpt ^=0x100; break;\r
+ case 9: currentConfig.EmuOpt ^=0x010; break;\r
case 10: return;\r
}\r
}\r
switch (menu_sel) {\r
case 1:\r
while ((inp = gp2x_joystick_read(1)) & (GP2X_LEFT|GP2X_RIGHT)) {\r
- tmp_gamma += (inp & GP2X_LEFT) ? -1 : 1;\r
- if (tmp_gamma < 1) tmp_gamma = 1;\r
- if (tmp_gamma > 300) tmp_gamma = 300;\r
+ currentConfig.gamma += (inp & GP2X_LEFT) ? -1 : 1;\r
+ if (currentConfig.gamma < 1) currentConfig.gamma = 1;\r
+ if (currentConfig.gamma > 300) currentConfig.gamma = 300;\r
draw_amenu_options(menu_sel);\r
usleep(18*1000);\r
}\r
\r
// -------------- options --------------\r
\r
-static char *region_name(unsigned int code)\r
+static const char *region_name(unsigned int code)\r
{\r
- char *names[] = { "Auto", "Japan NTSC", "Japan PAL", "USA", "Europe" };\r
- int i = 0;\r
- code <<= 1;\r
- while((code >>=1)) i++;\r
- if (i > 4) return "unknown";\r
- return names[i];\r
+ static const char *names[] = { "Auto", " Japan NTSC", " Japan PAL", " USA", " Europe" };\r
+ static const char *names_short[] = { "", " JP", " JP", " US", " EU" };\r
+ int u, i = 0;\r
+ if (code) {\r
+ code <<= 1;\r
+ while((code >>= 1)) i++;\r
+ if (i > 4) return "unknown";\r
+ return names[i];\r
+ } else {\r
+ static char name[24];\r
+ strcpy(name, "Auto:");\r
+ for (u = 0; u < 3; u++) {\r
+ i = 0; code = ((PicoAutoRgnOrder >> u*4) & 0xf) << 1;\r
+ while((code >>= 1)) i++;\r
+ strcat(name, names_short[i]);\r
+ }\r
+ return name;\r
+ }\r
}\r
\r
static void draw_menu_options(int menu_sel)\r
int tl_x = 25, tl_y = 40, y;\r
char monostereo[8], strframeskip[8], *strrend;\r
\r
- strcpy(monostereo, (tmp_opts.PicoOpt&0x08)?"stereo":"mono");\r
- if (tmp_opts.Frameskip < 0)\r
+ strcpy(monostereo, (currentConfig.PicoOpt&0x08)?"stereo":"mono");\r
+ if (currentConfig.Frameskip < 0)\r
strcpy(strframeskip, "Auto");\r
- else sprintf(strframeskip, "%i", tmp_opts.Frameskip);\r
- if (tmp_opts.PicoOpt&0x10) {\r
+ else sprintf(strframeskip, "%i", currentConfig.Frameskip);\r
+ if (currentConfig.PicoOpt&0x10) {\r
strrend = " 8bit fast";\r
- } else if (tmp_opts.EmuOpt&0x80) {\r
+ } else if (currentConfig.EmuOpt&0x80) {\r
strrend = "16bit accurate";\r
} else {\r
strrend = " 8bit accurate";\r
y = tl_y;\r
memset(gp2x_screen, 0, 320*240);\r
gp2x_text_out8(tl_x, y, "Renderer: %s", strrend); // 0\r
- gp2x_text_out8(tl_x, (y+=10), "Accurate timing (slower) %s", (tmp_opts.PicoOpt&0x040)?"ON":"OFF"); // 1\r
- gp2x_text_out8(tl_x, (y+=10), "Accurate sprites (slower) %s", (tmp_opts.PicoOpt&0x080)?"ON":"OFF"); // 2\r
- gp2x_text_out8(tl_x, (y+=10), "Show FPS %s", (tmp_opts.EmuOpt &0x002)?"ON":"OFF"); // 3\r
+ gp2x_text_out8(tl_x, (y+=10), "Accurate timing (slower) %s", (currentConfig.PicoOpt&0x040)?"ON":"OFF"); // 1\r
+ gp2x_text_out8(tl_x, (y+=10), "Accurate sprites (slower) %s", (currentConfig.PicoOpt&0x080)?"ON":"OFF"); // 2\r
+ gp2x_text_out8(tl_x, (y+=10), "Show FPS %s", (currentConfig.EmuOpt &0x002)?"ON":"OFF"); // 3\r
gp2x_text_out8(tl_x, (y+=10), "Frameskip %s", strframeskip);\r
- gp2x_text_out8(tl_x, (y+=10), "Enable sound %s", (tmp_opts.EmuOpt &0x004)?"ON":"OFF"); // 5\r
- gp2x_text_out8(tl_x, (y+=10), "Sound Quality: %5iHz %s", tmp_opts.PsndRate, monostereo);\r
- gp2x_text_out8(tl_x, (y+=10), "Use ARM940 core for sound %s", (tmp_opts.PicoOpt&0x200)?"ON":"OFF"); // 7\r
- gp2x_text_out8(tl_x, (y+=10), "6 button pad %s", (tmp_opts.PicoOpt&0x020)?"ON":"OFF"); // 8\r
- gp2x_text_out8(tl_x, (y+=10), "Genesis Region: %s", region_name(tmp_opts.PicoRegion));\r
- gp2x_text_out8(tl_x, (y+=10), "Use SRAM savestates %s", (tmp_opts.EmuOpt &0x001)?"ON":"OFF"); // 10\r
- gp2x_text_out8(tl_x, (y+=10), "Confirm save overwrites %s", (tmp_opts.EmuOpt &0x200)?"ON":"OFF"); // 11\r
+ gp2x_text_out8(tl_x, (y+=10), "Enable sound %s", (currentConfig.EmuOpt &0x004)?"ON":"OFF"); // 5\r
+ gp2x_text_out8(tl_x, (y+=10), "Sound Quality: %5iHz %s", currentConfig.PsndRate, monostereo);\r
+ gp2x_text_out8(tl_x, (y+=10), "Use ARM940 core for sound %s", (currentConfig.PicoOpt&0x200)?"ON":"OFF"); // 7\r
+ gp2x_text_out8(tl_x, (y+=10), "6 button pad %s", (currentConfig.PicoOpt&0x020)?"ON":"OFF"); // 8\r
+ gp2x_text_out8(tl_x, (y+=10), "Genesis Region: %s", region_name(currentConfig.PicoRegion));\r
+ gp2x_text_out8(tl_x, (y+=10), "Use SRAM/BRAM savestates %s", (currentConfig.EmuOpt &0x001)?"ON":"OFF"); // 10\r
+ gp2x_text_out8(tl_x, (y+=10), "Confirm save overwrites %s", (currentConfig.EmuOpt &0x200)?"ON":"OFF"); // 11\r
gp2x_text_out8(tl_x, (y+=10), "Save slot %i", state_slot); // 12\r
- gp2x_text_out8(tl_x, (y+=10), "GP2X CPU clocks %iMhz", tmp_opts.CPUclock);\r
- gp2x_text_out8(tl_x, (y+=10), "[advanced options]");\r
+ gp2x_text_out8(tl_x, (y+=10), "GP2X CPU clocks %iMhz", currentConfig.CPUclock);\r
+ gp2x_text_out8(tl_x, (y+=10), "[Sega/Mega CD options]");\r
+ gp2x_text_out8(tl_x, (y+=10), "[advanced options]"); // 15\r
gp2x_text_out8(tl_x, (y+=10), "Save cfg as default");\r
if (rom_data)\r
gp2x_text_out8(tl_x, (y+=10), "Save cfg for current game only");\r
return rates[i];\r
}\r
\r
+static void region_prevnext(int right)\r
+{\r
+ // jp_ntsc=1, jp_pal=2, usa=4, eu=8\r
+ static int rgn_orders[] = { 0x148, 0x184, 0x814, 0x418, 0x841, 0x481 };\r
+ int i;\r
+ if (right) {\r
+ if (!currentConfig.PicoRegion) {\r
+ for (i = 0; i < 6; i++)\r
+ if (rgn_orders[i] == PicoAutoRgnOrder) break;\r
+ if (i < 5) PicoAutoRgnOrder = rgn_orders[i+1];\r
+ else currentConfig.PicoRegion=1;\r
+ }\r
+ else currentConfig.PicoRegion<<=1;\r
+ if (currentConfig.PicoRegion > 8) currentConfig.PicoRegion = 8;\r
+ } else {\r
+ if (!currentConfig.PicoRegion) {\r
+ for (i = 0; i < 6; i++)\r
+ if (rgn_orders[i] == PicoAutoRgnOrder) break;\r
+ if (i > 0) PicoAutoRgnOrder = rgn_orders[i-1];\r
+ }\r
+ else currentConfig.PicoRegion>>=1;\r
+ }\r
+}\r
+\r
static void menu_options_save(void)\r
{\r
- memcpy(¤tConfig.EmuOpt, &tmp_opts.EmuOpt, sizeof(tmp_opts));\r
- currentConfig.gamma = tmp_gamma;\r
PicoOpt = currentConfig.PicoOpt;\r
PsndRate = currentConfig.PsndRate;\r
PicoRegionOverride = currentConfig.PicoRegion;\r
}\r
}\r
\r
-static void menu_loop_options(void)\r
+static int menu_loop_options(void)\r
{\r
- int menu_sel = 0, menu_sel_max = 15;\r
+ int menu_sel = 0, menu_sel_max = 16;\r
unsigned long inp = 0;\r
\r
if (rom_data) menu_sel_max++;\r
- memcpy(&tmp_opts.EmuOpt, ¤tConfig.EmuOpt, sizeof(tmp_opts));\r
- tmp_gamma = currentConfig.gamma;\r
- tmp_opts.PicoOpt = PicoOpt;\r
- tmp_opts.PsndRate = PsndRate;\r
- tmp_opts.PicoRegion = PicoRegionOverride;\r
+ currentConfig.PicoOpt = PicoOpt;\r
+ currentConfig.PsndRate = PsndRate;\r
+ currentConfig.PicoRegion = PicoRegionOverride;\r
\r
for(;;)\r
{\r
if(inp & GP2X_DOWN) { menu_sel++; if (menu_sel > menu_sel_max) menu_sel = 0; }\r
if((inp& GP2X_B)||(inp&GP2X_LEFT)||(inp&GP2X_RIGHT)) { // toggleable options\r
switch (menu_sel) {\r
- case 1: tmp_opts.PicoOpt^=0x040; break;\r
- case 2: tmp_opts.PicoOpt^=0x080; break;\r
- case 3: tmp_opts.EmuOpt ^=0x002; break;\r
- case 5: tmp_opts.EmuOpt ^=0x004; break;\r
- case 7: tmp_opts.PicoOpt^=0x200; break;\r
- case 8: tmp_opts.PicoOpt^=0x020; break;\r
- case 10: tmp_opts.EmuOpt ^=0x001; break;\r
- case 11: tmp_opts.EmuOpt ^=0x200; break;\r
- case 14: amenu_loop_options(); break;\r
- case 15: // done (save)\r
+ case 1: currentConfig.PicoOpt^=0x040; break;\r
+ case 2: currentConfig.PicoOpt^=0x080; break;\r
+ case 3: currentConfig.EmuOpt ^=0x002; break;\r
+ case 5: currentConfig.EmuOpt ^=0x004; break;\r
+ case 7: currentConfig.PicoOpt^=0x200; break;\r
+ case 8: currentConfig.PicoOpt^=0x020; break;\r
+ case 10: currentConfig.EmuOpt ^=0x001; break;\r
+ case 11: currentConfig.EmuOpt ^=0x200; break;\r
+ case 14: cd_menu_loop_options();\r
+ if (engineState == PGS_ReloadRom)\r
+ return 0; // test BIOS\r
+ break;\r
+ case 15: amenu_loop_options(); break;\r
+ case 16: // done (update and write)\r
menu_options_save();\r
- emu_WriteConfig(0);\r
- return;\r
- case 16: // done (save for current game)\r
+ if (emu_WriteConfig(0)) strcpy(menuErrorMsg, "config saved");\r
+ else strcpy(menuErrorMsg, "failed to write config");\r
+ return 1;\r
+ case 17: // done (update and write for current game)\r
menu_options_save();\r
- emu_WriteConfig(1);\r
- return;\r
+ if (emu_WriteConfig(1)) strcpy(menuErrorMsg, "config saved");\r
+ else strcpy(menuErrorMsg, "failed to write config");\r
+ return 1;\r
}\r
}\r
- if(inp & GP2X_X) return; // done (no save)\r
- if(inp & GP2X_A) {\r
+ if(inp & (GP2X_X|GP2X_A)) {\r
menu_options_save();\r
- return; // done (save)\r
+ return 0; // done (update, no write)\r
}\r
if(inp & (GP2X_LEFT|GP2X_RIGHT)) { // multi choise\r
switch (menu_sel) {\r
case 0:\r
if (inp & GP2X_LEFT) {\r
- if ( tmp_opts.PicoOpt&0x10) tmp_opts.PicoOpt&= ~0x10;\r
- else if (!(tmp_opts.EmuOpt &0x80))tmp_opts.EmuOpt |= 0x80;\r
- else if ( tmp_opts.EmuOpt &0x80) break;\r
+ if ( currentConfig.PicoOpt&0x10) currentConfig.PicoOpt&= ~0x10;\r
+ else if (!(currentConfig.EmuOpt &0x80))currentConfig.EmuOpt |= 0x80;\r
+ else if ( currentConfig.EmuOpt &0x80) break;\r
} else {\r
- if ( tmp_opts.PicoOpt&0x10) break;\r
- else if (!(tmp_opts.EmuOpt &0x80))tmp_opts.PicoOpt|= 0x10;\r
- else if ( tmp_opts.EmuOpt &0x80) tmp_opts.EmuOpt &= ~0x80;\r
+ if ( currentConfig.PicoOpt&0x10) break;\r
+ else if (!(currentConfig.EmuOpt &0x80))currentConfig.PicoOpt|= 0x10;\r
+ else if ( currentConfig.EmuOpt &0x80) currentConfig.EmuOpt &= ~0x80;\r
}\r
break;\r
case 4:\r
- tmp_opts.Frameskip += (inp & GP2X_LEFT) ? -1 : 1;\r
- if (tmp_opts.Frameskip < 0) tmp_opts.Frameskip = -1;\r
- if (tmp_opts.Frameskip > 32) tmp_opts.Frameskip = 32;\r
+ currentConfig.Frameskip += (inp & GP2X_LEFT) ? -1 : 1;\r
+ if (currentConfig.Frameskip < 0) currentConfig.Frameskip = -1;\r
+ if (currentConfig.Frameskip > 32) currentConfig.Frameskip = 32;\r
break;\r
case 6:\r
- if ((inp & GP2X_RIGHT) && tmp_opts.PsndRate == 44100 && !(tmp_opts.PicoOpt&0x08)) {\r
- tmp_opts.PsndRate = 8000; tmp_opts.PicoOpt|= 0x08;\r
- } else if ((inp & GP2X_LEFT) && tmp_opts.PsndRate == 8000 && (tmp_opts.PicoOpt&0x08)) {\r
- tmp_opts.PsndRate = 44100; tmp_opts.PicoOpt&=~0x08;\r
- } else tmp_opts.PsndRate = sndrate_prevnext(tmp_opts.PsndRate, inp & GP2X_RIGHT);\r
+ if ((inp & GP2X_RIGHT) && currentConfig.PsndRate == 44100 && !(currentConfig.PicoOpt&0x08)) {\r
+ currentConfig.PsndRate = 8000; currentConfig.PicoOpt|= 0x08;\r
+ } else if ((inp & GP2X_LEFT) && currentConfig.PsndRate == 8000 && (currentConfig.PicoOpt&0x08)) {\r
+ currentConfig.PsndRate = 44100; currentConfig.PicoOpt&=~0x08;\r
+ } else currentConfig.PsndRate = sndrate_prevnext(currentConfig.PsndRate, inp & GP2X_RIGHT);\r
break;\r
case 9:\r
- if (inp & GP2X_RIGHT) {\r
- if (tmp_opts.PicoRegion) tmp_opts.PicoRegion<<=1; else tmp_opts.PicoRegion=1;\r
- if (tmp_opts.PicoRegion > 8) tmp_opts.PicoRegion = 8;\r
- } else tmp_opts.PicoRegion>>=1;\r
+ region_prevnext(inp & GP2X_RIGHT);\r
break;\r
case 12:\r
if (inp & GP2X_RIGHT) {\r
break;\r
case 13:\r
while ((inp = gp2x_joystick_read(1)) & (GP2X_LEFT|GP2X_RIGHT)) {\r
- tmp_opts.CPUclock += (inp & GP2X_LEFT) ? -1 : 1;\r
- if (tmp_opts.CPUclock < 1) tmp_opts.CPUclock = 1;\r
+ currentConfig.CPUclock += (inp & GP2X_LEFT) ? -1 : 1;\r
+ if (currentConfig.CPUclock < 1) currentConfig.CPUclock = 1;\r
draw_menu_options(menu_sel);\r
usleep(50*1000);\r
}\r
int tl_x = 15, tl_y = 70, y;\r
memset(gp2x_screen, 0, 320*240);\r
\r
- gp2x_text_out8(tl_x, 20, "PicoDrive v" VERSION " (c) notaz, 2006");\r
+ gp2x_text_out8(tl_x, 20, "PicoDrive v" VERSION " (c) notaz, 2006,2007");\r
y = tl_y;\r
gp2x_text_out8(tl_x, y, "Credits:");\r
gp2x_text_out8(tl_x, (y+=10), "Dave: Cyclone 68000 core,");\r
} else {\r
y += 30;\r
}\r
- gp2x_text_out8(tl_x, (y+=10), "Load new ROM");\r
+ gp2x_text_out8(tl_x, (y+=10), "Load new ROM/ISO");\r
gp2x_text_out8(tl_x, (y+=10), "Change options");\r
gp2x_text_out8(tl_x, (y+=10), "Configure controls");\r
gp2x_text_out8(tl_x, (y+=10), "Credits");\r
\r
static void menu_loop_root(void)\r
{\r
- int menu_sel = 4, menu_sel_max = 8, menu_sel_min = 4;\r
+ int ret, menu_sel = 4, menu_sel_max = 8, menu_sel_min = 4;\r
unsigned long inp = 0;\r
char curr_path[PATH_MAX], *selfname;\r
FILE *tstf;\r
selfname = romsel_loop(curr_path);\r
if (selfname) {\r
printf("selected file: %s\n", selfname);\r
- strncpy(currentConfig.lastRomFile, selfname, sizeof(currentConfig.lastRomFile)-1);\r
- currentConfig.lastRomFile[sizeof(currentConfig.lastRomFile)-1] = 0;\r
engineState = PGS_ReloadRom;\r
}\r
return;\r
case 5: // options\r
- menu_loop_options();\r
+ ret = menu_loop_options();\r
+ if (ret == 1) continue; // status update\r
+ if (engineState == PGS_ReloadRom)\r
+ return; // BIOS test\r
break;\r
case 6: // controls\r
kc_sel_loop();\r