GBA Video: Render resets should reload state

This commit is contained in:
Jeffrey Pfau 2016-08-01 23:34:38 -07:00
parent a97276b3a0
commit ef742cb128
3 changed files with 6 additions and 3 deletions

View File

@ -91,8 +91,10 @@ static void GBAVideoSoftwareRendererReset(struct GBAVideoRenderer* renderer) {
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;

View File

@ -198,9 +198,9 @@ bool GBADeserialize(struct GBA* gba, const struct GBASerializedState* state) {
}
}
GBAVideoDeserialize(&gba->video, state);
GBAMemoryDeserialize(&gba->memory, state);
GBAIODeserialize(gba, state);
GBAVideoDeserialize(&gba->video, state);
GBAAudioDeserialize(&gba->audio, state);
GBASavedataDeserialize(&gba->memory.savedata, state);

View File

@ -334,4 +334,5 @@ void GBAVideoDeserialize(struct GBAVideo* video, const struct GBASerializedState
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);
}