mirror of https://github.com/mgba-emu/mgba.git
GBA Serialize: Fix alignment check when loading states
This commit is contained in:
parent
beba0cb2c5
commit
346f5dc0b5
1
CHANGES
1
CHANGES
|
@ -44,6 +44,7 @@ Emulation fixes:
|
|||
- GBA Memory: Improve robustness of Matrix memory support
|
||||
- GBA Memory: Mark Famicom Mini games 22 through 28 as non-mirroring
|
||||
- GBA Memory: Return correct byte for odd ROM open bus addresses
|
||||
- GBA Serialize: Fix alignment check when loading states
|
||||
- GBA SIO: Fix copying Normal mode transfer values
|
||||
- GBA SIO: Fix Normal mode being totally broken (fixes mgba.io/i/1800)
|
||||
- GBA SIO: Fix deseralizing SIO registers
|
||||
|
|
|
@ -154,7 +154,7 @@ bool GBADeserialize(struct GBA* gba, const struct GBASerializedState* state) {
|
|||
LOAD_32(gba->cpu->bankedSPSRs[i], i * sizeof(gba->cpu->bankedSPSRs[0]), state->cpu.bankedSPSRs);
|
||||
}
|
||||
gba->cpu->privilegeMode = gba->cpu->cpsr.priv;
|
||||
uint32_t pcMask = (gba->cpu->executionMode == MODE_THUMB ? WORD_SIZE_THUMB : WORD_SIZE_ARM) - 1;
|
||||
uint32_t pcMask = (gba->cpu->cpsr.t ? WORD_SIZE_THUMB : WORD_SIZE_ARM) - 1;
|
||||
if (gba->cpu->gprs[ARM_PC] & pcMask) {
|
||||
mLOG(GBA_STATE, WARN, "Savestate has unaligned PC and is probably corrupted");
|
||||
gba->cpu->gprs[ARM_PC] &= ~pcMask;
|
||||
|
|
Loading…
Reference in New Issue