From b1c7c6d14a10055f35116562c4d0ea2929e8d086 Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Sat, 11 May 2024 21:40:56 -0700 Subject: [PATCH] Qt: Fix crash when applying changes to GB I/O registers in I/O view --- CHANGES | 1 + src/platform/qt/IOViewer.cpp | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 293bb58a1..d79cb4f4c 100644 --- a/CHANGES +++ b/CHANGES @@ -4,6 +4,7 @@ Emulation fixes: - GBA GPIO: Fix gyro read-out start (fixes mgba.io/i/3141) - GBA SIO: Fix MULTI mode SIOCNT bit 7 writes on secondary GBAs (fixes mgba.io/i/3110) Other fixes: + - Qt: Fix crash when applying changes to GB I/O registers in I/O view - Updater: Fix updating appimage across filesystems Misc: - Vita: Add imc0 and xmc0 mount point support diff --git a/src/platform/qt/IOViewer.cpp b/src/platform/qt/IOViewer.cpp index 46c0d8dbb..b0c387914 100644 --- a/src/platform/qt/IOViewer.cpp +++ b/src/platform/qt/IOViewer.cpp @@ -1689,7 +1689,20 @@ void IOViewer::bitFlipped() { void IOViewer::writeback() { { CoreController::Interrupter interrupter(m_controller); - GBAIOWrite(static_cast(m_controller->thread()->core->board), m_register, m_value); + switch (m_controller->platform()) { +#ifdef M_CORE_GB + case mPLATFORM_GB: + GBIOWrite(static_cast(m_controller->thread()->core->board), m_register, m_value); + break; +#endif +#ifdef M_CORE_GBA + case mPLATFORM_GBA: + GBAIOWrite(static_cast(m_controller->thread()->core->board), m_register, m_value); + break; +#endif + case mPLATFORM_NONE: + return; + } } updateRegister(); }