From 8ccebad28fdd365769dfc809bebb6eca29026671 Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Sat, 28 Jan 2017 23:03:02 +1100 Subject: Hook up protection MCU in bballsa, add to parent set as BAD_DUMP. (nw) Uses a similar scheme to pushman, but doesn't use port D on the MCU, and uses the same endianness for MCU reads/writes (pushman swaps the bytes on writes). As an aside, bballs has at least partial nudity in it as seen in attract mode, although less than bballsa. --- src/mame/machine/tigeroad.cpp | 57 +++++++++++-------------------------------- 1 file changed, 14 insertions(+), 43 deletions(-) (limited to 'src/mame/machine/tigeroad.cpp') diff --git a/src/mame/machine/tigeroad.cpp b/src/mame/machine/tigeroad.cpp index d433c60f52c..07bcd2fc3bd 100644 --- a/src/mame/machine/tigeroad.cpp +++ b/src/mame/machine/tigeroad.cpp @@ -133,19 +133,20 @@ READ16_MEMBER(pushman_state::mcu_comm_r) m_mcu_semaphore = false; return m_mcu_latch; case 2: // expects bit 0 to be high when MCU has accepted command (other bits ignored) - return m_host_semaphore ? 0x0000 : 0x0001; + return m_host_semaphore ? 0xfffe : 0xffff; case 3: // expects bit 0 to be low when MCU has sent response (other bits ignored) - return m_mcu_semaphore ? 0x0000 : 0x0001; + return m_mcu_semaphore ? 0xfffe : 0xffff; } logerror("unknown MCU read offset %X & %04X\n", offset, mem_mask); - return 0x0000; + return 0xffff; } -WRITE16_MEMBER(pushman_state::mcu_comm_w) +WRITE16_MEMBER(pushman_state::pushman_mcu_comm_w) { switch (offset & 0x01) { case 0: + data = flipendian_int16(data); COMBINE_DATA(&m_host_latch); break; case 1: @@ -156,6 +157,13 @@ WRITE16_MEMBER(pushman_state::mcu_comm_w) } } +WRITE16_MEMBER(pushman_state::bballs_mcu_comm_w) +{ + COMBINE_DATA(&m_host_latch); + m_host_semaphore = true; + m_mcu->set_input_line(M68705_IRQ_LINE, ASSERT_LINE); +} + WRITE8_MEMBER(pushman_state::mcu_pa_w) { m_mcu_output = (m_mcu_output & 0xff00) | (u16(data) & 0x00ff); @@ -177,8 +185,8 @@ WRITE8_MEMBER(pushman_state::mcu_pc_w) { m_host_semaphore = false; m_mcu->set_input_line(M68705_IRQ_LINE, CLEAR_LINE); - m_mcu->pa_w(space, 0, (m_host_latch >> 8) & 0x00ff); - m_mcu->pb_w(space, 0, (m_host_latch >> 0) & 0x00ff); + m_mcu->pa_w(space, 0, (m_host_latch >> 0) & 0x00ff); + m_mcu->pb_w(space, 0, (m_host_latch >> 8) & 0x00ff); } if (BIT(m_mcu_latch_ctl, 1) && !BIT(data, 1)) @@ -189,40 +197,3 @@ WRITE8_MEMBER(pushman_state::mcu_pc_w) m_mcu_latch_ctl = data; } - - -/* ElSemi - Bouncing balls protection. */ -READ16_MEMBER(bballs_state::bballs_68705_r) -{ - switch (offset) - { - case 0: // read and acknowledge MCU reply - if (!space.debugger_access()) - m_mcu_semaphore = false; - return m_mcu_latch; - case 2: // pretend MCU accepts command instantly - return 0x0001; - case 3: // expects bit 0 to be low when MCU has sent response (other bits ignored) - return m_mcu_semaphore ? 0x0000 : 0x0001; - } - logerror("unknown 68705 read offset %X & %04X\n", offset, mem_mask); - return 0x0000; -} - -WRITE16_MEMBER(bballs_state::bballs_68705_w) -{ - m_mcu_latch = 0; - if ((data >> 8) <= 0x0f) - { - m_mcu_latch = (data >> 6) & 0x03fc; - if (data & 0x00ff) - m_mcu_latch |= 2; - m_mcu_semaphore = true; - } - else if (data >> 8) - { - if (data & 0x00ff) - m_mcu_latch |= 2; - m_mcu_semaphore = true; - } -} -- cgit v1.2.3-70-g09d2