From a6fa091ab3af2621777c87ccf034533e7a253f9a Mon Sep 17 00:00:00 2001 From: Eladash <18193363+elad335@users.noreply.github.com> Date: Wed, 27 Mar 2024 17:38:28 +0200 Subject: [PATCH] Savestates/RSX: Save pending flip --- rpcs3/Emu/RSX/RSXThread.cpp | 26 ++++++++++++++++++++++++++ rpcs3/Emu/savestate_utils.cpp | 2 +- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/rpcs3/Emu/RSX/RSXThread.cpp b/rpcs3/Emu/RSX/RSXThread.cpp index 35e394622e..564187c076 100644 --- a/rpcs3/Emu/RSX/RSXThread.cpp +++ b/rpcs3/Emu/RSX/RSXThread.cpp @@ -620,6 +620,32 @@ namespace rsx rsx_log.error("Savestate created in draw call scope. Report to developers if there are issues with it."); } + if (ar.is_writing() || version >= 2) + { + ar(vblank_count); + + b8 flip_pending{}; + + if (ar.is_writing()) + { + flip_pending = !!(async_flip_requested & flip_request::emu_requested); + } + + ar(flip_pending); + + if (flip_pending) + { + ar(vblank_at_flip); + ar(async_flip_buffer); + + if (!ar.is_writing()) + { + async_flip_requested |= flip_request::emu_requested; + flip_notification_count = 1; + } + } + } + if (ar.is_writing()) { if (fifo_ctrl && state & cpu_flag::again) diff --git a/rpcs3/Emu/savestate_utils.cpp b/rpcs3/Emu/savestate_utils.cpp index 3b2fef0baf..b4b6848163 100644 --- a/rpcs3/Emu/savestate_utils.cpp +++ b/rpcs3/Emu/savestate_utils.cpp @@ -54,7 +54,7 @@ SERIALIZATION_VER(lv2_config, 9, 1) namespace rsx { - SERIALIZATION_VER(rsx, 10, 1) + SERIALIZATION_VER(rsx, 10, 1, 2/*Pending flip*/) } namespace np