Qt: Fix crash when applying changes to GB I/O registers in I/O view

This commit is contained in:
Vicki Pfau 2024-05-11 21:40:56 -07:00
parent 92b67f960c
commit 6e3a00e081
2 changed files with 15 additions and 1 deletions

View File

@ -23,6 +23,7 @@ Other fixes:
- GBA Memory: Let raw access read high MMIO addresses
- Qt: Fix savestate preview sizes with different scales (fixes mgba.io/i/2560)
- Qt: Fix potential crash when configuring shortcuts
- Qt: Fix crash when applying changes to GB I/O registers in I/O view
- Updater: Fix updating appimage across filesystems
Misc:
- Core: Handle relative paths for saves, screenshots, etc consistently (fixes mgba.io/i/2826)

View File

@ -1687,7 +1687,20 @@ void IOViewer::bitFlipped() {
void IOViewer::writeback() {
{
CoreController::Interrupter interrupter(m_controller);
GBAIOWrite(static_cast<GBA*>(m_controller->thread()->core->board), m_register, m_value);
switch (m_controller->platform()) {
#ifdef M_CORE_GB
case mPLATFORM_GB:
GBIOWrite(static_cast<GB*>(m_controller->thread()->core->board), m_register, m_value);
break;
#endif
#ifdef M_CORE_GBA
case mPLATFORM_GBA:
GBAIOWrite(static_cast<GBA*>(m_controller->thread()->core->board), m_register, m_value);
break;
#endif
case mPLATFORM_NONE:
return;
}
}
updateRegister();
}