From e25d5958922bf9cd949e8e6f0d19a7f6672ca898 Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Tue, 30 Mar 2021 18:34:51 -0700 Subject: [PATCH] GB Serialize: Fix switching speed modes when loading a state (fixes #2097) --- CHANGES | 1 + src/gb/serialize.c | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGES b/CHANGES index ff21563db..8d305e30e 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,7 @@ 0.10.0: (Future) Emulation fixes: - Core: Fix first event scheduling after loading savestate + - GB Serialize: Fix switching speed modes when loading a state (fixes mgba.io/i/2097) - GBA Memory: Fix loading Thumb savestates when in ARM mode Other fixes: - GBA: Fix FireRed revision misdetecting as a ROM hack diff --git a/src/gb/serialize.c b/src/gb/serialize.c index ac7352a91..d3fd8f12a 100644 --- a/src/gb/serialize.c +++ b/src/gb/serialize.c @@ -172,6 +172,7 @@ bool GBDeserialize(struct GB* gb, const struct GBSerializedState* state) { gb->cpu->condition = GBSerializedCpuFlagsGetCondition(flags); gb->cpu->irqPending = GBSerializedCpuFlagsGetIrqPending(flags); gb->doubleSpeed = GBSerializedCpuFlagsGetDoubleSpeed(flags); + gb->cpu->tMultiplier = 2 - gb->doubleSpeed; gb->cpu->halted = GBSerializedCpuFlagsGetHalted(flags); gb->cpuBlocked = GBSerializedCpuFlagsGetBlocked(flags);