GBA Video: Render resets should reload state
Jeffrey Pfau jeffrey@endrift.com
Mon, 01 Aug 2016 23:34:38 -0700
3 files changed,
6 insertions(+),
3 deletions(-)
M
src/gba/renderers/video-software.c
→
src/gba/renderers/video-software.c
@@ -91,8 +91,10 @@ softwareRenderer->target1Bd = 0;
softwareRenderer->target2Obj = 0; softwareRenderer->target2Bd = 0; softwareRenderer->blendEffect = BLEND_NONE; - memset(softwareRenderer->normalPalette, 0, sizeof(softwareRenderer->normalPalette)); - memset(softwareRenderer->variantPalette, 0, sizeof(softwareRenderer->variantPalette)); + for (i = 0; i < 1024; i += 2) { + GBAVideoSoftwareRendererWritePalette(renderer, i, softwareRenderer->d.palette[i >> 1]); + } + _updatePalettes(softwareRenderer); softwareRenderer->blda = 0; softwareRenderer->bldb = 0;
M
src/gba/serialize.c
→
src/gba/serialize.c
@@ -198,9 +198,9 @@ LOAD_32(gba->cpu->prefetch[1], (gba->cpu->gprs[ARM_PC]) & gba->cpu->memory.activeMask, gba->cpu->memory.activeRegion);
} } + GBAVideoDeserialize(&gba->video, state); GBAMemoryDeserialize(&gba->memory, state); GBAIODeserialize(gba, state); - GBAVideoDeserialize(&gba->video, state); GBAAudioDeserialize(&gba->audio, state); GBASavedataDeserialize(&gba->memory.savedata, state);
M
src/gba/video.c
→
src/gba/video.c
@@ -334,4 +334,5 @@ LOAD_32(video->nextVblankIRQ, 0, &state->video.nextVblankIRQ);
LOAD_32(video->nextVcounterIRQ, 0, &state->video.nextVcounterIRQ); LOAD_32(video->frameCounter, 0, &state->video.frameCounter); LOAD_16(video->vcount, REG_VCOUNT, state->io); + video->renderer->reset(video->renderer); }