Skip to content

Commit

Permalink
CPU: GTE completion cycle should be reset/serialized
Browse files Browse the repository at this point in the history
Yay more determinism breakage...
  • Loading branch information
stenzek committed Dec 23, 2024
1 parent 9f73e69 commit 89f1109
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/core/cpu_core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<u32>(0));
sw.DoArray(g_state.regs.r, static_cast<u32>(Reg::count));
sw.Do(&g_state.pc);
sw.Do(&g_state.npc);
Expand Down
2 changes: 1 addition & 1 deletion src/core/save_state_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 89f1109

Please sign in to comment.