diff --git a/include/mgba/internal/gba/hardware.h b/include/mgba/internal/gba/hardware.h index 4cc05a427..3a1d94a62 100644 --- a/include/mgba/internal/gba/hardware.h +++ b/include/mgba/internal/gba/hardware.h @@ -71,6 +71,8 @@ DECL_BITS(RTCCommandData, Command, 4, 3); DECL_BIT(RTCCommandData, Reading, 7); DECL_BITFIELD(RTCStatus2, uint8_t); +DECL_BITS(RTCStatus2, INT1, 0, 4); +DECL_BIT(RTCStatus2, INT2, 6); #pragma pack(push, 1) struct GBARTC { diff --git a/src/gba/hardware.c b/src/gba/hardware.c index 4cf54176c..63ccef50b 100644 --- a/src/gba/hardware.c +++ b/src/gba/hardware.c @@ -224,6 +224,10 @@ void GBARTCProcessByte(struct GBARTC* rtc, struct mRTCSource* source) { break; case RTC_FORCE_IRQ: break; + case RTC_ALARM1: + if (RTCStatus2GetINT1(rtc->status2) == 4) { + rtc->bytesRemaining = 3; + } } } else { mLOG(GBA_HW, WARN, "Invalid RTC command byte: %02X", rtc->bits);