GBA Serialize: Serialize POSTFLG
Vicki Pfau vi@endrift.com
Sat, 08 Sep 2018 11:24:46 -0700
2 files changed,
4 insertions(+),
0 deletions(-)
M
include/mgba/internal/gba/serialize.h
→
include/mgba/internal/gba/serialize.h
@@ -195,6 +195,7 @@ * 0x00304 - 0x00317: Savestate creation time (usec since 1970)
* 0x00318 - 0x0031B: Last prefetched program counter * 0x0031C - 0x0031F: Miscellaneous flags * | bit 0: Is CPU halted? + * | bit 1: POSTFLG * 0x00320 - 0x003FF: Reserved (leave zero) * 0x00400 - 0x007FF: I/O memory * 0x00800 - 0x00BFF: Palette@@ -225,6 +226,7 @@ DECL_BIT(GBASerializedSavedataFlags, DustSettling, 5);
DECL_BITFIELD(GBASerializedMiscFlags, uint32_t); DECL_BIT(GBASerializedMiscFlags, Halted, 0); +DECL_BIT(GBASerializedMiscFlags, POSTFLG, 1); struct GBASerializedState { uint32_t versionMagic;
M
src/gba/serialize.c
→
src/gba/serialize.c
@@ -61,6 +61,7 @@ STORE_32(gba->memory.lastPrefetchedPc, 0, &state->lastPrefetchedPc);
GBASerializedMiscFlags miscFlags = 0; miscFlags = GBASerializedMiscFlagsSetHalted(miscFlags, gba->cpu->halted); + miscFlags = GBASerializedMiscFlagsSetPOSTFLG(miscFlags, gba->memory.io[REG_POSTFLG >> 1] & 1); STORE_32(miscFlags, 0, &state->miscFlags); GBAMemorySerialize(&gba->memory, state);@@ -177,6 +178,7 @@ }
GBASerializedMiscFlags miscFlags = 0; LOAD_32(miscFlags, 0, &state->miscFlags); gba->cpu->halted = GBASerializedMiscFlagsGetHalted(miscFlags); + gba->memory.io[REG_POSTFLG >> 1] = GBASerializedMiscFlagsGetPOSTFLG(miscFlags); GBAVideoDeserialize(&gba->video, state); GBAMemoryDeserialize(&gba->memory, state);