all repos — mgba @ 6604afb670535c2a37b3a93ae48ab715b0ec16a7

mGBA Game Boy Advance Emulator

ARM7: Fix bank switching with LDR[B]T/STR[B]T
Jeffrey Pfau jeffrey@endrift.com
Sun, 22 Nov 2015 02:30:59 -0800
commit

6604afb670535c2a37b3a93ae48ab715b0ec16a7

parent

bb793348569edd02ab448a72b1e4e288d73bd243

2 files changed, 9 insertions(+), 4 deletions(-)

jump to
M CHANGESCHANGES

@@ -36,6 +36,7 @@ - GBA Memory: Fix timing of DMAs

- GBA Memory: Fix DMAs triggering two cycles early - ARM7: Fix STRT/STRBT - ARM7: Implement undefined STRH/LDRH/LDRSH/LDRSB versions + - ARM7: Fix bank switching with LDR[B]T/STR[B]T Misc: - Qt: Window size command line options are now supported - Qt: Increase usability of key mapper
M src/arm/isa-arm.csrc/arm/isa-arm.c

@@ -524,28 +524,32 @@

DEFINE_LOAD_STORE_T_INSTRUCTION_ARM(LDRBT, enum PrivilegeMode priv = cpu->privilegeMode; ARMSetPrivilegeMode(cpu, MODE_USER); - cpu->gprs[rd] = cpu->memory.load8(cpu, address, &currentCycles); + int32_t r = cpu->memory.load8(cpu, address, &currentCycles); ARMSetPrivilegeMode(cpu, priv); + cpu->gprs[rd] = r; ARM_LOAD_POST_BODY;) DEFINE_LOAD_STORE_T_INSTRUCTION_ARM(LDRT, enum PrivilegeMode priv = cpu->privilegeMode; ARMSetPrivilegeMode(cpu, MODE_USER); - cpu->gprs[rd] = cpu->memory.load32(cpu, address, &currentCycles); + int32_t r = cpu->memory.load32(cpu, address, &currentCycles); ARMSetPrivilegeMode(cpu, priv); + cpu->gprs[rd] = r; ARM_LOAD_POST_BODY;) DEFINE_LOAD_STORE_T_INSTRUCTION_ARM(STRBT, enum PrivilegeMode priv = cpu->privilegeMode; + int32_t r = cpu->gprs[rd]; ARMSetPrivilegeMode(cpu, MODE_USER); - cpu->memory.store8(cpu, address, cpu->gprs[rd], &currentCycles); + cpu->memory.store8(cpu, address, r, &currentCycles); ARMSetPrivilegeMode(cpu, priv); ARM_STORE_POST_BODY;) DEFINE_LOAD_STORE_T_INSTRUCTION_ARM(STRT, enum PrivilegeMode priv = cpu->privilegeMode; + int32_t r = cpu->gprs[rd]; ARMSetPrivilegeMode(cpu, MODE_USER); - cpu->memory.store32(cpu, address, cpu->gprs[rd], &currentCycles); + cpu->memory.store32(cpu, address, r, &currentCycles); ARMSetPrivilegeMode(cpu, priv); ARM_STORE_POST_BODY;)