all repos — mgba @ eaf331b2499e23320b0807be90312627bdd6b817

mGBA Game Boy Advance Emulator

GB Serialize: Fix serializing video mode
Jeffrey Pfau jeffrey@endrift.com
Thu, 15 Sep 2016 17:48:15 -0700
commit

eaf331b2499e23320b0807be90312627bdd6b817

parent

7e3e9cf771f911bd8cec04665a6968ad20cd4d97

2 files changed, 5 insertions(+), 1 deletions(-)

jump to
M src/gb/serialize.hsrc/gb/serialize.h

@@ -112,7 +112,8 @@ * | 0x000CC: Current VRAM bank

* | 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_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);
M src/gb/video.csrc/gb/video.c

@@ -455,6 +455,7 @@

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 @@

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);