aboutsummaryrefslogtreecommitdiff
path: root/src/libui_sdl
diff options
context:
space:
mode:
authorRaphaël Zumer <rzumer@tebako.net>2019-12-10 17:54:34 -0500
committerRaphaël Zumer <rzumer@tebako.net>2019-12-10 17:54:35 -0500
commitca9f183d24c028cbbbecbe07aefb37bdcd04a581 (patch)
tree2f6b5020a994d29263179a982dd242dd9698a146 /src/libui_sdl
parentf6cd66e5b1eb02f1664a4de083085fb81e6816b6 (diff)
Hook up solar sensor control to the UI
It uses hardcoded keypad left and right arrows.
Diffstat (limited to 'src/libui_sdl')
-rw-r--r--src/libui_sdl/main.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/libui_sdl/main.cpp b/src/libui_sdl/main.cpp
index 31b0488..1b7cfe6 100644
--- a/src/libui_sdl/main.cpp
+++ b/src/libui_sdl/main.cpp
@@ -38,6 +38,7 @@
#include "DlgWifiSettings.h"
#include "../NDS.h"
+#include "../GBACart.h"
#include "../GPU.h"
#include "../SPU.h"
#include "../Wifi.h"
@@ -1291,6 +1292,20 @@ int OnAreaKeyEvent(uiAreaHandler* handler, uiArea* area, uiAreaKeyEvent* evt)
{
if (evt->Modifiers == 0x0) UndoStateLoad();
}
+ else if (evt->Scancode == 0x4B) // Keypad left
+ {
+ if (GBACart::CartInserted && GBACart::HasSolarSensor)
+ {
+ if (GBACart_SolarSensor::LightLevel > 0) GBACart_SolarSensor::LightLevel--;
+ }
+ }
+ else if (evt->Scancode == 0x4D) // Keypad right
+ {
+ if (GBACart::CartInserted && GBACart::HasSolarSensor)
+ {
+ if (GBACart_SolarSensor::LightLevel < 10) GBACart_SolarSensor::LightLevel++;
+ }
+ }
for (int i = 0; i < 12; i++)
if (EventMatchesKey(evt, Config::KeyMapping[i], false))