From 671e52155e82131b9cc70eea0edf6112d79f03da Mon Sep 17 00:00:00 2001 From: hap Date: Tue, 12 Nov 2024 16:30:34 +0100 Subject: [PATCH] system1: correct mcu t0 pin --- src/mame/sega/system1.cpp | 17 +++++++---------- src/mame/sega/system1.h | 2 +- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/src/mame/sega/system1.cpp b/src/mame/sega/system1.cpp index b2d228334b6..c2e5b93fd19 100644 --- a/src/mame/sega/system1.cpp +++ b/src/mame/sega/system1.cpp @@ -572,7 +572,7 @@ void system1_state::mcu_control_w(u8 data) { /* Bit 7 -> connects to TD62003 pins 5 & 6 @ IC151 - Bit 6 -> via PLS153, when high, asserts the BUSREQ signal, halting the Z80 + Bit 6 -> via PLS153, when high, asserts the BUSRQ signal, halting the Z80 Bit 5 -> n/c Bit 4 -> (with bit 3) Memory select: 0=Z80 program space, 1=banked ROM, 2=Z80 I/O space, 3=watchdog? Bit 3 -> @@ -635,16 +635,12 @@ u8 system1_state::mcu_io_r(offs_t offset) } -TIMER_DEVICE_CALLBACK_MEMBER(system1_state::mcu_t0_callback) +IRQ_CALLBACK_MEMBER(system1_state::mcu_t0_callback) { - /* The T0 line is clocked by something; if it is not clocked fast - enough, the MCU will fail; on shtngmst this happens after 3 - VBLANKs without a tick. - choplift is even more picky about it, affecting scroll speed - */ - m_mcu->set_input_line(MCS51_T0_LINE, ASSERT_LINE); m_mcu->set_input_line(MCS51_T0_LINE, CLEAR_LINE); + + return 0xff; } @@ -2524,11 +2520,12 @@ void system1_state::mcu(machine_config &config) config.set_maximum_quantum(attotime::from_hz(m_maincpu->clock() / 16)); - TIMER(config, "mcu_t0", 0).configure_periodic(FUNC(system1_state::mcu_t0_callback), attotime::from_usec(2500)); - // This interrupt is driven by pin 15 of a PAL16R4 (315-5138 on Choplifter), based on the vertical count. // The actual duty cycle likely differs from VBLANK, which is another output from the same PAL. m_screen->screen_vblank().set_inputline("mcu", MCS51_INT0_LINE); + + // bus controller INTACK pin clocks MCU T0 + m_maincpu->set_irq_acknowledge_callback(FUNC(system1_state::mcu_t0_callback)); } // alternate program map with RAM/collision swapped diff --git a/src/mame/sega/system1.h b/src/mame/sega/system1.h index 2d35e15b369..405dc6cc286 100644 --- a/src/mame/sega/system1.h +++ b/src/mame/sega/system1.h @@ -187,7 +187,7 @@ protected: // misc functions TIMER_DEVICE_CALLBACK_MEMBER(soundirq_gen); - TIMER_DEVICE_CALLBACK_MEMBER(mcu_t0_callback); + IRQ_CALLBACK_MEMBER(mcu_t0_callback); void bank44_custom_w(u8 data); void bank0c_custom_w(u8 data);