diff --git a/src/gba/renderers/video-software.c b/src/gba/renderers/video-software.c index 71c8ffa93..e9ee5358f 100644 --- a/src/gba/renderers/video-software.c +++ b/src/gba/renderers/video-software.c @@ -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; diff --git a/src/gba/serialize.c b/src/gba/serialize.c index 53ebf83ba..1a0100c8d 100644 --- a/src/gba/serialize.c +++ b/src/gba/serialize.c @@ -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); diff --git a/src/gba/video.c b/src/gba/video.c index 9ec7aa6fe..09a68f01b 100644 --- a/src/gba/video.c +++ b/src/gba/video.c @@ -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); }