GBA Serialize: Fix loading audio enable bit late (fixes #2230)

This commit is contained in:
Vicki Pfau 2021-06-27 22:37:01 -07:00
parent f14abdf749
commit 7dce4be2e2
2 changed files with 3 additions and 1 deletions

View File

@ -15,6 +15,7 @@ Emulation fixes:
- GBA SIO: Fix missing interrupt on an unattached NORMAL transfer
- GBA SIO: Fix SI value for unattached MULTI mode
- GBA Memory: Fix prefetch mask when swapping modes within a region
- GBA Serialize: Fix loading audio enable bit late (fixes mgba.io/i/2230)
- GBA Video: Revert scanline latching changes (fixes mgba.io/i/2153, mgba.io/i/2149)
Other fixes:
- 3DS: Fix disabling "wide" mode on 2DS (fixes mgba.io/i/2167)

View File

@ -973,6 +973,8 @@ void GBAIOSerialize(struct GBA* gba, struct GBASerializedState* state) {
}
void GBAIODeserialize(struct GBA* gba, const struct GBASerializedState* state) {
GBAAudioWriteSOUNDCNT_X(&gba->audio, state->io[REG_SOUNDCNT_X >> 1]);
int i;
for (i = 0; i < REG_MAX; i += 2) {
if (_isWSpecialRegister[i >> 1]) {
@ -1003,7 +1005,6 @@ void GBAIODeserialize(struct GBA* gba, const struct GBASerializedState* state) {
LOAD_32(gba->memory.dma[i].nextCount, 0, &state->dma[i].nextCount);
LOAD_32(gba->memory.dma[i].when, 0, &state->dma[i].when);
}
GBAAudioWriteSOUNDCNT_X(&gba->audio, gba->memory.io[REG_SOUNDCNT_X >> 1]);
gba->sio.siocnt = gba->memory.io[REG_SIOCNT >> 1];
GBASIOWriteRCNT(&gba->sio, gba->memory.io[REG_RCNT >> 1]);