mirror of https://github.com/mgba-emu/mgba.git
GB Serialize: Fix serializing video mode
This commit is contained in:
parent
7e3e9cf771
commit
eaf331b249
|
@ -112,7 +112,8 @@ mLOG_DECLARE_CATEGORY(GB_STATE);
|
|||
* | 0x000CD: Palette flags
|
||||
* | bit 0: BCP increment
|
||||
* | bit 1: OCP increment
|
||||
* | bits 2 - 7: Reserved
|
||||
* | bits 2 - 3: Mode
|
||||
* | bits 4 - 7: Reserved
|
||||
* | 0x000CE - 0x000CF: Reserved
|
||||
* | 0x000D0 - 0x000D1: BCP index
|
||||
* | 0x000D1 - 0x000D3: OCP index
|
||||
|
@ -214,6 +215,7 @@ DECL_BIT(GBSerializedTimerFlags, IrqPending, 0);
|
|||
DECL_BITFIELD(GBSerializedVideoFlags, uint8_t);
|
||||
DECL_BIT(GBSerializedVideoFlags, BcpIncrement, 0);
|
||||
DECL_BIT(GBSerializedVideoFlags, OcpIncrement, 1);
|
||||
DECL_BITS(GBSerializedVideoFlags, Mode, 2, 2);
|
||||
|
||||
DECL_BITFIELD(GBSerializedMBC7Flags, uint8_t);
|
||||
DECL_BITS(GBSerializedMBC7Flags, Command, 0, 2);
|
||||
|
|
|
@ -455,6 +455,7 @@ void GBVideoSerialize(const struct GBVideo* video, struct GBSerializedState* sta
|
|||
GBSerializedVideoFlags flags = 0;
|
||||
flags = GBSerializedVideoFlagsSetBcpIncrement(flags, video->bcpIncrement);
|
||||
flags = GBSerializedVideoFlagsSetOcpIncrement(flags, video->ocpIncrement);
|
||||
flags = GBSerializedVideoFlagsSetMode(flags, video->mode);
|
||||
state->video.flags = flags;
|
||||
STORE_16LE(video->bcpIndex, 0, &state->video.bcpIndex);
|
||||
STORE_16LE(video->ocpIndex, 0, &state->video.ocpIndex);
|
||||
|
@ -481,6 +482,7 @@ void GBVideoDeserialize(struct GBVideo* video, const struct GBSerializedState* s
|
|||
GBSerializedVideoFlags flags = state->video.flags;
|
||||
video->bcpIncrement = GBSerializedVideoFlagsGetBcpIncrement(flags);
|
||||
video->ocpIncrement = GBSerializedVideoFlagsGetOcpIncrement(flags);
|
||||
video->mode = GBSerializedVideoFlagsGetMode(flags);
|
||||
LOAD_16LE(video->bcpIndex, 0, &state->video.bcpIndex);
|
||||
video->bcpIndex &= 0x3F;
|
||||
LOAD_16LE(video->ocpIndex, 0, &state->video.ocpIndex);
|
||||
|
|
Loading…
Reference in New Issue