X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=pcsx_rearmed.git;a=blobdiff_plain;f=frontend%2Fmenu.c;h=8b51c06148c342f4526495c1008140ce93543cc7;hp=dee01597d6546d407555e4e12dca9f247dea5c56;hb=4c08b9e7dd350a48fc3e0515913d6ccc8b15e5ae;hpb=51f77282d6cb4bc06248395cc1e712ee298910af diff --git a/frontend/menu.c b/frontend/menu.c index dee01597..8b51c061 100644 --- a/frontend/menu.c +++ b/frontend/menu.c @@ -30,7 +30,7 @@ #include "../libpcsxcore/cdrom.h" #include "../libpcsxcore/psemu_plugin_defs.h" #include "../libpcsxcore/new_dynarec/new_dynarec.h" -#include "../plugins/dfinput/pad.h" +#include "../plugins/dfinput/main.h" #include "revision.h" #define MENU_X2 1 @@ -70,10 +70,10 @@ enum { }; static int last_psx_w, last_psx_h, last_psx_bpp; -static int scaling, filter, cpu_clock, cpu_clock_st; +static int scaling, filter, cpu_clock, cpu_clock_st, volume_boost; static char rom_fname_reload[MAXPATHLEN]; static char last_selected_fname[MAXPATHLEN]; -static int warned_about_bios, region, in_type_sel; +static int warned_about_bios, region, in_type_sel1, in_type_sel2; static int memcard1_sel, memcard2_sel; int g_opts; @@ -83,6 +83,7 @@ extern int iUseInterpolation; extern int iXAPitch; extern int iSPUIRQWait; extern int iUseTimer; +extern int iVolume; static const char *bioses[24]; static const char *gpu_plugins[16]; @@ -142,7 +143,16 @@ static void menu_sync_config(void) Config.PsxAuto = 0; Config.PsxType = region - 1; } - in_type = in_type_sel ? PSE_PAD_TYPE_ANALOGPAD : PSE_PAD_TYPE_STANDARD; + switch (in_type_sel1) { + case 1: in_type1 = PSE_PAD_TYPE_ANALOGPAD; break; + case 2: in_type1 = PSE_PAD_TYPE_GUNCON; break; + default: in_type1 = PSE_PAD_TYPE_STANDARD; + } + switch (in_type_sel2) { + case 1: in_type2 = PSE_PAD_TYPE_ANALOGPAD; break; + case 2: in_type2 = PSE_PAD_TYPE_GUNCON; break; + default: in_type2 = PSE_PAD_TYPE_STANDARD; + } if (in_evdev_allow_abs_only != allow_abs_only_old) { pandora_rescan_inputs(); allow_abs_only_old = in_evdev_allow_abs_only; @@ -153,15 +163,18 @@ static void menu_sync_config(void) pl_rearmed_cbs.gpu_peops.fFrameRateHz = Config.PsxType ? 50.0f : 59.94f; pl_rearmed_cbs.gpu_peops.dwFrameRateTicks = (100000*100 / (unsigned long)(pl_rearmed_cbs.gpu_peops.fFrameRateHz*100)); + + iVolume = 768 + 128 * volume_boost; } static void menu_set_defconfig(void) { g_opts = 0; scaling = SCALE_4_3; + volume_boost = 0; region = 0; - in_type_sel = 0; + in_type_sel1 = in_type_sel2 = 0; in_evdev_allow_abs_only = 0; Config.Xa = Config.Cdda = Config.Sio = Config.SpuIrq = Config.RCntFix = Config.VSyncWA = 0; @@ -229,7 +242,8 @@ static const struct { CE_INTVAL(state_slot), CE_INTVAL(cpu_clock), CE_INTVAL(g_opts), - CE_INTVAL(in_type_sel), + CE_INTVAL(in_type_sel1), + CE_INTVAL(in_type_sel2), CE_INTVAL_P(frameskip), CE_INTVAL_P(gpu_peops.iUseDither), CE_INTVAL_P(gpu_peops.dwActFixes), @@ -240,6 +254,7 @@ static const struct { CE_INTVAL(iUseTimer), CE_INTVAL(warned_about_bios), CE_INTVAL(in_evdev_allow_abs_only), + CE_INTVAL(volume_boost), }; static char *get_cd_label(void) @@ -703,6 +718,10 @@ me_bind_action emuctrl_actions[] = { "Toggle Frameskip ", 1 << SACTION_TOGGLE_FSKIP }, { "Take Screenshot ", 1 << SACTION_SCREENSHOT }, { "Enter Menu ", 1 << SACTION_ENTER_MENU }, + { "Gun Trigger ", 1 << SACTION_GUN_TRIGGER }, + { "Gun A button ", 1 << SACTION_GUN_A }, + { "Gun B button ", 1 << SACTION_GUN_B }, + { "Gun Offscreen Trigger", 1 << SACTION_GUN_TRIGGER2 }, { NULL, 0 } }; @@ -938,17 +957,25 @@ static int mh_input_rescan(int id, int keys) return 0; } -static const char *men_in_type_sel[] = { "Standard (SCPH-1080)", "Analog (SCPH-1150)", NULL }; +static const char *men_in_type_sel[] = { + "Standard (SCPH-1080)", + "Analog (SCPH-1150)", + "GunCon", + NULL +}; static const char h_nub_btns[] = "Experimental, keep this OFF if unsure. Select rescan after change."; +static const char h_notsgun[] = "Don't trigger (shoot) when touching screen in gun games."; static menu_entry e_menu_keyconfig[] = { - mee_handler_id("Player 1", MA_CTRL_PLAYER1, key_config_loop_wrap), - mee_handler_id("Player 2", MA_CTRL_PLAYER2, key_config_loop_wrap), - mee_handler_id("Emulator controls", MA_CTRL_EMU, key_config_loop_wrap), + mee_handler_id("Player 1", MA_CTRL_PLAYER1, key_config_loop_wrap), + mee_handler_id("Player 2", MA_CTRL_PLAYER2, key_config_loop_wrap), + mee_handler_id("Emulator/Gun controls", MA_CTRL_EMU, key_config_loop_wrap), mee_label (""), - mee_enum ("Controller", 0, in_type_sel, men_in_type_sel), + mee_enum ("Port 1 device", 0, in_type_sel1, men_in_type_sel), + mee_enum ("Port 2 device", 0, in_type_sel2, men_in_type_sel), mee_onoff_h ("Nubs as buttons", 0, in_evdev_allow_abs_only, 1, h_nub_btns), + mee_onoff_h ("No TS Gun trigger", 0, g_opts, OPT_TSGUN_NOTRIGGER, h_notsgun), mee_cust_nosave("Save global config", MA_OPT_SAVECFG, mh_savecfg, mgn_saveloadcfg), mee_cust_nosave("Save cfg for loaded game", MA_OPT_SAVECFG_GAME, mh_savecfg, mgn_saveloadcfg), mee_handler ("Rescan devices", mh_input_rescan), @@ -1083,14 +1110,15 @@ static int menu_loop_plugin_gpu(int id, int keys) return 0; } -static const char *men_spu_reverb[] = { "Off", "Fake", "On", NULL }; 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_enum ("Reverb", 0, iUseReverb, men_spu_reverb), + 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), @@ -1143,6 +1171,8 @@ static int menu_loop_plugin_options(int id, int keys) 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" @@ -1161,6 +1191,7 @@ static const char h_cfg_nodrc[] = "Disable dynamic recompiler and use interpret 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), @@ -1991,7 +2022,7 @@ void menu_prepare_emu(void) fprintf(stderr, "Warning: GPU_open returned %d\n", ret); } - dfinput_activate(in_type == PSE_PAD_TYPE_ANALOGPAD); + dfinput_activate(); } void me_update_msg(const char *msg)