ARM: Fix LDM^ with empty rlist (fixes #2127)

This commit is contained in:
Vicki Pfau 2021-04-15 19:16:51 -07:00
parent 0a7f8fa55d
commit 144a05a66e
2 changed files with 3 additions and 2 deletions

View File

@ -2,6 +2,7 @@
Features:
- Tool for converting scanned pictures of e-Reader cards to raw dotcode data
Emulation fixes:
- ARM: Fix LDM^ with empty rlist (fixes mgba.io/i/2127)
- Core: Fix first event scheduling after loading savestate
- GB Serialize: Fix switching speed modes when loading a state (fixes mgba.io/i/2097)
- GB: Fix skipping BIOS

View File

@ -421,7 +421,7 @@ ATTRIBUTE_NOINLINE static void _neutralS(struct ARMCore* cpu, int32_t d) {
#define ARM_MS_PRE_load \
enum PrivilegeMode privilegeMode; \
if (!(rs & 0x8000)) { \
if (!(rs & 0x8000) && rs) { \
privilegeMode = cpu->privilegeMode; \
ARMSetPrivilegeMode(cpu, MODE_SYSTEM); \
}
@ -429,7 +429,7 @@ ATTRIBUTE_NOINLINE static void _neutralS(struct ARMCore* cpu, int32_t d) {
#define ARM_MS_POST_store ARMSetPrivilegeMode(cpu, privilegeMode);
#define ARM_MS_POST_load \
if (!(rs & 0x8000)) { \
if (!(rs & 0x8000) && rs) { \
ARMSetPrivilegeMode(cpu, privilegeMode); \
} else if (_ARMModeHasSPSR(cpu->cpsr.priv)) { \
cpu->cpsr = cpu->spsr; \