summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--src/devices/cpu/h8/h8_timer16.cpp26
-rw-r--r--src/devices/cpu/h8/h8_timer8.cpp32
-rw-r--r--src/mame/chess/excal_ivant.cpp3
-rw-r--r--src/mame/namco/namcos23.cpp64
4 files changed, 64 insertions, 61 deletions
diff --git a/src/devices/cpu/h8/h8_timer16.cpp b/src/devices/cpu/h8/h8_timer16.cpp
index e76f6bd60ca..263168909d6 100644
--- a/src/devices/cpu/h8/h8_timer16.cpp
+++ b/src/devices/cpu/h8/h8_timer16.cpp
@@ -275,13 +275,14 @@ void h8_timer16_channel_device::update_counter(u64 cur_time)
m_tcnt = tt % m_counter_cycle;
for(int i = 0; i < m_tgr_count; i++) {
- bool match = m_tcnt == m_tgr[i] || (tt == m_tgr[i] && tt == m_counter_cycle);
+ u16 cmp = m_tgr[i] + 1;
+ bool match = m_tcnt == cmp || (tt == cmp && tt == m_counter_cycle);
if(!match) {
// Need to do additional checks here for software that polls the flags with interrupts disabled, since recalc_event only schedules IRQ events.
if(prev >= m_counter_cycle)
- match = (m_tgr[i] > prev && tt >= m_tgr[i]) || (m_tgr[i] <= m_counter_cycle && m_tcnt < m_counter_cycle && (delta - (0x10000 - prev)) >= m_tgr[i]);
- else if(m_tgr[i] <= m_counter_cycle)
- match = delta >= m_counter_cycle || (prev < m_tgr[i] && tt >= m_tgr[i]) || (m_tcnt <= prev && m_tcnt >= m_tgr[i]);
+ match = (cmp > prev && tt >= cmp) || (cmp <= m_counter_cycle && m_tcnt < m_counter_cycle && (delta - (0x10000 - prev)) >= cmp);
+ else if(cmp <= m_counter_cycle)
+ match = delta >= m_counter_cycle || (prev < cmp && tt >= cmp) || (m_tcnt <= prev && m_tcnt >= cmp);
if(match && BIT(m_ier, i) && m_interrupt[i] != -1)
logerror("update_counter unexpected TGR %d IRQ\n, i");
@@ -327,8 +328,8 @@ void h8_timer16_channel_device::recalc_event(u64 cur_time)
if(m_counter_incrementing) {
u32 event_delay = 0xffffffff;
- if(m_tgr_clearing >= 0 && m_tgr[m_tgr_clearing])
- m_counter_cycle = m_tgr[m_tgr_clearing];
+ if(m_tgr_clearing >= 0)
+ m_counter_cycle = m_tgr[m_tgr_clearing] + 1;
else
m_counter_cycle = 0x10000;
if((m_ier & IRQ_V && m_interrupt[4] != -1) && (m_counter_cycle == 0x10000 || m_tcnt >= m_counter_cycle))
@@ -337,14 +338,15 @@ void h8_timer16_channel_device::recalc_event(u64 cur_time)
for(int i = 0; i < m_tgr_count; i++)
if(BIT(m_ier, i) && m_interrupt[i] != -1) {
u32 new_delay = 0xffffffff;
- if(m_tgr[i] > m_tcnt) {
- if(m_tcnt >= m_counter_cycle || m_tgr[i] <= m_counter_cycle)
- new_delay = m_tgr[i] - m_tcnt;
- } else if(m_tgr[i] <= m_counter_cycle) {
+ u16 cmp = m_tgr[i] + 1;
+ if(cmp > m_tcnt) {
+ if(m_tcnt >= m_counter_cycle || cmp <= m_counter_cycle)
+ new_delay = cmp - m_tcnt;
+ } else if(cmp <= m_counter_cycle) {
if(m_tcnt < m_counter_cycle)
- new_delay = (m_counter_cycle - m_tcnt) + m_tgr[i];
+ new_delay = (m_counter_cycle - m_tcnt) + cmp;
else
- new_delay = (0x10000 - m_tcnt) + m_tgr[i];
+ new_delay = (0x10000 - m_tcnt) + cmp;
}
if(event_delay > new_delay)
diff --git a/src/devices/cpu/h8/h8_timer8.cpp b/src/devices/cpu/h8/h8_timer8.cpp
index f96a7c8b938..16f0ee757a1 100644
--- a/src/devices/cpu/h8/h8_timer8.cpp
+++ b/src/devices/cpu/h8/h8_timer8.cpp
@@ -265,10 +265,9 @@ void h8_timer8_channel_device::update_counter(u64 cur_time, u64 delta)
} else
m_tcnt = tt % m_counter_cycle;
- if(m_tcnt == m_tcor[0] || (tt == m_tcor[0] && tt == m_counter_cycle)) {
+ if(u8 cmp = m_tcor[0] + 1; m_tcnt == cmp || (tt == cmp && tt == m_counter_cycle)) {
if(m_chained_timer)
m_chained_timer->chained_timer_tcora();
-
if(!(m_tcsr & TCSR_CMFA)) {
m_tcsr |= TCSR_CMFA;
if(m_tcr & TCR_CMIEA)
@@ -276,10 +275,12 @@ void h8_timer8_channel_device::update_counter(u64 cur_time, u64 delta)
}
}
- if(!(m_tcsr & TCSR_CMFB) && (tt == m_tcor[1] || m_tcnt == m_tcor[1])) {
- m_tcsr |= TCSR_CMFB;
- if(m_tcr & TCR_CMIEB)
- m_intc->internal_interrupt(m_irq_cb);
+ if(u8 cmp = m_tcor[1] + 1; m_tcnt == cmp || (tt == cmp && tt == m_counter_cycle)) {
+ if(!(m_tcsr & TCSR_CMFB)) {
+ m_tcsr |= TCSR_CMFB;
+ if(m_tcr & TCR_CMIEB)
+ m_intc->internal_interrupt(m_irq_cb);
+ }
}
if(tt >= 0x100 && (m_counter_cycle == 0x100 || prev >= m_counter_cycle)) {
@@ -309,23 +310,24 @@ void h8_timer8_channel_device::recalc_event(u64 cur_time)
cur_time = m_cpu->total_cycles();
u32 event_delay = 0xffffffff;
- if((m_clear_type == CLEAR_A || m_clear_type == CLEAR_B) && m_tcor[m_clear_type - CLEAR_A])
- m_counter_cycle = m_tcor[m_clear_type - CLEAR_A];
+ if(m_clear_type == CLEAR_A || m_clear_type == CLEAR_B)
+ m_counter_cycle = m_tcor[m_clear_type - CLEAR_A] + 1;
else
m_counter_cycle = 0x100;
if(m_counter_cycle == 0x100 || m_tcnt >= m_counter_cycle)
event_delay = 0x100 - m_tcnt;
- for(auto &elem : m_tcor) {
+ for(auto &tcor : m_tcor) {
u32 new_delay = 0xffffffff;
- if(elem > m_tcnt) {
- if(m_tcnt >= m_counter_cycle || elem <= m_counter_cycle)
- new_delay = elem - m_tcnt;
- } else if(elem <= m_counter_cycle) {
+ u8 cmp = tcor + 1;
+ if(cmp > m_tcnt) {
+ if(m_tcnt >= m_counter_cycle || cmp <= m_counter_cycle)
+ new_delay = cmp - m_tcnt;
+ } else if(cmp <= m_counter_cycle) {
if(m_tcnt < m_counter_cycle)
- new_delay = (m_counter_cycle - m_tcnt) + elem;
+ new_delay = (m_counter_cycle - m_tcnt) + cmp;
else
- new_delay = (0x100 - m_tcnt) + elem;
+ new_delay = (0x100 - m_tcnt) + cmp;
}
if(event_delay > new_delay)
event_delay = new_delay;
diff --git a/src/mame/chess/excal_ivant.cpp b/src/mame/chess/excal_ivant.cpp
index a7c12dc5b42..75ab2519e45 100644
--- a/src/mame/chess/excal_ivant.cpp
+++ b/src/mame/chess/excal_ivant.cpp
@@ -16,7 +16,7 @@ Hardware notes:
The MCU used here is a HD6433256A33P from Excalibur Mirage, the internal ROM
is disabled. There's also a newer version on a H8/3216. The first version was
-manufactured by CXG.
+produced in a CXG factory.
TODO:
- it does a cold boot at every reset, so nvram won't work properly unless MAME
@@ -238,7 +238,6 @@ u8 ivant_state::p6_r()
void ivant_state::main_map(address_map &map)
{
map(0x0000, 0x0007).mirror(0xfff8).w(FUNC(ivant_state::latch_w));
- map(0x0000, 0xffff).w(FUNC(ivant_state::latch_w));
map(0x0000, 0x7fff).rom();
map(0x8000, 0xbfff).bankr(m_rombank);
}
diff --git a/src/mame/namco/namcos23.cpp b/src/mame/namco/namcos23.cpp
index 78cb76cf0ed..927d82f8a74 100644
--- a/src/mame/namco/namcos23.cpp
+++ b/src/mame/namco/namcos23.cpp
@@ -5597,37 +5597,37 @@ ROM_END
/* Games */
-#define GAME_FLAGS (MACHINE_NOT_WORKING | MACHINE_UNEMULATED_PROTECTION | MACHINE_IMPERFECT_GRAPHICS )
-// YEAR, NAME, PARENT, MACHINE, INPUT, CLASS, INIT, MNTR, COMPANY, FULLNAME, FLAGS
-GAME( 1997, rapidrvr, 0, gorgon, rapidrvr, namcos23_state, init_s23, ROT0, "Namco", "Rapid River (US, RD3 Ver. C)", GAME_FLAGS ) // 97/11/27, USA
-GAME( 1997, rapidrvrv2c, rapidrvr, gorgon, rapidrvr, namcos23_state, init_s23, ROT0, "Namco", "Rapid River (World, RD2 Ver. C)", GAME_FLAGS ) // 97/11/27, Europe
-GAME( 1997, rapidrvrp, rapidrvr, gorgon, rapidrvrp, namcos23_state, init_s23, ROT0, "Namco", "Rapid River (prototype)", GAME_FLAGS ) // 97/11/10, USA
-GAME( 1997, finfurl, 0, gorgon, finfurl, namcos23_state, init_s23, ROT0, "Namco", "Final Furlong (World, FF2 Ver. A)", GAME_FLAGS | MACHINE_NODEVICE_LAN )
-GAME( 1997, downhill, 0, s23, downhill, namcos23_state, init_s23, ROT0, "Namco", "Downhill Bikers (World, DH2 Ver. A)", GAME_FLAGS | MACHINE_NODEVICE_LAN )
-GAME( 1997, downhillu, downhill, s23, downhill, namcos23_state, init_s23, ROT0, "Namco", "Downhill Bikers (US, DH3 Ver. A)", GAME_FLAGS | MACHINE_NODEVICE_LAN )
-GAME( 1997, motoxgo, 0, motoxgo, s23, namcos23_state, init_s23, ROT0, "Namco", "Motocross Go! (US, MG3 Ver. A)", GAME_FLAGS | MACHINE_NODEVICE_LAN )
-GAME( 1997, motoxgov2a, motoxgo, motoxgo, s23, namcos23_state, init_s23, ROT0, "Namco", "Motocross Go! (World, MG2 Ver. A, set 1)", GAME_FLAGS | MACHINE_NODEVICE_LAN )
-GAME( 1997, motoxgov2a2, motoxgo, motoxgo, s23, namcos23_state, init_s23, ROT0, "Namco", "Motocross Go! (World, MG2 Ver. A, set 2)", GAME_FLAGS | MACHINE_NODEVICE_LAN )
+#define GAME_FLAGS (MACHINE_NOT_WORKING | MACHINE_UNEMULATED_PROTECTION | MACHINE_IMPERFECT_GRAPHICS)
+// YEAR, NAME, PARENT, MACHINE, INPUT, CLASS, INIT, MNTR, COMPANY, FULLNAME, FLAGS
+GAME( 1997, rapidrvr, 0, gorgon, rapidrvr, namcos23_state, init_s23, ROT0, "Namco", "Rapid River (US, RD3 Ver. C)", GAME_FLAGS ) // 97/11/27, USA
+GAME( 1997, rapidrvrv2c, rapidrvr, gorgon, rapidrvr, namcos23_state, init_s23, ROT0, "Namco", "Rapid River (World, RD2 Ver. C)", GAME_FLAGS ) // 97/11/27, Europe
+GAME( 1997, rapidrvrp, rapidrvr, gorgon, rapidrvrp, namcos23_state, init_s23, ROT0, "Namco", "Rapid River (prototype)", GAME_FLAGS ) // 97/11/10, USA
+GAME( 1997, finfurl, 0, gorgon, finfurl, namcos23_state, init_s23, ROT0, "Namco", "Final Furlong (World, FF2 Ver. A)", GAME_FLAGS | MACHINE_NODEVICE_LAN )
+GAME( 1997, downhill, 0, s23, downhill, namcos23_state, init_s23, ROT0, "Namco", "Downhill Bikers (World, DH2 Ver. A)", GAME_FLAGS | MACHINE_NODEVICE_LAN )
+GAME( 1997, downhillu, downhill, s23, downhill, namcos23_state, init_s23, ROT0, "Namco", "Downhill Bikers (US, DH3 Ver. A)", GAME_FLAGS | MACHINE_NODEVICE_LAN )
+GAME( 1997, motoxgo, 0, motoxgo, s23, namcos23_state, init_s23, ROT0, "Namco", "Motocross Go! (US, MG3 Ver. A)", GAME_FLAGS | MACHINE_NODEVICE_LAN )
+GAME( 1997, motoxgov2a, motoxgo, motoxgo, s23, namcos23_state, init_s23, ROT0, "Namco", "Motocross Go! (World, MG2 Ver. A, set 1)", GAME_FLAGS | MACHINE_NODEVICE_LAN )
+GAME( 1997, motoxgov2a2, motoxgo, motoxgo, s23, namcos23_state, init_s23, ROT0, "Namco", "Motocross Go! (World, MG2 Ver. A, set 2)", GAME_FLAGS | MACHINE_NODEVICE_LAN )
GAME( 1997, motoxgov1a, motoxgo, motoxgo, s23, namcos23_state, init_s23, ROT0, "Namco", "Motocross Go! (Japan, MG1 Ver. A, set 1)", GAME_FLAGS | MACHINE_NODEVICE_LAN )
GAME( 1997, motoxgov1a2, motoxgo, motoxgo, s23, namcos23_state, init_s23, ROT0, "Namco", "Motocross Go! (Japan, MG1 Ver. A, set 2)", GAME_FLAGS | MACHINE_NODEVICE_LAN )
-GAME( 1997, timecrs2, 0, timecrs2, timecrs2, namcos23_state, init_s23, ROT0, "Namco", "Time Crisis II (US, TSS3 Ver. B)", GAME_FLAGS | MACHINE_NODEVICE_LAN )
-GAME( 1997, timecrs2v2b, timecrs2, timecrs2, timecrs2, namcos23_state, init_s23, ROT0, "Namco", "Time Crisis II (World, TSS2 Ver. B)", GAME_FLAGS | MACHINE_NODEVICE_LAN )
-GAME( 1997, timecrs2v1b, timecrs2, timecrs2, timecrs2, namcos23_state, init_s23, ROT0, "Namco", "Time Crisis II (Japan, TSS1 Ver. B)", GAME_FLAGS | MACHINE_NODEVICE_LAN )
-GAME( 1997, timecrs2v4a, timecrs2, timecrs2v4a, timecrs2, namcos23_state, init_s23, ROT0, "Namco", "Time Crisis II (World, TSS4 Ver. A)", GAME_FLAGS | MACHINE_NODEVICE_LAN )
-GAME( 1997, timecrs2v5a, timecrs2, timecrs2v4a, timecrs2, namcos23_state, init_s23, ROT0, "Namco", "Time Crisis II (US, TSS5 Ver. A)", GAME_FLAGS | MACHINE_NODEVICE_LAN )
-GAME( 1997, panicprk, 0, s23, s23, namcos23_state, init_s23, ROT0, "Namco", "Panic Park (World, PNP2 Ver. A)", GAME_FLAGS )
-GAME( 1997, panicprkj, panicprk, s23, s23, namcos23_state, init_s23, ROT0, "Namco", "Panic Park (Japan, PNP1 Ver. B, set 1)", GAME_FLAGS )
-GAME( 1997, panicprkj2, panicprk, s23, s23, namcos23_state, init_s23, ROT0, "Namco", "Panic Park (Japan, PNP1 Ver. B, set 2)", GAME_FLAGS )
-GAME( 1998, gunwars, 0, gmen, s23, namcos23_state, init_s23, ROT0, "Namco", "Gunmen Wars (Japan, GM1 Ver. B)", GAME_FLAGS | MACHINE_NODEVICE_LAN )
-GAME( 1998, gunwarsa, gunwars, gmen, s23, namcos23_state, init_s23, ROT0, "Namco", "Gunmen Wars (Japan, GM1 Ver. A)", GAME_FLAGS | MACHINE_NODEVICE_LAN )
-GAME( 1998, raceon, 0, gmen, s23, namcos23_state, init_s23, ROT0, "Namco", "Race On! (World, RO2 Ver. A)", GAME_FLAGS | MACHINE_NODEVICE_LAN )
-GAME( 1998, 500gp, 0, ss23, 500gp, namcos23_state, init_s23, ROT0, "Namco", "500 GP (US, 5GP3 Ver. C)", GAME_FLAGS | MACHINE_NODEVICE_LAN )
-GAME( 1998, aking, 0, ss23, s23, namcos23_state, init_s23, ROT0, "Namco", "Angler King (Japan, AG1 Ver. A)", GAME_FLAGS )
-GAME( 1998, finfurl2, 0, gmen, s23, namcos23_state, init_s23, ROT0, "Namco", "Final Furlong 2 (World)", GAME_FLAGS | MACHINE_NODEVICE_LAN ) // 99/02/26 15:08:47 Overseas
-GAME( 1998, finfurl2j, finfurl2, gmen, s23, namcos23_state, init_s23, ROT0, "Namco", "Final Furlong 2 (Japan, FFS1 Ver.A)", GAME_FLAGS | MACHINE_NODEVICE_LAN ) // 99/02/26 15:03:14 Japanese
-GAME( 1999, crszone, 0, ss23e2, s23, namcos23_state, init_s23, ROT0, "Namco", "Crisis Zone (World, CSZO4 Ver. B)", GAME_FLAGS )
-GAME( 1999, crszonev4a, crszone, ss23e2, s23, namcos23_state, init_s23, ROT0, "Namco", "Crisis Zone (World, CSZO4 Ver. A)", GAME_FLAGS )
-GAME( 1999, crszonev3b, crszone, ss23e2, s23, namcos23_state, init_s23, ROT0, "Namco", "Crisis Zone (US, CSZO3 Ver. B, set 1)", GAME_FLAGS )
-GAME( 1999, crszonev3b2, crszone, ss23e2, s23, namcos23_state, init_s23, ROT0, "Namco", "Crisis Zone (US, CSZO3 Ver. B, set 2)", GAME_FLAGS )
-GAME( 1999, crszonev3a, crszone, ss23e2, s23, namcos23_state, init_s23, ROT0, "Namco", "Crisis Zone (US, CSZO3 Ver. A)", GAME_FLAGS )
-GAME( 1999, crszonev2a, crszone, ss23e2, s23, namcos23_state, init_s23, ROT0, "Namco", "Crisis Zone (World, CSZO2 Ver. A)", GAME_FLAGS )
+GAME( 1997, timecrs2, 0, timecrs2, timecrs2, namcos23_state, init_s23, ROT0, "Namco", "Time Crisis II (US, TSS3 Ver. B)", GAME_FLAGS | MACHINE_NODEVICE_LAN )
+GAME( 1997, timecrs2v2b, timecrs2, timecrs2, timecrs2, namcos23_state, init_s23, ROT0, "Namco", "Time Crisis II (World, TSS2 Ver. B)", GAME_FLAGS | MACHINE_NODEVICE_LAN )
+GAME( 1997, timecrs2v1b, timecrs2, timecrs2, timecrs2, namcos23_state, init_s23, ROT0, "Namco", "Time Crisis II (Japan, TSS1 Ver. B)", GAME_FLAGS | MACHINE_NODEVICE_LAN )
+GAME( 1997, timecrs2v4a, timecrs2, timecrs2v4a, timecrs2, namcos23_state, init_s23, ROT0, "Namco", "Time Crisis II (World, TSS4 Ver. A)", GAME_FLAGS | MACHINE_NODEVICE_LAN )
+GAME( 1997, timecrs2v5a, timecrs2, timecrs2v4a, timecrs2, namcos23_state, init_s23, ROT0, "Namco", "Time Crisis II (US, TSS5 Ver. A)", GAME_FLAGS | MACHINE_NODEVICE_LAN )
+GAME( 1997, panicprk, 0, s23, s23, namcos23_state, init_s23, ROT0, "Namco", "Panic Park (World, PNP2 Ver. A)", GAME_FLAGS )
+GAME( 1997, panicprkj, panicprk, s23, s23, namcos23_state, init_s23, ROT0, "Namco", "Panic Park (Japan, PNP1 Ver. B, set 1)", GAME_FLAGS )
+GAME( 1997, panicprkj2, panicprk, s23, s23, namcos23_state, init_s23, ROT0, "Namco", "Panic Park (Japan, PNP1 Ver. B, set 2)", GAME_FLAGS )
+GAME( 1998, gunwars, 0, gmen, s23, namcos23_state, init_s23, ROT0, "Namco", "Gunmen Wars (Japan, GM1 Ver. B)", GAME_FLAGS | MACHINE_NODEVICE_LAN )
+GAME( 1998, gunwarsa, gunwars, gmen, s23, namcos23_state, init_s23, ROT0, "Namco", "Gunmen Wars (Japan, GM1 Ver. A)", GAME_FLAGS | MACHINE_NODEVICE_LAN )
+GAME( 1998, raceon, 0, gmen, s23, namcos23_state, init_s23, ROT0, "Namco", "Race On! (World, RO2 Ver. A)", GAME_FLAGS | MACHINE_NODEVICE_LAN )
+GAME( 1998, 500gp, 0, ss23, 500gp, namcos23_state, init_s23, ROT0, "Namco", "500 GP (US, 5GP3 Ver. C)", GAME_FLAGS | MACHINE_NODEVICE_LAN )
+GAME( 1998, aking, 0, ss23, s23, namcos23_state, init_s23, ROT0, "Namco", "Angler King (Japan, AG1 Ver. A)", GAME_FLAGS )
+GAME( 1998, finfurl2, 0, gmen, s23, namcos23_state, init_s23, ROT0, "Namco", "Final Furlong 2 (World)", GAME_FLAGS | MACHINE_NODEVICE_LAN ) // 99/02/26 15:08:47 Overseas
+GAME( 1998, finfurl2j, finfurl2, gmen, s23, namcos23_state, init_s23, ROT0, "Namco", "Final Furlong 2 (Japan, FFS1 Ver.A)", GAME_FLAGS | MACHINE_NODEVICE_LAN ) // 99/02/26 15:03:14 Japanese
+GAME( 1999, crszone, 0, ss23e2, s23, namcos23_state, init_s23, ROT0, "Namco", "Crisis Zone (World, CSZO4 Ver. B)", GAME_FLAGS )
+GAME( 1999, crszonev4a, crszone, ss23e2, s23, namcos23_state, init_s23, ROT0, "Namco", "Crisis Zone (World, CSZO4 Ver. A)", GAME_FLAGS )
+GAME( 1999, crszonev3b, crszone, ss23e2, s23, namcos23_state, init_s23, ROT0, "Namco", "Crisis Zone (US, CSZO3 Ver. B, set 1)", GAME_FLAGS )
+GAME( 1999, crszonev3b2, crszone, ss23e2, s23, namcos23_state, init_s23, ROT0, "Namco", "Crisis Zone (US, CSZO3 Ver. B, set 2)", GAME_FLAGS )
+GAME( 1999, crszonev3a, crszone, ss23e2, s23, namcos23_state, init_s23, ROT0, "Namco", "Crisis Zone (US, CSZO3 Ver. A)", GAME_FLAGS )
+GAME( 1999, crszonev2a, crszone, ss23e2, s23, namcos23_state, init_s23, ROT0, "Namco", "Crisis Zone (World, CSZO2 Ver. A)", GAME_FLAGS )