all repos — mgba @ 4b7390cc3552eef01dfb30ad3bf2a306f2448299

mGBA Game Boy Advance Emulator

GBA Hardware: Count bytes for ALARM1 properly
Vicki Pfau vi@endrift.com
Tue, 04 Apr 2017 18:10:50 -0700
commit

4b7390cc3552eef01dfb30ad3bf2a306f2448299

parent

9567a8632f4a3804051866ec4174feb3460d0cdf

2 files changed, 6 insertions(+), 0 deletions(-)

jump to
M include/mgba/internal/gba/hardware.hinclude/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.csrc/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);