aboutsummaryrefslogtreecommitdiff
path: root/src/SPI.cpp
diff options
context:
space:
mode:
authorRayyan Ansari <rayyan@ansari.sh>2022-02-18 15:32:46 +0000
committerArisotura <thetotalworm@gmail.com>2022-03-07 21:08:54 +0100
commit2569c67a13a6ce855d27821cc6863ebea82c429d (patch)
tree6eb326bfadb2dc28999bb722731c006c4dc327f9 /src/SPI.cpp
parentc3adf6f606c694221342111a850e7b76ac77a56d (diff)
Add support for changing the DS and DSi battery level
The DS battery level is configured via the SPI Power Management Device, and the DSi's is configured via the I2C BPTWL. Add support for changing these registers and add the "Power Management" dialog in the UI.
Diffstat (limited to 'src/SPI.cpp')
-rw-r--r--src/SPI.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/SPI.cpp b/src/SPI.cpp
index 26aab8f..009fb32 100644
--- a/src/SPI.cpp
+++ b/src/SPI.cpp
@@ -624,6 +624,9 @@ void Reset()
RegMasks[4] = 0x0F;
}
+bool GetBatteryLevelOkay() { return !Registers[1]; }
+void SetBatteryLevelOkay(bool okay) { Registers[1] = okay ? 0x00 : 0x01; }
+
void DoSavestate(Savestate* file)
{
file->Section("SPPW");