From 86be25153ccbafcf80a2c41f9679983731922673 Mon Sep 17 00:00:00 2001 From: notaz Date: Sun, 2 Oct 2022 00:17:00 +0300 Subject: [PATCH] libretro: adjust options after recent changes --- frontend/libretro.c | 168 +++++++++++--------------- frontend/libretro_core_options.h | 55 ++------- frontend/libretro_core_options_intl.h | 26 +--- libpcsxcore/database.c | 2 +- 4 files changed, 80 insertions(+), 171 deletions(-) diff --git a/frontend/libretro.c b/frontend/libretro.c index 15c53a3c..42f6151f 100644 --- a/frontend/libretro.c +++ b/frontend/libretro.c @@ -1936,6 +1936,8 @@ static void update_variables(bool in_flight) display_internal_fps = true; } + // + // CPU emulation related config #ifndef DRC_DISABLE var.value = NULL; var.key = "pcsx_rearmed_drc"; @@ -1970,48 +1972,69 @@ static void update_variables(bool in_flight) } } #endif /* !DRC_DISABLE */ - psxCpu->ApplyConfig(); var.value = NULL; - var.key = "pcsx_rearmed_spu_reverb"; + var.key = "pcsx_rearmed_psxclock"; + if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) + { + int psxclock = atoi(var.value); + Config.cycle_multiplier = 10000 / psxclock; + } +#if !defined(DRC_DISABLE) && !defined(LIGHTREC) + var.value = NULL; + var.key = "pcsx_rearmed_nosmccheck"; if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) { - if (strcmp(var.value, "disabled") == 0) - spu_config.iUseReverb = false; - else if (strcmp(var.value, "enabled") == 0) - spu_config.iUseReverb = true; + if (strcmp(var.value, "enabled") == 0) + new_dynarec_hacks |= NDHACK_NO_SMC_CHECK; + else + new_dynarec_hacks &= ~NDHACK_NO_SMC_CHECK; } var.value = NULL; - var.key = "pcsx_rearmed_spu_interpolation"; + var.key = "pcsx_rearmed_gteregsunneeded"; + if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) + { + if (strcmp(var.value, "enabled") == 0) + new_dynarec_hacks |= NDHACK_GTE_UNNEEDED; + else + new_dynarec_hacks &= ~NDHACK_GTE_UNNEEDED; + } + var.value = NULL; + var.key = "pcsx_rearmed_nogteflags"; if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) { - if (strcmp(var.value, "simple") == 0) - spu_config.iUseInterpolation = 1; - else if (strcmp(var.value, "gaussian") == 0) - spu_config.iUseInterpolation = 2; - else if (strcmp(var.value, "cubic") == 0) - spu_config.iUseInterpolation = 3; - else if (strcmp(var.value, "off") == 0) - spu_config.iUseInterpolation = 0; + if (strcmp(var.value, "enabled") == 0) + new_dynarec_hacks |= NDHACK_GTE_NO_FLAGS; + else + new_dynarec_hacks &= ~NDHACK_GTE_NO_FLAGS; } var.value = NULL; - var.key = "pcsx_rearmed_pe2_fix"; + var.key = "pcsx_rearmed_nocompathacks"; + if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) + { + if (strcmp(var.value, "enabled") == 0) + new_dynarec_hacks |= NDHACK_NO_COMPAT_HACKS; + else + new_dynarec_hacks &= ~NDHACK_NO_COMPAT_HACKS; + } +#endif /* !DRC_DISABLE && !LIGHTREC */ + var.value = NULL; + var.key = "pcsx_rearmed_nostalls"; if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) { - if (strcmp(var.value, "disabled") == 0) - Config.RCntFix = 0; - else if (strcmp(var.value, "enabled") == 0) - Config.RCntFix = 1; + if (strcmp(var.value, "enabled") == 0) + Config.DisableStalls = 1; + else + Config.DisableStalls = 0; } - + var.value = NULL; var.key = "pcsx_rearmed_icache_emulation"; - if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) { if (strcmp(var.value, "disabled") == 0) @@ -2020,15 +2043,35 @@ static void update_variables(bool in_flight) Config.icache_emulation = 1; } + psxCpu->ApplyConfig(); + + // end of CPU emu config + // + var.value = NULL; - var.key = "pcsx_rearmed_inuyasha_fix"; + var.key = "pcsx_rearmed_spu_reverb"; if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) { if (strcmp(var.value, "disabled") == 0) - Config.VSyncWA = 0; + spu_config.iUseReverb = false; else if (strcmp(var.value, "enabled") == 0) - Config.VSyncWA = 1; + spu_config.iUseReverb = true; + } + + var.value = NULL; + var.key = "pcsx_rearmed_spu_interpolation"; + + if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) + { + if (strcmp(var.value, "simple") == 0) + spu_config.iUseInterpolation = 1; + else if (strcmp(var.value, "gaussian") == 0) + spu_config.iUseInterpolation = 2; + else if (strcmp(var.value, "cubic") == 0) + spu_config.iUseInterpolation = 3; + else if (strcmp(var.value, "off") == 0) + spu_config.iUseInterpolation = 0; } #ifndef _WIN32 @@ -2074,16 +2117,6 @@ static void update_variables(bool in_flight) Config.Cdda = 0; } - var.value = NULL; - var.key = "pcsx_rearmed_spuirq"; - if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) - { - if (strcmp(var.value, "disabled") == 0) - Config.SpuIrq = 0; - else - Config.SpuIrq = 1; - } - #ifdef THREAD_RENDERING var.key = "pcsx_rearmed_gpu_thread_rendering"; var.value = NULL; @@ -2267,67 +2300,6 @@ static void update_variables(bool in_flight) GunconAdjustRatioY = atof(var.value); } -#if !defined(DRC_DISABLE) && !defined(LIGHTREC) - var.value = NULL; - var.key = "pcsx_rearmed_nosmccheck"; - if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) - { - if (strcmp(var.value, "enabled") == 0) - new_dynarec_hacks |= NDHACK_NO_SMC_CHECK; - else - new_dynarec_hacks &= ~NDHACK_NO_SMC_CHECK; - } - - var.value = NULL; - var.key = "pcsx_rearmed_gteregsunneeded"; - if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) - { - if (strcmp(var.value, "enabled") == 0) - new_dynarec_hacks |= NDHACK_GTE_UNNEEDED; - else - new_dynarec_hacks &= ~NDHACK_GTE_UNNEEDED; - } - - var.value = NULL; - var.key = "pcsx_rearmed_nogteflags"; - if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) - { - if (strcmp(var.value, "enabled") == 0) - new_dynarec_hacks |= NDHACK_GTE_NO_FLAGS; - else - new_dynarec_hacks &= ~NDHACK_GTE_NO_FLAGS; - } - - /* this probably is safe to change in real-time */ - var.value = NULL; - var.key = "pcsx_rearmed_psxclock"; - if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) - { - int psxclock = atoi(var.value); - cycle_multiplier = 10000 / psxclock; - } - - var.value = NULL; - var.key = "pcsx_rearmed_nocompathacks"; - if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) - { - if (strcmp(var.value, "enabled") == 0) - new_dynarec_hacks |= NDHACK_NO_COMPAT_HACKS; - else - new_dynarec_hacks &= ~NDHACK_NO_COMPAT_HACKS; - } -#endif /* !DRC_DISABLE && !LIGHTREC */ - - var.value = NULL; - var.key = "pcsx_rearmed_nostalls"; - if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) - { - if (strcmp(var.value, "enabled") == 0) - Config.DisableStalls = 1; - else - Config.DisableStalls = 0; - } - var.value = NULL; var.key = "pcsx_rearmed_input_sensitivity"; if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) @@ -3049,9 +3021,9 @@ void retro_init(void) /* Set how much slower PSX CPU runs * 100 (so that 200 is 2 times) * we have to do this because cache misses and some IO penalties * are not emulated. Warning: changing this may break compatibility. */ - cycle_multiplier = 175; + Config.cycle_multiplier = CYCLE_MULT_DEFAULT; #if defined(HAVE_PRE_ARMV7) && !defined(_3DS) - cycle_multiplier = 200; + Config.cycle_multiplier = 200; #endif pl_rearmed_cbs.gpu_peops.iUseDither = 1; pl_rearmed_cbs.gpu_peops.dwActFixes = GPU_PEOPS_OLD_FRAME_SKIP; diff --git a/frontend/libretro_core_options.h b/frontend/libretro_core_options.h index 654651c3..39bc32b6 100644 --- a/frontend/libretro_core_options.h +++ b/frontend/libretro_core_options.h @@ -198,16 +198,20 @@ struct retro_core_option_v2_definition option_defs_us[] = { "enabled", }, #endif -#if !defined(DRC_DISABLE) && !defined(LIGHTREC) { "pcsx_rearmed_psxclock", "PSX CPU Clock Speed", NULL, + "Overclock or under-clock the PSX CPU. Try adjusting this if the game is too slow, too fast or hangs." +#if defined(LIGHTREC) + " Currently doesn't work with Lightrec dynarec." +#endif #if defined(HAVE_PRE_ARMV7) && !defined(_3DS) - "Overclock or under-clock the PSX CPU. Lower values may reduce performance requirements while higher values may improve frame rates in demanding games at the expense of increased overheads; setting the value too low or high may reduce compatibility. Default is 50.", + " Default is 50." #else - "Overclock or under-clock the PSX CPU. Lower values may reduce performance requirements while higher values may improve frame rates in demanding games at the expense of increased overheads; setting the value too low or high may reduce compatibility. Default is 57.", + " Default is 57." #endif + , NULL, "system", { @@ -290,7 +294,6 @@ struct retro_core_option_v2_definition option_defs_us[] = { "57", #endif }, -#endif /* !DRC_DISABLE && !LIGHTREC */ { "pcsx_rearmed_dithering", "Dithering Pattern", @@ -1135,53 +1138,11 @@ struct retro_core_option_v2_definition option_defs_us[] = { }, "1.00", }, - { - "pcsx_rearmed_pe2_fix", - "Parasite Eve 2/Vandal Hearts 1/2 Fix", - NULL, - "Hack fix required for correct operation of Parasite Eve 2 and Vandal Hearts 1/2. Should be disabled for all other games.", - NULL, - "compat_hack", - { - { "disabled", NULL }, - { "enabled", NULL }, - { NULL, NULL }, - }, - "disabled", - }, - { - "pcsx_rearmed_inuyasha_fix", - "InuYasha Sengoku Battle Fix", - NULL, - "Hack fix required for correct operation of Inuyasha Sengoku Otogi Kassen. Should be disabled for all other games.", - NULL, - "compat_hack", - { - { "disabled", NULL }, - { "enabled", NULL }, - { NULL, NULL }, - }, - "disabled", - }, - { - "pcsx_rearmed_spuirq", - "SPU IRQ Always Enabled", - NULL, - "Hack for certain games where events tied to audio cues do not trigger correctly. Fixes unopenable doors in Alien Resurrection. Fixes desynchronised FMV audio in Legend of Mana. Should be disabled unless required.", - NULL, - "compat_hack", - { - { "disabled", NULL }, - { "enabled", NULL }, - { NULL, NULL }, - }, - "disabled", - }, { "pcsx_rearmed_icache_emulation", "Instruction Cache Emulation", NULL, - "Enable emulation of the PSX CPU instruction cache. Improves accuracy at the expense of increased performance overheads. Required for Formula One 2001, Formula One Arcade and Formula One 99. May cause certain games to fail (e.g. Spyro 2: Gateway to Glimmer, PAL version) so should be disabled unless needed. [Interpreter only and partial on lightrec, unsupported when using ARMv7 backend]", + "Enable emulation of the PSX CPU instruction cache. Improves accuracy at the expense of increased performance overheads. Required for Formula One 2001, Formula One Arcade and Formula One 99. [Interpreter only and partial on lightrec, unsupported when using ARMv7 backend]", NULL, "compat_hack", { diff --git a/frontend/libretro_core_options_intl.h b/frontend/libretro_core_options_intl.h index 8382ff2d..5b04d601 100644 --- a/frontend/libretro_core_options_intl.h +++ b/frontend/libretro_core_options_intl.h @@ -221,7 +221,7 @@ struct retro_core_option_v2_definition option_defs_tr[] = { "pcsx_rearmed_psxclock", "PSX CPU Saat Hızı", NULL, -#ifdef HAVE_PRE_ARMV7 +#if defined(HAVE_PRE_ARMV7) && !defined(_3DS) "Overclock or underclock the PSX clock. Default is 50", #else "Overclock or underclock the PSX clock. Default is 57", @@ -459,18 +459,6 @@ struct retro_core_option_v2_definition option_defs_tr[] = { }, NULL }, - { - "pcsx_rearmed_pe2_fix", - "Parasite Eve 2/Vandal Hearts 1/2 Düzeltmleri", - NULL, - NULL, - NULL, - NULL, - { - { NULL, NULL }, - }, - NULL - }, { "pcsx_rearmed_icache_emulation", "ICache Düzeltmleri", @@ -483,18 +471,6 @@ struct retro_core_option_v2_definition option_defs_tr[] = { }, NULL }, - { - "pcsx_rearmed_inuyasha_fix", - "InuYasha Sengoku Battle Düzeltmesi", - NULL, - NULL, - NULL, - NULL, - { - { NULL, NULL }, - }, - NULL - }, /* ADVANCED OPTIONS */ { diff --git a/libpcsxcore/database.c b/libpcsxcore/database.c index 561aedee..1ea8d43b 100644 --- a/libpcsxcore/database.c +++ b/libpcsxcore/database.c @@ -30,7 +30,7 @@ cycle_multiplier_overrides[] = * changing memcard settings is enough to break/unbreak it */ { "SLPS02528", 190 }, { "SLPS02636", 190 }, -#ifdef DRC_DISABLE /* new_dynarec has a hack for this game */ +#if defined(DRC_DISABLE) || defined(LIGHTREC) /* new_dynarec has a hack for this game */ /* Parasite Eve II - internal timer checks */ { "SLUS01042", 125 }, { "SLUS01055", 125 }, -- 2.39.5