GBA Hardware: Count bytes for ALARM1 properly
Vicki Pfau vi@endrift.com
Tue, 04 Apr 2017 18:10:50 -0700
2 files changed,
6 insertions(+),
0 deletions(-)
M
include/mgba/internal/gba/hardware.h
→
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 {
M
src/gba/hardware.c
→
src/gba/hardware.c
@@ -224,6 +224,10 @@ _rtcUpdateClock(rtc, 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);