HW/GBACore: Allow save states to work when the GBA core is stopped.

This commit is contained in:
Jordan Woyak
2026-03-29 11:12:22 -05:00
parent de0999a19c
commit 84dd2304d6
2 changed files with 9 additions and 5 deletions

View File

@@ -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);

View File

@@ -95,7 +95,7 @@ struct CompressAndDumpStateArgs
static Common::WorkQueueThreadSP<CompressAndDumpStateArgs> 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