From 397c3db37de978bae0ef60267b57b74922afb455 Mon Sep 17 00:00:00 2001 From: notaz Date: Fri, 8 Nov 2024 02:41:35 +0200 Subject: [PATCH] libretro: don't make cycle_multiplier depend on device It causes different compatibility on different devices. If the user wants to win some fps this way, they should just change their config. --- frontend/libretro.c | 12 ++++-------- frontend/libretro_core_options.h | 7 ++----- libpcsxcore/psxcommon.h | 2 ++ 3 files changed, 8 insertions(+), 13 deletions(-) diff --git a/frontend/libretro.c b/frontend/libretro.c index 68ec65ff..aa69ce65 100644 --- a/frontend/libretro.c +++ b/frontend/libretro.c @@ -2297,7 +2297,10 @@ static void update_variables(bool in_flight) if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) { int psxclock = atoi(var.value); - Config.cycle_multiplier = 10000 / psxclock; + if (strcmp(var.value, "auto") == 0 || psxclock == 0) + Config.cycle_multiplier = CYCLE_MULT_DEFAULT; + else + Config.cycle_multiplier = 10000 / psxclock; } #if !defined(DRC_DISABLE) && !defined(LIGHTREC) @@ -3612,13 +3615,6 @@ void retro_init(void) if (environ_cb(RETRO_ENVIRONMENT_GET_RUMBLE_INTERFACE, &rumble)) rumble_cb = rumble.set_rumble_state; - /* 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. */ - Config.cycle_multiplier = CYCLE_MULT_DEFAULT; -#if defined(HAVE_PRE_ARMV7) && !defined(_3DS) - 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 ed2f41c3..220df0f2 100644 --- a/frontend/libretro_core_options.h +++ b/frontend/libretro_core_options.h @@ -239,6 +239,7 @@ struct retro_core_option_v2_definition option_defs_us[] = { NULL, "system", { + { "auto", "Auto" }, { "30", NULL }, { "31", NULL }, { "32", NULL }, @@ -312,11 +313,7 @@ struct retro_core_option_v2_definition option_defs_us[] = { { "100", NULL }, { NULL, NULL }, }, -#if defined(HAVE_PRE_ARMV7) && !defined(_3DS) - "50", -#else - "57", -#endif + "auto", }, { "pcsx_rearmed_dithering", diff --git a/libpcsxcore/psxcommon.h b/libpcsxcore/psxcommon.h index 68c32a91..8a0ac703 100644 --- a/libpcsxcore/psxcommon.h +++ b/libpcsxcore/psxcommon.h @@ -112,6 +112,8 @@ extern int Log; void __Log(char *fmt, ...); +// lots of timing depends on this and makes or breaks compatibility, +// don't change unless you're going to retest hundreds of games #define CYCLE_MULT_DEFAULT 175 typedef struct { -- 2.39.5