aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArisotura <thetotalworm@gmail.com>2023-11-02 12:21:59 +0100
committerArisotura <thetotalworm@gmail.com>2023-11-02 12:21:59 +0100
commiteb13bce6e7300ffb71f76dec11ce422e05154c28 (patch)
treeb42570cea6cc82c89c316882062b2dcc8b9df247
parentd11ba63bb0c385131eadba758345e0022ae3001a (diff)
RTC: add the DSi alarm expansion registers
-rw-r--r--src/RTC.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/RTC.cpp b/src/RTC.cpp
index ff40322..3d25226 100644
--- a/src/RTC.cpp
+++ b/src/RTC.cpp
@@ -324,6 +324,16 @@ void ProcessIRQ(int type) // 0=minute carry 1=periodic 2=status reg write
if (State.Alarm1[2] & (1<<7))
cond = cond && ((State.Alarm1[2] & 0x7F) == State.DateTime[5]);
+ if (NDS::ConsoleType == 1)
+ {
+ if (State.AlarmDate1[1] & (1<<6))
+ cond = cond && (State.AlarmDate1[0] == State.DateTime[0]);
+ if (State.AlarmDate1[1] & (1<<7))
+ cond = cond && ((State.AlarmDate1[1] & 0x1F) == State.DateTime[1]);
+ if (State.AlarmDate1[2] & (1<<7))
+ cond = cond && ((State.AlarmDate1[2] & 0x3F) == State.DateTime[2]);
+ }
+
if (cond)
SetIRQ(0x10);
else
@@ -356,6 +366,16 @@ void ProcessIRQ(int type) // 0=minute carry 1=periodic 2=status reg write
if (State.Alarm2[2] & (1<<7))
cond = cond && ((State.Alarm2[2] & 0x7F) == State.DateTime[5]);
+ if (NDS::ConsoleType == 1)
+ {
+ if (State.AlarmDate2[1] & (1<<6))
+ cond = cond && (State.AlarmDate2[0] == State.DateTime[0]);
+ if (State.AlarmDate2[1] & (1<<7))
+ cond = cond && ((State.AlarmDate2[1] & 0x1F) == State.DateTime[1]);
+ if (State.AlarmDate2[2] & (1<<7))
+ cond = cond && ((State.AlarmDate2[2] & 0x3F) == State.DateTime[2]);
+ }
+
if (cond)
SetIRQ(0x20);
else