From 2ba92b043b6511adeecf039affb8bace37001845 Mon Sep 17 00:00:00 2001 From: angelosa Date: Wed, 30 Aug 2017 11:10:29 +0200 Subject: ninjaw.cpp: saner interleave CPU timings, attempt to fix missing enemies bug in Ninja Warriors [Angelo Salese] --- src/mame/drivers/ninjaw.cpp | 9 +++++++-- src/mame/video/mb60553.cpp | 5 +++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/mame/drivers/ninjaw.cpp b/src/mame/drivers/ninjaw.cpp index 27e91125712..a8cc0ba4eed 100644 --- a/src/mame/drivers/ninjaw.cpp +++ b/src/mame/drivers/ninjaw.cpp @@ -742,7 +742,11 @@ static MACHINE_CONFIG_START( ninjaw ) MCFG_CPU_PROGRAM_MAP(ninjaw_slave_map) MCFG_CPU_VBLANK_INT_DRIVER("lscreen", ninjaw_state, irq4_line_hold) - MCFG_QUANTUM_TIME(attotime::from_hz(6000)) /* CPU slices */ + // TODO: if CPUs are unsynched then seldomly stages loads up with no enemies + // Let's use a better timer (was 6000 before) based off actual CPU timing. + // Might as well bump the divider in case the bug still occurs before resorting to perfect CPU. + MCFG_QUANTUM_TIME(attotime::from_hz(16000000/1024)) /* CPU slices */ + //MCFG_QUANTUM_PERFECT_CPU("maincpu") MCFG_DEVICE_ADD("tc0040ioc", TC0040IOC, 0) MCFG_TC0040IOC_READ_0_CB(IOPORT("DSWA")) @@ -863,7 +867,8 @@ static MACHINE_CONFIG_START( darius2 ) MCFG_CPU_PROGRAM_MAP(darius2_slave_map) MCFG_CPU_VBLANK_INT_DRIVER("lscreen", ninjaw_state, irq4_line_hold) - MCFG_QUANTUM_TIME(attotime::from_hz(6000)) /* CPU slices */ + MCFG_QUANTUM_TIME(attotime::from_hz(16000000/1024)) /* CPU slices */ + //MCFG_QUANTUM_PERFECT_CPU("maincpu") MCFG_DEVICE_ADD("tc0040ioc", TC0040IOC, 0) MCFG_TC0040IOC_READ_0_CB(IOPORT("DSWA")) diff --git a/src/mame/video/mb60553.cpp b/src/mame/video/mb60553.cpp index e23c386ad34..0fa843d5513 100644 --- a/src/mame/video/mb60553.cpp +++ b/src/mame/video/mb60553.cpp @@ -277,10 +277,12 @@ void mb60553_zooming_tilemap_device::draw( screen_device &screen, bitmap_ind16& incxx = m_lineram[(line)*8+0]<<4; + incyy = m_lineram[(line)*8+3]<<4; + // startx has an offset based off current x zoom value // This is confirmed by Tecmo World Cup '94 startx being 0xff40 (-192) when showing footballer pics on attract mode (incxx is 0x800) // TODO: slightly offset? - xoffset = (float)incxx/(float)0x10000 * 384.0; + xoffset = ((float)incxx/(float)0x10000) * 384.0; startx = m_regs[0] + (uint32_t)xoffset; starty = m_regs[1]; @@ -288,7 +290,6 @@ void mb60553_zooming_tilemap_device::draw( screen_device &screen, bitmap_ind16& // TODO: what's this? Used by Grand Striker playfield // startx -= m_lineram[(line)*8+7]/2; - incyy = m_lineram[(line)*8+3]<<4; clip.min_y = clip.max_y = line; -- cgit v1.2.3