We don't need to get rid of idle loop patching for non-dynarec

core
This commit is contained in:
twinaphex 2014-12-10 17:27:18 +01:00
parent 75cffe81f2
commit 82731290ee
3 changed files with 19 additions and 27 deletions

View File

@ -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;

View File

@ -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"))

View File

@ -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);