all repos — mgba @ ef742cb1282b13ae4a1df471c38e1445424e60e8

mGBA Game Boy Advance Emulator

GBA Video: Render resets should reload state
Jeffrey Pfau jeffrey@endrift.com
Mon, 01 Aug 2016 23:34:38 -0700
commit

ef742cb1282b13ae4a1df471c38e1445424e60e8

parent

a97276b3a017311198e8aefcb89de50b54604dc5

3 files changed, 6 insertions(+), 3 deletions(-)

jump to
M src/gba/renderers/video-software.csrc/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.csrc/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.csrc/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); }