GBA Hardware: Count bytes for ALARM1 properly

This commit is contained in:
Vicki Pfau 2017-04-04 18:10:50 -07:00
parent 9567a8632f
commit 4b7390cc35
2 changed files with 6 additions and 0 deletions

View File

@ -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 {

View File

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