From: retro-wertz Date: Tue, 11 Jun 2019 01:08:27 +0000 (+0800) Subject: Allow dynarec speedhacks to be applied on-the-fly X-Git-Tag: r24l~723^2 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=decba348a49c50232fc706d0f860d3f910a06453;p=pcsx_rearmed.git Allow dynarec speedhacks to be applied on-the-fly --- diff --git a/frontend/libretro.c b/frontend/libretro.c index 9f7c4fe5..ccf14330 100644 --- a/frontend/libretro.c +++ b/frontend/libretro.c @@ -1626,6 +1626,38 @@ static void update_variables(bool in_flight) Config.Cdda = 0; } +#ifndef DRC_DISABLE + 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; + } +#endif + if (in_flight) { // inform core things about possible config changes plugin_call_rearmed_cbs(); @@ -1664,36 +1696,6 @@ static void update_variables(bool in_flight) int psxclock = atoi(var.value); cycle_multiplier = 10000 / psxclock; } - - 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; - } #endif } }