mirror of https://github.com/mgba-emu/mgba.git
GB MBC: Add more TAMA6 commands
This commit is contained in:
parent
0d8e7efff4
commit
9b35e76416
|
@ -138,6 +138,8 @@ enum GBTAMA6Command {
|
|||
GBTAMA6_HOUR_WRITE = 0x5,
|
||||
GBTAMA6_MINUTE_READ = 0x6,
|
||||
GBTAMA6_HOUR_READ = 0x7,
|
||||
GBTAMA6_DISABLE_ALARM = 0x10,
|
||||
GBTAMA6_ENABLE_ALARM = 0x11,
|
||||
};
|
||||
|
||||
enum GBHuC3Register {
|
||||
|
|
12
src/gb/mbc.c
12
src/gb/mbc.c
|
@ -1719,6 +1719,18 @@ void _GBTAMA5(struct GB* gb, uint16_t address, uint8_t value) {
|
|||
tama5->rtcTimerPage[GBTAMA6_RTC_PA0_HOUR_1] = out & 0xF;
|
||||
tama5->rtcTimerPage[GBTAMA6_RTC_PA0_HOUR_10] = out >> 4;
|
||||
break;
|
||||
case GBTAMA6_DISABLE_ALARM:
|
||||
tama5->rtcTimerPage[GBTAMA6_RTC_PAGE] &= 0xB;
|
||||
tama5->rtcAlarmPage[GBTAMA6_RTC_PAGE] &= 0xB;
|
||||
tama5->rtcFreePage0[GBTAMA6_RTC_PAGE] &= 0xB;
|
||||
tama5->rtcFreePage1[GBTAMA6_RTC_PAGE] &= 0xB;
|
||||
break;
|
||||
case GBTAMA6_ENABLE_ALARM:
|
||||
tama5->rtcTimerPage[GBTAMA6_RTC_PAGE] |= 0x4;
|
||||
tama5->rtcAlarmPage[GBTAMA6_RTC_PAGE] |= 0x4;
|
||||
tama5->rtcFreePage0[GBTAMA6_RTC_PAGE] |= 0x4;
|
||||
tama5->rtcFreePage1[GBTAMA6_RTC_PAGE] |= 0x4;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 0x4: // RTC access
|
||||
|
|
Loading…
Reference in New Issue