mirror of https://github.com/mgba-emu/mgba.git
GB Serialize: Add missing Pocket Cam state to savestates
This commit is contained in:
parent
b876f13cb2
commit
5bf048e380
1
CHANGES
1
CHANGES
|
@ -5,6 +5,7 @@ Features:
|
|||
- New unlicensed GB mappers: NT (older types 1 and 2), Li Cheng, GGB-81
|
||||
- Debugger: Add range watchpoints
|
||||
Emulation fixes:
|
||||
- GB Serialize: Add missing Pocket Cam state to savestates
|
||||
- GB Video: Implement DMG-style sprite ordering
|
||||
- GBA Audio: Fix improperly deserializing GB audio registers (fixes mgba.io/i/2793)
|
||||
- GBA Audio: Clear GB audio state when disabled
|
||||
|
|
|
@ -419,6 +419,9 @@ struct GBSerializedState {
|
|||
uint8_t locked;
|
||||
uint8_t bank0;
|
||||
} mmm01;
|
||||
struct {
|
||||
uint8_t registersActive;
|
||||
} pocketCam;
|
||||
struct {
|
||||
uint64_t lastLatch;
|
||||
uint8_t reg;
|
||||
|
@ -484,6 +487,7 @@ struct GBSerializedState {
|
|||
|
||||
union {
|
||||
uint8_t huc3Registers[0x80];
|
||||
uint8_t pocketCamRegisters[0x36];
|
||||
struct {
|
||||
uint8_t registers[4];
|
||||
uint8_t reserved[4];
|
||||
|
|
|
@ -799,6 +799,10 @@ void GBMemorySerialize(const struct GB* gb, struct GBSerializedState* state) {
|
|||
state->huc3Registers[i] |= memory->mbcState.huc3.registers[i * 2 + 1] << 4;
|
||||
}
|
||||
break;
|
||||
case GB_POCKETCAM:
|
||||
state->memory.pocketCam.registersActive = memory->mbcState.pocketCam.registersActive;
|
||||
memcpy(state->pocketCamRegisters, memory->mbcState.pocketCam.registers, sizeof(memory->mbcState.pocketCam.registers));
|
||||
break;
|
||||
case GB_MMM01:
|
||||
state->memory.mmm01.locked = memory->mbcState.mmm01.locked;
|
||||
state->memory.mmm01.bank0 = memory->mbcState.mmm01.currentBank0;
|
||||
|
@ -950,6 +954,10 @@ void GBMemoryDeserialize(struct GB* gb, const struct GBSerializedState* state) {
|
|||
memory->mbcState.huc3.registers[i * 2 + 1] = state->huc3Registers[i] >> 4;
|
||||
}
|
||||
break;
|
||||
case GB_POCKETCAM:
|
||||
memory->mbcState.pocketCam.registersActive = state->memory.pocketCam.registersActive;
|
||||
memcpy(memory->mbcState.pocketCam.registers, state->pocketCamRegisters, sizeof(memory->mbcState.pocketCam.registers));
|
||||
break;
|
||||
case GB_MMM01:
|
||||
memory->mbcState.mmm01.locked = state->memory.mmm01.locked;
|
||||
memory->mbcState.mmm01.currentBank0 = state->memory.mmm01.bank0;
|
||||
|
|
Loading…
Reference in New Issue