mirror of https://github.com/mgba-emu/mgba.git
GBA Serialize: Serialize POSTFLG
This commit is contained in:
parent
45a5101099
commit
0d7cdb9ed8
|
@ -195,6 +195,7 @@ mLOG_DECLARE_CATEGORY(GBA_STATE);
|
|||
* 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;
|
||||
|
|
|
@ -61,6 +61,7 @@ void GBASerialize(struct GBA* gba, struct GBASerializedState* state) {
|
|||
|
||||
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 @@ bool GBADeserialize(struct GBA* gba, const struct GBASerializedState* state) {
|
|||
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);
|
||||
|
|
Loading…
Reference in New Issue