mirror of https://github.com/mgba-emu/mgba.git
GBA Serialize: Savestates now properly store prefetch
This commit is contained in:
parent
2d94f202a6
commit
77922aea5d
1
CHANGES
1
CHANGES
|
@ -11,6 +11,7 @@ Bugfixes:
|
||||||
- PSP2: Fix GPU crash while exiting
|
- PSP2: Fix GPU crash while exiting
|
||||||
- PSP2: Fix VSync
|
- PSP2: Fix VSync
|
||||||
- ARM7: Fix decoding of Thumb ADD (variants 5 and 6)
|
- ARM7: Fix decoding of Thumb ADD (variants 5 and 6)
|
||||||
|
- GBA Serialize: Savestates now properly store prefetch
|
||||||
Misc:
|
Misc:
|
||||||
- 3DS: Use blip_add_delta_fast for a small speed improvement
|
- 3DS: Use blip_add_delta_fast for a small speed improvement
|
||||||
- OpenGL: Log shader compilation failure
|
- OpenGL: Log shader compilation failure
|
||||||
|
|
|
@ -61,9 +61,10 @@ void GBASerialize(struct GBA* gba, struct GBASerializedState* state) {
|
||||||
STORE_32(gba->cpu->bankedSPSRs[i], i * sizeof(gba->cpu->bankedSPSRs[0]), state->cpu.bankedSPSRs);
|
STORE_32(gba->cpu->bankedSPSRs[i], i * sizeof(gba->cpu->bankedSPSRs[0]), state->cpu.bankedSPSRs);
|
||||||
}
|
}
|
||||||
|
|
||||||
state->biosPrefetch = gba->memory.biosPrefetch;
|
STORE_32(gba->memory.biosPrefetch, 0, &state->biosPrefetch);
|
||||||
STORE_32(gba->cpu->prefetch[0], 0, state->cpuPrefetch);
|
STORE_32(gba->cpu->prefetch[0], 0, state->cpuPrefetch);
|
||||||
STORE_32(gba->cpu->prefetch[1], 4, state->cpuPrefetch);
|
STORE_32(gba->cpu->prefetch[1], 4, state->cpuPrefetch);
|
||||||
|
STORE_32(gba->memory.lastPrefetchedPc, 0, &state->lastPrefetchedPc);
|
||||||
|
|
||||||
GBAMemorySerialize(&gba->memory, state);
|
GBAMemorySerialize(&gba->memory, state);
|
||||||
GBAIOSerialize(gba, state);
|
GBAIOSerialize(gba, state);
|
||||||
|
@ -172,6 +173,7 @@ bool GBADeserialize(struct GBA* gba, const struct GBASerializedState* state) {
|
||||||
if (state->biosPrefetch) {
|
if (state->biosPrefetch) {
|
||||||
LOAD_32(gba->memory.biosPrefetch, 0, &state->biosPrefetch);
|
LOAD_32(gba->memory.biosPrefetch, 0, &state->biosPrefetch);
|
||||||
}
|
}
|
||||||
|
LOAD_32(gba->memory.lastPrefetchedPc, 0, &state->lastPrefetchedPc);
|
||||||
if (gba->cpu->cpsr.t) {
|
if (gba->cpu->cpsr.t) {
|
||||||
gba->cpu->executionMode = MODE_THUMB;
|
gba->cpu->executionMode = MODE_THUMB;
|
||||||
if (state->cpuPrefetch[0] && state->cpuPrefetch[1]) {
|
if (state->cpuPrefetch[0] && state->cpuPrefetch[1]) {
|
||||||
|
|
|
@ -195,7 +195,8 @@ mLOG_DECLARE_CATEGORY(GBA_STATE);
|
||||||
* 0x00300 - 0x00303: Associated movie stream ID for record/replay (or 0 if no stream)
|
* 0x00300 - 0x00303: Associated movie stream ID for record/replay (or 0 if no stream)
|
||||||
* 0x00304 - 0x0030F: Reserved (leave zero)
|
* 0x00304 - 0x0030F: Reserved (leave zero)
|
||||||
* 0x00310 - 0x00317: Savestate creation time (usec since 1970)
|
* 0x00310 - 0x00317: Savestate creation time (usec since 1970)
|
||||||
* 0x00318 - 0x003FF: Reserved (leave zero)
|
* 0x00318 - 0x0031B: Last prefetched program counter
|
||||||
|
* 0x0031C - 0x003FF: Reserved (leave zero)
|
||||||
* 0x00400 - 0x007FF: I/O memory
|
* 0x00400 - 0x007FF: I/O memory
|
||||||
* 0x00800 - 0x00BFF: Palette
|
* 0x00800 - 0x00BFF: Palette
|
||||||
* 0x00C00 - 0x00FFF: OAM
|
* 0x00C00 - 0x00FFF: OAM
|
||||||
|
@ -311,7 +312,9 @@ struct GBASerializedState {
|
||||||
|
|
||||||
uint64_t creationUsec;
|
uint64_t creationUsec;
|
||||||
|
|
||||||
uint32_t reserved[58];
|
uint32_t lastPrefetchedPc;
|
||||||
|
|
||||||
|
uint32_t reserved[57];
|
||||||
|
|
||||||
uint16_t io[SIZE_IO >> 1];
|
uint16_t io[SIZE_IO >> 1];
|
||||||
uint16_t pram[SIZE_PALETTE_RAM >> 1];
|
uint16_t pram[SIZE_PALETTE_RAM >> 1];
|
||||||
|
|
Loading…
Reference in New Issue