Fix CPSR reads in ARM32

Interestingly enough, doesn't seem to affect more than a couple games.
This commit is contained in:
David Guillen Fandos 2021-10-23 09:31:21 +02:00
parent cdb61227bc
commit d89977d25d
1 changed files with 3 additions and 0 deletions

View File

@ -1164,12 +1164,15 @@ u32 execute_spsr_restore_body(u32 pc)
} \ } \
#define arm_psr_read_cpsr() \ #define arm_psr_read_cpsr() \
{ \
u32 _rd = arm_prepare_store_reg(reg_a0, rd); \ u32 _rd = arm_prepare_store_reg(reg_a0, rd); \
arm_generate_load_reg(_rd, REG_CPSR); \ arm_generate_load_reg(_rd, REG_CPSR); \
generate_save_flags(); \
ARM_BIC_REG_IMM(0, _rd, _rd, 0xF0, arm_imm_lsl_to_rot(24)); \ ARM_BIC_REG_IMM(0, _rd, _rd, 0xF0, arm_imm_lsl_to_rot(24)); \
ARM_AND_REG_IMM(0, reg_flags, reg_flags, 0xF0, arm_imm_lsl_to_rot(24)); \ ARM_AND_REG_IMM(0, reg_flags, reg_flags, 0xF0, arm_imm_lsl_to_rot(24)); \
ARM_ORR_REG_REG(0, _rd, _rd, reg_flags); \ ARM_ORR_REG_REG(0, _rd, _rd, reg_flags); \
arm_complete_store_reg(_rd, rd) \ arm_complete_store_reg(_rd, rd) \
}
#define arm_psr_read_spsr() \ #define arm_psr_read_spsr() \
generate_function_call(execute_read_spsr) \ generate_function_call(execute_read_spsr) \