From 3aa48dc90593b7c45d41aaab5349aeec5424363c Mon Sep 17 00:00:00 2001 From: Shaun Inman Date: Sun, 1 Nov 2026 14:00:09 -0500 Subject: [PATCH] gpu: restore geometry busy timing when loading save states Loading an older state can retain a future GX busy deadline from the current session, causing DQIX to freeze until emulated time catches up. Save and restore swap_wait_ and swap_busy_until_. Older states default these fields to idle instead of inheriting live values. --- src/core/gpu/gpu3d.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/core/gpu/gpu3d.cpp b/src/core/gpu/gpu3d.cpp index 5c4076c7..772fbe72 100644 --- a/src/core/gpu/gpu3d.cpp +++ b/src/core/gpu/gpu3d.cpp @@ -1448,6 +1448,10 @@ template void Gpu3D::sync_state(S& s) { else { Polygon copy = pram_[b * PRAM_BANK + i]; for (u32 j = 0; j < 10; ++j) copy.vtx[j] = static_cast(remap(copy.vtx[j], VRAM_BANK)); sync_polygon(s, copy); } } } + // GXSTAT's busy flag must follow the restored scheduler timeline, not + // the later session we are replacing. Older states omit these fields. + if constexpr (S::reading) { swap_wait_ = false; swap_busy_until_ = 0; } + s.fields(swap_wait_, swap_busy_until_); s.end(); renderer_.sync_output(s); stack_err_ = gxstat_ & 0x8000u; box_result_ = gxstat_ & 2u; gxstat_ &= ~0x8002u;