aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornegativeExponent2020-05-07 18:54:56 +0800
committernegativeExponent2020-05-07 18:54:56 +0800
commit570b9365c21d4e30a09b5e55c7cc94954fd4dd6d (patch)
treedcb4ae4d60b6c7762ebcc56ac0edc8ed04970861
parent14e45ca252a6b0bcd0863310b862538eb3af8aee (diff)
downloadpcsx_rearmed-570b9365c21d4e30a09b5e55c7cc94954fd4dd6d.tar.gz
pcsx_rearmed-570b9365c21d4e30a09b5e55c7cc94954fd4dd6d.tar.bz2
pcsx_rearmed-570b9365c21d4e30a09b5e55c7cc94954fd4dd6d.zip
Fix some edge case where core can freeze upon loading content
- Core sometime freeze while loading content during the loading of the core options. Moving update_variables() from retro_init to retro_load_game() fixes the problem, on my case at least. - Also apply fix as suggested in this issue page: https://github.com/libretro/pcsx_rearmed/issues/373
-rw-r--r--frontend/libretro.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/frontend/libretro.c b/frontend/libretro.c
index 6872dde..783f9cd 100644
--- a/frontend/libretro.c
+++ b/frontend/libretro.c
@@ -1227,6 +1227,7 @@ static void set_retro_memmap(void)
environ_cb(RETRO_ENVIRONMENT_SET_MEMORY_MAPS, &retromap);
}
+static void update_variables(bool in_flight);
bool retro_load_game(const struct retro_game_info *info)
{
size_t i;
@@ -1422,6 +1423,8 @@ bool retro_load_game(const struct retro_game_info *info)
return false;
}
+ update_variables(false);
+
if (plugins_opened) {
ClosePlugins();
plugins_opened = 0;
@@ -1772,7 +1775,7 @@ static void update_variables(bool in_flight)
if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) || var.value)
{
- R3000Acpu *prev_cpu = psxCpu;
+ R3000Acpu *prev_cpu = psxCpu;
#if defined(LIGHTREC)
bool can_use_dynarec = found_bios;
#else
@@ -2762,13 +2765,15 @@ void retro_init(void)
if (environ_cb(RETRO_ENVIRONMENT_GET_INPUT_BITMASKS, NULL))
libretro_supports_bitmasks = true;
- update_variables(false);
check_system_specs();
}
void retro_deinit(void)
{
- ClosePlugins();
+ if (plugins_opened) {
+ ClosePlugins();
+ plugins_opened = 0;
+ }
SysClose();
#ifdef _3DS
linearFree(vout_buf);