summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author R. Belmont <rb6502@users.noreply.github.com>2009-01-11 05:36:04 +0000
committer R. Belmont <rb6502@users.noreply.github.com>2009-01-11 05:36:04 +0000
commit1b4e540fbd5c90696f82235d3230d8c583735ebd (patch)
treef8b1df0499d63c8fed9582f6436cbe5bb345007f
parent4df40b369cd6d0bbb19a15fef8873781b8a6ca09 (diff)
Fix clock used in Namco systems 12 & 23.
-rw-r--r--src/mame/drivers/namcos12.c12
-rw-r--r--src/mame/drivers/namcos23.c11
2 files changed, 14 insertions, 9 deletions
diff --git a/src/mame/drivers/namcos12.c b/src/mame/drivers/namcos12.c
index a964272738e..f9464d5f302 100644
--- a/src/mame/drivers/namcos12.c
+++ b/src/mame/drivers/namcos12.c
@@ -10,7 +10,6 @@
not all games work due to either banking, dma or protection issues.
graphics are glitchy in some games.
- - day, date, and year from the RTC appear to be ignored (hour/min/sec are fine). H8 core bug or BIOS doesn't care?
- golgo13 assumes the test switch is a switch, not a button - must hold down F2 to stay in test mode
@@ -1311,16 +1310,19 @@ static READ8_HANDLER( s12_mcu_rtc_r )
ret = make_bcd(systime.local_time.hour); // hour (BCD, 0-23)
break;
case 3:
- ret = make_bcd(weekday[systime.local_time.weekday]); // day of the week (1 = Monday, 7 = Sunday)
+ ret = make_bcd(weekday[systime.local_time.weekday]); // low nibble = day of the week
+ ret |= (make_bcd(systime.local_time.mday) & 0x0f)<<4; // high nibble = low digit of day
break;
case 4:
- ret = make_bcd(systime.local_time.mday); // day (BCD, 1-31)
+ ret = (make_bcd(systime.local_time.mday) >> 4); // low nibble = high digit of day
+ ret |= (make_bcd(systime.local_time.month + 1) & 0x0f)<<4; // high nibble = low digit of month
break;
case 5:
- ret = make_bcd(systime.local_time.month + 1); // month (BCD, 1-12)
+ ret = make_bcd(systime.local_time.month + 1) >> 4; // low nibble = high digit of month
+ ret |= (make_bcd(systime.local_time.year % 10) << 4); // high nibble = low digit of year
break;
case 6:
- ret = make_bcd(systime.local_time.year % 100); // year (BCD, 0-99)
+ ret = make_bcd(systime.local_time.year % 100) >> 4; // low nibble = tens digit of year (BCD, 0-9)
break;
}
diff --git a/src/mame/drivers/namcos23.c b/src/mame/drivers/namcos23.c
index 0233d570f5b..437c11507bb 100644
--- a/src/mame/drivers/namcos23.c
+++ b/src/mame/drivers/namcos23.c
@@ -1152,16 +1152,19 @@ static READ8_HANDLER( s23_mcu_rtc_r )
ret = make_bcd(systime.local_time.hour); // hour (BCD, 0-23)
break;
case 3:
- ret = make_bcd(weekday[systime.local_time.weekday]); // day of the week (1 = Monday, 7 = Sunday)
+ ret = make_bcd(weekday[systime.local_time.weekday]); // low nibble = day of the week
+ ret |= (make_bcd(systime.local_time.mday) & 0x0f)<<4; // high nibble = low digit of day
break;
case 4:
- ret = make_bcd(systime.local_time.mday); // day (BCD, 1-31)
+ ret = (make_bcd(systime.local_time.mday) >> 4); // low nibble = high digit of day
+ ret |= (make_bcd(systime.local_time.month + 1) & 0x0f)<<4; // high nibble = low digit of month
break;
case 5:
- ret = make_bcd(systime.local_time.month + 1); // month (BCD, 1-12)
+ ret = make_bcd(systime.local_time.month + 1) >> 4; // low nibble = high digit of month
+ ret |= (make_bcd(systime.local_time.year % 10) << 4); // high nibble = low digit of year
break;
case 6:
- ret = make_bcd(systime.local_time.year % 100); // year (BCD, 0-99)
+ ret = make_bcd(systime.local_time.year % 100) >> 4; // low nibble = tens digit of year (BCD, 0-9)
break;
}