From fc33aec7bbf40fe93ee7101af30e796fc24c812c Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Fri, 22 Feb 2019 22:22:06 -0800 Subject: [PATCH] GB, GBA Serialize: Fix loading two states in a row --- CHANGES | 1 + src/gb/serialize.c | 2 +- src/gba/serialize.c | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 2de271e03..6b5674e61 100644 --- a/CHANGES +++ b/CHANGES @@ -15,6 +15,7 @@ Bugfixes: - GBA DMA: Fix Display Start DMAs - GBA DMA: Fix DMA start/end timing - Qt: Fix window icon on X11 + - GB, GBA Serialize: Fix loading two states in a row Misc: - GBA Video: Improve sprite cycle counting (fixes mgba.io/i/1274) diff --git a/src/gb/serialize.c b/src/gb/serialize.c index 6c3db6308..7a4f5de4b 100644 --- a/src/gb/serialize.c +++ b/src/gb/serialize.c @@ -138,7 +138,7 @@ bool GBDeserialize(struct GB* gb, const struct GBSerializedState* state) { if (error) { return false; } - gb->timing.root = NULL; + mTimingClear(&gb->timing); LOAD_32LE(gb->timing.masterCycles, 0, &state->masterCycles); gb->cpu->a = state->cpu.a; diff --git a/src/gba/serialize.c b/src/gba/serialize.c index 72cdd453f..781b60899 100644 --- a/src/gba/serialize.c +++ b/src/gba/serialize.c @@ -128,7 +128,7 @@ bool GBADeserialize(struct GBA* gba, const struct GBASerializedState* state) { if (error) { return false; } - gba->timing.root = NULL; + mTimingClear(&gba->timing); LOAD_32(gba->timing.masterCycles, 0, &state->masterCycles); size_t i;