From 8b47178add1e78da5ff96b335ecac73f34f4a8e9 Mon Sep 17 00:00:00 2001 From: Jesse Talavera-Greenberg Date: Wed, 8 Nov 2023 16:21:21 -0500 Subject: Move GBACart-related global state into objects (#1870) - RAII will now do the heavy lifting - Mark some methods as const or noexcept - Once the `NDS` object is finalized, most of these `assert`s can go away --- src/frontend/qt_sdl/main.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/frontend') diff --git a/src/frontend/qt_sdl/main.cpp b/src/frontend/qt_sdl/main.cpp index f033e66..a4e56d4 100644 --- a/src/frontend/qt_sdl/main.cpp +++ b/src/frontend/qt_sdl/main.cpp @@ -384,7 +384,8 @@ void EmuThread::run() if (Input::HotkeyPressed(HK_SolarSensorDecrease)) { - int level = GBACart::SetInput(GBACart::Input_SolarSensorDown, true); + assert(NDS::GBACartSlot != nullptr); + int level = NDS::GBACartSlot->SetInput(GBACart::Input_SolarSensorDown, true); if (level != -1) { char msg[64]; @@ -394,7 +395,8 @@ void EmuThread::run() } if (Input::HotkeyPressed(HK_SolarSensorIncrease)) { - int level = GBACart::SetInput(GBACart::Input_SolarSensorUp, true); + assert(NDS::GBACartSlot != nullptr); + int level = NDS::GBACartSlot->SetInput(GBACart::Input_SolarSensorUp, true); if (level != -1) { char msg[64]; -- cgit v1.2.3