X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=frontend%2Flibretro.c;h=783f9cd2ee0ce40d6de828343ee6d12cf23cc80c;hb=570b9365c21d4e30a09b5e55c7cc94954fd4dd6d;hp=b41eca074473a489309ad04da9915015da1b81ca;hpb=ea884d3029c673e06a4084156ceb662598d8945a;p=pcsx_rearmed.git diff --git a/frontend/libretro.c b/frontend/libretro.c index b41eca07..783f9cd2 100644 --- a/frontend/libretro.c +++ b/frontend/libretro.c @@ -59,6 +59,18 @@ #define INTERNAL_FPS_SAMPLE_PERIOD 64 +#ifdef DRC_DISABLE +int stop; +u32 next_interupt; +u32 event_cycles[PSXINT_COUNT]; +int cycle_multiplier; +int new_dynarec_hacks; + +void new_dyna_before_save(void) { } +void new_dyna_after_save(void) { } +void new_dyna_freeze(void *f, int i) { } +#endif + //hack to prevent retroarch freezing when reseting in the menu but not while running with the hot key static int rebootemu = 0; @@ -81,8 +93,12 @@ static bool found_bios; static bool display_internal_fps = false; static unsigned frame_count = 0; static bool libretro_supports_bitmasks = false; +#ifdef GPU_PEOPS static int show_advanced_gpu_peops_settings = -1; +#endif +#ifdef GPU_UNAI static int show_advanced_gpu_unai_settings = -1; +#endif static unsigned previous_width = 0; static unsigned previous_height = 0; @@ -1211,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; @@ -1406,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; @@ -1600,7 +1619,9 @@ static void update_variables(bool in_flight) { struct retro_variable var; int i; +#ifdef GPU_PEOPS int gpu_peops_fix = 0; +#endif var.value = NULL; var.key = "pcsx_rearmed_frameskip"; @@ -1691,7 +1712,7 @@ static void update_variables(bool in_flight) } } -#ifdef __ARM_NEON__ +#ifdef GPU_NEON var.value = "NULL"; var.key = "pcsx_rearmed_neon_interlace_enable"; @@ -1754,14 +1775,19 @@ 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 + bool can_use_dynarec = 1; +#endif #ifdef _3DS if(!__ctr_svchax) Config.Cpu = CPU_INTERPRETER; else #endif - if (strcmp(var.value, "disabled") == 0) + if (strcmp(var.value, "disabled") == 0 || !can_use_dynarec) Config.Cpu = CPU_INTERPRETER; else if (strcmp(var.value, "enabled") == 0) Config.Cpu = CPU_DYNAREC; @@ -1834,6 +1860,18 @@ static void update_variables(bool in_flight) Config.VSyncWA = 1; } +#ifndef _WIN32 + var.value = NULL; + var.key = "pcsx_rearmed_async_cd"; + if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) || var.value) + { + if (strcmp(var.value, "async") == 0) + Config.AsyncCD = 1; + else + Config.AsyncCD = 0; + } +#endif + var.value = NULL; var.key = "pcsx_rearmed_noxadecoding"; if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) || var.value) @@ -2142,7 +2180,8 @@ static void update_variables(bool in_flight) } } } -#ifndef DRC_DISABLE + +#if defined(LIGHTREC) || defined(NEW_DYNAREC) var.value = "NULL"; var.key = "pcsx_rearmed_psxclock"; if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) || var.value) @@ -2726,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);