diff --git a/cpu_threaded.c b/cpu_threaded.c index 99887ec..36a188a 100644 --- a/cpu_threaded.c +++ b/cpu_threaded.c @@ -48,13 +48,7 @@ u32 ewram_code_max = 0xFFFFFFFF; u32 *rom_branch_hash[ROM_BRANCH_HASH_SIZE]; // Default -#ifdef HAVE_DYNAREC -u32 idle_loop_target_pc = 0xFFFFFFFF; -u32 iwram_stack_optimize = 1; -#endif u32 force_pc_update_target = 0xFFFFFFFF; -u32 translation_gate_target_pc[MAX_TRANSLATION_GATES]; -u32 translation_gate_targets = 0; u32 allow_smc_ram_u8 = 1; u32 allow_smc_ram_u16 = 1; u32 allow_smc_ram_u32 = 1; diff --git a/gba_memory.c b/gba_memory.c index bff8c9b..e1fa1a7 100644 --- a/gba_memory.c +++ b/gba_memory.c @@ -2233,11 +2233,9 @@ s32 load_game_config(char *gamepak_title, char *gamepak_code, char *gamepak_make char config_path[512]; FILE *config_file; -#ifdef HAVE_DYNAREC idle_loop_target_pc = 0xFFFFFFFF; iwram_stack_optimize = 1; translation_gate_targets = 0; -#endif bios_rom[0x39] = 0x00; bios_rom[0x2C] = 0x00; flash_device_id = FLASH_DEVICE_MACRONIX_64KB; @@ -2282,29 +2280,24 @@ s32 load_game_config(char *gamepak_title, char *gamepak_code, char *gamepak_make return 0; } -#ifdef HAVE_DYNAREC - if (dynarec_enable) + if(!strcmp(current_variable, "idle_loop_eliminate_target")) + idle_loop_target_pc = strtol(current_value, NULL, 16); + + if(!strcmp(current_variable, "translation_gate_target")) { - if(!strcmp(current_variable, "idle_loop_eliminate_target")) - idle_loop_target_pc = strtol(current_value, NULL, 16); - - if(!strcmp(current_variable, "translation_gate_target")) + if(translation_gate_targets < MAX_TRANSLATION_GATES) { - if(translation_gate_targets < MAX_TRANSLATION_GATES) - { - translation_gate_target_pc[translation_gate_targets] = - strtol(current_value, NULL, 16); - translation_gate_targets++; - } - } - - if(!strcmp(current_variable, "iwram_stack_optimize") && - !strcmp(current_value, "no\0")) /* \0 for broken toolchain workaround */ - { - iwram_stack_optimize = 0; + translation_gate_target_pc[translation_gate_targets] = + strtol(current_value, NULL, 16); + translation_gate_targets++; } } -#endif + + if(!strcmp(current_variable, "iwram_stack_optimize") && + !strcmp(current_value, "no\0")) /* \0 for broken toolchain workaround */ + { + iwram_stack_optimize = 0; + } if(!strcmp(current_variable, "flash_rom_type") && !strcmp(current_value, "128KB")) diff --git a/libretro.c b/libretro.c index c753f01..7f1e299 100644 --- a/libretro.c +++ b/libretro.c @@ -22,6 +22,11 @@ static cothread_t main_thread; static cothread_t cpu_thread; int dynarec_enable; +u32 idle_loop_target_pc = 0xFFFFFFFF; +u32 iwram_stack_optimize = 1; +u32 translation_gate_target_pc[MAX_TRANSLATION_GATES]; +u32 translation_gate_targets = 0; + void switch_to_main_thread(void) { co_switch(main_thread);