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
This commit is contained in:
Jesse Talavera-Greenberg
2023-11-08 16:21:21 -05:00
committed by GitHub
parent b4ff911fa3
commit 8b47178add
5 changed files with 151 additions and 153 deletions

View File

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