From 84dd2304d60a47816bee348272b4dc0946dbbfea Mon Sep 17 00:00:00 2001 From: Jordan Woyak Date: Sun, 29 Mar 2026 11:12:22 -0500 Subject: [PATCH] HW/GBACore: Allow save states to work when the GBA core is stopped. --- Source/Core/Core/HW/GBACore.cpp | 12 ++++++++---- Source/Core/Core/State.cpp | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Source/Core/Core/HW/GBACore.cpp b/Source/Core/Core/HW/GBACore.cpp index 5f2c3ff5b6..d95617b9b3 100644 --- a/Source/Core/Core/HW/GBACore.cpp +++ b/Source/Core/Core/HW/GBACore.cpp @@ -650,11 +650,13 @@ void Core::ExportSave(std::string_view save_path) void Core::DoState(PointerWrap& p) { Flush(); - if (!IsStarted()) + + bool is_started = IsStarted(); + p.Do(is_started); + + if (!is_started) { - ::Core::DisplayMessage(fmt::format("GBA{} core not started. Aborting.", m_device_number + 1), - 3000); - p.SetVerifyMode(); + Stop(); return; } @@ -675,6 +677,8 @@ void Core::DoState(PointerWrap& p) return; } + Start(0); + p.Do(m_video_buffer); p.Do(m_last_gc_ticks); p.Do(m_gc_ticks_remainder); diff --git a/Source/Core/Core/State.cpp b/Source/Core/Core/State.cpp index b9f655e578..e121dcfb7b 100644 --- a/Source/Core/Core/State.cpp +++ b/Source/Core/Core/State.cpp @@ -95,7 +95,7 @@ struct CompressAndDumpStateArgs static Common::WorkQueueThreadSP s_compress_and_dump_thread; // Don't forget to increase this after doing changes on the savestate system -constexpr u32 STATE_VERSION = 184; // Last changed in PR 14110 +constexpr u32 STATE_VERSION = 185; // Last changed in PR 14526 // Increase this if the StateExtendedHeader definition changes constexpr u32 EXTENDED_HEADER_VERSION = 1; // Last changed in PR 12217