+static const char h_gpu_neon[] = "Configure built-in NEON GPU plugin";
+static const char *men_gpu_interlace[] = { "Off", "On", "Auto", NULL };
+
+static menu_entry e_menu_plugin_gpu_neon[] =
+{
+ mee_enum ("Enable interlace mode", 0, pl_rearmed_cbs.gpu_neon.allow_interlace, men_gpu_interlace),
+ mee_end,
+};
+
+static int menu_loop_plugin_gpu_neon(int id, int keys)
+{
+ int sel = 0;
+ me_loop(e_menu_plugin_gpu_neon, &sel);
+ return 0;
+}
+
+#endif
+
+static menu_entry e_menu_plugin_gpu_unai[] =
+{
+ mee_onoff ("Skip every 2nd line", 0, pl_rearmed_cbs.gpu_unai.lineskip, 1),
+ mee_onoff ("Abe's Odyssey hack", 0, pl_rearmed_cbs.gpu_unai.abe_hack, 1),
+ mee_onoff ("Disable lighting", 0, pl_rearmed_cbs.gpu_unai.no_light, 1),
+ mee_onoff ("Disable blending", 0, pl_rearmed_cbs.gpu_unai.no_blend, 1),
+ mee_end,
+};
+
+static int menu_loop_plugin_gpu_unai(int id, int keys)
+{
+ int sel = 0;
+ me_loop(e_menu_plugin_gpu_unai, &sel);
+ return 0;
+}
+
+static const char *men_gpu_dithering[] = { "None", "Game dependant", "Always", NULL };
+//static const char h_gpu_0[] = "Needed for Chrono Cross";
+static const char h_gpu_1[] = "Capcom fighting games";
+static const char h_gpu_2[] = "Black screens in Lunar";
+static const char h_gpu_3[] = "Compatibility mode";
+static const char h_gpu_6[] = "Pandemonium 2";
+//static const char h_gpu_7[] = "Skip every second frame";
+static const char h_gpu_8[] = "Needed by Dark Forces";
+static const char h_gpu_9[] = "better g-colors, worse textures";
+static const char h_gpu_10[] = "Toggle busy flags after drawing";
+
+static menu_entry e_menu_plugin_gpu_peops[] =
+{
+ mee_enum ("Dithering", 0, pl_rearmed_cbs.gpu_peops.iUseDither, men_gpu_dithering),
+// mee_onoff_h ("Odd/even bit hack", 0, pl_rearmed_cbs.gpu_peops.dwActFixes, 1<<0, h_gpu_0),
+ mee_onoff_h ("Expand screen width", 0, pl_rearmed_cbs.gpu_peops.dwActFixes, 1<<1, h_gpu_1),
+ mee_onoff_h ("Ignore brightness color", 0, pl_rearmed_cbs.gpu_peops.dwActFixes, 1<<2, h_gpu_2),
+ mee_onoff_h ("Disable coordinate check", 0, pl_rearmed_cbs.gpu_peops.dwActFixes, 1<<3, h_gpu_3),
+ mee_onoff_h ("Lazy screen update", 0, pl_rearmed_cbs.gpu_peops.dwActFixes, 1<<6, h_gpu_6),
+// mee_onoff_h ("Old frame skipping", 0, pl_rearmed_cbs.gpu_peops.dwActFixes, 1<<7, h_gpu_7),
+ mee_onoff_h ("Repeated flat tex triangles ",0,pl_rearmed_cbs.gpu_peops.dwActFixes, 1<<8, h_gpu_8),
+ mee_onoff_h ("Draw quads with triangles", 0, pl_rearmed_cbs.gpu_peops.dwActFixes, 1<<9, h_gpu_9),
+ mee_onoff_h ("Fake 'gpu busy' states", 0, pl_rearmed_cbs.gpu_peops.dwActFixes, 1<<10, h_gpu_10),
+ mee_end,
+};
+
+static int menu_loop_plugin_gpu_peops(int id, int keys)
+{
+ static int sel = 0;
+ me_loop(e_menu_plugin_gpu_peops, &sel);
+ return 0;
+}
+
+static const char *men_spu_interp[] = { "None", "Simple", "Gaussian", "Cubic", NULL };
+static const char h_spu_volboost[] = "Large values cause distortion";
+static const char h_spu_irq_wait[] = "Wait for CPU (recommended set to ON)";
+static const char h_spu_thread[] = "Run sound emulation in main thread (recommended)";
+
+static menu_entry e_menu_plugin_spu[] =
+{
+ mee_range_h ("Volume boost", 0, volume_boost, -5, 30, h_spu_volboost),
+ mee_onoff ("Reverb", 0, iUseReverb, 2),
+ mee_enum ("Interpolation", 0, iUseInterpolation, men_spu_interp),
+ mee_onoff ("Adjust XA pitch", 0, iXAPitch, 1),
+ mee_onoff_h ("SPU IRQ Wait", 0, iSPUIRQWait, 1, h_spu_irq_wait),
+ mee_onoff_h ("Sound in main thread", 0, iUseTimer, 2, h_spu_thread),
+ mee_end,
+};
+
+static int menu_loop_plugin_spu(int id, int keys)
+{
+ static int sel = 0;
+ me_loop(e_menu_plugin_spu, &sel);
+ return 0;
+}
+
+static const char h_bios[] = "HLE is simulated BIOS. BIOS selection is saved in\n"
+ "savestates and can't be changed there. Must save\n"
+ "config and reload the game for change to take effect";
+static const char h_plugin_xpu[] = "Must save config and reload the game\n"
+ "for plugin change to take effect";
+static const char h_gpu_peops[] = "Configure P.E.Op.S. SoftGL Driver V1.17";
+static const char h_gpu_unai[] = "Configure Unai/PCSX4ALL Team GPU plugin";
+static const char h_spu[] = "Configure built-in P.E.Op.S. Sound Driver V1.7";
+
+static menu_entry e_menu_plugin_options[] =
+{
+ mee_enum_h ("BIOS", 0, bios_sel, bioses, h_bios),
+ mee_enum_h ("GPU plugin", 0, gpu_plugsel, gpu_plugins, h_plugin_xpu),
+ mee_enum_h ("SPU plugin", 0, spu_plugsel, spu_plugins, h_plugin_xpu),
+#ifdef __ARM_NEON__
+ mee_handler_h ("Configure built-in GPU plugin", menu_loop_plugin_gpu_neon, h_gpu_neon),
+#endif
+ mee_handler_h ("Configure gpu_peops plugin", menu_loop_plugin_gpu_peops, h_gpu_peops),
+ mee_handler_h ("Configure PCSX4ALL GPU plugin", menu_loop_plugin_gpu_unai, h_gpu_unai),
+ mee_handler_h ("Configure built-in SPU plugin", menu_loop_plugin_spu, h_spu),
+ mee_end,
+};
+
+static menu_entry e_menu_main2[];
+
+static int menu_loop_plugin_options(int id, int keys)
+{
+ static int sel = 0;
+ me_loop(e_menu_plugin_options, &sel);
+
+ // sync BIOS/plugins
+ snprintf(Config.Bios, sizeof(Config.Bios), "%s", bioses[bios_sel]);
+ snprintf(Config.Gpu, sizeof(Config.Gpu), "%s", gpu_plugins[gpu_plugsel]);
+ snprintf(Config.Spu, sizeof(Config.Spu), "%s", spu_plugins[spu_plugsel]);
+ me_enable(e_menu_main2, MA_MAIN_RUN_BIOS, bios_sel != 0);
+
+ return 0;
+}
+
+// ------------ adv options menu ------------
+
+static const char h_cfg_psxclk[] = "Over/under-clock the PSX, default is " DEFAULT_PSX_CLOCK_S "\n";
+static const char h_cfg_nosmc[] = "Will cause crashes when loading, break memcards";
+static const char h_cfg_gteunn[] = "May cause graphical glitches";
+static const char h_cfg_gteflgs[] = "Will cause graphical glitches";
+
+static menu_entry e_menu_speed_hacks[] =
+{
+ mee_range_h ("PSX CPU clock, %%", 0, psx_clock, 1, 500, h_cfg_psxclk),
+ mee_onoff_h ("Disable SMC checks", 0, new_dynarec_hacks, NDHACK_NO_SMC_CHECK, h_cfg_nosmc),
+ mee_onoff_h ("Assume GTE regs unneeded", 0, new_dynarec_hacks, NDHACK_GTE_UNNEEDED, h_cfg_gteunn),
+ mee_onoff_h ("Disable GTE flags", 0, new_dynarec_hacks, NDHACK_GTE_NO_FLAGS, h_cfg_gteflgs),
+ mee_end,
+};
+
+static int menu_loop_speed_hacks(int id, int keys)
+{
+ static int sel = 0;
+ me_loop(e_menu_speed_hacks, &sel);
+ return 0;
+}
+
+static const char *men_cfg_cdrr[] = { "Auto", "ON", "OFF", NULL };
+static const char h_cfg_cpul[] = "Shows CPU usage in %";
+static const char h_cfg_spu[] = "Shows active SPU channels\n"
+ "(green: normal, red: fmod, blue: noise)";
+static const char h_cfg_fl[] = "Frame Limiter keeps the game from running too fast";
+static const char h_cfg_xa[] = "Disables XA sound, which can sometimes improve performance";
+static const char h_cfg_cdda[] = "Disable CD Audio for a performance boost\n"
+ "(proper .cue/.bin dump is needed otherwise)";
+static const char h_cfg_sio[] = "You should not need this, breaks games";
+static const char h_cfg_spuirq[] = "Compatibility tweak; should be left off";
+static const char h_cfg_rcnt1[] = "Parasite Eve 2, Vandal Hearts 1/2 Fix\n"
+ "(timing hack, breaks other games)";
+static const char h_cfg_rcnt2[] = "InuYasha Sengoku Battle Fix\n"
+ "(timing hack, breaks other games)";
+static const char h_cfg_cdrr[] = "Compatibility tweak (CD timing hack, breaks FMVs)";
+static const char h_cfg_nodrc[] = "Disable dynamic recompiler and use interpreter\n"
+ "Might be useful to overcome some dynarec bugs";
+static const char h_cfg_shacks[] = "Breaks games but may give better performance\n"
+ "must reload game for any change to take effect";
+
+static menu_entry e_menu_adv_options[] =
+{
+ mee_onoff_h ("Show CPU load", 0, g_opts, OPT_SHOWCPU, h_cfg_cpul),
+ mee_onoff_h ("Show SPU channels", 0, g_opts, OPT_SHOWSPU, h_cfg_spu),
+ mee_onoff_h ("Disable Frame Limiter", 0, g_opts, OPT_NO_FRAMELIM, h_cfg_fl),
+ mee_onoff_h ("Disable XA Decoding", 0, Config.Xa, 1, h_cfg_xa),
+ mee_onoff_h ("Disable CD Audio", 0, Config.Cdda, 1, h_cfg_cdda),
+ mee_onoff_h ("SIO IRQ Always Enabled", 0, Config.Sio, 1, h_cfg_sio),
+ mee_onoff_h ("SPU IRQ Always Enabled", 0, Config.SpuIrq, 1, h_cfg_spuirq),
+ //mee_onoff_h ("Rootcounter hack", 0, Config.RCntFix, 1, h_cfg_rcnt1),
+ mee_onoff_h ("Rootcounter hack 2", 0, Config.VSyncWA, 1, h_cfg_rcnt2),
+ mee_enum_h ("CD read reschedule hack",0, Config.CdrReschedule, men_cfg_cdrr, h_cfg_cdrr),
+ mee_onoff_h ("Disable dynarec (slow!)",0, Config.Cpu, 1, h_cfg_nodrc),
+ mee_handler_h ("[Speed hacks]", menu_loop_speed_hacks, h_cfg_shacks),
+ mee_end,
+};
+
+static int menu_loop_adv_options(int id, int keys)
+{
+ static int sel = 0;
+ me_loop(e_menu_adv_options, &sel);
+ return 0;
+}
+
+// ------------ options menu ------------
+
+static int mh_restore_defaults(int id, int keys)
+{
+ menu_set_defconfig();
+ me_update_msg("defaults restored");
+ return 1;
+}
+
+static const char *men_region[] = { "Auto", "NTSC", "PAL", NULL };
+static const char *men_frameskip[] = { "Auto", "Off", "1", "2", "3", NULL };
+/*
+static const char *men_confirm_save[] = { "OFF", "writes", "loads", "both", NULL };
+static const char h_confirm_save[] = "Ask for confirmation when overwriting save,\n"
+ "loading state or both";
+*/
+static const char h_restore_def[] = "Switches back to default / recommended\n"
+ "configuration";
+static const char h_frameskip[] = "Warning: frameskip sometimes causes glitches\n";