diff options
Diffstat (limited to 'src/mame/drivers/ambush.cpp')
-rw-r--r-- | src/mame/drivers/ambush.cpp | 36 |
1 files changed, 20 insertions, 16 deletions
diff --git a/src/mame/drivers/ambush.cpp b/src/mame/drivers/ambush.cpp index 542789e1389..2847574c749 100644 --- a/src/mame/drivers/ambush.cpp +++ b/src/mame/drivers/ambush.cpp @@ -72,6 +72,7 @@ public: m_color_bank(0) { } + void ambush_base(machine_config &config); void mariobl(machine_config &config); void ambush(machine_config &config); void dkong3abl(machine_config &config); @@ -690,21 +691,12 @@ WRITE8_MEMBER(ambush_state::output_latches_w) // MACHINE DEFINTIONS //************************************************************************** -MACHINE_CONFIG_START(ambush_state::ambush) +MACHINE_CONFIG_START(ambush_state::ambush_base) MCFG_DEVICE_ADD("maincpu", Z80, XTAL(18'432'000)/6) MCFG_DEVICE_PROGRAM_MAP(main_map) MCFG_DEVICE_IO_MAP(main_portmap) MCFG_DEVICE_VBLANK_INT_DRIVER("screen", ambush_state, irq0_line_hold) - // addressable latches at 8B and 8C - MCFG_DEVICE_ADD("outlatch1", LS259, 0) - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(*this, ambush_state, flip_screen_w)) - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE(*this, ambush_state, color_bank_1_w)) - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, ambush_state, coin_counter_1_w)) - MCFG_DEVICE_ADD("outlatch2", LS259, 0) - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE(*this, ambush_state, color_bank_2_w)) - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, ambush_state, coin_counter_2_w)) - MCFG_WATCHDOG_ADD("watchdog") MCFG_MACHINE_START_OVERRIDE(ambush_state, ambush) @@ -731,17 +723,29 @@ MACHINE_CONFIG_START(ambush_state::ambush) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.33) MACHINE_CONFIG_END +MACHINE_CONFIG_START(ambush_state::ambush) + ambush_base(config); + + // addressable latches at 8B and 8C + LS259(config, m_outlatch[0]); + m_outlatch[0]->q_out_cb<4>().set(FUNC(ambush_state::flip_screen_w)); + m_outlatch[0]->q_out_cb<5>().set(FUNC(ambush_state::color_bank_1_w)); + m_outlatch[0]->q_out_cb<7>().set(FUNC(ambush_state::coin_counter_1_w)); + + LS259(config, m_outlatch[1]); + m_outlatch[1]->q_out_cb<5>().set(FUNC(ambush_state::color_bank_2_w)); + m_outlatch[1]->q_out_cb<7>().set(FUNC(ambush_state::coin_counter_2_w)); +MACHINE_CONFIG_END + MACHINE_CONFIG_START(ambush_state::mariobl) - ambush(config); + ambush_base(config); MCFG_DEVICE_MODIFY("maincpu") MCFG_DEVICE_PROGRAM_MAP(bootleg_map) // To be verified: do these bootlegs only have one LS259? - MCFG_DEVICE_REMOVE("outlatch1") - MCFG_DEVICE_REMOVE("outlatch2") - MCFG_DEVICE_ADD("outlatch", LS259, 0) - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(*this, ambush_state, coin_counter_1_w)) - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(*this, ambush_state, color_bank_1_w)) + ls259_device &outlatch(LS259(config, "outlatch")); + outlatch.q_out_cb<4>().set(FUNC(ambush_state::coin_counter_1_w)); + outlatch.q_out_cb<6>().set(FUNC(ambush_state::color_bank_1_w)); MCFG_MACHINE_START_OVERRIDE(ambush_state, mariobl) |