aboutsummaryrefslogtreecommitdiff
path: root/src/frontend
diff options
context:
space:
mode:
authorJesse Talavera-Greenberg <jesse@jesse.tg>2023-11-08 16:21:21 -0500
committerGitHub <noreply@github.com>2023-11-08 22:21:21 +0100
commit8b47178add1e78da5ff96b335ecac73f34f4a8e9 (patch)
tree23bf7bad0aec69c3533ca22856dc24b96e1690b0 /src/frontend
parentb4ff911fa357dd4a3572ff55373f8ddcd3f6f5ad (diff)
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
Diffstat (limited to 'src/frontend')
-rw-r--r--src/frontend/qt_sdl/main.cpp6
1 files changed, 4 insertions, 2 deletions
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];