From 89f11095bc3db402c5a71c4a0c3d73a943fd3ad8 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Mon, 23 Dec 2024 23:29:56 +1000 Subject: [PATCH] CPU: GTE completion cycle should be reset/serialized Yay more determinism breakage... --- src/core/cpu_core.cpp | 4 +++- src/core/save_state_version.h | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/core/cpu_core.cpp b/src/core/cpu_core.cpp index 2583af4525..87d280c7b1 100644 --- a/src/core/cpu_core.cpp +++ b/src/core/cpu_core.cpp @@ -221,14 +221,16 @@ void CPU::Reset() // This consumes cycles, so do it first. SetPC(RESET_VECTOR); - g_state.pending_ticks = 0; g_state.downcount = 0; + g_state.pending_ticks = 0; + g_state.gte_completion_tick = 0; } bool CPU::DoState(StateWrapper& sw) { sw.Do(&g_state.pending_ticks); sw.Do(&g_state.downcount); + sw.DoEx(&g_state.gte_completion_tick, 78, static_cast(0)); sw.DoArray(g_state.regs.r, static_cast(Reg::count)); sw.Do(&g_state.pc); sw.Do(&g_state.npc); diff --git a/src/core/save_state_version.h b/src/core/save_state_version.h index f404f7925b..bf2f0a1085 100644 --- a/src/core/save_state_version.h +++ b/src/core/save_state_version.h @@ -6,7 +6,7 @@ #include "common/types.h" static constexpr u32 SAVE_STATE_MAGIC = 0x43435544; -static constexpr u32 SAVE_STATE_VERSION = 77; +static constexpr u32 SAVE_STATE_VERSION = 78; static constexpr u32 SAVE_STATE_MINIMUM_VERSION = 42; static_assert(SAVE_STATE_VERSION >= SAVE_STATE_MINIMUM_VERSION);