GB Video: Fix SGB video logs
Vicki Pfau vi@endrift.com
Sun, 22 Nov 2020 15:08:45 -0800
5 files changed,
13 insertions(+),
3 deletions(-)
M
CHANGES
→
CHANGES
@@ -58,6 +58,7 @@ - Debugger: Don't skip undefined instructions when debugger attached
- Debugger: Close trace log when done tracing - FFmpeg: Fix some small memory leaks - FFmpeg: Fix encoding of time base + - GB Video: Fix SGB video logs - mGUI: Don't attempt to preload files larger than can fit in RAM - Qt: Force OpenGL paint engine creation thread (fixes mgba.io/i/1642) - Qt: Fix static compilation in MinGW (fixes mgba.io/i/1769)
M
include/mgba/internal/gb/serialize.h
→
include/mgba/internal/gb/serialize.h
@@ -437,6 +437,9 @@
bool GBDeserialize(struct GB* gb, const struct GBSerializedState* state); void GBSerialize(struct GB* gb, struct GBSerializedState* state); +void GBSGBSerialize(struct GB* gb, struct GBSerializedState* state); +void GBSGBDeserialize(struct GB* gb, const struct GBSerializedState* state); + CXX_GUARD_END #endif
M
src/gb/core.c
→
src/gb/core.c
@@ -1163,6 +1163,9 @@ GBVideoReset(&gb->video);
GBVideoDeserialize(&gb->video, state); GBIODeserialize(gb, state); GBAudioReset(&gb->audio); + if (gb->model & GB_MODEL_SGB) { + GBSGBDeserialize(gb, state); + } // Make sure CPU loop never spins gb->memory.ie = 0;
M
src/gb/extra/proxy.c
→
src/gb/extra/proxy.c
@@ -102,6 +102,12 @@ }
renderer->backend = video->renderer; video->renderer = &renderer->d; renderer->d.cache = renderer->backend->cache; + renderer->d.sgbRenderMode = renderer->backend->sgbRenderMode; + renderer->d.sgbCharRam = renderer->backend->sgbCharRam; + renderer->d.sgbMapRam = renderer->backend->sgbMapRam; + renderer->d.sgbPalRam = renderer->backend->sgbPalRam; + renderer->d.sgbAttributeFiles = renderer->backend->sgbAttributeFiles; + renderer->d.sgbAttributes = renderer->backend->sgbAttributes; renderer->d.vram = video->vram; renderer->d.oam = &video->oam; _init(renderer);
M
src/gb/serialize.c
→
src/gb/serialize.c
@@ -16,9 +16,6 @@
const uint32_t GB_SAVESTATE_MAGIC = 0x00400000; const uint32_t GB_SAVESTATE_VERSION = 0x00000002; -static void GBSGBSerialize(struct GB* gb, struct GBSerializedState* state); -static void GBSGBDeserialize(struct GB* gb, const struct GBSerializedState* state); - void GBSerialize(struct GB* gb, struct GBSerializedState* state) { STORE_32LE(GB_SAVESTATE_MAGIC + GB_SAVESTATE_VERSION, 0, &state->versionMagic); STORE_32LE(gb->romCrc32, 0, &state->romCrc32);