\r
// ------------ gfx options menu ------------\r
\r
+static int mh_opt_render(menu_id id, int keys)\r
+{\r
+ plat_video_toggle_renderer((keys & PBTN_RIGHT) ? 1 : 0, 1);\r
+ return 0;\r
+}\r
+\r
+static const char *mgn_opt_renderer(menu_id id, int *offs)\r
+{\r
+ *offs = -11;\r
+ if (PicoOpt & POPT_ALT_RENDERER)\r
+ return " 8bit fast";\r
+ else if (currentConfig.EmuOpt & EOPT_16BPP)\r
+ return "16bit accurate";\r
+ else\r
+ return " 8bit accurate";\r
+}\r
+\r
static const char *mgn_opt_scaling(menu_id id, int *offs)\r
{\r
*offs = -13;\r
\r
static menu_entry e_menu_gfx_options[] =\r
{\r
+ mee_cust ("Renderer", MA_OPT_RENDERER, mh_opt_render, mgn_opt_renderer),\r
mee_range_cust("Scaling", MA_OPT_SCALING, currentConfig.scaling, 0, 3, mgn_opt_scaling),\r
mee_range_cust("Gamma correction", MA_OPT2_GAMMA, currentConfig.gamma, 1, 300, mgn_aopt_gamma),\r
mee_onoff ("A_SN's gamma curve", MA_OPT2_A_SN_GAMMA, currentConfig.EmuOpt, EOPT_A_SN_GAMMA),\r
\r
static menu_entry e_menu_options[];\r
\r
-/* TODO: move to plat */\r
-static int mh_opt_render(menu_id id, int keys)\r
-{\r
- if (keys & PBTN_LEFT) {\r
- if (PicoOpt&0x10) PicoOpt&= ~0x10;\r
- else if (!(currentConfig.EmuOpt &0x80))currentConfig.EmuOpt |= 0x80;\r
- } else {\r
- if (PicoOpt&0x10) return 0;\r
- else if (!(currentConfig.EmuOpt &0x80))PicoOpt|= 0x10;\r
- else if ( currentConfig.EmuOpt &0x80) currentConfig.EmuOpt &= ~0x80;\r
- }\r
- return 0;\r
-}\r
-\r
static int sndrate_prevnext(int rate, int dir)\r
{\r
static const int rates[] = { 8000, 11025, 16000, 22050, 44100 };\r
return 1;\r
}\r
\r
-static const char *mgn_opt_renderer(menu_id id, int *offs)\r
+static int mh_restore_defaults(menu_id id, int keys)\r
{\r
- *offs = -6;\r
- if (PicoOpt & POPT_ALT_RENDERER)\r
- return " 8bit fast";\r
- else if (currentConfig.EmuOpt & 0x80)\r
- return "16bit accurate";\r
- else\r
- return " 8bit accurate";\r
+ emu_set_defconfig();\r
+ me_update_msg("defaults restored");\r
+ return 1;\r
}\r
\r
static const char *mgn_opt_fskip(menu_id id, int *offs)\r
mee_range ("Save slot", MA_OPT_SAVE_SLOT, state_slot, 0, 9),\r
mee_range_cust("Frameskip", MA_OPT_FRAMESKIP, currentConfig.Frameskip, -1, 16, mgn_opt_fskip),\r
mee_cust ("Region", MA_OPT_REGION, mh_opt_misc, mgn_opt_region),\r
- mee_cust ("Renderer", MA_OPT_RENDERER, mh_opt_render, mgn_opt_renderer),\r
- mee_onoff ("Show FPS", MA_OPT_SHOW_FPS, currentConfig.EmuOpt, 0x002),\r
- mee_onoff ("Enable sound", MA_OPT_ENABLE_SOUND, currentConfig.EmuOpt, 0x004),\r
+ mee_onoff ("Show FPS", MA_OPT_SHOW_FPS, currentConfig.EmuOpt, EOPT_SHOW_FPS),\r
+ mee_onoff ("Enable sound", MA_OPT_ENABLE_SOUND, currentConfig.EmuOpt, EOPT_EN_SOUND),\r
mee_cust ("Sound Quality", MA_OPT_SOUND_QUALITY, mh_opt_misc, mgn_opt_sound),\r
mee_cust ("Confirm savestate", MA_OPT_CONFIRM_STATES,mh_opt_misc, mgn_opt_c_saves),\r
mee_range (cpu_clk_name, MA_OPT_CPU_CLOCKS, currentConfig.CPUclock, 20, 900),\r
mee_handler_mkname_id(MA_OPT_SAVECFG, mh_saveloadcfg, mgn_savecfg),\r
mee_handler_id("Save cfg for current game only", MA_OPT_SAVECFG_GAME, mh_saveloadcfg),\r
mee_handler_mkname_id(MA_OPT_LOADCFG, mh_saveloadcfg, mgn_loadcfg),\r
+ mee_handler ("Restore defaults", mh_restore_defaults),\r
mee_end,\r
};\r
\r
else gp2x_video_RGB_setscaling(0, (PicoOpt&0x100)&&!(Pico.video.reg[12]&1) ? 256 : 320, 240);\r
}\r
\r
-void plat_video_toggle_renderer(void)\r
+void plat_video_toggle_renderer(int is_next, int is_menu)\r
{\r
+ /* alt, 16bpp, 8bpp */\r
if (PicoOpt & POPT_ALT_RENDERER) {\r
PicoOpt &= ~POPT_ALT_RENDERER;\r
- currentConfig.EmuOpt |= EOPT_16BPP;\r
- } else if (!(currentConfig.EmuOpt & EOPT_16BPP))\r
- PicoOpt |= POPT_ALT_RENDERER;\r
- else\r
+ if (is_next)\r
+ currentConfig.EmuOpt |= EOPT_16BPP;\r
+ } else if (!(currentConfig.EmuOpt & EOPT_16BPP)) {\r
+ if (is_next)\r
+ PicoOpt |= POPT_ALT_RENDERER;\r
+ else\r
+ currentConfig.EmuOpt |= EOPT_16BPP;\r
+ } else {\r
currentConfig.EmuOpt &= ~EOPT_16BPP;\r
+ if (!is_next)\r
+ PicoOpt |= POPT_ALT_RENDERER;\r
+ }\r
+\r
+ if (is_menu)\r
+ return;\r
\r
vidResetMode();\r
\r