From d5d598a1c021c19e992e5f4cd8f56aa8c697076e Mon Sep 17 00:00:00 2001 From: mooglyguy Date: Sat, 11 Aug 2018 15:00:54 +0200 Subject: -7200fifo, 7400, 7404, 74123, 74145, 74148, 74153, 74157, 74161, 74259: [Ryan Holtz] * Removed MCFG and old devcb macros. AJR, any breakage? nw --- src/devices/bus/einstein/pipe/speculator.cpp | 34 ++--- src/devices/bus/hexbus/hx5102.cpp | 34 ++--- src/devices/bus/ti99/peb/pcode.cpp | 6 +- src/devices/bus/ti99/peb/samsmem.cpp | 6 +- src/devices/bus/ti99/peb/ti_fdc.cpp | 18 +-- src/devices/bus/ti99/peb/ti_rs232.cpp | 18 +-- src/devices/machine/7200fifo.h | 32 ++--- src/devices/machine/7400.cpp | 28 +--- src/devices/machine/7400.h | 26 +--- src/devices/machine/7404.cpp | 32 +---- src/devices/machine/7404.h | 35 +---- src/devices/machine/74123.h | 31 +--- src/devices/machine/74145.cpp | 35 +---- src/devices/machine/74145.h | 70 +-------- src/devices/machine/74148.cpp | 5 +- src/devices/machine/74148.h | 14 +- src/devices/machine/74153.h | 17 +-- src/devices/machine/74157.h | 18 --- src/devices/machine/74161.h | 32 +---- src/devices/machine/74259.h | 24 ---- src/devices/machine/wozfdc.cpp | 9 +- src/devices/sound/es8712.cpp | 9 +- src/mame/audio/asteroid.cpp | 18 +-- src/mame/audio/avalnche.cpp | 19 ++- src/mame/audio/cinemat.cpp | 139 ++++++++---------- src/mame/audio/copsnrob.cpp | 31 ++-- src/mame/audio/sprint8.cpp | 33 ++--- src/mame/drivers/acrnsys1.cpp | 5 +- src/mame/drivers/alpha68k.cpp | 6 +- src/mame/drivers/ambush.cpp | 36 ++--- src/mame/drivers/apple2.cpp | 18 +-- src/mame/drivers/apricot.cpp | 6 +- src/mame/drivers/astrocde.cpp | 66 ++++----- src/mame/drivers/asuka.cpp | 8 +- src/mame/drivers/avalnche.cpp | 10 +- src/mame/drivers/bagman.cpp | 133 +++++++++-------- src/mame/drivers/balsente.cpp | 18 +-- src/mame/drivers/bigbord2.cpp | 4 +- src/mame/drivers/bsktball.cpp | 16 +-- src/mame/drivers/canyon.cpp | 14 +- src/mame/drivers/carpolo.cpp | 10 +- src/mame/drivers/cclimber.cpp | 16 +-- src/mame/drivers/cd2650.cpp | 6 +- src/mame/drivers/centiped.cpp | 54 ++++--- src/mame/drivers/champbas.cpp | 80 +++++------ src/mame/drivers/changela.cpp | 12 +- src/mame/drivers/cinemat.cpp | 12 +- src/mame/drivers/circusc.cpp | 14 +- src/mame/drivers/cortex.cpp | 16 +-- src/mame/drivers/crgolf.cpp | 12 +- src/mame/drivers/ddenlovr.cpp | 24 ++-- src/mame/drivers/dec0.cpp | 16 +-- src/mame/drivers/didact.cpp | 2 +- src/mame/drivers/discoboy.cpp | 4 +- src/mame/drivers/dynax.cpp | 8 +- src/mame/drivers/e100.cpp | 2 +- src/mame/drivers/equites.cpp | 18 +-- src/mame/drivers/et3400.cpp | 22 ++- src/mame/drivers/excali64.cpp | 16 +-- src/mame/drivers/fastfred.cpp | 30 ++-- src/mame/drivers/firetrap.cpp | 8 +- src/mame/drivers/flyball.cpp | 14 +- src/mame/drivers/freekick.cpp | 57 ++++---- src/mame/drivers/funkybee.cpp | 10 +- src/mame/drivers/gaelco2.cpp | 56 ++++---- src/mame/drivers/gaelco3d.cpp | 44 +++--- src/mame/drivers/gaiden.cpp | 8 +- src/mame/drivers/galaga.cpp | 4 +- src/mame/drivers/gauntlet.cpp | 14 +- src/mame/drivers/gladiatr.cpp | 26 ++-- src/mame/drivers/glass.cpp | 12 +- src/mame/drivers/gomoku.cpp | 8 +- src/mame/drivers/gridlee.cpp | 10 +- src/mame/drivers/gyruss.cpp | 10 +- src/mame/drivers/hnayayoi.cpp | 30 ++-- src/mame/drivers/hp64k.cpp | 100 ++++++------- src/mame/drivers/hyperspt.cpp | 16 +-- src/mame/drivers/inder.cpp | 4 +- src/mame/drivers/jackpool.cpp | 40 +++--- src/mame/drivers/jedi.cpp | 16 +-- src/mame/drivers/joctronic.cpp | 24 ++-- src/mame/drivers/jp.cpp | 7 +- src/mame/drivers/jpmmps.cpp | 18 +-- src/mame/drivers/jpms80.cpp | 32 ++--- src/mame/drivers/jrpacman.cpp | 24 ++-- src/mame/drivers/junofrst.cpp | 14 +- src/mame/drivers/kchamp.cpp | 18 +-- src/mame/drivers/ladybug.cpp | 4 +- src/mame/drivers/looping.cpp | 30 ++-- src/mame/drivers/m10.cpp | 33 ++--- src/mame/drivers/m63.cpp | 20 +-- src/mame/drivers/marineb.cpp | 27 ++-- src/mame/drivers/mario.cpp | 18 +-- src/mame/drivers/mastboy.cpp | 12 +- src/mame/drivers/maygay1b.cpp | 16 +-- src/mame/drivers/mcr3.cpp | 18 +-- src/mame/drivers/megazone.cpp | 10 +- src/mame/drivers/mephisto.cpp | 16 +-- src/mame/drivers/mermaid.cpp | 33 ++--- src/mame/drivers/mikie.cpp | 14 +- src/mame/drivers/mirax.cpp | 12 +- src/mame/drivers/mitchell.cpp | 4 +- src/mame/drivers/mjsister.cpp | 28 ++-- src/mame/drivers/mouser.cpp | 8 +- src/mame/drivers/mrgame.cpp | 21 +-- src/mame/drivers/munchmo.cpp | 16 +-- src/mame/drivers/mz700.cpp | 2 +- src/mame/drivers/nemesis.cpp | 90 ++++++------ src/mame/drivers/neogeo.cpp | 20 ++- src/mame/drivers/nyny.cpp | 16 +-- src/mame/drivers/orbit.cpp | 10 +- src/mame/drivers/pacman.cpp | 182 ++++++++++++----------- src/mame/drivers/pengo.cpp | 34 ++--- src/mame/drivers/pitnrun.cpp | 14 +- src/mame/drivers/polgar.cpp | 14 +- src/mame/drivers/pooyan.cpp | 16 +-- src/mame/drivers/pturn.cpp | 16 +-- src/mame/drivers/punchout.cpp | 18 +-- src/mame/drivers/r2dtank.cpp | 16 +-- src/mame/drivers/rallyx.cpp | 36 ++--- src/mame/drivers/rastan.cpp | 4 +- src/mame/drivers/retofinv.cpp | 21 ++- src/mame/drivers/rocnrope.cpp | 14 +- src/mame/drivers/rollrace.cpp | 16 +-- src/mame/drivers/sauro.cpp | 30 ++-- src/mame/drivers/sbasketb.cpp | 16 +-- src/mame/drivers/seibuspi.cpp | 4 +- src/mame/drivers/shangkid.cpp | 8 +- src/mame/drivers/skyarmy.cpp | 12 +- src/mame/drivers/skydiver.cpp | 50 +++---- src/mame/drivers/slapfght.cpp | 28 ++-- src/mame/drivers/slicer.cpp | 18 +-- src/mame/drivers/sonson.cpp | 10 +- src/mame/drivers/spcforce.cpp | 23 ++- src/mame/drivers/spiders.cpp | 16 +-- src/mame/drivers/spinb.cpp | 8 +- src/mame/drivers/splash.cpp | 10 +- src/mame/drivers/sprint2.cpp | 24 ++-- src/mame/drivers/sprint4.cpp | 18 +-- src/mame/drivers/stactics.cpp | 48 +++---- src/mame/drivers/starshp1.cpp | 34 ++--- src/mame/drivers/stuntair.cpp | 18 +-- src/mame/drivers/sub.cpp | 10 +- src/mame/drivers/sym1.cpp | 14 +- src/mame/drivers/system16.cpp | 4 +- src/mame/drivers/taito_l.cpp | 206 +++++++++++++-------------- src/mame/drivers/tankbatt.cpp | 28 ++-- src/mame/drivers/targeth.cpp | 6 +- src/mame/drivers/thepit.cpp | 30 ++-- src/mame/drivers/thoop2.cpp | 14 +- src/mame/drivers/timeplt.cpp | 27 ++-- src/mame/drivers/toaplan1.cpp | 10 +- src/mame/drivers/tp84.cpp | 12 +- src/mame/drivers/trackfld.cpp | 55 ++++--- src/mame/drivers/tsamurai.cpp | 38 ++--- src/mame/drivers/tti.cpp | 8 +- src/mame/drivers/tubep.cpp | 22 +-- src/mame/drivers/turbo.cpp | 8 +- src/mame/drivers/tutankhm.cpp | 18 +-- src/mame/drivers/twincobr.cpp | 38 +++-- src/mame/drivers/ultratnk.cpp | 12 +- src/mame/drivers/unixpc.cpp | 12 +- src/mame/drivers/vertigo.cpp | 4 +- src/mame/drivers/wardner.cpp | 26 ++-- src/mame/drivers/warpwarp.cpp | 53 ++++--- src/mame/drivers/williams.cpp | 49 ++++--- src/mame/drivers/wink.cpp | 18 +-- src/mame/drivers/wrally.cpp | 18 +-- src/mame/drivers/xorworld.cpp | 8 +- src/mame/drivers/xtheball.cpp | 12 +- src/mame/drivers/yunsung8.cpp | 4 +- src/mame/drivers/zaccaria.cpp | 12 +- src/mame/drivers/zaxxon.cpp | 45 +++--- src/mame/drivers/zn.cpp | 6 +- src/mame/includes/avalnche.h | 9 +- src/mame/includes/bagman.h | 3 + src/mame/includes/carpolo.h | 2 +- src/mame/includes/centiped.h | 3 + src/mame/includes/champbas.h | 3 + src/mame/includes/fastfred.h | 16 ++- src/mame/includes/freekick.h | 3 + src/mame/includes/hnayayoi.h | 3 + src/mame/includes/marineb.h | 5 +- src/mame/includes/mermaid.h | 5 +- src/mame/includes/neogeo.h | 3 + src/mame/includes/pacman.h | 5 +- src/mame/includes/retofinv.h | 6 +- src/mame/includes/sauro.h | 3 + src/mame/includes/spcforce.h | 3 + src/mame/includes/taito_l.h | 3 + src/mame/includes/thepit.h | 3 + src/mame/includes/trackfld.h | 3 + src/mame/includes/twincobr.h | 7 +- src/mame/includes/vertigo.h | 2 +- src/mame/includes/warpwarp.h | 3 + src/mame/includes/williams.h | 21 ++- src/mame/machine/carpolo.cpp | 2 +- src/mame/machine/vertigo.cpp | 4 +- 198 files changed, 2008 insertions(+), 2304 deletions(-) (limited to 'src') diff --git a/src/devices/bus/einstein/pipe/speculator.cpp b/src/devices/bus/einstein/pipe/speculator.cpp index 50f3458b947..75519847e16 100644 --- a/src/devices/bus/einstein/pipe/speculator.cpp +++ b/src/devices/bus/einstein/pipe/speculator.cpp @@ -26,23 +26,23 @@ DEFINE_DEVICE_TYPE(EINSTEIN_SPECULATOR, einstein_speculator_device, "einstein_sp //------------------------------------------------- MACHINE_CONFIG_START(einstein_speculator_device::device_add_mconfig) - MCFG_DEVICE_ADD("ic5a", TTL74123, 0) - MCFG_TTL74123_CONNECTION_TYPE(TTL74123_NOT_GROUNDED_NO_DIODE) - MCFG_TTL74123_RESISTOR_VALUE(RES_K(47)) - MCFG_TTL74123_CAPACITOR_VALUE(CAP_P(560)) - MCFG_TTL74123_A_PIN_VALUE(1) - MCFG_TTL74123_B_PIN_VALUE(1) - MCFG_TTL74123_CLEAR_PIN_VALUE(0) - MCFG_TTL74123_OUTPUT_CHANGED_CB(WRITELINE(*this, einstein_speculator_device, ic5a_q_w)) - - MCFG_DEVICE_ADD("ic5b", TTL74123, 0) - MCFG_TTL74123_CONNECTION_TYPE(TTL74123_NOT_GROUNDED_NO_DIODE) - MCFG_TTL74123_RESISTOR_VALUE(RES_K(47)) - MCFG_TTL74123_CAPACITOR_VALUE(CAP_P(560)) - MCFG_TTL74123_A_PIN_VALUE(1) - MCFG_TTL74123_B_PIN_VALUE(1) - MCFG_TTL74123_CLEAR_PIN_VALUE(0) - MCFG_TTL74123_OUTPUT_CHANGED_CB(WRITELINE(*this, einstein_speculator_device, ic5b_q_w)) + TTL74123(config, m_ic5a, 0); + m_ic5a->set_connection_type(TTL74123_NOT_GROUNDED_NO_DIODE); + m_ic5a->set_resistor_value(RES_K(47)); + m_ic5a->set_capacitor_value(CAP_P(560)); + m_ic5a->set_a_pin_value(1); + m_ic5a->set_b_pin_value(1); + m_ic5a->set_clear_pin_value(0); + m_ic5a->out_cb().set(FUNC(einstein_speculator_device::ic5a_q_w)); + + TTL74123(config, m_ic5b, 0); + m_ic5b->set_connection_type(TTL74123_NOT_GROUNDED_NO_DIODE); + m_ic5b->set_resistor_value(RES_K(47)); + m_ic5b->set_capacitor_value(CAP_P(560)); + m_ic5b->set_a_pin_value(1); + m_ic5b->set_b_pin_value(1); + m_ic5b->set_clear_pin_value(0); + m_ic5b->out_cb().set(FUNC(einstein_speculator_device::ic5b_q_w)); SPEAKER(config, "mono").front_center(); WAVE(config, "wave", m_cassette).add_route(ALL_OUTPUTS, "mono", 0.25); diff --git a/src/devices/bus/hexbus/hx5102.cpp b/src/devices/bus/hexbus/hx5102.cpp index 5aa2eb7a81b..f5d91e9b62d 100644 --- a/src/devices/bus/hexbus/hx5102.cpp +++ b/src/devices/bus/hexbus/hx5102.cpp @@ -695,23 +695,23 @@ MACHINE_CONFIG_START(hx5102_device::device_add_mconfig) MCFG_FLOPPY_DRIVE_SOUND(true) // Monoflops - MCFG_DEVICE_ADD(MTRD_TAG, TTL74123, 0) - MCFG_TTL74123_CONNECTION_TYPE(TTL74123_GROUNDED) - MCFG_TTL74123_RESISTOR_VALUE(RES_K(200)) - MCFG_TTL74123_CAPACITOR_VALUE(CAP_U(47)) - MCFG_TTL74123_A_PIN_VALUE(0) - MCFG_TTL74123_B_PIN_VALUE(1) - MCFG_TTL74123_CLEAR_PIN_VALUE(1) - MCFG_TTL74123_OUTPUT_CHANGED_CB(WRITELINE(*this, hx5102_device, motor_w)) - - MCFG_DEVICE_ADD(MTSPD_TAG, TTL74123, 0) - MCFG_TTL74123_CONNECTION_TYPE(TTL74123_GROUNDED) - MCFG_TTL74123_RESISTOR_VALUE(RES_K(200)) - MCFG_TTL74123_CAPACITOR_VALUE(CAP_U(10)) - MCFG_TTL74123_A_PIN_VALUE(0) - MCFG_TTL74123_B_PIN_VALUE(1) - MCFG_TTL74123_CLEAR_PIN_VALUE(1) - MCFG_TTL74123_OUTPUT_CHANGED_CB(WRITELINE(*this, hx5102_device, mspeed_w)) + TTL74123(config, m_motormf, 0); + m_motormf->set_connection_type(TTL74123_GROUNDED); + m_motormf->set_resistor_value(RES_K(200)); + m_motormf->set_capacitor_value(CAP_U(47)); + m_motormf->set_a_pin_value(0); + m_motormf->set_b_pin_value(1); + m_motormf->set_clear_pin_value(1); + m_motormf->out_cb().set(FUNC(hx5102_device::motor_w)); + + TTL74123(config, m_speedmf, 0); + m_speedmf->set_connection_type(TTL74123_GROUNDED); + m_speedmf->set_resistor_value(RES_K(200)); + m_speedmf->set_capacitor_value(CAP_U(10)); + m_speedmf->set_a_pin_value(0); + m_speedmf->set_b_pin_value(1); + m_speedmf->set_clear_pin_value(1); + m_speedmf->out_cb().set(FUNC(hx5102_device::mspeed_w)); // READY flipflop MCFG_DEVICE_ADD(READYFF_TAG, TTL7474, 0) diff --git a/src/devices/bus/ti99/peb/pcode.cpp b/src/devices/bus/ti99/peb/pcode.cpp index 1d13b16e7b5..3d7fc69400f 100644 --- a/src/devices/bus/ti99/peb/pcode.cpp +++ b/src/devices/bus/ti99/peb/pcode.cpp @@ -418,9 +418,9 @@ MACHINE_CONFIG_START(ti_pcode_card_device::device_add_mconfig) m_grom7->ready_cb().set(FUNC(ti_pcode_card_device::ready_line)); m_grom7->set_region_and_ident(PCODE_GROM_TAG, 0xe000, 7); - MCFG_DEVICE_ADD("crulatch", LS259, 0) // U12 - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, ti_pcode_card_device, pcpage_w)) - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(*this, ti_pcode_card_device, ekrpg_w)) + LS259(config, m_crulatch); // U12 + m_crulatch->q_out_cb<0>().set(FUNC(ti_pcode_card_device::pcpage_w)); + m_crulatch->q_out_cb<4>().set(FUNC(ti_pcode_card_device::ekrpg_w)); MACHINE_CONFIG_END const tiny_rom_entry *ti_pcode_card_device::device_rom_region() const diff --git a/src/devices/bus/ti99/peb/samsmem.cpp b/src/devices/bus/ti99/peb/samsmem.cpp index 290ad9f20e2..a79cf069d2c 100644 --- a/src/devices/bus/ti99/peb/samsmem.cpp +++ b/src/devices/bus/ti99/peb/samsmem.cpp @@ -125,9 +125,9 @@ MACHINE_CONFIG_START(sams_memory_expansion_device::device_add_mconfig) MCFG_RAM_DEFAULT_SIZE("1M") MCFG_RAM_DEFAULT_VALUE(0) - MCFG_DEVICE_ADD("crulatch", LS259, 0) // U8 - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, sams_memory_expansion_device, access_mapper_w)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, sams_memory_expansion_device, map_mode_w)) + LS259(config, m_crulatch); // U8 + m_crulatch->q_out_cb<0>().set(FUNC(sams_memory_expansion_device::access_mapper_w)); + m_crulatch->q_out_cb<1>().set(FUNC(sams_memory_expansion_device::map_mode_w)); MACHINE_CONFIG_END void sams_memory_expansion_device::device_start() diff --git a/src/devices/bus/ti99/peb/ti_fdc.cpp b/src/devices/bus/ti99/peb/ti_fdc.cpp index 587e4a739f1..472a5d5d881 100644 --- a/src/devices/bus/ti99/peb/ti_fdc.cpp +++ b/src/devices/bus/ti99/peb/ti_fdc.cpp @@ -431,15 +431,15 @@ MACHINE_CONFIG_START(ti_fdc_device::device_add_mconfig) MCFG_FLOPPY_DRIVE_ADD("2", tifdc_floppies, nullptr, ti_fdc_device::floppy_formats) MCFG_FLOPPY_DRIVE_SOUND(true) - MCFG_DEVICE_ADD("crulatch", LS259, 0) // U23 - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, ti_fdc_device, dskpgena_w)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, ti_fdc_device, kaclk_w)) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, ti_fdc_device, waiten_w)) - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, ti_fdc_device, hlt_w)) - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(*this, ti_fdc_device, dsel_w)) - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE(*this, ti_fdc_device, dsel_w)) - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(*this, ti_fdc_device, dsel_w)) - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, ti_fdc_device, sidsel_w)) + LS259(config, m_crulatch); // U23 + m_crulatch->q_out_cb<0>().set(FUNC(ti_fdc_device::dskpgena_w)); + m_crulatch->q_out_cb<1>().set(FUNC(ti_fdc_device::kaclk_w)); + m_crulatch->q_out_cb<2>().set(FUNC(ti_fdc_device::waiten_w)); + m_crulatch->q_out_cb<3>().set(FUNC(ti_fdc_device::hlt_w)); + m_crulatch->q_out_cb<4>().set(FUNC(ti_fdc_device::dsel_w)); + m_crulatch->q_out_cb<5>().set(FUNC(ti_fdc_device::dsel_w)); + m_crulatch->q_out_cb<6>().set(FUNC(ti_fdc_device::dsel_w)); + m_crulatch->q_out_cb<7>().set(FUNC(ti_fdc_device::sidsel_w)); MACHINE_CONFIG_END const tiny_rom_entry *ti_fdc_device::device_rom_region() const diff --git a/src/devices/bus/ti99/peb/ti_rs232.cpp b/src/devices/bus/ti99/peb/ti_rs232.cpp index fde50e1dc0d..4863c9f875f 100644 --- a/src/devices/bus/ti99/peb/ti_rs232.cpp +++ b/src/devices/bus/ti99/peb/ti_rs232.cpp @@ -1162,15 +1162,15 @@ MACHINE_CONFIG_START(ti_rs232_pio_device::device_add_mconfig) MCFG_DEVICE_ADD("serdev1", TI99_RS232_DEV, 0) MCFG_DEVICE_ADD("piodev", TI99_PIO_DEV, 0) - MCFG_DEVICE_ADD("crulatch", LS259, 0) // U12 - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, ti_rs232_pio_device, selected_w)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, ti_rs232_pio_device, pio_direction_in_w)) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, ti_rs232_pio_device, pio_handshake_out_w)) - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, ti_rs232_pio_device, pio_spareout_w)) - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(*this, ti_rs232_pio_device, flag0_w)) - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE(*this, ti_rs232_pio_device, cts0_w)) - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(*this, ti_rs232_pio_device, cts1_w)) - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, ti_rs232_pio_device, led_w)) + LS259(config, m_crulatch); // U12 + m_crulatch->q_out_cb<0>().set(FUNC(ti_rs232_pio_device::selected_w)); + m_crulatch->q_out_cb<1>().set(FUNC(ti_rs232_pio_device::pio_direction_in_w)); + m_crulatch->q_out_cb<2>().set(FUNC(ti_rs232_pio_device::pio_handshake_out_w)); + m_crulatch->q_out_cb<3>().set(FUNC(ti_rs232_pio_device::pio_spareout_w)); + m_crulatch->q_out_cb<4>().set(FUNC(ti_rs232_pio_device::flag0_w)); + m_crulatch->q_out_cb<5>().set(FUNC(ti_rs232_pio_device::cts0_w)); + m_crulatch->q_out_cb<6>().set(FUNC(ti_rs232_pio_device::cts1_w)); + m_crulatch->q_out_cb<7>().set(FUNC(ti_rs232_pio_device::led_w)); MACHINE_CONFIG_END const tiny_rom_entry *ti_rs232_pio_device::device_rom_region() const diff --git a/src/devices/machine/7200fifo.h b/src/devices/machine/7200fifo.h index 642932691c0..2311584d63a 100644 --- a/src/devices/machine/7200fifo.h +++ b/src/devices/machine/7200fifo.h @@ -52,25 +52,6 @@ The following chips are functionally equivalent and pin-compatible. -//************************************************************************** -// INTERFACE CONFIGURATION MACROS -//************************************************************************** - -#define MCFG_FIFO7200_ADD(_tag, _ramsize) \ - MCFG_DEVICE_ADD(_tag, FIFO7200, 0) \ - downcast(*device).set_ram_size(_ramsize); - -#define MCFG_FIFO7200_EF_HANDLER(_devcb) \ - downcast(*device).set_ef_handler(DEVCB_##_devcb); - -#define MCFG_FIFO7200_FF_HANDLER(_devcb) \ - downcast(*device).set_ff_handler(DEVCB_##_devcb); - -#define MCFG_FIFO7200_HF_HANDLER(_devcb) \ - downcast(*device).set_hf_handler(DEVCB_##_devcb); - - - //************************************************************************** // TYPE DEFINITIONS //************************************************************************** @@ -80,12 +61,17 @@ The following chips are functionally equivalent and pin-compatible. class fifo7200_device : public device_t { public: + fifo7200_device(const machine_config &mconfig, const char *tag, device_t *owner, int size) + : fifo7200_device(mconfig, tag, owner, (uint32_t)0) + { + set_ram_size(size); + } + fifo7200_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - // static configuration helpers - template devcb_base &set_ef_handler(Object &&cb) { return m_ef_handler.set_callback(std::forward(cb)); } - template devcb_base &set_ff_handler(Object &&cb) { return m_ff_handler.set_callback(std::forward(cb)); } - template devcb_base &set_hf_handler(Object &&cb) { return m_hf_handler.set_callback(std::forward(cb)); } + auto ef_handler() { return m_ef_handler.bind(); } + auto ff_handler() { return m_ff_handler.bind(); } + auto hf_handler() { return m_hf_handler.bind(); } void set_ram_size(int size) { m_ram_size = size; } DECLARE_READ_LINE_MEMBER( ef_r ) { return !m_ef; } // _EF diff --git a/src/devices/machine/7400.cpp b/src/devices/machine/7400.cpp index 595ce09ac32..a7c4e1528b4 100644 --- a/src/devices/machine/7400.cpp +++ b/src/devices/machine/7400.cpp @@ -13,10 +13,7 @@ DEFINE_DEVICE_TYPE(TTL7400, ttl7400_device, "7400", "7400 Quad 2-Input NAND Gate ttl7400_device::ttl7400_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, TTL7400, tag, owner, clock) - , m_y1_func(*this) - , m_y2_func(*this) - , m_y3_func(*this) - , m_y4_func(*this) + , m_y_func{{*this}, {*this}, {*this}, {*this}} , m_a(0) , m_b(0) , m_y(0) @@ -25,24 +22,15 @@ ttl7400_device::ttl7400_device(const machine_config &mconfig, const char *tag, d void ttl7400_device::device_start() { - init(); - save_item(NAME(m_a)); save_item(NAME(m_b)); save_item(NAME(m_y)); - m_y1_func.resolve_safe(); - m_y2_func.resolve_safe(); - m_y3_func.resolve_safe(); - m_y4_func.resolve_safe(); + for (std::size_t bit = 0; bit < 4; bit++) + m_y_func[bit].resolve_safe(); } void ttl7400_device::device_reset() -{ - init(); -} - -void ttl7400_device::init() { m_a = 0; m_b = 0; @@ -57,18 +45,12 @@ void ttl7400_device::update() if (m_y != last_y) { - for (int bit = 0; bit < 4; bit++) + for (std::size_t bit = 0; bit < 4; bit++) { if (BIT(m_y, bit) == BIT(last_y, bit)) continue; - switch(bit) - { - case 0: m_y1_func(BIT(m_y, bit)); break; - case 1: m_y2_func(BIT(m_y, bit)); break; - case 2: m_y3_func(BIT(m_y, bit)); break; - case 3: m_y4_func(BIT(m_y, bit)); break; - } + m_y_func[bit](BIT(m_y, bit)); } } } diff --git a/src/devices/machine/7400.h b/src/devices/machine/7400.h index a96c02bcf87..40ac9280cd3 100644 --- a/src/devices/machine/7400.h +++ b/src/devices/machine/7400.h @@ -33,31 +33,13 @@ #pragma once - -#define MCFG_7400_Y1_CB(_devcb) \ - downcast(*device).set_y1_cb(DEVCB_##_devcb); - -#define MCFG_7400_Y2_CB(_devcb) \ - downcast(*device).set_y2_cb(DEVCB_##_devcb); - -#define MCFG_7400_Y3_CB(_devcb) \ - downcast(*device).set_y3_cb(DEVCB_##_devcb); - -#define MCFG_7400_Y4_CB(_devcb) \ - downcast(*device).set_y4_cb(DEVCB_##_devcb); - - class ttl7400_device : public device_t { public: // construction/destruction ttl7400_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); - // static configuration helpers - template devcb_base &set_y1_cb(Object &&cb) { return m_y1_func.set_callback(std::forward(cb)); } - template devcb_base &set_y2_cb(Object &&cb) { return m_y2_func.set_callback(std::forward(cb)); } - template devcb_base &set_y3_cb(Object &&cb) { return m_y3_func.set_callback(std::forward(cb)); } - template devcb_base &set_y4_cb(Object &&cb) { return m_y4_func.set_callback(std::forward(cb)); } + template auto y_cb() { return m_y_func[Bit].bind(); } // public interfaces DECLARE_WRITE_LINE_MEMBER( a1_w ); @@ -84,14 +66,10 @@ protected: virtual void device_reset() override; private: - void init(); void update(); // callbacks - devcb_write_line m_y1_func; - devcb_write_line m_y2_func; - devcb_write_line m_y3_func; - devcb_write_line m_y4_func; + devcb_write_line m_y_func[4]; // inputs uint8_t m_a; // pins 1,4,9,12 diff --git a/src/devices/machine/7404.cpp b/src/devices/machine/7404.cpp index 1c056c4ccc0..c252823ade6 100644 --- a/src/devices/machine/7404.cpp +++ b/src/devices/machine/7404.cpp @@ -13,12 +13,7 @@ DEFINE_DEVICE_TYPE(TTL7404, ttl7404_device, "7404", "5/7404 Hex Inverters") ttl7404_device::ttl7404_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, TTL7404, tag, owner, clock) - , m_y1_func(*this) - , m_y2_func(*this) - , m_y3_func(*this) - , m_y4_func(*this) - , m_y5_func(*this) - , m_y6_func(*this) + , m_y_func{{*this}, {*this}, {*this}, {*this}, {*this}, {*this}} , m_a(0) , m_y(0x3f) { @@ -26,25 +21,14 @@ ttl7404_device::ttl7404_device(const machine_config &mconfig, const char *tag, d void ttl7404_device::device_start() { - init(); - save_item(NAME(m_a)); save_item(NAME(m_y)); - m_y1_func.resolve_safe(); - m_y2_func.resolve_safe(); - m_y3_func.resolve_safe(); - m_y4_func.resolve_safe(); - m_y5_func.resolve_safe(); - m_y6_func.resolve_safe(); + for (std::size_t bit = 0; bit < 6; bit++) + m_y_func[bit].resolve_safe(); } void ttl7404_device::device_reset() -{ - init(); -} - -void ttl7404_device::init() { m_a = 0; m_y = 0x3f; @@ -63,15 +47,7 @@ void ttl7404_device::update() if (BIT(m_y, bit) == BIT(last_y, bit)) continue; - switch(bit) - { - case 0: m_y1_func(BIT(m_y, bit)); break; - case 1: m_y2_func(BIT(m_y, bit)); break; - case 2: m_y3_func(BIT(m_y, bit)); break; - case 3: m_y4_func(BIT(m_y, bit)); break; - case 4: m_y5_func(BIT(m_y, bit)); break; - case 5: m_y6_func(BIT(m_y, bit)); break; - } + m_y_func[bit](BIT(m_y, bit)); } } } diff --git a/src/devices/machine/7404.h b/src/devices/machine/7404.h index 4d767fbfed4..04f5f981065 100644 --- a/src/devices/machine/7404.h +++ b/src/devices/machine/7404.h @@ -60,38 +60,13 @@ #pragma once - -#define MCFG_7404_Y1_CB(_devcb) \ - downcast(*device).set_y1_cb(DEVCB_##_devcb); - -#define MCFG_7404_Y2_CB(_devcb) \ - downcast(*device).set_y2_cb(DEVCB_##_devcb); - -#define MCFG_7404_Y3_CB(_devcb) \ - downcast(*device).set_y3_cb(DEVCB_##_devcb); - -#define MCFG_7404_Y4_CB(_devcb) \ - downcast(*device).set_y4_cb(DEVCB_##_devcb); - -#define MCFG_7404_Y5_CB(_devcb) \ - downcast(*device).set_y5_cb(DEVCB_##_devcb); - -#define MCFG_7404_Y6_CB(_devcb) \ - downcast(*device).set_y6_cb(DEVCB_##_devcb); - class ttl7404_device : public device_t { public: // construction/destruction ttl7404_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); - // static configuration helpers - template devcb_base &set_y1_cb(Object &&cb) { return m_y1_func.set_callback(std::forward(cb)); } - template devcb_base &set_y2_cb(Object &&cb) { return m_y2_func.set_callback(std::forward(cb)); } - template devcb_base &set_y3_cb(Object &&cb) { return m_y3_func.set_callback(std::forward(cb)); } - template devcb_base &set_y4_cb(Object &&cb) { return m_y4_func.set_callback(std::forward(cb)); } - template devcb_base &set_y5_cb(Object &&cb) { return m_y5_func.set_callback(std::forward(cb)); } - template devcb_base &set_y6_cb(Object &&cb) { return m_y6_func.set_callback(std::forward(cb)); } + template auto y_cb() { return m_y_func[Bit].bind(); } // public interfaces DECLARE_WRITE_LINE_MEMBER( a1_w ); @@ -117,16 +92,10 @@ protected: virtual void device_reset() override; private: - void init(); void update(); // callbacks - devcb_write_line m_y1_func; - devcb_write_line m_y2_func; - devcb_write_line m_y3_func; - devcb_write_line m_y4_func; - devcb_write_line m_y5_func; - devcb_write_line m_y6_func; + devcb_write_line m_y_func[6]; // inputs uint8_t m_a; // pins 1,3,5,9,11,13 diff --git a/src/devices/machine/74123.h b/src/devices/machine/74123.h index b5f0fc7e15b..f1f94f035c7 100644 --- a/src/devices/machine/74123.h +++ b/src/devices/machine/74123.h @@ -50,34 +50,6 @@ #pragma once - - - -/*************************************************************************** - DEVICE CONFIGURATION MACROS -***************************************************************************/ - -#define MCFG_TTL74123_CONNECTION_TYPE(_ctype) \ - downcast(*device).set_connection_type(_ctype); - -#define MCFG_TTL74123_RESISTOR_VALUE(_value) \ - downcast(*device).set_resistor_value(_value); - -#define MCFG_TTL74123_CAPACITOR_VALUE(_value) \ - downcast(*device).set_capacitor_value(_value); - -#define MCFG_TTL74123_A_PIN_VALUE(_value) \ - downcast(*device).set_a_pin_value(_value); - -#define MCFG_TTL74123_B_PIN_VALUE(_value) \ - downcast(*device).set_b_pin_value(_value); - -#define MCFG_TTL74123_CLEAR_PIN_VALUE(_value) \ - downcast(*device).set_clear_pin_value(_value); - -#define MCFG_TTL74123_OUTPUT_CHANGED_CB(_devcb) \ - downcast(*device).set_output_changed_callback(DEVCB_##_devcb); - /* constants for the different ways the cap/res can be connected. This determines the formula for calculating the pulse width */ #define TTL74123_NOT_GROUNDED_NO_DIODE (1) @@ -103,7 +75,8 @@ public: void set_a_pin_value(int value) { m_a = value; } void set_b_pin_value(int value) { m_b = value; } void set_clear_pin_value(int value) { m_clear = value; } - template devcb_base &set_output_changed_callback(Object &&cb) { return m_output_changed_cb.set_callback(std::forward(cb)); } + + auto out_cb() { return m_output_changed_cb.bind(); } DECLARE_WRITE_LINE_MEMBER(a_w); DECLARE_WRITE_LINE_MEMBER(b_w); diff --git a/src/devices/machine/74145.cpp b/src/devices/machine/74145.cpp index e6fdd674f97..e2ffeedf9f4 100644 --- a/src/devices/machine/74145.cpp +++ b/src/devices/machine/74145.cpp @@ -61,16 +61,7 @@ DEFINE_DEVICE_TYPE(TTL74145, ttl74145_device, "ttl74145", "TTL74145") ttl74145_device::ttl74145_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, TTL74145, tag, owner, clock) - , m_output_line_0_cb(*this) - , m_output_line_1_cb(*this) - , m_output_line_2_cb(*this) - , m_output_line_3_cb(*this) - , m_output_line_4_cb(*this) - , m_output_line_5_cb(*this) - , m_output_line_6_cb(*this) - , m_output_line_7_cb(*this) - , m_output_line_8_cb(*this) - , m_output_line_9_cb(*this) + , m_output_line_cb{{*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}} , m_number(0) { } @@ -83,16 +74,8 @@ ttl74145_device::ttl74145_device(const machine_config &mconfig, const char *tag, void ttl74145_device::device_start() { /* resolve callbacks */ - m_output_line_0_cb.resolve_safe(); - m_output_line_1_cb.resolve_safe(); - m_output_line_2_cb.resolve_safe(); - m_output_line_3_cb.resolve_safe(); - m_output_line_4_cb.resolve_safe(); - m_output_line_5_cb.resolve_safe(); - m_output_line_6_cb.resolve_safe(); - m_output_line_7_cb.resolve_safe(); - m_output_line_8_cb.resolve_safe(); - m_output_line_9_cb.resolve_safe(); + for (std::size_t bit = 0; bit < 10; bit++) + m_output_line_cb[bit].resolve_safe(); // register for state saving save_item(NAME(m_number)); @@ -119,16 +102,8 @@ void ttl74145_device::write(uint8_t data) /* call output callbacks if the number changed */ if (new_number != m_number) { - m_output_line_0_cb(new_number == 0); - m_output_line_1_cb(new_number == 1); - m_output_line_2_cb(new_number == 2); - m_output_line_3_cb(new_number == 3); - m_output_line_4_cb(new_number == 4); - m_output_line_5_cb(new_number == 5); - m_output_line_6_cb(new_number == 6); - m_output_line_7_cb(new_number == 7); - m_output_line_8_cb(new_number == 8); - m_output_line_9_cb(new_number == 9); + for (std::size_t bit = 0; bit < 10; bit++) + m_output_line_cb[bit](new_number == bit); } /* update state */ diff --git a/src/devices/machine/74145.h b/src/devices/machine/74145.h index 642ffbe29c7..f13bef15706 100644 --- a/src/devices/machine/74145.h +++ b/src/devices/machine/74145.h @@ -14,39 +14,6 @@ #pragma once -//************************************************************************** -// INTERFACE CONFIGURATION MACROS -//************************************************************************** -#define MCFG_TTL74145_OUTPUT_LINE_0_CB(_devcb) \ - downcast(*device).set_output_line_0_callback(DEVCB_##_devcb); - -#define MCFG_TTL74145_OUTPUT_LINE_1_CB(_devcb) \ - downcast(*device).set_output_line_1_callback(DEVCB_##_devcb); - -#define MCFG_TTL74145_OUTPUT_LINE_2_CB(_devcb) \ - downcast(*device).set_output_line_2_callback(DEVCB_##_devcb); - -#define MCFG_TTL74145_OUTPUT_LINE_3_CB(_devcb) \ - downcast(*device).set_output_line_3_callback(DEVCB_##_devcb); - -#define MCFG_TTL74145_OUTPUT_LINE_4_CB(_devcb) \ - downcast(*device).set_output_line_4_callback(DEVCB_##_devcb); - -#define MCFG_TTL74145_OUTPUT_LINE_5_CB(_devcb) \ - downcast(*device).set_output_line_5_callback(DEVCB_##_devcb); - -#define MCFG_TTL74145_OUTPUT_LINE_6_CB(_devcb) \ - downcast(*device).set_output_line_6_callback(DEVCB_##_devcb); - -#define MCFG_TTL74145_OUTPUT_LINE_7_CB(_devcb) \ - downcast(*device).set_output_line_7_callback(DEVCB_##_devcb); - -#define MCFG_TTL74145_OUTPUT_LINE_8_CB(_devcb) \ - downcast(*device).set_output_line_8_callback(DEVCB_##_devcb); - -#define MCFG_TTL74145_OUTPUT_LINE_9_CB(_devcb) \ - downcast(*device).set_output_line_9_callback(DEVCB_##_devcb); - //************************************************************************** // TYPE DEFINITIONS //************************************************************************** @@ -57,29 +24,9 @@ class ttl74145_device : public device_t { public: // construction/destruction - ttl74145_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - - template devcb_base &set_output_line_0_callback(Object &&cb) { return m_output_line_0_cb.set_callback(std::forward(cb)); } - template devcb_base &set_output_line_1_callback(Object &&cb) { return m_output_line_1_cb.set_callback(std::forward(cb)); } - template devcb_base &set_output_line_2_callback(Object &&cb) { return m_output_line_2_cb.set_callback(std::forward(cb)); } - template devcb_base &set_output_line_3_callback(Object &&cb) { return m_output_line_3_cb.set_callback(std::forward(cb)); } - template devcb_base &set_output_line_4_callback(Object &&cb) { return m_output_line_4_cb.set_callback(std::forward(cb)); } - template devcb_base &set_output_line_5_callback(Object &&cb) { return m_output_line_5_cb.set_callback(std::forward(cb)); } - template devcb_base &set_output_line_6_callback(Object &&cb) { return m_output_line_6_cb.set_callback(std::forward(cb)); } - template devcb_base &set_output_line_7_callback(Object &&cb) { return m_output_line_7_cb.set_callback(std::forward(cb)); } - template devcb_base &set_output_line_8_callback(Object &&cb) { return m_output_line_8_cb.set_callback(std::forward(cb)); } - template devcb_base &set_output_line_9_callback(Object &&cb) { return m_output_line_9_cb.set_callback(std::forward(cb)); } - - auto output_line0_callback() { return m_output_line_0_cb.bind(); } - auto output_line1_callback() { return m_output_line_1_cb.bind(); } - auto output_line2_callback() { return m_output_line_2_cb.bind(); } - auto output_line3_callback() { return m_output_line_3_cb.bind(); } - auto output_line4_callback() { return m_output_line_4_cb.bind(); } - auto output_line5_callback() { return m_output_line_5_cb.bind(); } - auto output_line6_callback() { return m_output_line_6_cb.bind(); } - auto output_line7_callback() { return m_output_line_7_cb.bind(); } - auto output_line8_callback() { return m_output_line_8_cb.bind(); } - auto output_line9_callback() { return m_output_line_9_cb.bind(); } + ttl74145_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); + + template auto output_line_callback() { return m_output_line_cb[Bit].bind(); } uint16_t read(); void write(uint8_t data); @@ -90,16 +37,7 @@ protected: virtual void device_reset() override; private: - devcb_write_line m_output_line_0_cb; - devcb_write_line m_output_line_1_cb; - devcb_write_line m_output_line_2_cb; - devcb_write_line m_output_line_3_cb; - devcb_write_line m_output_line_4_cb; - devcb_write_line m_output_line_5_cb; - devcb_write_line m_output_line_6_cb; - devcb_write_line m_output_line_7_cb; - devcb_write_line m_output_line_8_cb; - devcb_write_line m_output_line_9_cb; + devcb_write_line m_output_line_cb[10]; /* decoded number */ uint16_t m_number; diff --git a/src/devices/machine/74148.cpp b/src/devices/machine/74148.cpp index 1b8033bc297..45ce281ed51 100644 --- a/src/devices/machine/74148.cpp +++ b/src/devices/machine/74148.cpp @@ -49,6 +49,7 @@ DEFINE_DEVICE_TYPE(TTL74148, ttl74148_device, "74148", "74148 TTL") ttl74148_device::ttl74148_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, TTL74148, tag, owner, clock) + , m_output_cb(*this) , m_enable_input(0) , m_output(0) , m_output_valid(0) @@ -67,7 +68,7 @@ ttl74148_device::ttl74148_device(const machine_config &mconfig, const char *tag, void ttl74148_device::device_start() { - m_output_cb.bind_relative_to(*owner()); + m_output_cb.resolve_safe(); save_item(NAME(m_input_lines)); save_item(NAME(m_enable_input)); @@ -164,7 +165,7 @@ void ttl74148_device::update() m_last_output_valid = m_output_valid; m_last_enable_output = m_enable_output; - m_output_cb(); + m_output_cb(m_output); } } diff --git a/src/devices/machine/74148.h b/src/devices/machine/74148.h index bc1a52cf64c..88039005ed6 100644 --- a/src/devices/machine/74148.h +++ b/src/devices/machine/74148.h @@ -45,12 +45,6 @@ #pragma once - -typedef device_delegate ttl74148_output_delegate; - -#define TTL74148_OUTPUT_CB(_name) void _name(void) - - class ttl74148_device : public device_t { public: @@ -58,6 +52,7 @@ public: ~ttl74148_device() {} template void set_output_callback(Object &&cb) { m_output_cb = std::forward(cb); } + auto out_cb() { return m_output_cb.bind(); } /* must call update() after setting the inputs */ void update(); @@ -74,7 +69,7 @@ protected: virtual void device_reset() override; private: // internal state - ttl74148_output_delegate m_output_cb; + devcb_write8 m_output_cb; /* inputs */ int m_input_lines[8]; /* pins 1-4,10-13 */ @@ -93,9 +88,4 @@ private: DECLARE_DEVICE_TYPE(TTL74148, ttl74148_device) - -#define MCFG_74148_OUTPUT_CB(_class, _method) \ - downcast(*device).set_output_callback(ttl74148_output_delegate(&_class::_method, #_class "::" #_method, this)); - - #endif // MAME_DEVICES_MACHINE_74148_H diff --git a/src/devices/machine/74153.h b/src/devices/machine/74153.h index fc234463e30..4c48c557174 100644 --- a/src/devices/machine/74153.h +++ b/src/devices/machine/74153.h @@ -23,19 +23,6 @@ #pragma once - - -//************************************************************************** -// INTERFACE CONFIGURATION MACROS -//************************************************************************** - -#define MCFG_TTL153_ZA_CB(_devcb) \ - downcast(*device).set_za_callback(DEVCB_##_devcb); - -#define MCFG_TTL153_ZB_CB(_devcb) \ - downcast(*device).set_zb_callback(DEVCB_##_devcb); - - //************************************************************************** // TYPE DEFINITIONS //************************************************************************** @@ -47,8 +34,8 @@ public: ttl153_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); // configuration - template devcb_base &set_za_callback(Object &&cb) { return m_za_cb.set_callback(std::forward(cb)); } - template devcb_base &set_zb_callback(Object &&cb) { return m_zb_cb.set_callback(std::forward(cb)); } + auto za_cb() { return m_za_cb.bind(); } + auto zb_cb() { return m_zb_cb.bind(); } // select DECLARE_WRITE_LINE_MEMBER(s0_w); diff --git a/src/devices/machine/74157.h b/src/devices/machine/74157.h index 96a23d64235..4bd4685546c 100644 --- a/src/devices/machine/74157.h +++ b/src/devices/machine/74157.h @@ -25,20 +25,6 @@ -//************************************************************************** -// DEVICE CONFIGURATION MACROS -//************************************************************************** - -#define MCFG_74157_A_IN_CB(_devcb) \ - downcast(*device).set_a_in_callback(DEVCB_##_devcb); - -#define MCFG_74157_B_IN_CB(_devcb) \ - downcast(*device).set_b_in_callback(DEVCB_##_devcb); - -#define MCFG_74157_OUT_CB(_devcb) \ - downcast(*device).set_out_callback(DEVCB_##_devcb); - - //************************************************************************** // TYPE DEFINITIONS //************************************************************************** @@ -51,10 +37,6 @@ public: // construction/destruction ls157_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock = 0); - // static configuration - template devcb_base &set_a_in_callback(Object &&cb) { return m_a_in_cb.set_callback(std::forward(cb)); } - template devcb_base &set_b_in_callback(Object &&cb) { return m_b_in_cb.set_callback(std::forward(cb)); } - template devcb_base &set_out_callback(Object &&cb) { return m_out_cb.set_callback(std::forward(cb)); } auto a_in_callback() { return m_a_in_cb.bind(); } auto b_in_callback() { return m_b_in_cb.bind(); } auto out_callback() { return m_out_cb.bind(); } diff --git a/src/devices/machine/74161.h b/src/devices/machine/74161.h index 932428bdb78..503617b1635 100644 --- a/src/devices/machine/74161.h +++ b/src/devices/machine/74161.h @@ -57,35 +57,15 @@ #pragma once - -#define MCFG_7416x_QA_CB(_devcb) \ - downcast(*device).set_qa_cb(DEVCB_##_devcb); - -#define MCFG_7416x_QB_CB(_devcb) \ - downcast(*device).set_qb_cb(DEVCB_##_devcb); - -#define MCFG_7416x_QC_CB(_devcb) \ - downcast(*device).set_qc_cb(DEVCB_##_devcb); - -#define MCFG_7416x_QD_CB(_devcb) \ - downcast(*device).set_qd_cb(DEVCB_##_devcb); - -#define MCFG_7416x_OUTPUT_CB(_devcb) \ - downcast(*device).set_output_cb(DEVCB_##_devcb); - -#define MCFG_7416x_TC_CB(_devcb) \ - downcast(*device).set_tc_cb(DEVCB_##_devcb); - class ttl7416x_device : public device_t { public: - // static configuration helpers - template devcb_base &set_qa_cb(Object &&cb) { return m_qa_func.set_callback(std::forward(cb)); } - template devcb_base &set_qb_cb(Object &&cb) { return m_qb_func.set_callback(std::forward(cb)); } - template devcb_base &set_qc_cb(Object &&cb) { return m_qc_func.set_callback(std::forward(cb)); } - template devcb_base &set_qd_cb(Object &&cb) { return m_qd_func.set_callback(std::forward(cb)); } - template devcb_base &set_output_cb(Object &&cb) { return m_output_func.set_callback(std::forward(cb)); } - template devcb_base &set_tc_cb(Object &&cb) { return m_tc_func.set_callback(std::forward(cb)); } + auto qa_cb() { return m_qa_func.bind(); } + auto qb_cb() { return m_qb_func.bind(); } + auto qc_cb() { return m_qc_func.bind(); } + auto qd_cb() { return m_qd_func.bind(); } + auto out_cb() { return m_output_func.bind(); } + auto tc_cb() { return m_tc_func.bind(); } // public interfaces DECLARE_WRITE_LINE_MEMBER( clear_w ); diff --git a/src/devices/machine/74259.h b/src/devices/machine/74259.h index 990c1f1ca58..96b7c95316f 100644 --- a/src/devices/machine/74259.h +++ b/src/devices/machine/74259.h @@ -32,30 +32,6 @@ #pragma once -//************************************************************************** -// CONFIGURATION MACROS -//************************************************************************** - -#define MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(_devcb) \ - downcast(*device).set_q_out_cb<0>(DEVCB_##_devcb); -#define MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(_devcb) \ - downcast(*device).set_q_out_cb<1>(DEVCB_##_devcb); -#define MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(_devcb) \ - downcast(*device).set_q_out_cb<2>(DEVCB_##_devcb); -#define MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(_devcb) \ - downcast(*device).set_q_out_cb<3>(DEVCB_##_devcb); -#define MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(_devcb) \ - downcast(*device).set_q_out_cb<4>(DEVCB_##_devcb); -#define MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(_devcb) \ - downcast(*device).set_q_out_cb<5>(DEVCB_##_devcb); -#define MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(_devcb) \ - downcast(*device).set_q_out_cb<6>(DEVCB_##_devcb); -#define MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(_devcb) \ - downcast(*device).set_q_out_cb<7>(DEVCB_##_devcb); - -#define MCFG_ADDRESSABLE_LATCH_PARALLEL_OUT_CB(_devcb) \ - downcast(*device).set_parallel_out_cb(DEVCB_##_devcb); - //************************************************************************** // TYPE DEFINITIONS //************************************************************************** diff --git a/src/devices/machine/wozfdc.cpp b/src/devices/machine/wozfdc.cpp index 79cbb43fadb..61f1150bee0 100644 --- a/src/devices/machine/wozfdc.cpp +++ b/src/devices/machine/wozfdc.cpp @@ -45,10 +45,11 @@ const tiny_rom_entry *wozfdc_device::device_rom_region() const // device_add_mconfig - add device configuration //------------------------------------------------- -MACHINE_CONFIG_START(wozfdc_device::device_add_mconfig) - MCFG_DEVICE_ADD("phaselatch", F9334, 0) // 9334 on circuit diagram but 74LS259 in parts list; actual chip may vary - MCFG_ADDRESSABLE_LATCH_PARALLEL_OUT_CB(WRITE8(*this, wozfdc_device, set_phase)) -MACHINE_CONFIG_END +void wozfdc_device::device_add_mconfig(machine_config &config) +{ + F9334(config, m_phaselatch); // 9334 on circuit diagram but 74LS259 in parts list; actual chip may vary + m_phaselatch->parallel_out_cb().set(FUNC(wozfdc_device::set_phase)); +} //************************************************************************** // LIVE DEVICE diff --git a/src/devices/sound/es8712.cpp b/src/devices/sound/es8712.cpp index 9440bd7ce60..e0b2699edd0 100644 --- a/src/devices/sound/es8712.cpp +++ b/src/devices/sound/es8712.cpp @@ -57,10 +57,11 @@ es8712_device::es8712_device(const machine_config &mconfig, const char *tag, dev // configuration addiitons //------------------------------------------------- -MACHINE_CONFIG_START(es8712_device::device_add_mconfig) - MCFG_DEVICE_ADD("adpcm_select", HCT157, 0) // TODO : gcpinbal case, differs per games? - MCFG_74157_OUT_CB(WRITE8(*this, es8712_device, msm_w)) -MACHINE_CONFIG_END +void es8712_device::device_add_mconfig(machine_config &config) +{ + HCT157(config, m_adpcm_select, 0); // TODO : gcpinbal case, differs per games? + m_adpcm_select->out_callback().set(FUNC(es8712_device::msm_w)); +} //------------------------------------------------- diff --git a/src/mame/audio/asteroid.cpp b/src/mame/audio/asteroid.cpp index 5abe45484c3..1b647d42a4e 100644 --- a/src/mame/audio/asteroid.cpp +++ b/src/mame/audio/asteroid.cpp @@ -321,13 +321,13 @@ MACHINE_CONFIG_START(asteroid_state::asteroid_sound) MCFG_DEVICE_ADD("discrete", DISCRETE, asteroid_discrete) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.4) - MCFG_DEVICE_ADD("audiolatch", LS259, 0) // M10 - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE("discrete", discrete_device, write_line)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE("discrete", discrete_device, write_line)) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE("discrete", discrete_device, write_line)) - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE("discrete", discrete_device, write_line)) - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE("discrete", discrete_device, write_line)) - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE("discrete", discrete_device, write_line)) + ls259_device &audiolatch(LS259(config, "audiolatch")); // M10 + audiolatch.q_out_cb<0>().set("discrete", FUNC(discrete_device::write_line)); + audiolatch.q_out_cb<1>().set("discrete", FUNC(discrete_device::write_line)); + audiolatch.q_out_cb<2>().set("discrete", FUNC(discrete_device::write_line)); + audiolatch.q_out_cb<3>().set("discrete", FUNC(discrete_device::write_line)); + audiolatch.q_out_cb<4>().set("discrete", FUNC(discrete_device::write_line)); + audiolatch.q_out_cb<5>().set("discrete", FUNC(discrete_device::write_line)); MACHINE_CONFIG_END @@ -337,6 +337,6 @@ MACHINE_CONFIG_START(asteroid_state::astdelux_sound) MCFG_DEVICE_ADD("discrete", DISCRETE, astdelux_discrete) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) - MCFG_DEVICE_ADD("audiolatch", LS259, 0) // M10 - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE("discrete", discrete_device, write_line)) + ls259_device &audiolatch(LS259(config, "audiolatch")); // M10 + audiolatch.q_out_cb<3>().set("discrete", FUNC(discrete_device::write_line)); MACHINE_CONFIG_END diff --git a/src/mame/audio/avalnche.cpp b/src/mame/audio/avalnche.cpp index e462d19cfb2..2572b907698 100644 --- a/src/mame/audio/avalnche.cpp +++ b/src/mame/audio/avalnche.cpp @@ -8,7 +8,6 @@ #include "emu.h" #include "includes/avalnche.h" -#include "machine/74259.h" #include "sound/discrete.h" #include "speaker.h" @@ -109,20 +108,18 @@ MACHINE_CONFIG_START(avalnche_state::avalnche_sound) MCFG_DEVICE_ADD("discrete", DISCRETE, avalnche_discrete) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) - MCFG_DEVICE_MODIFY("latch") - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE("discrete", discrete_device, write_line)) - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE("discrete", discrete_device, write_line)) - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE("discrete", discrete_device, write_line)) - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE("discrete", discrete_device, write_line)) + m_latch->q_out_cb<1>().set("discrete", FUNC(discrete_device::write_line)); + m_latch->q_out_cb<4>().set("discrete", FUNC(discrete_device::write_line)); + m_latch->q_out_cb<5>().set("discrete", FUNC(discrete_device::write_line)); + m_latch->q_out_cb<6>().set("discrete", FUNC(discrete_device::write_line)); MACHINE_CONFIG_END MACHINE_CONFIG_START(avalnche_state::acatch_sound) // just a stub here... - MCFG_DEVICE_MODIFY("latch") - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(NOOP) // It is attract_enable just like avalnche, but not hooked up yet. - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(*this, avalnche_state, catch_aud0_w)) - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE(*this, avalnche_state, catch_aud1_w)) - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(*this, avalnche_state, catch_aud2_w)) + m_latch->q_out_cb<1>().set_nop(); // It is attract_enable just like avalnche, but not hooked up yet. + m_latch->q_out_cb<4>().set(FUNC(avalnche_state::catch_aud0_w)); + m_latch->q_out_cb<5>().set(FUNC(avalnche_state::catch_aud1_w)); + m_latch->q_out_cb<6>().set(FUNC(avalnche_state::catch_aud2_w)); MACHINE_CONFIG_END diff --git a/src/mame/audio/cinemat.cpp b/src/mame/audio/cinemat.cpp index d2d46bfeafc..031f11b3112 100644 --- a/src/mame/audio/cinemat.cpp +++ b/src/mame/audio/cinemat.cpp @@ -148,12 +148,11 @@ WRITE_LINE_MEMBER(cinemat_state::spacewar_sound4_w) } MACHINE_CONFIG_START(cinemat_state::spacewar_sound) - MCFG_DEVICE_MODIFY("outlatch") - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, cinemat_state, spacewar_sound0_w)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, cinemat_state, spacewar_sound1_w)) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, cinemat_state, spacewar_sound2_w)) - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, cinemat_state, spacewar_sound3_w)) - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(*this, cinemat_state, spacewar_sound4_w)) + m_outlatch->q_out_cb<0>().set(FUNC(cinemat_state::spacewar_sound0_w)); + m_outlatch->q_out_cb<1>().set(FUNC(cinemat_state::spacewar_sound1_w)); + m_outlatch->q_out_cb<2>().set(FUNC(cinemat_state::spacewar_sound2_w)); + m_outlatch->q_out_cb<3>().set(FUNC(cinemat_state::spacewar_sound3_w)); + m_outlatch->q_out_cb<4>().set(FUNC(cinemat_state::spacewar_sound4_w)); SPEAKER(config, "mono").front_center(); @@ -202,10 +201,9 @@ WRITE_LINE_MEMBER(cinemat_state::barrier_sound2_w) } MACHINE_CONFIG_START(cinemat_state::barrier_sound) - MCFG_DEVICE_MODIFY("outlatch") - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, cinemat_state, barrier_sound0_w)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, cinemat_state, barrier_sound1_w)) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, cinemat_state, barrier_sound2_w)) + m_outlatch->q_out_cb<0>().set(FUNC(cinemat_state::barrier_sound0_w)); + m_outlatch->q_out_cb<1>().set(FUNC(cinemat_state::barrier_sound1_w)); + m_outlatch->q_out_cb<2>().set(FUNC(cinemat_state::barrier_sound2_w)); SPEAKER(config, "mono").front_center(); @@ -259,10 +257,9 @@ WRITE_LINE_MEMBER(cinemat_state::speedfrk_start_led_w) } MACHINE_CONFIG_START(cinemat_state::speedfrk_sound) - MCFG_DEVICE_MODIFY("outlatch") - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, cinemat_state, speedfrk_start_led_w)) - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, cinemat_state, speedfrk_sound3_w)) - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(*this, cinemat_state, speedfrk_sound4_w)) + m_outlatch->q_out_cb<1>().set(FUNC(cinemat_state::speedfrk_start_led_w)); + m_outlatch->q_out_cb<3>().set(FUNC(cinemat_state::speedfrk_sound3_w)); + m_outlatch->q_out_cb<4>().set(FUNC(cinemat_state::speedfrk_sound4_w)); SPEAKER(config, "mono").front_center(); @@ -341,13 +338,12 @@ WRITE_LINE_MEMBER(cinemat_state::starhawk_sound7_w) } MACHINE_CONFIG_START(cinemat_state::starhawk_sound) - MCFG_DEVICE_MODIFY("outlatch") - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, cinemat_state, starhawk_sound0_w)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, cinemat_state, starhawk_sound1_w)) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, cinemat_state, starhawk_sound2_w)) - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, cinemat_state, starhawk_sound3_w)) - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(*this, cinemat_state, starhawk_sound4_w)) - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, cinemat_state, starhawk_sound7_w)) + m_outlatch->q_out_cb<0>().set(FUNC(cinemat_state::starhawk_sound0_w)); + m_outlatch->q_out_cb<1>().set(FUNC(cinemat_state::starhawk_sound1_w)); + m_outlatch->q_out_cb<2>().set(FUNC(cinemat_state::starhawk_sound2_w)); + m_outlatch->q_out_cb<3>().set(FUNC(cinemat_state::starhawk_sound3_w)); + m_outlatch->q_out_cb<4>().set(FUNC(cinemat_state::starhawk_sound4_w)); + m_outlatch->q_out_cb<7>().set(FUNC(cinemat_state::starhawk_sound7_w)); SPEAKER(config, "mono").front_center(); @@ -420,13 +416,12 @@ WRITE_LINE_MEMBER(cinemat_16level_state::sundance_sound7_w) } MACHINE_CONFIG_START(cinemat_16level_state::sundance_sound) - MCFG_DEVICE_MODIFY("outlatch") - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, cinemat_16level_state, sundance_sound0_w)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, cinemat_16level_state, sundance_sound1_w)) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, cinemat_16level_state, sundance_sound2_w)) - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, cinemat_16level_state, sundance_sound3_w)) - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(*this, cinemat_16level_state, sundance_sound4_w)) - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, cinemat_16level_state, sundance_sound7_w)) + m_outlatch->q_out_cb<0>().set(FUNC(cinemat_16level_state::sundance_sound0_w)); + m_outlatch->q_out_cb<1>().set(FUNC(cinemat_16level_state::sundance_sound1_w)); + m_outlatch->q_out_cb<2>().set(FUNC(cinemat_16level_state::sundance_sound2_w)); + m_outlatch->q_out_cb<3>().set(FUNC(cinemat_16level_state::sundance_sound3_w)); + m_outlatch->q_out_cb<4>().set(FUNC(cinemat_16level_state::sundance_sound4_w)); + m_outlatch->q_out_cb<7>().set(FUNC(cinemat_16level_state::sundance_sound7_w)); SPEAKER(config, "mono").front_center(); @@ -503,8 +498,7 @@ WRITE_LINE_MEMBER(cinemat_state::tailg_sound_w) } MACHINE_CONFIG_START(cinemat_state::tailg_sound) - MCFG_DEVICE_MODIFY("outlatch") - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(*this, cinemat_state, tailg_sound_w)) + m_outlatch->q_out_cb<4>().set(FUNC(cinemat_state::tailg_sound_w)); SPEAKER(config, "mono").front_center(); @@ -573,12 +567,11 @@ WRITE_LINE_MEMBER(cinemat_state::warrior_sound4_w) } MACHINE_CONFIG_START(cinemat_state::warrior_sound) - MCFG_DEVICE_MODIFY("outlatch") - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, cinemat_state, warrior_sound0_w)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, cinemat_state, warrior_sound1_w)) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, cinemat_state, warrior_sound2_w)) - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, cinemat_state, warrior_sound3_w)) - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(*this, cinemat_state, warrior_sound4_w)) + m_outlatch->q_out_cb<0>().set(FUNC(cinemat_state::warrior_sound0_w)); + m_outlatch->q_out_cb<1>().set(FUNC(cinemat_state::warrior_sound1_w)); + m_outlatch->q_out_cb<2>().set(FUNC(cinemat_state::warrior_sound2_w)); + m_outlatch->q_out_cb<3>().set(FUNC(cinemat_state::warrior_sound3_w)); + m_outlatch->q_out_cb<4>().set(FUNC(cinemat_state::warrior_sound4_w)); SPEAKER(config, "mono").front_center(); @@ -673,12 +666,11 @@ WRITE_LINE_MEMBER(cinemat_state::armora_sound3_w) } MACHINE_CONFIG_START(cinemat_state::armora_sound) - MCFG_DEVICE_MODIFY("outlatch") - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, cinemat_state, armora_sound0_w)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, cinemat_state, armora_sound1_w)) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, cinemat_state, armora_sound2_w)) - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, cinemat_state, armora_sound3_w)) - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(*this, cinemat_state, armora_sound4_w)) + m_outlatch->q_out_cb<0>().set(FUNC(cinemat_state::armora_sound0_w)); + m_outlatch->q_out_cb<1>().set(FUNC(cinemat_state::armora_sound1_w)); + m_outlatch->q_out_cb<2>().set(FUNC(cinemat_state::armora_sound2_w)); + m_outlatch->q_out_cb<3>().set(FUNC(cinemat_state::armora_sound3_w)); + m_outlatch->q_out_cb<4>().set(FUNC(cinemat_state::armora_sound4_w)); SPEAKER(config, "mono").front_center(); @@ -770,12 +762,11 @@ WRITE_LINE_MEMBER(cinemat_state::ripoff_sound7_w) } MACHINE_CONFIG_START(cinemat_state::ripoff_sound) - MCFG_DEVICE_MODIFY("outlatch") - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, cinemat_state, ripoff_sound1_w)) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, cinemat_state, ripoff_sound2_w)) - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, cinemat_state, ripoff_sound3_w)) - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(*this, cinemat_state, ripoff_sound4_w)) - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, cinemat_state, ripoff_sound7_w)) + m_outlatch->q_out_cb<1>().set(FUNC(cinemat_state::ripoff_sound1_w)); + m_outlatch->q_out_cb<2>().set(FUNC(cinemat_state::ripoff_sound2_w)); + m_outlatch->q_out_cb<3>().set(FUNC(cinemat_state::ripoff_sound3_w)); + m_outlatch->q_out_cb<4>().set(FUNC(cinemat_state::ripoff_sound4_w)); + m_outlatch->q_out_cb<7>().set(FUNC(cinemat_state::ripoff_sound7_w)); SPEAKER(config, "mono").front_center(); @@ -887,12 +878,11 @@ WRITE_LINE_MEMBER(cinemat_state::starcas_sound3_w) } MACHINE_CONFIG_START(cinemat_state::starcas_sound) - MCFG_DEVICE_MODIFY("outlatch") - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, cinemat_state, starcas_sound0_w)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, cinemat_state, starcas_sound1_w)) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, cinemat_state, starcas_sound2_w)) - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, cinemat_state, starcas_sound3_w)) - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(*this, cinemat_state, starcas_sound4_w)) + m_outlatch->q_out_cb<0>().set(FUNC(cinemat_state::starcas_sound0_w)); + m_outlatch->q_out_cb<1>().set(FUNC(cinemat_state::starcas_sound1_w)); + m_outlatch->q_out_cb<2>().set(FUNC(cinemat_state::starcas_sound2_w)); + m_outlatch->q_out_cb<3>().set(FUNC(cinemat_state::starcas_sound3_w)); + m_outlatch->q_out_cb<4>().set(FUNC(cinemat_state::starcas_sound4_w)); SPEAKER(config, "mono").front_center(); @@ -1021,10 +1011,9 @@ WRITE_LINE_MEMBER(cinemat_64level_state::solarq_sound0_w) } MACHINE_CONFIG_START(cinemat_64level_state::solarq_sound) - MCFG_DEVICE_MODIFY("outlatch") - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, cinemat_64level_state, solarq_sound0_w)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, cinemat_64level_state, solarq_sound1_w)) - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(*this, cinemat_64level_state, solarq_sound4_w)) + m_outlatch->q_out_cb<0>().set(FUNC(cinemat_64level_state::solarq_sound0_w)); + m_outlatch->q_out_cb<1>().set(FUNC(cinemat_64level_state::solarq_sound1_w)); + m_outlatch->q_out_cb<4>().set(FUNC(cinemat_64level_state::solarq_sound4_w)); SPEAKER(config, "mono").front_center(); @@ -1159,12 +1148,11 @@ WRITE_LINE_MEMBER(cinemat_color_state::boxingb_sound3_w) } MACHINE_CONFIG_START(cinemat_color_state::boxingb_sound) - MCFG_DEVICE_MODIFY("outlatch") - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, cinemat_color_state, boxingb_sound0_w)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, cinemat_color_state, boxingb_sound1_w)) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, cinemat_color_state, boxingb_sound2_w)) - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, cinemat_color_state, boxingb_sound3_w)) - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(*this, cinemat_color_state, boxingb_sound4_w)) + m_outlatch->q_out_cb<0>().set(FUNC(cinemat_color_state::boxingb_sound0_w)); + m_outlatch->q_out_cb<1>().set(FUNC(cinemat_color_state::boxingb_sound1_w)); + m_outlatch->q_out_cb<2>().set(FUNC(cinemat_color_state::boxingb_sound2_w)); + m_outlatch->q_out_cb<3>().set(FUNC(cinemat_color_state::boxingb_sound3_w)); + m_outlatch->q_out_cb<4>().set(FUNC(cinemat_color_state::boxingb_sound4_w)); SPEAKER(config, "mono").front_center(); @@ -1276,12 +1264,11 @@ WRITE_LINE_MEMBER(cinemat_state::wotw_sound3_w) } MACHINE_CONFIG_START(cinemat_state::wotw_sound) - MCFG_DEVICE_MODIFY("outlatch") - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, cinemat_state, wotw_sound0_w)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, cinemat_state, wotw_sound1_w)) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, cinemat_state, wotw_sound2_w)) - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, cinemat_state, wotw_sound3_w)) - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(*this, cinemat_state, wotw_sound4_w)) + m_outlatch->q_out_cb<0>().set(FUNC(cinemat_state::wotw_sound0_w)); + m_outlatch->q_out_cb<1>().set(FUNC(cinemat_state::wotw_sound1_w)); + m_outlatch->q_out_cb<2>().set(FUNC(cinemat_state::wotw_sound2_w)); + m_outlatch->q_out_cb<3>().set(FUNC(cinemat_state::wotw_sound3_w)); + m_outlatch->q_out_cb<4>().set(FUNC(cinemat_state::wotw_sound4_w)); SPEAKER(config, "mono").front_center(); @@ -1416,8 +1403,7 @@ MACHINE_CONFIG_START(demon_state::demon_sound) MCFG_DEVICE_ADD("ctc", Z80CTC, 3579545 /* same as "audiocpu" */) MCFG_Z80CTC_INTR_CB(INPUTLINE("audiocpu", INPUT_LINE_IRQ0)) - MCFG_DEVICE_MODIFY("outlatch") - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(*this, demon_state, demon_sound4_w)) + m_outlatch->q_out_cb<4>().set(FUNC(demon_state::demon_sound4_w)); /* sound hardware */ SPEAKER(config, "mono").front_center(); @@ -1463,9 +1449,8 @@ void qb3_state::sound_reset() } -MACHINE_CONFIG_START(qb3_state::qb3_sound) +void qb3_state::qb3_sound(machine_config &config) +{ demon_sound(config); - - MCFG_DEVICE_MODIFY("outlatch") - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(NOOP) // not mapped through LS259 -MACHINE_CONFIG_END + m_outlatch->q_out_cb<4>().set_nop(); // not mapped through LS259 +} diff --git a/src/mame/audio/copsnrob.cpp b/src/mame/audio/copsnrob.cpp index cda3823e988..b91df3809d8 100644 --- a/src/mame/audio/copsnrob.cpp +++ b/src/mame/audio/copsnrob.cpp @@ -695,22 +695,23 @@ WRITE_LINE_MEMBER(copsnrob_state::one_start_w) } -MACHINE_CONFIG_START(copsnrob_state::copsnrob_audio) +void copsnrob_state::copsnrob_audio(machine_config &config) +{ /* sound hardware */ SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); - MCFG_DEVICE_ADD("discrete", DISCRETE, copsnrob_discrete) - MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) - MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) - - MCFG_DEVICE_ADD("latch", F9334, 0) // H3 on audio board - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE("discrete", discrete_device, write_line)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE("discrete", discrete_device, write_line)) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE("discrete", discrete_device, write_line)) - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE("discrete", discrete_device, write_line)) - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE("discrete", discrete_device, write_line)) - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE("discrete", discrete_device, write_line)) - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(*this, copsnrob_state, one_start_w)) - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE("discrete", discrete_device, write_line)) -MACHINE_CONFIG_END + discrete_sound_device &discrete(DISCRETE(config, "discrete", copsnrob_discrete)); + discrete.add_route(0, "lspeaker", 1.0); + discrete.add_route(1, "rspeaker", 1.0); + + f9334_device &latch(F9334(config, "latch")); // H3 on audio board + latch.q_out_cb<0>().set("discrete", FUNC(discrete_device::write_line)); + latch.q_out_cb<1>().set("discrete", FUNC(discrete_device::write_line)); + latch.q_out_cb<2>().set("discrete", FUNC(discrete_device::write_line)); + latch.q_out_cb<3>().set("discrete", FUNC(discrete_device::write_line)); + latch.q_out_cb<4>().set("discrete", FUNC(discrete_device::write_line)); + latch.q_out_cb<5>().set("discrete", FUNC(discrete_device::write_line)); + latch.q_out_cb<6>().set(FUNC(copsnrob_state::one_start_w)); + latch.q_out_cb<7>().set("discrete", FUNC(discrete_device::write_line)); +} diff --git a/src/mame/audio/sprint8.cpp b/src/mame/audio/sprint8.cpp index 91d0a89203c..74c4fea6d09 100644 --- a/src/mame/audio/sprint8.cpp +++ b/src/mame/audio/sprint8.cpp @@ -314,20 +314,21 @@ MACHINE_CONFIG_START(sprint8_state::sprint8_audio) MCFG_SOUND_ROUTE(2, "speaker_5_6", 0.0) MCFG_SOUND_ROUTE(3, "speaker_4_8", 0.0) - MCFG_DEVICE_ADD("latch", F9334, 0) - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, sprint8_state, int_reset_w)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE("discrete", discrete_device, write_line)) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE("discrete", discrete_device, write_line)) - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE(*this, sprint8_state, team_w)) - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE("discrete", discrete_device, write_line)) - - MCFG_DEVICE_ADD("motor", F9334, 0) - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE("discrete", discrete_device, write_line)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE("discrete", discrete_device, write_line)) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE("discrete", discrete_device, write_line)) - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE("discrete", discrete_device, write_line)) - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE("discrete", discrete_device, write_line)) - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE("discrete", discrete_device, write_line)) - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE("discrete", discrete_device, write_line)) - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE("discrete", discrete_device, write_line)) + f9334_device &latch(F9334(config, "latch")); + latch.q_out_cb<0>().set(FUNC(sprint8_state::int_reset_w)); + latch.q_out_cb<1>().set("discrete", FUNC(discrete_device::write_line)); + latch.q_out_cb<2>().set("discrete", FUNC(discrete_device::write_line)); + latch.q_out_cb<5>().set(FUNC(sprint8_state::team_w)); + latch.q_out_cb<6>().set("discrete", FUNC(discrete_device::write_line)); + + f9334_device &motor(F9334(config, "motor")); + motor.q_out_cb<0>().set("discrete", FUNC(discrete_device::write_line)); + motor.q_out_cb<1>().set("discrete", FUNC(discrete_device::write_line)); + motor.q_out_cb<2>().set("discrete", FUNC(discrete_device::write_line)); + motor.q_out_cb<3>().set("discrete", FUNC(discrete_device::write_line)); + motor.q_out_cb<4>().set("discrete", FUNC(discrete_device::write_line)); + motor.q_out_cb<5>().set("discrete", FUNC(discrete_device::write_line)); + motor.q_out_cb<6>().set("discrete", FUNC(discrete_device::write_line)); + motor.q_out_cb<7>().set("discrete", FUNC(discrete_device::write_line)); MACHINE_CONFIG_END +; \ No newline at end of file diff --git a/src/mame/drivers/acrnsys1.cpp b/src/mame/drivers/acrnsys1.cpp index 916893b5eef..4cbd307f9d9 100644 --- a/src/mame/drivers/acrnsys1.cpp +++ b/src/mame/drivers/acrnsys1.cpp @@ -280,8 +280,11 @@ MACHINE_CONFIG_START(acrnsys1_state::acrnsys1) MCFG_INS8154_IN_A_CB(READ8(*this, acrnsys1_state, ins8154_b1_port_a_r)) MCFG_INS8154_OUT_A_CB(WRITE8(*this, acrnsys1_state, ins8154_b1_port_a_w)) MCFG_INS8154_OUT_B_CB(WRITE8(*this, acrnsys1_state, acrnsys1_led_segment_w)) - MCFG_DEVICE_ADD("ic8_7445", TTL74145, 0) + + TTL74145(config, m_ttl74145, 0); + MCFG_CASSETTE_ADD( "cassette" ) + MCFG_TIMER_DRIVER_ADD_PERIODIC("acrnsys1_c", acrnsys1_state, acrnsys1_c, attotime::from_hz(4800)) MCFG_TIMER_DRIVER_ADD_PERIODIC("acrnsys1_p", acrnsys1_state, acrnsys1_p, attotime::from_hz(40000)) MACHINE_CONFIG_END diff --git a/src/mame/drivers/alpha68k.cpp b/src/mame/drivers/alpha68k.cpp index 4fa7f393a99..e9dcf40ae0c 100644 --- a/src/mame/drivers/alpha68k.cpp +++ b/src/mame/drivers/alpha68k.cpp @@ -2172,9 +2172,9 @@ MACHINE_CONFIG_START(alpha68k_state::alpha68k_V) MCFG_DEVICE_IO_MAP(sound_portmap) MCFG_DEVICE_PERIODIC_INT_DRIVER(alpha68k_state, alpha68k_sound_nmi, ALPHA68K_PIXEL_CLOCK / ALPHA68K_HTOTAL / 2) - MCFG_DEVICE_ADD("outlatch", LS259, 0) // 13C - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, alpha68k_state, video_control2_w)) - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, alpha68k_state, video_control3_w)) + LS259(config, m_outlatch); // 13C + m_outlatch->q_out_cb<2>().set(FUNC(alpha68k_state::video_control2_w)); + m_outlatch->q_out_cb<3>().set(FUNC(alpha68k_state::video_control3_w)); MCFG_MACHINE_START_OVERRIDE(alpha68k_state,alpha68k_V) MCFG_MACHINE_RESET_OVERRIDE(alpha68k_state,alpha68k_V) 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) diff --git a/src/mame/drivers/apple2.cpp b/src/mame/drivers/apple2.cpp index 8c5ef0bf354..0d318307e67 100644 --- a/src/mame/drivers/apple2.cpp +++ b/src/mame/drivers/apple2.cpp @@ -1403,15 +1403,15 @@ MACHINE_CONFIG_START(napple2_state::apple2_common) MCFG_ADDRESS_MAP_BANK_STRIDE(0x3000) /* soft switches */ - MCFG_DEVICE_ADD("softlatch", F9334, 0) // F14 (labeled 74LS259 on some boards and in the Apple ][ Reference Manual) - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, napple2_state, txt_w)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, napple2_state, mix_w)) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, napple2_state, scr_w)) - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, napple2_state, res_w)) - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(*this, napple2_state, an0_w)) - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE(*this, napple2_state, an1_w)) - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(*this, napple2_state, an2_w)) - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, napple2_state, an3_w)) + F9334(config, m_softlatch); // F14 (labeled 74LS259 on some boards and in the Apple ][ Reference Manual) + m_softlatch->q_out_cb<0>().set(FUNC(napple2_state::txt_w)); + m_softlatch->q_out_cb<1>().set(FUNC(napple2_state::mix_w)); + m_softlatch->q_out_cb<2>().set(FUNC(napple2_state::scr_w)); + m_softlatch->q_out_cb<3>().set(FUNC(napple2_state::res_w)); + m_softlatch->q_out_cb<4>().set(FUNC(napple2_state::an0_w)); + m_softlatch->q_out_cb<5>().set(FUNC(napple2_state::an1_w)); + m_softlatch->q_out_cb<6>().set(FUNC(napple2_state::an2_w)); + m_softlatch->q_out_cb<7>().set(FUNC(napple2_state::an3_w)); /* keyboard controller */ MCFG_DEVICE_ADD(A2_KBDC_TAG, AY3600, 0) diff --git a/src/mame/drivers/apricot.cpp b/src/mame/drivers/apricot.cpp index deccf3b679d..3abfa5027c4 100644 --- a/src/mame/drivers/apricot.cpp +++ b/src/mame/drivers/apricot.cpp @@ -418,9 +418,9 @@ MACHINE_CONFIG_START(apricot_state::apricot) m_pit->out_handler<2>().append("ic14", FUNC(ttl153_device::i2a_w)); m_pit->out_handler<2>().append("ic14", FUNC(ttl153_device::i2b_w)); - MCFG_DEVICE_ADD("ic14", TTL153) - MCFG_TTL153_ZA_CB(WRITELINE("ic15", z80sio_device, rxca_w)) - MCFG_TTL153_ZB_CB(WRITELINE("ic15", z80sio_device, txca_w)) + ttl153_device &ttl74153(TTL153(config, "ic14")); + ttl74153.za_cb().set("ic15", FUNC(z80sio_device::rxca_w)); + ttl74153.zb_cb().set("ic15", FUNC(z80sio_device::txca_w)); CLOCK(config, "ic15_rxtxcb", 4_MHz_XTAL / 16).signal_handler().set(m_sio, FUNC(z80sio_device::rxtxcb_w)); diff --git a/src/mame/drivers/astrocde.cpp b/src/mame/drivers/astrocde.cpp index fd54719916e..7d75245316a 100644 --- a/src/mame/drivers/astrocde.cpp +++ b/src/mame/drivers/astrocde.cpp @@ -1351,14 +1351,14 @@ MACHINE_CONFIG_START(astrocde_state::wow) MCFG_DEVICE_PROGRAM_MAP(wow_map) MCFG_DEVICE_IO_MAP(port_map_stereo_pattern) - MCFG_DEVICE_ADD("outlatch", CD4099, 0) - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, astrocde_state, coin_counter_w<0>)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, astrocde_state, coin_counter_w<1>)) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, astrocde_state, sparkle_w<0>)) - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, astrocde_state, sparkle_w<1>)) - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(*this, astrocde_state, sparkle_w<2>)) - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE(*this, astrocde_state, sparkle_w<3>)) - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, astrocde_state, coin_counter_w<2>)) + cd4099_device &outlatch(CD4099(config, "outlatch")); + outlatch.q_out_cb<0>().set(FUNC(astrocde_state::coin_counter_w<0>)); + outlatch.q_out_cb<1>().set(FUNC(astrocde_state::coin_counter_w<1>)); + outlatch.q_out_cb<2>().set(FUNC(astrocde_state::sparkle_w<0>)); + outlatch.q_out_cb<3>().set(FUNC(astrocde_state::sparkle_w<1>)); + outlatch.q_out_cb<4>().set(FUNC(astrocde_state::sparkle_w<2>)); + outlatch.q_out_cb<5>().set(FUNC(astrocde_state::sparkle_w<3>)); + outlatch.q_out_cb<7>().set(FUNC(astrocde_state::coin_counter_w<2>)); /* video hardware */ MCFG_SCREEN_MODIFY("screen") @@ -1385,25 +1385,25 @@ MACHINE_CONFIG_START(astrocde_state::gorf) MCFG_DEVICE_PROGRAM_MAP(wow_map) MCFG_DEVICE_IO_MAP(port_map_stereo_pattern) - MCFG_DEVICE_ADD("outlatch", CD4099, 0) // MC14099B on game board at U6 - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, astrocde_state, coin_counter_w<0>)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, astrocde_state, coin_counter_w<1>)) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, astrocde_state, sparkle_w<0>)) - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, astrocde_state, sparkle_w<1>)) - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(*this, astrocde_state, sparkle_w<2>)) - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE(*this, astrocde_state, sparkle_w<3>)) - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(*this, astrocde_state, gorf_sound_switch_w)) - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(OUTPUT("lamp6")) - - MCFG_DEVICE_ADD("lamplatch", CD4099, 0) // MC14099B on game board at U7 - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(OUTPUT("lamp0")) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(OUTPUT("lamp1")) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(OUTPUT("lamp2")) - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(OUTPUT("lamp3")) - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(OUTPUT("lamp4")) - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(OUTPUT("lamp5")) - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(NOOP) // n/c - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(OUTPUT("lamp7")) + cd4099_device &outlatch(CD4099(config, "outlatch")); // MC14099B on game board at U6 + outlatch.q_out_cb<0>().set(FUNC(astrocde_state::coin_counter_w<0>)); + outlatch.q_out_cb<1>().set(FUNC(astrocde_state::coin_counter_w<1>)); + outlatch.q_out_cb<2>().set(FUNC(astrocde_state::sparkle_w<0>)); + outlatch.q_out_cb<3>().set(FUNC(astrocde_state::sparkle_w<1>)); + outlatch.q_out_cb<4>().set(FUNC(astrocde_state::sparkle_w<2>)); + outlatch.q_out_cb<5>().set(FUNC(astrocde_state::sparkle_w<3>)); + outlatch.q_out_cb<6>().set(FUNC(astrocde_state::gorf_sound_switch_w)); + outlatch.q_out_cb<7>().set_output("lamp6"); + + cd4099_device &lamplatch(CD4099(config, "lamplatch")); // MC14099B on game board at U7 + lamplatch.q_out_cb<0>().set_output("lamp0"); + lamplatch.q_out_cb<1>().set_output("lamp1"); + lamplatch.q_out_cb<2>().set_output("lamp2"); + lamplatch.q_out_cb<3>().set_output("lamp3"); + lamplatch.q_out_cb<4>().set_output("lamp4"); + lamplatch.q_out_cb<5>().set_output("lamp5"); + lamplatch.q_out_cb<6>().set_nop(); // n/c + lamplatch.q_out_cb<7>().set_output("lamp7"); MCFG_WATCHDOG_ADD("watchdog") // MC14024 on CPU board at U18 MCFG_WATCHDOG_VBLANK_INIT("screen", 128) // CLK = VERTDR, Q7 used for RESET @@ -1443,12 +1443,12 @@ MACHINE_CONFIG_START(astrocde_state::robby) MCFG_NVRAM_ADD_0FILL("nvram") // HM6116LP-4 + battery - MCFG_DEVICE_ADD("outlatch", CD4099, 0) // on game board at U1 - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, astrocde_state, coin_counter_w<0>)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, astrocde_state, coin_counter_w<1>)) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, astrocde_state, coin_counter_w<2>)) - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(OUTPUT("led0")) - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(OUTPUT("led1")) + cd4099_device &outlatch(CD4099(config, "outlatch")); // on game board at U1 + outlatch.q_out_cb<0>().set(FUNC(astrocde_state::coin_counter_w<0>)); + outlatch.q_out_cb<1>().set(FUNC(astrocde_state::coin_counter_w<1>)); + outlatch.q_out_cb<2>().set(FUNC(astrocde_state::coin_counter_w<2>)); + outlatch.q_out_cb<6>().set_output("led0"); + outlatch.q_out_cb<7>().set_output("led1"); MCFG_DEVICE_MODIFY("astrocade1") MCFG_ASTROCADE_IO_SO5_STROBE_CB(WRITE8("outlatch", cd4099_device, write_nibble_d0)) diff --git a/src/mame/drivers/asuka.cpp b/src/mame/drivers/asuka.cpp index b8e9ecf50ef..5bcc7e3f095 100644 --- a/src/mame/drivers/asuka.cpp +++ b/src/mame/drivers/asuka.cpp @@ -962,8 +962,8 @@ MACHINE_CONFIG_START(asuka_state::asuka) MCFG_MSM5205_PRESCALER_SELECTOR(S48_4B) /* 8 kHz */ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) - MCFG_DEVICE_ADD("adpcm_select", LS157, 0) - MCFG_74157_OUT_CB(WRITE8("msm", msm5205_device, data_w)) + LS157(config, m_adpcm_select, 0); + m_adpcm_select->out_callback().set("msm", FUNC(msm5205_device::data_w)); MCFG_DEVICE_ADD("ciu", PC060HA, 0) MCFG_PC060HA_MASTER_CPU("maincpu") @@ -1099,8 +1099,8 @@ MACHINE_CONFIG_START(asuka_state::mofflott) MCFG_MSM5205_PRESCALER_SELECTOR(S48_4B) /* 8 kHz */ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) - MCFG_DEVICE_ADD("adpcm_select", LS157, 0) - MCFG_74157_OUT_CB(WRITE8("msm", msm5205_device, data_w)) + LS157(config, m_adpcm_select, 0); + m_adpcm_select->out_callback().set("msm", FUNC(msm5205_device::data_w)); MCFG_DEVICE_ADD("ciu", PC060HA, 0) MCFG_PC060HA_MASTER_CPU("maincpu") diff --git a/src/mame/drivers/avalnche.cpp b/src/mame/drivers/avalnche.cpp index 9edc6586121..c1b0f87d5dc 100644 --- a/src/mame/drivers/avalnche.cpp +++ b/src/mame/drivers/avalnche.cpp @@ -222,11 +222,11 @@ MACHINE_CONFIG_START(avalnche_state::avalnche_base) MCFG_DEVICE_PROGRAM_MAP(main_map) MCFG_DEVICE_PERIODIC_INT_DRIVER(avalnche_state, nmi_line_pulse, 8*60) - MCFG_DEVICE_ADD("latch", F9334, 0) // F8 - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(OUTPUT("led0")) // 1 CREDIT LAMP - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, avalnche_state, video_invert_w)) - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(OUTPUT("led1")) // 2 CREDIT LAMP - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(OUTPUT("led2")) // START LAMP + F9334(config, m_latch); // F8 + m_latch->q_out_cb<0>().set_output("led0"); // 1 CREDIT LAMP + m_latch->q_out_cb<2>().set(FUNC(avalnche_state::video_invert_w)); + m_latch->q_out_cb<3>().set_output("led1"); // 2 CREDIT LAMP + m_latch->q_out_cb<7>().set_output("led2"); // START LAMP // Q1, Q4, Q5, Q6 are configured in audio/avalnche.cpp MCFG_WATCHDOG_ADD("watchdog") diff --git a/src/mame/drivers/bagman.cpp b/src/mame/drivers/bagman.cpp index 03830cbeac7..c256ca8377c 100644 --- a/src/mame/drivers/bagman.cpp +++ b/src/mame/drivers/bagman.cpp @@ -424,34 +424,44 @@ WRITE_LINE_MEMBER(bagman_state::vblank_irq) m_maincpu->set_input_line(0, ASSERT_LINE); } - -MACHINE_CONFIG_START(bagman_state::bagman) - - /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", Z80, BAGMAN_H0) - MCFG_DEVICE_PROGRAM_MAP(main_map) - MCFG_DEVICE_IO_MAP(main_portmap) - - MCFG_DEVICE_ADD("mainlatch", LS259, 0) // 8H - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, bagman_state, irq_mask_w)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, bagman_state, flipscreen_x_w)) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, bagman_state, flipscreen_y_w)) +void bagman_state::bagman_base(machine_config &config) +{ + Z80(config, m_maincpu, BAGMAN_H0); + m_maincpu->set_addrmap(AS_PROGRAM, &bagman_state::main_map); + m_maincpu->set_addrmap(AS_IO, &bagman_state::main_portmap); + + LS259(config, m_mainlatch); // 8H + m_mainlatch->q_out_cb<0>().set(FUNC(bagman_state::irq_mask_w)); + m_mainlatch->q_out_cb<1>().set(FUNC(bagman_state::flipscreen_x_w)); + m_mainlatch->q_out_cb<2>().set(FUNC(bagman_state::flipscreen_y_w)); // video enable register not available on earlier hardware revision(s) // Bagman is supposed to have glitches during screen transitions - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(*this, bagman_state, coin_counter_w)) - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(NOOP) // ???? + m_mainlatch->q_out_cb<4>().set(FUNC(bagman_state::coin_counter_w)); + m_mainlatch->q_out_cb<4>().set_nop(); // ???? /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_RAW_PARAMS(BAGMAN_HCLK, HTOTAL, HBEND, HBSTART, VTOTAL, VBEND, VBSTART) - MCFG_SCREEN_UPDATE_DRIVER(bagman_state, screen_update) - MCFG_SCREEN_PALETTE("palette") - MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, bagman_state, vblank_irq)) + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_raw(BAGMAN_HCLK, HTOTAL, HBEND, HBSTART, VTOTAL, VBEND, VBSTART); + screen.set_screen_update(FUNC(bagman_state::screen_update)); + screen.set_palette("palette"); + screen.screen_vblank().set(FUNC(bagman_state::vblank_irq)); - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_bagman) - MCFG_PALETTE_ADD("palette", 64) + GFXDECODE(config, m_gfxdecode, "palette", gfx_bagman); - MCFG_PALETTE_INIT_OWNER(bagman_state,bagman) + PALETTE(config, m_palette, 64); + m_palette->set_init(DEVICE_SELF_OWNER, FUNC(bagman_state::palette_init_bagman)); + + /* sound hardware */ + SPEAKER(config, "mono").front_center(); + + ay8910_device &aysnd(AY8910(config, "aysnd", BAGMAN_H0 / 2)); + aysnd.port_a_read_callback().set_ioport("P1"); + aysnd.port_b_read_callback().set_ioport("P2"); + aysnd.add_route(ALL_OUTPUTS, "mono", 0.40); +} + +MACHINE_CONFIG_START(bagman_state::bagman) + bagman_base(config); MCFG_DEVICE_ADD("tmsprom", TMSPROM, 640000 / 2) /* rom clock */ MCFG_TMSPROM_REGION("5110ctrl") /* prom memory region - sound region is automatically assigned */ @@ -467,42 +477,31 @@ MACHINE_CONFIG_START(bagman_state::bagman) MCFG_TMSPROM_PDC_CB(WRITELINE("tms", tms5110_device, pdc_w)) /* tms pdc func */ MCFG_TMSPROM_CTL_CB(WRITE8("tms", tms5110_device, ctl_w)) /* tms ctl func */ - /* sound hardware */ - SPEAKER(config, "mono").front_center(); - - MCFG_DEVICE_ADD("aysnd", AY8910, BAGMAN_H0 / 2) - MCFG_AY8910_PORT_A_READ_CB(IOPORT("P1")) - MCFG_AY8910_PORT_B_READ_CB(IOPORT("P2")) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40) - MCFG_DEVICE_ADD("tms", TMS5110A, 640000) MCFG_TMS5110_M0_CB(WRITELINE("tmsprom", tmsprom_device, m0_w)) MCFG_TMS5110_DATA_CB(READLINE("tmsprom", tmsprom_device, data_r)) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) - MCFG_DEVICE_ADD("tmslatch", LS259, 0) // 7H - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, bagman_state, tmsprom_bit_w)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, bagman_state, tmsprom_bit_w)) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, bagman_state, tmsprom_bit_w)) - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE("tmsprom", tmsprom_device, enable_w)) - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(*this, bagman_state, tmsprom_csq0_w)) - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE(*this, bagman_state, tmsprom_csq1_w)) + LS259(config, m_tmslatch); // 7H + m_tmslatch->q_out_cb<0>().set(FUNC(bagman_state::tmsprom_bit_w)); + m_tmslatch->q_out_cb<1>().set(FUNC(bagman_state::tmsprom_bit_w)); + m_tmslatch->q_out_cb<2>().set(FUNC(bagman_state::tmsprom_bit_w)); + m_tmslatch->q_out_cb<3>().set("tmsprom", FUNC(tmsprom_device::enable_w)); + m_tmslatch->q_out_cb<4>().set(FUNC(bagman_state::tmsprom_csq0_w)); + m_tmslatch->q_out_cb<5>().set(FUNC(bagman_state::tmsprom_csq1_w)); MACHINE_CONFIG_END -MACHINE_CONFIG_START(bagman_state::sbagman) +void bagman_state::sbagman(machine_config &config) +{ bagman(config); - MCFG_DEVICE_MODIFY("mainlatch") - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, bagman_state, video_enable_w)) -MACHINE_CONFIG_END - -MACHINE_CONFIG_START(bagman_state::sbagmani) - sbagman(config); + m_mainlatch->q_out_cb<3>().set(FUNC(bagman_state::video_enable_w)); +} - // only 1 AY8910 - MCFG_DEVICE_REMOVE("tmsprom") - MCFG_DEVICE_REMOVE("tms") - MCFG_DEVICE_REMOVE("tmslatch") -MACHINE_CONFIG_END +void bagman_state::sbagmani(machine_config &config) +{ + bagman_base(config); + m_mainlatch->q_out_cb<3>().set(FUNC(bagman_state::video_enable_w)); +} MACHINE_CONFIG_START(bagman_state::pickin) @@ -511,15 +510,15 @@ MACHINE_CONFIG_START(bagman_state::pickin) MCFG_DEVICE_PROGRAM_MAP(pickin_map) MCFG_DEVICE_IO_MAP(main_portmap) - MCFG_DEVICE_ADD("mainlatch", LS259, 0) - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, bagman_state, irq_mask_w)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, bagman_state, flipscreen_x_w)) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, bagman_state, flipscreen_y_w)) - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, bagman_state, video_enable_w)) - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(*this, bagman_state, coin_counter_w)) - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(NOOP) // ???? - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(NOOP) // ???? - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(NOOP) // ???? + LS259(config, m_mainlatch); + m_mainlatch->q_out_cb<0>().set(FUNC(bagman_state::irq_mask_w)); + m_mainlatch->q_out_cb<1>().set(FUNC(bagman_state::flipscreen_x_w)); + m_mainlatch->q_out_cb<2>().set(FUNC(bagman_state::flipscreen_y_w)); + m_mainlatch->q_out_cb<3>().set(FUNC(bagman_state::video_enable_w)); + m_mainlatch->q_out_cb<4>().set(FUNC(bagman_state::coin_counter_w)); + m_mainlatch->q_out_cb<5>().set_nop(); // ???? + m_mainlatch->q_out_cb<6>().set_nop(); // ???? + m_mainlatch->q_out_cb<7>().set_nop(); // ???? /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) @@ -571,15 +570,15 @@ MACHINE_CONFIG_START(bagman_state::botanic) MCFG_DEVICE_PROGRAM_MAP(pickin_map) MCFG_DEVICE_IO_MAP(main_portmap) - MCFG_DEVICE_ADD("mainlatch", LS259, 0) - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, bagman_state, irq_mask_w)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, bagman_state, flipscreen_x_w)) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, bagman_state, flipscreen_y_w)) - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, bagman_state, video_enable_w)) - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(*this, bagman_state, coin_counter_w)) - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(NOOP) // ???? - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(NOOP) // ???? - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(NOOP) // ???? + LS259(config, m_mainlatch); + m_mainlatch->q_out_cb<0>().set(FUNC(bagman_state::irq_mask_w)); + m_mainlatch->q_out_cb<1>().set(FUNC(bagman_state::flipscreen_x_w)); + m_mainlatch->q_out_cb<2>().set(FUNC(bagman_state::flipscreen_y_w)); + m_mainlatch->q_out_cb<3>().set(FUNC(bagman_state::video_enable_w)); + m_mainlatch->q_out_cb<4>().set(FUNC(bagman_state::coin_counter_w)); + m_mainlatch->q_out_cb<5>().set_nop(); // ???? + m_mainlatch->q_out_cb<6>().set_nop(); // ???? + m_mainlatch->q_out_cb<7>().set_nop(); // ???? /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) diff --git a/src/mame/drivers/balsente.cpp b/src/mame/drivers/balsente.cpp index eac9c000dc2..c48967b4989 100644 --- a/src/mame/drivers/balsente.cpp +++ b/src/mame/drivers/balsente.cpp @@ -1344,17 +1344,17 @@ MACHINE_CONFIG_START(balsente_state::balsente) MCFG_PIT8253_CLK1(8_MHz_XTAL / 4) MCFG_PIT8253_CLK2(8_MHz_XTAL / 4) - MCFG_DEVICE_ADD("outlatch", LS259, 0) // U9H + LS259(config, m_outlatch); // U9H // these outputs are generally used to control the various lamps - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, balsente_state, out0_w)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, balsente_state, out1_w)) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, balsente_state, out2_w)) - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, balsente_state, out3_w)) - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(*this, balsente_state, out4_w)) - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE(*this, balsente_state, out5_w)) - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(*this, balsente_state, out6_w)) + m_outlatch->q_out_cb<0>().set(FUNC(balsente_state::out0_w)); + m_outlatch->q_out_cb<1>().set(FUNC(balsente_state::out1_w)); + m_outlatch->q_out_cb<2>().set(FUNC(balsente_state::out2_w)); + m_outlatch->q_out_cb<3>().set(FUNC(balsente_state::out3_w)); + m_outlatch->q_out_cb<4>().set(FUNC(balsente_state::out4_w)); + m_outlatch->q_out_cb<5>().set(FUNC(balsente_state::out5_w)); + m_outlatch->q_out_cb<6>().set(FUNC(balsente_state::out6_w)); // special case is output 7, which recalls the NVRAM data - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, balsente_state, nvrecall_w)) + m_outlatch->q_out_cb<7>().set(FUNC(balsente_state::nvrecall_w)); /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) diff --git a/src/mame/drivers/bigbord2.cpp b/src/mame/drivers/bigbord2.cpp index 191d87f26fa..c42788ffbe7 100644 --- a/src/mame/drivers/bigbord2.cpp +++ b/src/mame/drivers/bigbord2.cpp @@ -601,8 +601,8 @@ MACHINE_CONFIG_START(bigbord2_state::bigbord2) MCFG_MC6845_UPDATE_ROW_CB(bigbord2_state, crtc_update_row) MCFG_MC6845_OUT_VSYNC_CB(WRITELINE("ctc1", z80ctc_device, trg3)) - MCFG_DEVICE_ADD("proglatch", LS259, 0) // U41 - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE("outlatch1", ls259_device, clear_w)) // FCRST - also resets the 8877 + ls259_device &proglatch(LS259(config, "proglatch")); // U41 + proglatch.q_out_cb<6>().set("outlatch1", FUNC(ls259_device::clear_w)); // FCRST - also resets the 8877 LS259(config, m_syslatch1, 0); // U14 m_syslatch1->q_out_cb<0>().set_membank(m_bankr); // D_S diff --git a/src/mame/drivers/bsktball.cpp b/src/mame/drivers/bsktball.cpp index c9b01a12e8a..d917977a5dd 100644 --- a/src/mame/drivers/bsktball.cpp +++ b/src/mame/drivers/bsktball.cpp @@ -246,14 +246,14 @@ MACHINE_CONFIG_START(bsktball_state::bsktball) MCFG_DEVICE_PROGRAM_MAP(main_map) MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", bsktball_state, bsktball_scanline, "screen", 0, 1) - MCFG_DEVICE_ADD("outlatch", F9334, 0) // M6 - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(NOOP) // Coin Counter - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(OUTPUT("led0")) // LED 1 - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(OUTPUT("led1")) // LED 2 - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(*this, bsktball_state, ld1_w)) // LD 1 - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE(*this, bsktball_state, ld2_w)) // LD 2 - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE("discrete", discrete_device, write_line)) // Noise Reset - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, bsktball_state, nmion_w)) // NMI On + f9334_device &outlatch(F9334(config, "outlatch")); // M6 + outlatch.q_out_cb<1>().set_nop(); // Coin Counter + outlatch.q_out_cb<2>().set_output("led0"); // LED 1 + outlatch.q_out_cb<3>().set_output("led1"); // LED 2 + outlatch.q_out_cb<4>().set(FUNC(bsktball_state::ld1_w)); // LD 1 + outlatch.q_out_cb<5>().set(FUNC(bsktball_state::ld2_w)); // LD 2 + outlatch.q_out_cb<6>().set("discrete", FUNC(discrete_device::write_line)); // Noise Reset + outlatch.q_out_cb<7>().set(FUNC(bsktball_state::nmion_w)); // NMI On /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) diff --git a/src/mame/drivers/canyon.cpp b/src/mame/drivers/canyon.cpp index 05e5851648c..b1de3875d12 100644 --- a/src/mame/drivers/canyon.cpp +++ b/src/mame/drivers/canyon.cpp @@ -244,13 +244,13 @@ MACHINE_CONFIG_START(canyon_state::canyon) MCFG_DEVICE_ADD("maincpu", M6502, 12.096_MHz_XTAL / 16) MCFG_DEVICE_PROGRAM_MAP(main_map) - MCFG_DEVICE_ADD("outlatch", F9334, 0) // C7 - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE("discrete", discrete_device, write_line)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE("discrete", discrete_device, write_line)) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(OUTPUT("led0")) // 1 PLAYER LAMP - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(OUTPUT("led1")) // 2 PLAYER LAMP - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE("discrete", discrete_device, write_line)) - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE("discrete", discrete_device, write_line)) + F9334(config, m_outlatch); // C7 + m_outlatch->q_out_cb<0>().set("discrete", FUNC(discrete_device::write_line)); + m_outlatch->q_out_cb<1>().set("discrete", FUNC(discrete_device::write_line)); + m_outlatch->q_out_cb<2>().set_output("led0"); // 1 PLAYER LAMP + m_outlatch->q_out_cb<3>().set_output("led1"); // 2 PLAYER LAMP + m_outlatch->q_out_cb<4>().set("discrete", FUNC(discrete_device::write_line)); + m_outlatch->q_out_cb<5>().set("discrete", FUNC(discrete_device::write_line)); MCFG_WATCHDOG_ADD("watchdog") MCFG_WATCHDOG_VBLANK_INIT("screen", 8) diff --git a/src/mame/drivers/carpolo.cpp b/src/mame/drivers/carpolo.cpp index fdc72d92a86..c501af749bf 100644 --- a/src/mame/drivers/carpolo.cpp +++ b/src/mame/drivers/carpolo.cpp @@ -275,12 +275,12 @@ MACHINE_CONFIG_START(carpolo_state::carpolo) MCFG_DEVICE_ADD(m_ttl7474_1a_1, TTL7474, 0) MCFG_DEVICE_ADD(m_ttl7474_1a_2, TTL7474, 0) - MCFG_DEVICE_ADD(m_ttl74148_3s, TTL74148, 0) - MCFG_74148_OUTPUT_CB(carpolo_state, ttl74148_3s_cb) + TTL74148(config, m_ttl74148_3s, 0); + m_ttl74148_3s->out_cb().set(FUNC(carpolo_state::ttl74148_3s_cb)); - MCFG_DEVICE_ADD(m_ttl74153_1k, TTL153) - MCFG_TTL153_ZA_CB(WRITELINE(*this, carpolo_state, ls153_za_w)) // pia1 pb5 - MCFG_TTL153_ZB_CB(WRITELINE(*this, carpolo_state, ls153_zb_w)) // pia1 pb4 + TTL153(config, m_ttl74153_1k); + m_ttl74153_1k->za_cb().set(FUNC(carpolo_state::ls153_za_w)); // pia1 pb5 + m_ttl74153_1k->zb_cb().set(FUNC(carpolo_state::ls153_zb_w)); // pia1 pb4 /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) diff --git a/src/mame/drivers/cclimber.cpp b/src/mame/drivers/cclimber.cpp index 2ecfd8f9d03..4927471ce56 100644 --- a/src/mame/drivers/cclimber.cpp +++ b/src/mame/drivers/cclimber.cpp @@ -1116,9 +1116,9 @@ MACHINE_CONFIG_START(cclimber_state::root) MCFG_DEVICE_IO_MAP(cclimber_portmap) MCFG_DEVICE_ADD(m_mainlatch, LS259, 0) - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, cclimber_state, nmi_mask_w)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, cclimber_state, flip_screen_x_w)) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, cclimber_state, flip_screen_y_w)) + m_mainlatch->q_out_cb<0>().set(FUNC(cclimber_state::nmi_mask_w)); + m_mainlatch->q_out_cb<1>().set(FUNC(cclimber_state::flip_screen_x_w)); + m_mainlatch->q_out_cb<2>().set(FUNC(cclimber_state::flip_screen_y_w)); /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) @@ -1254,11 +1254,11 @@ MACHINE_CONFIG_START(cclimber_state::swimmer) MCFG_DEVICE_PROGRAM_MAP(swimmer_map) MCFG_DEVICE_ADD(m_mainlatch, LS259, 0) - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, cclimber_state, nmi_mask_w)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, cclimber_state, flip_screen_x_w)) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, cclimber_state, flip_screen_y_w)) - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, cclimber_state, sidebg_enable_w)) - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(*this, cclimber_state, palette_bank_w)) + m_mainlatch->q_out_cb<0>().set(FUNC(cclimber_state::nmi_mask_w)); + m_mainlatch->q_out_cb<1>().set(FUNC(cclimber_state::flip_screen_x_w)); + m_mainlatch->q_out_cb<2>().set(FUNC(cclimber_state::flip_screen_y_w)); + m_mainlatch->q_out_cb<3>().set(FUNC(cclimber_state::sidebg_enable_w)); + m_mainlatch->q_out_cb<4>().set(FUNC(cclimber_state::palette_bank_w)); MCFG_DEVICE_ADD("audiocpu", Z80,XTAL(4'000'000)/2) /* verified on pcb */ MCFG_DEVICE_PROGRAM_MAP(swimmer_audio_map) diff --git a/src/mame/drivers/cd2650.cpp b/src/mame/drivers/cd2650.cpp index e989d0eb724..e77327012e8 100644 --- a/src/mame/drivers/cd2650.cpp +++ b/src/mame/drivers/cd2650.cpp @@ -295,9 +295,9 @@ MACHINE_CONFIG_START(cd2650_state::cd2650) MCFG_S2650_SENSE_INPUT(READLINE(*this, cd2650_state, cass_r)) MCFG_S2650_FLAG_OUTPUT(WRITELINE(*this, cd2650_state, cass_w)) - MCFG_DEVICE_ADD("outlatch", F9334, 0) // IC26 - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, cd2650_state, tape_deck_on_w)) // TD ON - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE("beeper", beep_device, set_state)) // OUT6 + f9334_device &outlatch(F9334(config, "outlatch")); // IC26 + outlatch.q_out_cb<0>().set(FUNC(cd2650_state::tape_deck_on_w)); // TD ON + outlatch.q_out_cb<7>().set("beeper", FUNC(beep_device::set_state)); // OUT6 // Q1-Q7 = OUT 0-6, not defined in RE // The connection of OUT6 to a 700-1200 Hz noise generator is suggested // in Central Data 2650 Newsletter, Volume 1, Issue 3 for use with the diff --git a/src/mame/drivers/centiped.cpp b/src/mame/drivers/centiped.cpp index 7a2249e9f73..4061bfe3379 100644 --- a/src/mame/drivers/centiped.cpp +++ b/src/mame/drivers/centiped.cpp @@ -419,7 +419,6 @@ each direction to assign the boundries. #include "cpu/m6502/m6502.h" #include "cpu/s2650/s2650.h" -#include "machine/74259.h" #include "machine/watchdog.h" #include "sound/sn76496.h" #include "sound/pokey.h" @@ -1749,12 +1748,12 @@ MACHINE_CONFIG_START(centiped_state::centiped_base) MCFG_DEVICE_ADD("earom", ER2055) - ls259_device &outlatch(LS259(config, "outlatch")); - outlatch.q_out_cb<0>().set(FUNC(centiped_state::coin_counter_left_w)); - outlatch.q_out_cb<1>().set(FUNC(centiped_state::coin_counter_center_w)); - outlatch.q_out_cb<2>().set(FUNC(centiped_state::coin_counter_right_w)); - outlatch.q_out_cb<3>().set_output("led0").invert(); // LED 1 - outlatch.q_out_cb<4>().set_output("led1").invert(); // LED 2 + LS259(config, m_outlatch); + m_outlatch->q_out_cb<0>().set(FUNC(centiped_state::coin_counter_left_w)); + m_outlatch->q_out_cb<1>().set(FUNC(centiped_state::coin_counter_center_w)); + m_outlatch->q_out_cb<2>().set(FUNC(centiped_state::coin_counter_right_w)); + m_outlatch->q_out_cb<3>().set_output("led0").invert(); // LED 1 + m_outlatch->q_out_cb<4>().set_output("led1").invert(); // LED 2 MCFG_WATCHDOG_ADD("watchdog") @@ -1781,8 +1780,8 @@ MACHINE_CONFIG_START(centiped_state::centiped) MCFG_DEVICE_MODIFY("maincpu") MCFG_DEVICE_PROGRAM_MAP(centiped_map) - MCFG_DEVICE_MODIFY("outlatch") // M10 - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, centiped_state, flip_screen_w)) + // M10 + m_outlatch->q_out_cb<7>().set(FUNC(centiped_state::flip_screen_w)); /* sound hardware */ SPEAKER(config, "mono").front_center(); @@ -1808,8 +1807,7 @@ MACHINE_CONFIG_START(centiped_state::caterplr) MCFG_DEVICE_MODIFY("maincpu") MCFG_DEVICE_PROGRAM_MAP(caterplr_map) - MCFG_DEVICE_MODIFY("outlatch") - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, centiped_state, flip_screen_w)) + m_outlatch->q_out_cb<7>().set(FUNC(centiped_state::flip_screen_w)); /* sound hardware */ SPEAKER(config, "mono").front_center(); @@ -1827,8 +1825,7 @@ MACHINE_CONFIG_START(centiped_state::centipdb) MCFG_DEVICE_MODIFY("maincpu") MCFG_DEVICE_PROGRAM_MAP(centipdb_map) - MCFG_DEVICE_MODIFY("outlatch") - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, centiped_state, flip_screen_w)) + m_outlatch->q_out_cb<7>().set(FUNC(centiped_state::flip_screen_w)); /* sound hardware */ SPEAKER(config, "mono").front_center(); @@ -1847,8 +1844,8 @@ MACHINE_CONFIG_START(centiped_state::magworm) MCFG_DEVICE_PROGRAM_MAP(magworm_map) MCFG_MACHINE_RESET_OVERRIDE(centiped_state,magworm) - MCFG_DEVICE_MODIFY("outlatch") // 12A - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, centiped_state, flip_screen_w)) + // 12A + m_outlatch->q_out_cb<7>().set(FUNC(centiped_state::flip_screen_w)); /* sound hardware */ SPEAKER(config, "mono").front_center(); @@ -1866,10 +1863,10 @@ MACHINE_CONFIG_START(centiped_state::milliped) MCFG_DEVICE_MODIFY("maincpu") MCFG_DEVICE_PROGRAM_MAP(milliped_map) - MCFG_DEVICE_MODIFY("outlatch") // 12E - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE(*this, centiped_state, input_select_w)) // TBEN - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(*this, centiped_state, flip_screen_w)) - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, centiped_state, control_select_w)) // CNTRLSEL + // 12E + m_outlatch->q_out_cb<5>().set(FUNC(centiped_state::input_select_w)); // TBEN + m_outlatch->q_out_cb<6>().set(FUNC(centiped_state::flip_screen_w)); + m_outlatch->q_out_cb<7>().set(FUNC(centiped_state::control_select_w)); // CNTRLSEL /* video hardware */ MCFG_GFXDECODE_MODIFY("gfxdecode", gfx_milliped) @@ -1915,9 +1912,9 @@ MACHINE_CONFIG_START(centiped_state::warlords) MCFG_DEVICE_REMOVE("earom") // these extra LEDs also appear on Centipede schematics - ls259_device &outlatch(*subdevice("outlatch")); // P9 - outlatch.q_out_cb<5>().set_output("led2").invert(); // LED 3 - outlatch.q_out_cb<6>().set_output("led3").invert(); // LED 4 + // P9 + m_outlatch->q_out_cb<5>().set_output("led2").invert(); // LED 3 + m_outlatch->q_out_cb<6>().set_output("led3").invert(); // LED 4 /* video hardware */ MCFG_GFXDECODE_MODIFY("gfxdecode", gfx_warlords) @@ -1948,8 +1945,7 @@ MACHINE_CONFIG_START(centiped_state::mazeinv) MCFG_DEVICE_MODIFY("maincpu") MCFG_DEVICE_PROGRAM_MAP(mazeinv_map) - MCFG_DEVICE_MODIFY("outlatch") - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(NOOP) + m_outlatch->q_out_cb<7>().set_nop(); MCFG_SCREEN_MODIFY("screen") MCFG_SCREEN_UPDATE_DRIVER(centiped_state, screen_update_centiped) @@ -1966,11 +1962,11 @@ MACHINE_CONFIG_START(centiped_state::bullsdrt) MCFG_DEVICE_ADD("earom", ER2055) - ls259_device &outlatch(LS259(config, "outlatch")); - outlatch.q_out_cb<1>().set(FUNC(centiped_state::bullsdrt_coin_count_w)); - outlatch.q_out_cb<3>().set_output("led0").invert(); - outlatch.q_out_cb<4>().set_output("led1").invert(); - outlatch.q_out_cb<7>().set(FUNC(centiped_state::flip_screen_w)); + LS259(config, m_outlatch); + m_outlatch->q_out_cb<1>().set(FUNC(centiped_state::bullsdrt_coin_count_w)); + m_outlatch->q_out_cb<3>().set_output("led0").invert(); + m_outlatch->q_out_cb<4>().set_output("led1").invert(); + m_outlatch->q_out_cb<7>().set(FUNC(centiped_state::flip_screen_w)); MCFG_WATCHDOG_ADD("watchdog") diff --git a/src/mame/drivers/champbas.cpp b/src/mame/drivers/champbas.cpp index f4eea5c2f34..6c532d607a4 100644 --- a/src/mame/drivers/champbas.cpp +++ b/src/mame/drivers/champbas.cpp @@ -82,7 +82,6 @@ TODO: #include "includes/champbas.h" #include "cpu/z80/z80.h" #include "cpu/m6805/m68705.h" -#include "machine/74259.h" #include "machine/gen_latch.h" #include "machine/watchdog.h" #include "sound/ay8910.h" @@ -193,7 +192,7 @@ void champbas_state::champbas_map(address_map &map) map(0xa080, 0xa080).mirror(0x0020).portr("DSW"); map(0xa0c0, 0xa0c0).portr("SYSTEM"); - map(0xa000, 0xa007).w("mainlatch", FUNC(ls259_device::write_d0)); + map(0xa000, 0xa007).w(m_mainlatch, FUNC(ls259_device::write_d0)); map(0xa060, 0xa06f).writeonly().share("spriteram"); map(0xa080, 0xa080).w("soundlatch", FUNC(generic_latch_8_device::write)); @@ -534,15 +533,15 @@ MACHINE_CONFIG_START(champbas_state::talbot) MCFG_DEVICE_PROGRAM_MAP(champbasj_map) MCFG_DEVICE_VBLANK_INT_DRIVER("screen", champbas_state, vblank_irq) - MCFG_DEVICE_ADD("mainlatch", LS259, 0) - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, champbas_state, irq_enable_w)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(NOOP) // !WORK board output (no use?) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(NOOP) // no gfxbank - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, champbas_state, flipscreen_w)) - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(NOOP) // no palettebank - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(NOOP) // n.c. - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(*this, champbas_state, mcu_start_w)) - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, champbas_state, mcu_switch_w)) + LS259(config, m_mainlatch); + m_mainlatch->q_out_cb<0>().set(FUNC(champbas_state::irq_enable_w)); + m_mainlatch->q_out_cb<1>().set_nop(); // !WORK board output (no use?) + m_mainlatch->q_out_cb<2>().set_nop(); // no gfxbank + m_mainlatch->q_out_cb<3>().set(FUNC(champbas_state::flipscreen_w)); + m_mainlatch->q_out_cb<4>().set_nop(); // no palettebank + m_mainlatch->q_out_cb<5>().set_nop(); // n.c. + m_mainlatch->q_out_cb<6>().set(FUNC(champbas_state::mcu_start_w)); + m_mainlatch->q_out_cb<7>().set(FUNC(champbas_state::mcu_switch_w)); MCFG_DEVICE_ADD("alpha_8201", ALPHA_8201, XTAL(18'432'000)/6/8) MCFG_QUANTUM_PERFECT_CPU("alpha_8201:mcu") @@ -580,15 +579,15 @@ MACHINE_CONFIG_START(champbas_state::champbas) MCFG_DEVICE_PROGRAM_MAP(champbas_map) MCFG_DEVICE_VBLANK_INT_DRIVER("screen", champbas_state, vblank_irq) - MCFG_DEVICE_ADD("mainlatch", LS259, 0) // 9D; 8G on Champion Baseball II Double Board Configuration - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, champbas_state, irq_enable_w)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(NOOP) // !WORK board output (no use?) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, champbas_state, gfxbank_w)) - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, champbas_state, flipscreen_w)) - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(*this, champbas_state, palette_bank_w)) - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(NOOP) // n.c. - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(NOOP) // no MCU - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(NOOP) // no MCU + LS259(config, m_mainlatch); // 9D; 8G on Champion Baseball II Double Board Configuration + m_mainlatch->q_out_cb<0>().set(FUNC(champbas_state::irq_enable_w)); + m_mainlatch->q_out_cb<1>().set_nop(); // !WORK board output (no use?) + m_mainlatch->q_out_cb<2>().set(FUNC(champbas_state::gfxbank_w)); + m_mainlatch->q_out_cb<3>().set(FUNC(champbas_state::flipscreen_w)); + m_mainlatch->q_out_cb<4>().set(FUNC(champbas_state::palette_bank_w)); + m_mainlatch->q_out_cb<5>().set_nop(); // n.c. + m_mainlatch->q_out_cb<6>().set_nop(); // no MCU + m_mainlatch->q_out_cb<7>().set_nop(); // no MCU MCFG_DEVICE_ADD("audiocpu", Z80, XTAL(18'432'000)/6) MCFG_DEVICE_PROGRAM_MAP(champbas_sound_map) @@ -629,9 +628,8 @@ MACHINE_CONFIG_START(champbas_state::champbasj) MCFG_DEVICE_MODIFY("maincpu") MCFG_DEVICE_PROGRAM_MAP(champbasj_map) - MCFG_DEVICE_MODIFY("mainlatch") - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(*this, champbas_state, mcu_start_w)) - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, champbas_state, mcu_switch_w)) + m_mainlatch->q_out_cb<6>().set(FUNC(champbas_state::mcu_start_w)); + m_mainlatch->q_out_cb<7>().set(FUNC(champbas_state::mcu_switch_w)); MCFG_DEVICE_ADD("alpha_8201", ALPHA_8201, XTAL(18'432'000)/6/8) // note: 8302 rom on champbb2 (same device!) MCFG_QUANTUM_PERFECT_CPU("alpha_8201:mcu") @@ -686,15 +684,15 @@ MACHINE_CONFIG_START(exctsccr_state::exctsccr) MCFG_DEVICE_PROGRAM_MAP(exctsccr_map) MCFG_DEVICE_VBLANK_INT_DRIVER("screen", exctsccr_state, vblank_irq) - MCFG_DEVICE_ADD("mainlatch", LS259, 0) - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, exctsccr_state, irq_enable_w)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(NOOP) // !WORK board output (no use?) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, exctsccr_state, gfxbank_w)) - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, exctsccr_state, flipscreen_w)) - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(NOOP) // no palettebank - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(NOOP) // n.c. - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(*this, exctsccr_state, mcu_start_w)) - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, exctsccr_state, mcu_switch_w)) + LS259(config, m_mainlatch); + m_mainlatch->q_out_cb<0>().set(FUNC(exctsccr_state::irq_enable_w)); + m_mainlatch->q_out_cb<1>().set_nop(); // !WORK board output (no use?) + m_mainlatch->q_out_cb<2>().set(FUNC(exctsccr_state::gfxbank_w)); + m_mainlatch->q_out_cb<3>().set(FUNC(exctsccr_state::flipscreen_w)); + m_mainlatch->q_out_cb<4>().set_nop(); // no palettebank + m_mainlatch->q_out_cb<5>().set_nop(); // n.c. + m_mainlatch->q_out_cb<6>().set(FUNC(exctsccr_state::mcu_start_w)); + m_mainlatch->q_out_cb<7>().set(FUNC(exctsccr_state::mcu_switch_w)); MCFG_DEVICE_ADD("audiocpu", Z80, XTAL(14'318'181)/4 ) MCFG_DEVICE_PROGRAM_MAP(exctsccr_sound_map) @@ -756,15 +754,15 @@ MACHINE_CONFIG_START(exctsccr_state::exctsccrb) MCFG_DEVICE_PROGRAM_MAP(exctsccrb_map) MCFG_DEVICE_VBLANK_INT_DRIVER("screen", exctsccr_state, vblank_irq) - MCFG_DEVICE_ADD("mainlatch", LS259, 0) - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, exctsccr_state, irq_enable_w)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(NOOP) // !WORK board output (no use?) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, exctsccr_state, gfxbank_w)) - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, exctsccr_state, flipscreen_w)) - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(NOOP) // no palettebank - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(NOOP) // n.c. - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(*this, exctsccr_state, mcu_start_w)) - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, exctsccr_state, mcu_switch_w)) + LS259(config, m_mainlatch); + m_mainlatch->q_out_cb<0>().set(FUNC(exctsccr_state::irq_enable_w)); + m_mainlatch->q_out_cb<1>().set_nop(); // !WORK board output (no use?) + m_mainlatch->q_out_cb<2>().set(FUNC(exctsccr_state::gfxbank_w)); + m_mainlatch->q_out_cb<3>().set(FUNC(exctsccr_state::flipscreen_w)); + m_mainlatch->q_out_cb<4>().set_nop(); // no palettebank + m_mainlatch->q_out_cb<5>().set_nop(); // n.c. + m_mainlatch->q_out_cb<6>().set(FUNC(exctsccr_state::mcu_start_w)); + m_mainlatch->q_out_cb<7>().set(FUNC(exctsccr_state::mcu_switch_w)); MCFG_DEVICE_ADD("audiocpu", Z80, XTAL(18'432'000)/6) MCFG_DEVICE_PROGRAM_MAP(champbas_sound_map) diff --git a/src/mame/drivers/changela.cpp b/src/mame/drivers/changela.cpp index 75d9691887f..f17f16e01ad 100644 --- a/src/mame/drivers/changela.cpp +++ b/src/mame/drivers/changela.cpp @@ -428,12 +428,12 @@ MACHINE_CONFIG_START(changela_state::changela) MCFG_M68705_PORTC_W_CB(WRITE8(*this, changela_state, changela_68705_port_c_w)) MCFG_DEVICE_VBLANK_INT_DRIVER("screen", changela_state, chl_mcu_irq) - MCFG_DEVICE_ADD("outlatch", LS259, 0) // U44 on Sound I/O Board - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, changela_state, collision_reset_0_w)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, changela_state, coin_counter_1_w)) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, changela_state, coin_counter_2_w)) - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(*this, changela_state, mcu_pc_0_w)) - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE(*this, changela_state, collision_reset_1_w)) + ls259_device &outlatch(LS259(config, "outlatch")); // U44 on Sound I/O Board + outlatch.q_out_cb<0>().set(FUNC(changela_state::collision_reset_0_w)); + outlatch.q_out_cb<1>().set(FUNC(changela_state::coin_counter_1_w)); + outlatch.q_out_cb<2>().set(FUNC(changela_state::coin_counter_2_w)); + outlatch.q_out_cb<4>().set(FUNC(changela_state::mcu_pc_0_w)); + outlatch.q_out_cb<5>().set(FUNC(changela_state::collision_reset_1_w)); MCFG_WATCHDOG_ADD("watchdog") diff --git a/src/mame/drivers/cinemat.cpp b/src/mame/drivers/cinemat.cpp index a64dc230e31..7c199f9e9ee 100644 --- a/src/mame/drivers/cinemat.cpp +++ b/src/mame/drivers/cinemat.cpp @@ -982,9 +982,9 @@ MACHINE_CONFIG_START(cinemat_state::cinemat_nojmi_4k) MCFG_DEVICE_DATA_MAP(data_map) MCFG_DEVICE_IO_MAP(io_map) - MCFG_DEVICE_ADD("outlatch", LS259, 0) // 7J on CCG-1 - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE(*this, cinemat_state, coin_reset_w)) - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(*this, cinemat_state, vector_control_w)) + LS259(config, m_outlatch); // 7J on CCG-1 + m_outlatch->q_out_cb<5>().set(FUNC(cinemat_state::coin_reset_w)); + m_outlatch->q_out_cb<6>().set(FUNC(cinemat_state::vector_control_w)); /* video hardware */ MCFG_VECTOR_ADD("vector") @@ -1077,8 +1077,7 @@ MACHINE_CONFIG_START(cinemat_state::tailg) cinemat_nojmi_8k(config); tailg_sound(config); - MCFG_DEVICE_MODIFY("outlatch") - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, cinemat_state, mux_select_w)) + m_outlatch->q_out_cb<7>().set(FUNC(cinemat_state::mux_select_w)); MACHINE_CONFIG_END @@ -1118,8 +1117,7 @@ MACHINE_CONFIG_START(cinemat_color_state::boxingb) MCFG_SCREEN_MODIFY("screen") MCFG_SCREEN_VISIBLE_AREA(0, 1024, 0, 788) - MCFG_DEVICE_MODIFY("outlatch") - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, cinemat_state, mux_select_w)) + m_outlatch->q_out_cb<7>().set(FUNC(cinemat_state::mux_select_w)); MACHINE_CONFIG_END diff --git a/src/mame/drivers/circusc.cpp b/src/mame/drivers/circusc.cpp index 12540299ee3..1c993de2ddc 100644 --- a/src/mame/drivers/circusc.cpp +++ b/src/mame/drivers/circusc.cpp @@ -350,13 +350,13 @@ MACHINE_CONFIG_START(circusc_state::circusc) MCFG_DEVICE_ADD("maincpu", KONAMI1, 2048000) /* 2 MHz? */ MCFG_DEVICE_PROGRAM_MAP(circusc_map) - MCFG_DEVICE_ADD("mainlatch", LS259, 0) // 2C - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, circusc_state, flipscreen_w)) // FLIP - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, circusc_state, irq_mask_w)) // INTST - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(NOOP) // MUT - not used - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, circusc_state, coin_counter_1_w)) // COIN1 - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(*this, circusc_state, coin_counter_2_w)) // COIN2 - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE(*this, circusc_state, spritebank_w)) // OBJ CHENG + ls259_device &mainlatch(LS259(config, "mainlatch")); // 2C + mainlatch.q_out_cb<0>().set(FUNC(circusc_state::flipscreen_w)); // FLIP + mainlatch.q_out_cb<1>().set(FUNC(circusc_state::irq_mask_w)); // INTST + mainlatch.q_out_cb<2>().set_nop(); // MUT - not used + mainlatch.q_out_cb<3>().set(FUNC(circusc_state::coin_counter_1_w)); // COIN1 + mainlatch.q_out_cb<4>().set(FUNC(circusc_state::coin_counter_2_w)); // COIN2 + mainlatch.q_out_cb<5>().set(FUNC(circusc_state::spritebank_w)); // OBJ CHENG MCFG_WATCHDOG_ADD("watchdog") MCFG_WATCHDOG_VBLANK_INIT("screen", 8) diff --git a/src/mame/drivers/cortex.cpp b/src/mame/drivers/cortex.cpp index bdecceeafdb..43662ffbba3 100644 --- a/src/mame/drivers/cortex.cpp +++ b/src/mame/drivers/cortex.cpp @@ -186,14 +186,14 @@ MACHINE_CONFIG_START(cortex_state::cortex) // No lines connected yet MCFG_TMS99xx_ADD("maincpu", TMS9995, XTAL(12'000'000), mem_map, io_map) - MCFG_DEVICE_ADD("control", LS259, 0) // IC64 - //MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, cortex_state, basic_led_w)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, cortex_state, keyboard_ack_w)) - //MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, cortex_state, ebus_int_ack_w)) - //MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, cortex_state, ebus_to_en_w)) - //MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(*this, cortex_state, disk_size_w)) - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE(*this, cortex_state, romsw_w)) - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE("beeper", beep_device, set_state)) + ls259_device &control(LS259(config, "control")); // IC64 + //control.q_out_cb<0>().set(FUNC(cortex_state::basic_led_w)); + control.q_out_cb<1>().set(FUNC(cortex_state::keyboard_ack_w)); + //control.q_out_cb<2>().set(FUNC(cortex_state::ebus_int_ack_w)); + //control.q_out_cb<3>().set(FUNC(cortex_state::ebus_to_en_w)); + //control.q_out_cb<4>().set(FUNC(cortex_state::disk_size_w)); + control.q_out_cb<5>().set(FUNC(cortex_state::romsw_w)); + control.q_out_cb<6>().set("beeper", FUNC(beep_device::set_state)); /* video hardware */ tms9929a_device &crtc(TMS9929A(config, "crtc", XTAL(10'738'635) / 2)); diff --git a/src/mame/drivers/crgolf.cpp b/src/mame/drivers/crgolf.cpp index 36ebdc417bc..da852644593 100644 --- a/src/mame/drivers/crgolf.cpp +++ b/src/mame/drivers/crgolf.cpp @@ -478,12 +478,12 @@ MACHINE_CONFIG_START(crgolf_state::crgolf) MCFG_QUANTUM_TIME(attotime::from_hz(6000)) - MCFG_DEVICE_ADD("mainlatch", LS259, 0) // 1H - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, crgolf_state, color_select_w)) - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(*this, crgolf_state, screen_flip_w)) - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE(*this, crgolf_state, screen_select_w)) - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(*this, crgolf_state, screenb_enable_w)) - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, crgolf_state, screena_enable_w)) + ls259_device &mainlatch(LS259(config, "mainlatch")); // 1H + mainlatch.q_out_cb<3>().set(FUNC(crgolf_state::color_select_w)); + mainlatch.q_out_cb<4>().set(FUNC(crgolf_state::screen_flip_w)); + mainlatch.q_out_cb<5>().set(FUNC(crgolf_state::screen_select_w)); + mainlatch.q_out_cb<6>().set(FUNC(crgolf_state::screenb_enable_w)); + mainlatch.q_out_cb<7>().set(FUNC(crgolf_state::screena_enable_w)); MCFG_GENERIC_LATCH_8_ADD("soundlatch1") MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", INPUT_LINE_NMI)) diff --git a/src/mame/drivers/ddenlovr.cpp b/src/mame/drivers/ddenlovr.cpp index 0097e04ec0d..c3e4fd683c3 100644 --- a/src/mame/drivers/ddenlovr.cpp +++ b/src/mame/drivers/ddenlovr.cpp @@ -9721,10 +9721,10 @@ MACHINE_CONFIG_START(ddenlovr_state::ddenlovr) MCFG_DEVICE_ADD("maincpu",M68000, XTAL(24'000'000) / 2) MCFG_DEVICE_PROGRAM_MAP(ddenlovr_map) - MCFG_DEVICE_ADD("mainlatch", LS259, 0) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, ddenlovr_state, ddenlovr_blitter_irq_ack_w)) - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(*this, ddenlovr_state, ddenlovr_coincounter_0_w)) - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE(*this, ddenlovr_state, ddenlovr_coincounter_1_w)) + LS259(config, m_mainlatch); + m_mainlatch->q_out_cb<1>().set(FUNC(ddenlovr_state::ddenlovr_blitter_irq_ack_w)); + m_mainlatch->q_out_cb<4>().set(FUNC(ddenlovr_state::ddenlovr_coincounter_0_w)); + m_mainlatch->q_out_cb<5>().set(FUNC(ddenlovr_state::ddenlovr_coincounter_1_w)); MCFG_MACHINE_START_OVERRIDE(ddenlovr_state,ddenlovr) MCFG_MACHINE_RESET_OVERRIDE(ddenlovr_state,ddenlovr) @@ -9769,8 +9769,9 @@ MACHINE_CONFIG_START(ddenlovr_state::ddenlovj) MCFG_DEVICE_MODIFY("maincpu") MCFG_DEVICE_PROGRAM_MAP(ddenlovj_map) - MCFG_DEVICE_REPLACE("mainlatch", LS259, 0) - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE(*this, ddenlovr_state, ddenlovr_blitter_irq_ack_w)) + m_mainlatch->q_out_cb<1>().set_nop(); + m_mainlatch->q_out_cb<4>().set_nop(); + m_mainlatch->q_out_cb<5>().set(FUNC(ddenlovr_state::ddenlovr_blitter_irq_ack_w)); MCFG_DEVICE_REPLACE("rtc", RTC62421, XTAL(32'768)) // internal oscillator MACHINE_CONFIG_END @@ -9788,9 +9789,8 @@ MACHINE_CONFIG_START(ddenlovr_state::akamaru) MCFG_DEVICE_MODIFY("maincpu") MCFG_DEVICE_PROGRAM_MAP(akamaru_map) - MCFG_DEVICE_MODIFY("mainlatch") - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, ddenlovr_state, akamaru_dsw2_sel_w)) - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, ddenlovr_state, akamaru_dsw1_sel_w)) + m_mainlatch->q_out_cb<2>().set(FUNC(ddenlovr_state::akamaru_dsw2_sel_w)); + m_mainlatch->q_out_cb<3>().set(FUNC(ddenlovr_state::akamaru_dsw1_sel_w)); MACHINE_CONFIG_END MACHINE_CONFIG_START(ddenlovr_state::quiz365) @@ -9800,9 +9800,9 @@ MACHINE_CONFIG_START(ddenlovr_state::quiz365) MCFG_DEVICE_MODIFY("maincpu") MCFG_DEVICE_PROGRAM_MAP(quiz365_map) - MCFG_DEVICE_MODIFY("mainlatch") // 7D has wire mod connecting to sample ROM at 1F - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, ddenlovr_state, quiz365_oki_bank1_w)) - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(*this, ddenlovr_state, quiz365_oki_bank2_w)) + // 7D has wire mod connecting to sample ROM at 1F + m_mainlatch->q_out_cb<1>().set(FUNC(ddenlovr_state::quiz365_oki_bank1_w)); + m_mainlatch->q_out_cb<6>().set(FUNC(ddenlovr_state::quiz365_oki_bank2_w)); MCFG_DEVICE_REPLACE("aysnd", YM2149, XTAL(28'636'363) / 16) // or /8 ? MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30) diff --git a/src/mame/drivers/dec0.cpp b/src/mame/drivers/dec0.cpp index ce24fe9289a..07ac946a6d8 100644 --- a/src/mame/drivers/dec0.cpp +++ b/src/mame/drivers/dec0.cpp @@ -1790,11 +1790,11 @@ MACHINE_CONFIG_START(dec0_automat_state::automat) MCFG_SOUND_ROUTE(2, "mono", 0.90) MCFG_SOUND_ROUTE(3, "mono", 0.35) - MCFG_DEVICE_ADD("adpcm_select1", LS157, 0) - MCFG_74157_OUT_CB(WRITE8("msm1", msm5205_device, data_w)) + LS157(config, m_adpcm_select[0], 0); + m_adpcm_select[0]->out_callback().set("msm1", FUNC(msm5205_device::data_w)); - MCFG_DEVICE_ADD("adpcm_select2", LS157, 0) - MCFG_74157_OUT_CB(WRITE8("msm2", msm5205_device, data_w)) + LS157(config, m_adpcm_select[1], 0); + m_adpcm_select[1]->out_callback().set("msm2", FUNC(msm5205_device::data_w)); MCFG_DEVICE_ADD("msm1", MSM5205, 384000) MCFG_MSM5205_VCLK_CB(WRITELINE(*this, dec0_automat_state, msm1_vclk_cb)) @@ -1862,11 +1862,11 @@ MACHINE_CONFIG_START(dec0_automat_state::secretab) MCFG_DEVICE_ADD("ym3812", YM3812, 2500000) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80) - MCFG_DEVICE_ADD("adpcm_select1", LS157, 0) - MCFG_74157_OUT_CB(WRITE8("msm1", msm5205_device, data_w)) + LS157(config, m_adpcm_select[0], 0); + m_adpcm_select[0]->out_callback().set("msm1", FUNC(msm5205_device::data_w)); - MCFG_DEVICE_ADD("adpcm_select2", LS157, 0) - MCFG_74157_OUT_CB(WRITE8("msm2", msm5205_device, data_w)) + LS157(config, m_adpcm_select[1], 0); + m_adpcm_select[1]->out_callback().set("msm2", FUNC(msm5205_device::data_w)); MCFG_DEVICE_ADD("msm1", MSM5205, 384000) MCFG_MSM5205_VCLK_CB(WRITELINE(*this, dec0_automat_state, msm1_vclk_cb)) diff --git a/src/mame/drivers/didact.cpp b/src/mame/drivers/didact.cpp index cbdab4db4e3..a7115cd01f4 100644 --- a/src/mame/drivers/didact.cpp +++ b/src/mame/drivers/didact.cpp @@ -587,7 +587,7 @@ MACHINE_CONFIG_START(md6802_state::md6802) config.set_default_layout(layout_md6802); /* Devices */ - MCFG_DEVICE_ADD("tb16_74145", TTL74145, 0) + TTL74145(config, m_tb16_74145, 0); /* PIA #1 0xA000-0xA003 - used differently by laborations and loaded software */ PIA6821(config, m_pia1, 0); diff --git a/src/mame/drivers/discoboy.cpp b/src/mame/drivers/discoboy.cpp index 7a1d5db0bf0..0f320ceb692 100644 --- a/src/mame/drivers/discoboy.cpp +++ b/src/mame/drivers/discoboy.cpp @@ -498,8 +498,8 @@ MACHINE_CONFIG_START(discoboy_state::discoboy) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.6) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.6) - MCFG_DEVICE_ADD("adpcm_select", LS157, 0) - MCFG_74157_OUT_CB(WRITE8("msm", msm5205_device, data_w)) + LS157(config, m_adpcm_select, 0); + m_adpcm_select->out_callback().set("msm", FUNC(msm5205_device::data_w)); MCFG_DEVICE_ADD("msm", MSM5205, XTAL(400'000)) MCFG_MSM5205_VCLK_CB(WRITELINE(*this, discoboy_state, yunsung8_adpcm_int)) /* interrupt function */ diff --git a/src/mame/drivers/dynax.cpp b/src/mame/drivers/dynax.cpp index 7e28094ec1f..2810aa6bd99 100644 --- a/src/mame/drivers/dynax.cpp +++ b/src/mame/drivers/dynax.cpp @@ -4938,11 +4938,11 @@ MACHINE_CONFIG_START(dynax_state::majrjhdx) MCFG_PALETTE_INIT_OWNER(dynax_state,sprtmtch) // static palette MACHINE_CONFIG_END -MACHINE_CONFIG_START(dynax_state::mjreach) +void dynax_state::mjreach(machine_config &config) +{ tenkai(config); - MCFG_DEVICE_MODIFY("mainlatch") - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, dynax_state, flipscreen_w)) // not inverted -MACHINE_CONFIG_END + m_mainlatch->q_out_cb<0>().set(FUNC(dynax_state::flipscreen_w)); // not inverted +} /*************************************************************************** Mahjong Gekisha diff --git a/src/mame/drivers/e100.cpp b/src/mame/drivers/e100.cpp index 29c32ad8df3..e228345f121 100644 --- a/src/mame/drivers/e100.cpp +++ b/src/mame/drivers/e100.cpp @@ -543,7 +543,7 @@ MACHINE_CONFIG_START(e100_state::e100) MCFG_DEVICE_PROGRAM_MAP(e100_map) /* Devices */ - MCFG_DEVICE_ADD("kbd_74145", TTL74145, 0) + TTL74145(config, m_kbd_74145, 0); /* --PIA inits----------------------- */ /* 0xF883 0xC818 (PIA1 DDR A) = 0x00 - Port A all inputs */ diff --git a/src/mame/drivers/equites.cpp b/src/mame/drivers/equites.cpp index e0cc23ff0e2..16d87b69ad2 100644 --- a/src/mame/drivers/equites.cpp +++ b/src/mame/drivers/equites.cpp @@ -1160,10 +1160,10 @@ MACHINE_CONFIG_START(equites_state::equites) MCFG_DEVICE_PROGRAM_MAP(equites_map) MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", equites_state, equites_scanline, "screen", 0, 1) - MCFG_DEVICE_ADD("mainlatch", LS259, 0) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, equites_state, flip_screen_w)) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, equites_state, mcu_start_w)) - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, equites_state, mcu_switch_w)) + LS259(config, m_mainlatch); + m_mainlatch->q_out_cb<0>().set(FUNC(equites_state::flip_screen_w)); + m_mainlatch->q_out_cb<1>().set(FUNC(equites_state::mcu_start_w)); + m_mainlatch->q_out_cb<2>().set(FUNC(equites_state::mcu_switch_w)); common_sound(config); @@ -1211,11 +1211,11 @@ MACHINE_CONFIG_START(splndrbt_state::splndrbt) MCFG_DEVICE_PROGRAM_MAP(splndrbt_map) MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", splndrbt_state, splndrbt_scanline, "screen", 0, 1) - MCFG_DEVICE_ADD("mainlatch", LS259, 0) - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, equites_state, flip_screen_w)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, equites_state, mcu_start_w)) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, equites_state, mcu_switch_w)) - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, splndrbt_state, splndrbt_selchar_w)) + LS259(config, m_mainlatch); + m_mainlatch->q_out_cb<0>().set(FUNC(equites_state::flip_screen_w)); + m_mainlatch->q_out_cb<1>().set(FUNC(equites_state::mcu_start_w)); + m_mainlatch->q_out_cb<2>().set(FUNC(equites_state::mcu_switch_w)); + m_mainlatch->q_out_cb<3>().set(FUNC(splndrbt_state::splndrbt_selchar_w)); common_sound(config); diff --git a/src/mame/drivers/et3400.cpp b/src/mame/drivers/et3400.cpp index e0f28310d44..a6daa5d1114 100644 --- a/src/mame/drivers/et3400.cpp +++ b/src/mame/drivers/et3400.cpp @@ -237,18 +237,16 @@ MACHINE_CONFIG_START(et3400_state::et3400) MCFG_DEVICE_ADD("rs232", RS232_PORT, default_rs232_devices, "terminal") MCFG_SLOT_OPTION_DEVICE_INPUT_DEFAULTS("terminal", terminal) - MCFG_DEVICE_ADD("displatch1", LS259, 0) // IC28 - MCFG_ADDRESSABLE_LATCH_PARALLEL_OUT_CB(WRITE8(*this, et3400_state, led_w<1>)) - MCFG_DEVICE_ADD("displatch2", LS259, 0) // IC27 - MCFG_ADDRESSABLE_LATCH_PARALLEL_OUT_CB(WRITE8(*this, et3400_state, led_w<2>)) - MCFG_DEVICE_ADD("displatch3", LS259, 0) // IC26 - MCFG_ADDRESSABLE_LATCH_PARALLEL_OUT_CB(WRITE8(*this, et3400_state, led_w<3>)) - MCFG_DEVICE_ADD("displatch4", LS259, 0) // IC25 - MCFG_ADDRESSABLE_LATCH_PARALLEL_OUT_CB(WRITE8(*this, et3400_state, led_w<4>)) - MCFG_DEVICE_ADD("displatch5", LS259, 0) // IC24 - MCFG_ADDRESSABLE_LATCH_PARALLEL_OUT_CB(WRITE8(*this, et3400_state, led_w<5>)) - MCFG_DEVICE_ADD("displatch6", LS259, 0) // IC23 - MCFG_ADDRESSABLE_LATCH_PARALLEL_OUT_CB(WRITE8(*this, et3400_state, led_w<6>)) + for (std::size_t i = 0; i < 6; i++) + LS259(config, m_displatch[i]); + + + m_displatch[0]->parallel_out_cb().set(FUNC(et3400_state::led_w<1>)); + m_displatch[1]->parallel_out_cb().set(FUNC(et3400_state::led_w<2>)); + m_displatch[2]->parallel_out_cb().set(FUNC(et3400_state::led_w<3>)); + m_displatch[3]->parallel_out_cb().set(FUNC(et3400_state::led_w<4>)); + m_displatch[4]->parallel_out_cb().set(FUNC(et3400_state::led_w<5>)); + m_displatch[5]->parallel_out_cb().set(FUNC(et3400_state::led_w<6>)); MCFG_CASSETTE_ADD("cassette") MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED | CASSETTE_MOTOR_ENABLED | CASSETTE_SPEAKER_ENABLED) diff --git a/src/mame/drivers/excali64.cpp b/src/mame/drivers/excali64.cpp index dd0cca56e8a..689667dd6e0 100644 --- a/src/mame/drivers/excali64.cpp +++ b/src/mame/drivers/excali64.cpp @@ -616,14 +616,14 @@ MACHINE_CONFIG_START(excali64_state::excali64) MCFG_Z80DMA_IN_IORQ_CB(READ8(*this, excali64_state, io_read_byte)) MCFG_Z80DMA_OUT_IORQ_CB(WRITE8(*this, excali64_state, io_write_byte)) - MCFG_DEVICE_ADD("u12", TTL74123, 0) - MCFG_TTL74123_CONNECTION_TYPE(TTL74123_GROUNDED) /* Hook up type (no idea what this means) */ - MCFG_TTL74123_RESISTOR_VALUE(RES_K(100)) /* resistor connected between RCext & 5v */ - MCFG_TTL74123_CAPACITOR_VALUE(CAP_U(100)) /* capacitor connected between Cext and RCext */ - MCFG_TTL74123_A_PIN_VALUE(0) /* A pin - grounded */ - MCFG_TTL74123_B_PIN_VALUE(1) /* B pin - driven by port e4 bit 5 */ - MCFG_TTL74123_CLEAR_PIN_VALUE(1) /* Clear pin - pulled high */ - MCFG_TTL74123_OUTPUT_CHANGED_CB(WRITELINE(*this, excali64_state, motor_w)) + TTL74123(config, m_u12, 0); + m_u12->set_connection_type(TTL74123_GROUNDED); /* Hook up type (no idea what this means) */ + m_u12->set_resistor_value(RES_K(100)); /* resistor connected between RCext & 5v */ + m_u12->set_capacitor_value(CAP_U(100)); /* capacitor connected between Cext and RCext */ + m_u12->set_a_pin_value(0); /* A pin - grounded */ + m_u12->set_b_pin_value(1); /* B pin - driven by port e4 bit 5 */ + m_u12->set_clear_pin_value(1); /* Clear pin - pulled high */ + m_u12->out_cb().set(FUNC(excali64_state::motor_w)); MCFG_DEVICE_ADD(m_centronics, CENTRONICS, centronics_devices, "printer") MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(*this, excali64_state, cent_busy_w)) diff --git a/src/mame/drivers/fastfred.cpp b/src/mame/drivers/fastfred.cpp index 8875114ff3e..d7b21c9a7f9 100644 --- a/src/mame/drivers/fastfred.cpp +++ b/src/mame/drivers/fastfred.cpp @@ -14,7 +14,6 @@ #include "includes/fastfred.h" #include "cpu/z80/z80.h" -#include "machine/74259.h" #include "machine/gen_latch.h" #include "machine/watchdog.h" #include "sound/ay8910.h" @@ -200,7 +199,7 @@ void fastfred_state::fastfred_map(address_map &map) map(0xd860, 0xdbff).ram(); // Unused, but initialized map(0xe000, 0xe000).portr("BUTTONS").writeonly().share("bgcolor"); map(0xe800, 0xe800).portr("JOYS"); - map(0xf000, 0xf007).mirror(0x07f8).w("outlatch", FUNC(ls259_device::write_d0)); + map(0xf000, 0xf007).mirror(0x07f8).w(m_outlatch, FUNC(ls259_device::write_d0)); map(0xf000, 0xf000).portr("DSW").nopw(); map(0xf800, 0xf800).r("watchdog", FUNC(watchdog_timer_device::reset_r)).w("soundlatch", FUNC(generic_latch_8_device::write)); } @@ -219,7 +218,7 @@ void fastfred_state::jumpcoas_map(address_map &map) map(0xe801, 0xe801).portr("DSW2"); map(0xe802, 0xe802).portr("BUTTONS"); map(0xe803, 0xe803).portr("JOYS"); - map(0xf000, 0xf007).mirror(0x07f8).w("outlatch", FUNC(ls259_device::write_d0)); + map(0xf000, 0xf007).mirror(0x07f8).w(m_outlatch, FUNC(ls259_device::write_d0)); //AM_RANGE(0xf800, 0xf800) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r) // Why doesn't this work??? map(0xf800, 0xf801).nopr().w("ay8910.1", FUNC(ay8910_device::address_data_w)); } @@ -241,7 +240,7 @@ void fastfred_state::imago_map(address_map &map) map(0xe000, 0xe000).portr("BUTTONS"); map(0xe800, 0xe800).portr("JOYS"); map(0xf000, 0xf000).portr("DSW"); - map(0xf000, 0xf007).mirror(0x03f8).w("outlatch", FUNC(ls259_device::write_d0)); + map(0xf000, 0xf007).mirror(0x03f8).w(m_outlatch, FUNC(ls259_device::write_d0)); map(0xf400, 0xf400).nopw(); // writes 0 or 2 map(0xf401, 0xf401).w(FUNC(fastfred_state::imago_sprites_bank_w)); map(0xf800, 0xf800).nopr().w("soundlatch", FUNC(generic_latch_8_device::write)); @@ -643,14 +642,14 @@ MACHINE_CONFIG_START(fastfred_state::fastfred) MCFG_DEVICE_PROGRAM_MAP(sound_map) MCFG_DEVICE_PERIODIC_INT_DRIVER(fastfred_state, sound_timer_irq, 4*60) - MCFG_DEVICE_ADD("outlatch", LS259, 0) // "Control Signal Latch" at D10 - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, fastfred_state, nmi_mask_w)) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, fastfred_state, colorbank1_w)) - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, fastfred_state, colorbank2_w)) - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(*this, fastfred_state, charbank1_w)) - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE(*this, fastfred_state, charbank2_w)) - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(*this, fastfred_state, flip_screen_x_w)) - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, fastfred_state, flip_screen_y_w)) + LS259(config, m_outlatch); // "Control Signal Latch" at D10 + m_outlatch->q_out_cb<1>().set(FUNC(fastfred_state::nmi_mask_w)); + m_outlatch->q_out_cb<2>().set(FUNC(fastfred_state::colorbank1_w)); + m_outlatch->q_out_cb<3>().set(FUNC(fastfred_state::colorbank2_w)); + m_outlatch->q_out_cb<4>().set(FUNC(fastfred_state::charbank1_w)); + m_outlatch->q_out_cb<5>().set(FUNC(fastfred_state::charbank2_w)); + m_outlatch->q_out_cb<6>().set(FUNC(fastfred_state::flip_screen_x_w)); + m_outlatch->q_out_cb<7>().set(FUNC(fastfred_state::flip_screen_y_w)); MCFG_WATCHDOG_ADD("watchdog") @@ -707,10 +706,9 @@ MACHINE_CONFIG_START(fastfred_state::imago) MCFG_DEVICE_MODIFY("maincpu") MCFG_DEVICE_PROGRAM_MAP(imago_map) - MCFG_DEVICE_MODIFY("outlatch") - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(NOOP) // writes 1 when level starts, 0 when game over - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(*this, fastfred_state, imago_dma_irq_w)) - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE(*this, fastfred_state, imago_charbank_w)) + m_outlatch->q_out_cb<0>().set_nop(); // writes 1 when level starts, 0 when game over + m_outlatch->q_out_cb<4>().set(FUNC(fastfred_state::imago_dma_irq_w)); + m_outlatch->q_out_cb<5>().set(FUNC(fastfred_state::imago_charbank_w)); MCFG_MACHINE_START_OVERRIDE(fastfred_state,imago) diff --git a/src/mame/drivers/firetrap.cpp b/src/mame/drivers/firetrap.cpp index 78812bac80a..65f38a8f066 100644 --- a/src/mame/drivers/firetrap.cpp +++ b/src/mame/drivers/firetrap.cpp @@ -654,8 +654,8 @@ MACHINE_CONFIG_START(firetrap_state::firetrap) MCFG_DEVICE_ADD("ymsnd", YM3526, FIRETRAP_XTAL/4) // 3 MHz MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) - MCFG_DEVICE_ADD("adpcm_select", LS157, 0) - MCFG_74157_OUT_CB(WRITE8("msm", msm5205_device, data_w)) + LS157(config, m_adpcm_select, 0); + m_adpcm_select->out_callback().set("msm", FUNC(msm5205_device::data_w)); MCFG_DEVICE_ADD("msm", MSM5205, FIRETRAP_XTAL/32) // 375 kHz MCFG_MSM5205_VCK_CALLBACK(WRITELINE(*this, firetrap_state, firetrap_adpcm_int)) @@ -699,8 +699,8 @@ MACHINE_CONFIG_START(firetrap_state::firetrapbl) MCFG_DEVICE_ADD("ymsnd", YM3526, FIRETRAP_XTAL/4) // 3 MHz MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) - MCFG_DEVICE_ADD("adpcm_select", LS157, 0) - MCFG_74157_OUT_CB(WRITE8("msm", msm5205_device, data_w)) + LS157(config, m_adpcm_select, 0); + m_adpcm_select->out_callback().set("msm", FUNC(msm5205_device::data_w)); MCFG_DEVICE_ADD("msm", MSM5205, FIRETRAP_XTAL/32) // 375 kHz MCFG_MSM5205_VCK_CALLBACK(WRITELINE(*this, firetrap_state, firetrap_adpcm_int)) diff --git a/src/mame/drivers/flyball.cpp b/src/mame/drivers/flyball.cpp index 326d78a6b50..edfe2e44429 100644 --- a/src/mame/drivers/flyball.cpp +++ b/src/mame/drivers/flyball.cpp @@ -465,13 +465,13 @@ MACHINE_CONFIG_START(flyball_state::flyball) MCFG_DEVICE_ADD("maincpu", M6502, MASTER_CLOCK/16) MCFG_DEVICE_PROGRAM_MAP(flyball_map) - MCFG_DEVICE_ADD("outlatch", F9334, 0) // F7 - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, flyball_state, lamp_w)) // 1 player lamp - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(NOOP) // crowd very loud - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(NOOP) // footstep off-on - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(NOOP) // crowd off-on - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(NOOP) // crowd soft-loud - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(NOOP) // bat hit + F9334(config, m_outlatch); // F7 + m_outlatch->q_out_cb<2>().set_nop(); // bat hit + m_outlatch->q_out_cb<3>().set_nop(); // crowd soft-loud + m_outlatch->q_out_cb<4>().set_nop(); // crowd off-on + m_outlatch->q_out_cb<5>().set_nop(); // footstep off-on + m_outlatch->q_out_cb<6>().set_nop(); // crowd very loud + m_outlatch->q_out_cb<7>().set(FUNC(flyball_state::lamp_w)); // 1 player lamp /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) diff --git a/src/mame/drivers/freekick.cpp b/src/mame/drivers/freekick.cpp index 0f4c46d3b89..b8386e62032 100644 --- a/src/mame/drivers/freekick.cpp +++ b/src/mame/drivers/freekick.cpp @@ -48,7 +48,6 @@ TODO: #include "includes/freekick.h" #include "cpu/z80/z80.h" -#include "machine/74259.h" #include "machine/i8255.h" #include "machine/mc8123.h" #include "sound/sn76496.h" @@ -203,7 +202,7 @@ void freekick_state::omega_map(address_map &map) map(0xd800, 0xd8ff).ram().share("spriteram"); map(0xd900, 0xdfff).ram(); map(0xe000, 0xe000).portr("IN0"); - map(0xe000, 0xe007).w("outlatch", FUNC(ls259_device::write_d0)); + map(0xe000, 0xe007).w(m_outlatch, FUNC(ls259_device::write_d0)); map(0xe800, 0xe800).portr("IN1"); map(0xf000, 0xf000).portr("DSW1").nopw(); //bankswitch ? map(0xf800, 0xf800).portr("DSW2"); @@ -222,7 +221,7 @@ void freekick_state::pbillrd_map(address_map &map) map(0xd800, 0xd8ff).ram().share("spriteram"); map(0xd900, 0xdfff).ram(); map(0xe000, 0xe000).portr("IN0"); - map(0xe000, 0xe007).w("outlatch", FUNC(ls259_device::write_d0)); + map(0xe000, 0xe007).w(m_outlatch, FUNC(ls259_device::write_d0)); map(0xe800, 0xe800).portr("IN1"); map(0xf000, 0xf000).portr("DSW1").w(FUNC(freekick_state::pbillrd_bankswitch_w)); map(0xf800, 0xf800).portr("DSW2"); @@ -250,7 +249,7 @@ void freekick_state::freekick_map(address_map &map) map(0xf801, 0xf801).portr("IN1"); map(0xf802, 0xf802).nopr(); //MUST return bit 0 = 0, otherwise game resets map(0xf803, 0xf803).r(FUNC(freekick_state::spinner_r)); - map(0xf800, 0xf807).w("outlatch", FUNC(ls259_device::write_d0)); + map(0xf800, 0xf807).w(m_outlatch, FUNC(ls259_device::write_d0)); map(0xfc00, 0xfc00).w("sn1", FUNC(sn76489a_device::command_w)); map(0xfc01, 0xfc01).w("sn2", FUNC(sn76489a_device::command_w)); map(0xfc02, 0xfc02).w("sn3", FUNC(sn76489a_device::command_w)); @@ -265,7 +264,7 @@ void freekick_state::gigas_map(address_map &map) map(0xd800, 0xd8ff).ram().share("spriteram"); map(0xd900, 0xdfff).ram(); map(0xe000, 0xe000).portr("IN0"); - map(0xe000, 0xe007).w("outlatch", FUNC(ls259_device::write_d0)); + map(0xe000, 0xe007).w(m_outlatch, FUNC(ls259_device::write_d0)); map(0xe800, 0xe800).portr("IN1"); map(0xf000, 0xf000).portr("DSW1").nopw(); //bankswitch ? map(0xf800, 0xf800).portr("DSW2"); @@ -738,12 +737,12 @@ MACHINE_CONFIG_START(freekick_state::omega) MCFG_DEVICE_OPCODES_MAP(decrypted_opcodes_map) MCFG_DEVICE_PERIODIC_INT_DRIVER(freekick_state, irq0_line_hold, 120) // measured on PCB - MCFG_DEVICE_ADD("outlatch", LS259, 0) // 3M - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, freekick_state, flipscreen_w)) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, freekick_state, coin1_w)) - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, freekick_state, coin2_w)) - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(*this, freekick_state, nmi_enable_w)) - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(NOOP) // ??? + LS259(config, m_outlatch); // 3M + m_outlatch->q_out_cb<0>().set(FUNC(freekick_state::flipscreen_w)); + m_outlatch->q_out_cb<2>().set(FUNC(freekick_state::coin1_w)); + m_outlatch->q_out_cb<3>().set(FUNC(freekick_state::coin2_w)); + m_outlatch->q_out_cb<4>().set(FUNC(freekick_state::nmi_enable_w)); + m_outlatch->q_out_cb<5>().set_nop(); // ??? // video hardware MCFG_SCREEN_ADD("screen", RASTER) @@ -778,10 +777,10 @@ MACHINE_CONFIG_START(freekick_state::base) MCFG_DEVICE_PROGRAM_MAP(pbillrd_map) MCFG_DEVICE_PERIODIC_INT_DRIVER(freekick_state, irq0_line_hold, 120) // measured on PCB - MCFG_DEVICE_ADD("outlatch", LS259, 0) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, freekick_state, coin1_w)) - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, freekick_state, coin2_w)) - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(*this, freekick_state, nmi_enable_w)) + LS259(config, m_outlatch); + m_outlatch->q_out_cb<2>().set(FUNC(freekick_state::coin1_w)); + m_outlatch->q_out_cb<3>().set(FUNC(freekick_state::coin2_w)); + m_outlatch->q_out_cb<4>().set(FUNC(freekick_state::nmi_enable_w)); /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) @@ -809,16 +808,18 @@ MACHINE_CONFIG_START(freekick_state::base) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) MACHINE_CONFIG_END -MACHINE_CONFIG_START(freekick_state::pbillrd) +void freekick_state::pbillrd(machine_config &config) +{ base(config); - MCFG_DEVICE_MODIFY("outlatch") // 10K - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, freekick_state, flipscreen_x_w)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, freekick_state, flipscreen_y_w)) + + // 10K + m_outlatch->q_out_cb<0>().set(FUNC(freekick_state::flipscreen_x_w)); + m_outlatch->q_out_cb<1>().set(FUNC(freekick_state::flipscreen_y_w)); /* flip Y/X could be the other way round... */ MCFG_MACHINE_START_OVERRIDE(freekick_state,pbillrd) MCFG_MACHINE_RESET_OVERRIDE(freekick_state,freekick) -MACHINE_CONFIG_END +} MACHINE_CONFIG_START(freekick_state::pbillrdm) pbillrd(config); @@ -836,9 +837,9 @@ MACHINE_CONFIG_START(freekick_state::freekick) MCFG_DEVICE_PROGRAM_MAP(freekick_map) MCFG_DEVICE_IO_MAP(freekick_io_map) - MCFG_DEVICE_MODIFY("outlatch") // 5C - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, freekick_state, flipscreen_w)) - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(*this, freekick_state, spinner_select_w)) + // 5C + m_outlatch->q_out_cb<0>().set(FUNC(freekick_state::flipscreen_w)); + m_outlatch->q_out_cb<6>().set(FUNC(freekick_state::spinner_select_w)); MCFG_MACHINE_START_OVERRIDE(freekick_state,freekick) MCFG_MACHINE_RESET_OVERRIDE(freekick_state,freekick) @@ -867,9 +868,8 @@ MACHINE_CONFIG_START(freekick_state::gigas) MCFG_DEVICE_IO_MAP(gigas_io_map) MCFG_DEVICE_OPCODES_MAP(decrypted_opcodes_map) - MCFG_DEVICE_MODIFY("outlatch") - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, freekick_state, flipscreen_w)) - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(NOOP) // ??? + m_outlatch->q_out_cb<0>().set(FUNC(freekick_state::flipscreen_w)); + m_outlatch->q_out_cb<5>().set_nop(); // ??? MCFG_MACHINE_START_OVERRIDE(freekick_state,freekick) MCFG_MACHINE_RESET_OVERRIDE(freekick_state,freekick) @@ -889,9 +889,8 @@ MACHINE_CONFIG_START(freekick_state::gigasm) MCFG_DEVICE_OPCODES_MAP(decrypted_opcodes_map) MCFG_DEVICE_PERIODIC_INT_DRIVER(freekick_state, irq0_line_hold, 120) // measured on PCB - MCFG_DEVICE_MODIFY("outlatch") - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, freekick_state, flipscreen_w)) - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(NOOP) // ??? + m_outlatch->q_out_cb<0>().set(FUNC(freekick_state::flipscreen_w)); + m_outlatch->q_out_cb<5>().set_nop(); // ??? MCFG_MACHINE_START_OVERRIDE(freekick_state,freekick) MCFG_MACHINE_RESET_OVERRIDE(freekick_state,freekick) diff --git a/src/mame/drivers/funkybee.cpp b/src/mame/drivers/funkybee.cpp index 450737c3f42..085ca67dc09 100644 --- a/src/mame/drivers/funkybee.cpp +++ b/src/mame/drivers/funkybee.cpp @@ -293,11 +293,11 @@ MACHINE_CONFIG_START(funkybee_state::funkybee) MCFG_DEVICE_IO_MAP(io_map) MCFG_DEVICE_VBLANK_INT_DRIVER("screen", funkybee_state, irq0_line_hold) - MCFG_DEVICE_ADD("mainlatch", LS259, 0) - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, funkybee_state, flipscreen_w)) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, funkybee_state, coin_counter_1_w)) - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, funkybee_state, coin_counter_2_w)) - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE(*this, funkybee_state, gfx_bank_w)) + ls259_device &mainlatch(LS259(config, "mainlatch")); + mainlatch.q_out_cb<0>().set(FUNC(funkybee_state::flipscreen_w)); + mainlatch.q_out_cb<2>().set(FUNC(funkybee_state::coin_counter_1_w)); + mainlatch.q_out_cb<3>().set(FUNC(funkybee_state::coin_counter_2_w)); + mainlatch.q_out_cb<5>().set(FUNC(funkybee_state::gfx_bank_w)); MCFG_WATCHDOG_ADD("watchdog") diff --git a/src/mame/drivers/gaelco2.cpp b/src/mame/drivers/gaelco2.cpp index b7217a62a28..c4aa69b9b8c 100644 --- a/src/mame/drivers/gaelco2.cpp +++ b/src/mame/drivers/gaelco2.cpp @@ -712,12 +712,12 @@ MACHINE_CONFIG_START(bang_state::bang) MCFG_DEVICE_ADD("eeprom", EEPROM_SERIAL_93C66_16BIT) - MCFG_DEVICE_ADD("mainlatch", LS259, 0) - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, gaelco2_state, coin1_counter_w)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, gaelco2_state, coin2_counter_w)) - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE("eeprom", eeprom_serial_93cxx_device, di_write)) /* EEPROM data */ - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE("eeprom", eeprom_serial_93cxx_device, clk_write)) /* EEPROM serial clock */ - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE("eeprom", eeprom_serial_93cxx_device, cs_write)) /* EEPROM chip select */ + LS259(config, m_mainlatch); + m_mainlatch->q_out_cb<0>().set(FUNC(gaelco2_state::coin1_counter_w)); + m_mainlatch->q_out_cb<1>().set(FUNC(gaelco2_state::coin2_counter_w)); + m_mainlatch->q_out_cb<4>().set("eeprom", FUNC(eeprom_serial_93cxx_device::di_write)); /* EEPROM data */ + m_mainlatch->q_out_cb<5>().set("eeprom", FUNC(eeprom_serial_93cxx_device::clk_write)); /* EEPROM serial clock */ + m_mainlatch->q_out_cb<6>().set("eeprom", FUNC(eeprom_serial_93cxx_device::cs_write)); /* EEPROM chip select */ /* video hardware */ MCFG_DEVICE_ADD("spriteram", BUFFERED_SPRITERAM16) @@ -1256,11 +1256,11 @@ MACHINE_CONFIG_START(gaelco2_state::touchgo) MCFG_DEVICE_PROGRAM_MAP(touchgo_map) MCFG_DEVICE_VBLANK_INT_DRIVER("lscreen", gaelco2_state, irq6_line_hold) - MCFG_DEVICE_ADD("mainlatch", LS259, 0) // IC6 - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, gaelco2_state, coin1_counter_w)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, gaelco2_state, coin2_counter_w)) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, gaelco2_state, coin3_counter_w)) - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, gaelco2_state, coin4_counter_w)) + LS259(config, m_mainlatch); // IC6 + m_mainlatch->q_out_cb<0>().set(FUNC(gaelco2_state::coin1_counter_w)); + m_mainlatch->q_out_cb<1>().set(FUNC(gaelco2_state::coin2_counter_w)); + m_mainlatch->q_out_cb<2>().set(FUNC(gaelco2_state::coin3_counter_w)); + m_mainlatch->q_out_cb<3>().set(FUNC(gaelco2_state::coin4_counter_w)); /* video hardware */ MCFG_DEVICE_ADD("spriteram", BUFFERED_SPRITERAM16) @@ -1562,12 +1562,12 @@ MACHINE_CONFIG_START(gaelco2_state::snowboar) MCFG_DEVICE_ADD("eeprom", EEPROM_SERIAL_93C66_16BIT) - MCFG_DEVICE_ADD("mainlatch", LS259, 0) - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, gaelco2_state, coin1_counter_w)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, gaelco2_state, coin2_counter_w)) - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE("eeprom", eeprom_serial_93cxx_device, di_write)) /* EEPROM data */ - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE("eeprom", eeprom_serial_93cxx_device, clk_write)) /* EEPROM serial clock */ - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE("eeprom", eeprom_serial_93cxx_device, cs_write)) /* EEPROM chip select */ + LS259(config, m_mainlatch); + m_mainlatch->q_out_cb<0>().set(FUNC(gaelco2_state::coin1_counter_w)); + m_mainlatch->q_out_cb<1>().set(FUNC(gaelco2_state::coin2_counter_w)); + m_mainlatch->q_out_cb<4>().set("eeprom", FUNC(eeprom_serial_93cxx_device::di_write)); /* EEPROM data */ + m_mainlatch->q_out_cb<5>().set("eeprom", FUNC(eeprom_serial_93cxx_device::clk_write)); /* EEPROM serial clock */ + m_mainlatch->q_out_cb<6>().set("eeprom", FUNC(eeprom_serial_93cxx_device::cs_write)); /* EEPROM chip select */ /* video hardware */ MCFG_DEVICE_ADD("spriteram", BUFFERED_SPRITERAM16) @@ -1605,12 +1605,12 @@ MACHINE_CONFIG_START(gaelco2_state::maniacsqs) MCFG_DEVICE_ADD("eeprom", EEPROM_SERIAL_93C66_16BIT) - MCFG_DEVICE_ADD("mainlatch", LS259, 0) - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, gaelco2_state, coin1_counter_w)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, gaelco2_state, coin2_counter_w)) - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE("eeprom", eeprom_serial_93cxx_device, di_write)) /* EEPROM data */ - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE("eeprom", eeprom_serial_93cxx_device, clk_write)) /* EEPROM serial clock */ - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE("eeprom", eeprom_serial_93cxx_device, cs_write)) /* EEPROM chip select */ + LS259(config, m_mainlatch); + m_mainlatch->q_out_cb<0>().set(FUNC(gaelco2_state::coin1_counter_w)); + m_mainlatch->q_out_cb<1>().set(FUNC(gaelco2_state::coin2_counter_w)); + m_mainlatch->q_out_cb<4>().set("eeprom", FUNC(eeprom_serial_93cxx_device::di_write)); /* EEPROM data */ + m_mainlatch->q_out_cb<5>().set("eeprom", FUNC(eeprom_serial_93cxx_device::clk_write)); /* EEPROM serial clock */ + m_mainlatch->q_out_cb<6>().set("eeprom", FUNC(eeprom_serial_93cxx_device::cs_write)); /* EEPROM chip select */ /* video hardware */ MCFG_DEVICE_ADD("spriteram", BUFFERED_SPRITERAM16) @@ -1852,11 +1852,11 @@ MACHINE_CONFIG_START(wrally2_state::wrally2) MCFG_DEVICE_ADD("gaelco_ds5002fp", GAELCO_DS5002FP, XTAL(26'000'000) / 2) /* 13 MHz */ MCFG_DEVICE_ADDRESS_MAP(0, mcu_hostmem_map) - MCFG_DEVICE_ADD("mainlatch", LS259, 0) - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, gaelco2_state, coin1_counter_w)) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, gaelco2_state, coin2_counter_w)) - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE(*this, wrally2_state, wrally2_adc_clk)) /* ADCs clock-in line */ - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(*this, wrally2_state, wrally2_adc_cs)) /* ADCs chip select line */ + LS259(config, m_mainlatch); // IC6 + m_mainlatch->q_out_cb<0>().set(FUNC(gaelco2_state::coin1_counter_w)); + m_mainlatch->q_out_cb<1>().set(FUNC(gaelco2_state::coin2_counter_w)); + m_mainlatch->q_out_cb<5>().set(FUNC(wrally2_state::wrally2_adc_clk)); /* ADCs clock-in line */ + m_mainlatch->q_out_cb<6>().set(FUNC(wrally2_state::wrally2_adc_cs)); /* ADCs chip select line */ /* video hardware */ MCFG_DEVICE_ADD("spriteram", BUFFERED_SPRITERAM16) diff --git a/src/mame/drivers/gaelco3d.cpp b/src/mame/drivers/gaelco3d.cpp index 22d147800ef..a1775155bd5 100644 --- a/src/mame/drivers/gaelco3d.cpp +++ b/src/mame/drivers/gaelco3d.cpp @@ -948,24 +948,24 @@ MACHINE_CONFIG_START(gaelco3d_state::gaelco3d) MCFG_DEVICE_ADD(m_serial, GAELCO_SERIAL, 0) MCFG_GAELCO_SERIAL_IRQ_HANDLER(WRITELINE(*this, gaelco3d_state, ser_irq)) - MCFG_DEVICE_ADD(m_mainlatch, LS259, 0) // IC5 on bottom board next to EEPROM - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(m_serial, gaelco_serial_device, tr_w)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(m_serial, gaelco_serial_device, rts_w)) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(m_eeprom, eeprom_serial_93cxx_device, di_write)) - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(m_eeprom, eeprom_serial_93cxx_device, clk_write)) - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(m_eeprom, eeprom_serial_93cxx_device, cs_write)) - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE(*this, gaelco3d_state, tms_reset_w)) - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(*this, gaelco3d_state, tms_irq_w)) - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, gaelco3d_state, unknown_13a_w)) - - MCFG_DEVICE_ADD(m_outlatch, LS259, 0) // IC2 on top board near edge connector - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, gaelco3d_state, tms_control3_w)) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, gaelco3d_state, radikalb_lamp_w)) - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, gaelco3d_state, unknown_137_w)) - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(m_serial, gaelco_serial_device, irq_enable)) - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE(*this, gaelco3d_state, analog_port_clock_w)) - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(*this, gaelco3d_state, analog_port_latch_w)) - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(m_serial, gaelco_serial_device, unknown_w)) + LS259(config, m_mainlatch); // IC5 on bottom board next to EEPROM + m_mainlatch->q_out_cb<0>().set(m_serial, FUNC(gaelco_serial_device::tr_w)); + m_mainlatch->q_out_cb<0>().set(m_serial, FUNC(gaelco_serial_device::rts_w)); + m_mainlatch->q_out_cb<0>().set(m_eeprom, FUNC(eeprom_serial_93cxx_device::di_write)); + m_mainlatch->q_out_cb<0>().set(m_eeprom, FUNC(eeprom_serial_93cxx_device::clk_write)); + m_mainlatch->q_out_cb<0>().set(m_eeprom, FUNC(eeprom_serial_93cxx_device::cs_write)); + m_mainlatch->q_out_cb<0>().set(FUNC(gaelco3d_state::tms_reset_w)); + m_mainlatch->q_out_cb<0>().set(FUNC(gaelco3d_state::tms_irq_w)); + m_mainlatch->q_out_cb<0>().set(FUNC(gaelco3d_state::unknown_13a_w)); + + LS259(config, m_outlatch); // IC2 on top board near edge connector + m_outlatch->q_out_cb<1>().set(FUNC(gaelco3d_state::tms_control3_w)); + m_outlatch->q_out_cb<2>().set(FUNC(gaelco3d_state::radikalb_lamp_w)); + m_outlatch->q_out_cb<3>().set(FUNC(gaelco3d_state::unknown_137_w)); + m_outlatch->q_out_cb<4>().set(m_serial, FUNC(gaelco_serial_device::irq_enable)); + m_outlatch->q_out_cb<5>().set(FUNC(gaelco3d_state::analog_port_clock_w)); + m_outlatch->q_out_cb<6>().set(FUNC(gaelco3d_state::analog_port_latch_w)); + m_outlatch->q_out_cb<7>().set(m_serial, FUNC(gaelco_serial_device::unknown_w)); GENERIC_LATCH_8(config, m_soundlatch).data_pending_callback().set_inputline(m_adsp, ADSP2115_IRQ2); @@ -1011,11 +1011,11 @@ MACHINE_CONFIG_START(gaelco3d_state::gaelco3d2) MCFG_MACHINE_RESET_OVERRIDE(gaelco3d_state,gaelco3d2) MACHINE_CONFIG_END -MACHINE_CONFIG_START(gaelco3d_state::footbpow) +void gaelco3d_state::footbpow(machine_config &config) +{ gaelco3d2(config); - MCFG_DEVICE_MODIFY("outlatch") - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE(*this, gaelco3d_state, fp_analog_clock_w)) -MACHINE_CONFIG_END + m_outlatch->q_out_cb<5>().set(FUNC(gaelco3d_state::fp_analog_clock_w)); +} /************************************* diff --git a/src/mame/drivers/gaiden.cpp b/src/mame/drivers/gaiden.cpp index abf369bb1ba..ca384d9c6ab 100644 --- a/src/mame/drivers/gaiden.cpp +++ b/src/mame/drivers/gaiden.cpp @@ -1047,11 +1047,11 @@ MACHINE_CONFIG_START(gaiden_state::mastninj) MCFG_SOUND_ROUTE(2, "mono", 0.15) MCFG_SOUND_ROUTE(3, "mono", 0.60) - MCFG_DEVICE_ADD("adpcm_select1", LS157, 0) - MCFG_74157_OUT_CB(WRITE8("msm1", msm5205_device, data_w)) + LS157(config, m_adpcm_select[0], 0); + m_adpcm_select[0]->out_callback().set("msm1", FUNC(msm5205_device::data_w)); - MCFG_DEVICE_ADD("adpcm_select2", LS157, 0) - MCFG_74157_OUT_CB(WRITE8("msm2", msm5205_device, data_w)) + LS157(config, m_adpcm_select[1], 0); + m_adpcm_select[1]->out_callback().set("msm2", FUNC(msm5205_device::data_w)); MSM5205(config, m_msm[0], 384000); m_msm[0]->vck_callback().set(m_msm[1], FUNC(msm5205_device::vclk_w)); diff --git a/src/mame/drivers/galaga.cpp b/src/mame/drivers/galaga.cpp index 20814ae6c7c..50d48e9ca57 100644 --- a/src/mame/drivers/galaga.cpp +++ b/src/mame/drivers/galaga.cpp @@ -1779,8 +1779,8 @@ MACHINE_CONFIG_START(galaga_state::gatsbee) MCFG_DEVICE_MODIFY("maincpu") MCFG_DEVICE_PROGRAM_MAP(gatsbee_main_map) - MCFG_DEVICE_ADD("extralatch", LS259, 0) - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, galaga_state, gatsbee_bank_w)) + ls259_device &extralatch(LS259(config, "extralatch")); + extralatch.q_out_cb<0>().set(FUNC(galaga_state::gatsbee_bank_w)); MACHINE_CONFIG_END MACHINE_CONFIG_START(xevious_state::xevious) diff --git a/src/mame/drivers/gauntlet.cpp b/src/mame/drivers/gauntlet.cpp index 3b151bf0999..a23bf45ef7d 100644 --- a/src/mame/drivers/gauntlet.cpp +++ b/src/mame/drivers/gauntlet.cpp @@ -538,13 +538,13 @@ MACHINE_CONFIG_START(gauntlet_state::gauntlet_base) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.80) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.80) - MCFG_DEVICE_ADD("soundctl", LS259, 0) // 16T/U - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE("ymsnd", ym2151_device, reset_w)) // music reset, low reset - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE("tms", tms5220_device, wsq_w)) // speech write, active low - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE("tms", tms5220_device, rsq_w)) // speech reset, active low - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, gauntlet_state, speech_squeak_w)) // speech squeak, low = 650 Hz - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(*this, gauntlet_state, coin_counter_right_w)) - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE(*this, gauntlet_state, coin_counter_left_w)) + LS259(config, m_soundctl); // 16T/U + m_soundctl->q_out_cb<0>().set("ymsnd", FUNC(ym2151_device::reset_w)); // music reset, low reset + m_soundctl->q_out_cb<1>().set("tms", FUNC(tms5220_device::wsq_w)); // speech write, active low + m_soundctl->q_out_cb<2>().set("tms", FUNC(tms5220_device::rsq_w)); // speech reset, active low + m_soundctl->q_out_cb<3>().set(FUNC(gauntlet_state::speech_squeak_w)); // speech squeak, low = 650 Hz + m_soundctl->q_out_cb<4>().set(FUNC(gauntlet_state::coin_counter_right_w)); + m_soundctl->q_out_cb<5>().set(FUNC(gauntlet_state::coin_counter_left_w)); MACHINE_CONFIG_END diff --git a/src/mame/drivers/gladiatr.cpp b/src/mame/drivers/gladiatr.cpp index 54a46c9b2c2..45333777a94 100644 --- a/src/mame/drivers/gladiatr.cpp +++ b/src/mame/drivers/gladiatr.cpp @@ -959,14 +959,14 @@ MACHINE_CONFIG_START(ppking_state::ppking) MCFG_MACHINE_RESET_OVERRIDE(ppking_state, ppking) MCFG_NVRAM_ADD_0FILL("nvram") - MCFG_DEVICE_ADD("mainlatch", LS259, 0) // 5L on main board - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, ppking_state, spritebuffer_w)) -// MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, gladiatr_state, spritebank_w)) -// MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(MEMBANK("bank1")) -// MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, ppking_state, nmi_mask_w)) -// MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(INPUTLINE("sub", INPUT_LINE_RESET)) // shadowed by aforementioned hack + ls259_device &mainlatch(LS259(config, "mainlatch")); // 5L on main board + mainlatch.q_out_cb<0>().set(FUNC(ppking_state::spritebuffer_w)); +// mainlatch.q_out_cb<1>().set(FUNC(gladiatr_state::spritebank_w)); +// mainlatch.q_out_cb<2>().set_membank("bank1"); +// mainlatch.q_out_cb<3>().set(FUNC(ppking_state::nmi_mask_w)); +// mainlatch.q_out_cb<4>().set("sub", INPUT_LINE_RESET); // shadowed by aforementioned hack // Q6 used - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, ppking_state, flipscreen_w)) + mainlatch.q_out_cb<7>().set(FUNC(ppking_state::flipscreen_w)); /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) @@ -1021,12 +1021,12 @@ MACHINE_CONFIG_START(gladiatr_state::gladiatr) MCFG_MACHINE_RESET_OVERRIDE(gladiatr_state,gladiator) MCFG_NVRAM_ADD_0FILL("nvram") // NEC uPD449 CMOS SRAM - MCFG_DEVICE_ADD("mainlatch", LS259, 0) // 5L on main board - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, gladiatr_state, spritebuffer_w)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, gladiatr_state, spritebank_w)) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(MEMBANK("bank1")) - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(INPUTLINE("sub", INPUT_LINE_RESET)) // shadowed by aforementioned hack - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, gladiatr_state, flipscreen_w)) + ls259_device &mainlatch(LS259(config, "mainlatch")); // 5L on main board + mainlatch.q_out_cb<0>().set(FUNC(gladiatr_state::spritebuffer_w)); + mainlatch.q_out_cb<1>().set(FUNC(gladiatr_state::spritebank_w)); + mainlatch.q_out_cb<2>().set_membank("bank1"); + mainlatch.q_out_cb<4>().set_inputline("sub", INPUT_LINE_RESET); // shadowed by aforementioned hack + mainlatch.q_out_cb<7>().set(FUNC(gladiatr_state::flipscreen_w)); I8741(config, m_cctl, 12_MHz_XTAL/2); /* verified on pcb */ m_cctl->t0_in_cb().set_ioport("COINS").bit(3); diff --git a/src/mame/drivers/glass.cpp b/src/mame/drivers/glass.cpp index a7416bb83fd..a0d2865508f 100644 --- a/src/mame/drivers/glass.cpp +++ b/src/mame/drivers/glass.cpp @@ -238,12 +238,12 @@ MACHINE_CONFIG_START(glass_state::glass) MCFG_DEVICE_PROGRAM_MAP(glass_map) MCFG_DEVICE_VBLANK_INT_DRIVER("screen", glass_state, interrupt) - MCFG_DEVICE_ADD("outlatch", LS259, 0) - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, glass_state, coin1_lockout_w)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, glass_state, coin2_lockout_w)) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, glass_state, coin1_counter_w)) - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, glass_state, coin2_counter_w)) - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(NOOP) // Sound Muting (if bit 0 == 1, sound output stream = 0) + LS259(config, m_outlatch); + m_outlatch->q_out_cb<0>().set(FUNC(glass_state::coin1_lockout_w)); + m_outlatch->q_out_cb<1>().set(FUNC(glass_state::coin2_lockout_w)); + m_outlatch->q_out_cb<2>().set(FUNC(glass_state::coin1_counter_w)); + m_outlatch->q_out_cb<3>().set(FUNC(glass_state::coin2_counter_w)); + m_outlatch->q_out_cb<4>().set_nop(); // Sound Muting (if bit 0 == 1, sound output stream = 0) /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) diff --git a/src/mame/drivers/gomoku.cpp b/src/mame/drivers/gomoku.cpp index ca1c4cf4f8a..47c09d9fec8 100644 --- a/src/mame/drivers/gomoku.cpp +++ b/src/mame/drivers/gomoku.cpp @@ -128,10 +128,10 @@ MACHINE_CONFIG_START(gomoku_state::gomoku) MCFG_DEVICE_PROGRAM_MAP(gomoku_map) MCFG_DEVICE_VBLANK_INT_DRIVER("screen", gomoku_state, irq0_line_hold) - MCFG_DEVICE_ADD("latch", LS259, 0) // 7J - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, gomoku_state, flipscreen_w)) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, gomoku_state, bg_dispsw_w)) - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(NOOP) // start LED? + ls259_device &latch(LS259(config, "latch")); // 7J + latch.q_out_cb<1>().set(FUNC(gomoku_state::flipscreen_w)); + latch.q_out_cb<2>().set(FUNC(gomoku_state::bg_dispsw_w)); + latch.q_out_cb<7>().set_nop(); // start LED? /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) diff --git a/src/mame/drivers/gridlee.cpp b/src/mame/drivers/gridlee.cpp index 24d43452297..33d5cfbe222 100644 --- a/src/mame/drivers/gridlee.cpp +++ b/src/mame/drivers/gridlee.cpp @@ -406,12 +406,12 @@ MACHINE_CONFIG_START(gridlee_state::gridlee) MCFG_WATCHDOG_ADD("watchdog") - MCFG_DEVICE_ADD("latch", LS259, 0) // type can only be guessed - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(OUTPUT("led0")) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(OUTPUT("led1")) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, gridlee_state, coin_counter_w)) + LS259(config, m_latch); // type can only be guessed + m_latch->q_out_cb<0>().set_output("led0"); + m_latch->q_out_cb<1>().set_output("led1"); + m_latch->q_out_cb<2>().set(FUNC(gridlee_state::coin_counter_w)); // Q6 unknown - only written to at startup - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, gridlee_state, cocktail_flip_w)) + m_latch->q_out_cb<7>().set(FUNC(gridlee_state::cocktail_flip_w)); /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) diff --git a/src/mame/drivers/gyruss.cpp b/src/mame/drivers/gyruss.cpp index b99b740917a..3e367a95ad1 100644 --- a/src/mame/drivers/gyruss.cpp +++ b/src/mame/drivers/gyruss.cpp @@ -495,11 +495,11 @@ MACHINE_CONFIG_START(gyruss_state::gyruss) MCFG_QUANTUM_TIME(attotime::from_hz(6000)) - MCFG_DEVICE_ADD("mainlatch", LS259, 0) // 3C - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, gyruss_state, master_nmi_mask_w)) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, gyruss_state, coin_counter_1_w)) - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, gyruss_state, coin_counter_2_w)) - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE(*this, gyruss_state, flipscreen_w)) + ls259_device &mainlatch(LS259(config, "mainlatch")); // 3C + mainlatch.q_out_cb<0>().set(FUNC(gyruss_state::master_nmi_mask_w)); + mainlatch.q_out_cb<2>().set(FUNC(gyruss_state::coin_counter_1_w)); + mainlatch.q_out_cb<3>().set(FUNC(gyruss_state::coin_counter_2_w)); + mainlatch.q_out_cb<5>().set(FUNC(gyruss_state::flipscreen_w)); /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) diff --git a/src/mame/drivers/hnayayoi.cpp b/src/mame/drivers/hnayayoi.cpp index 629de9fc02d..0562f7c9a50 100644 --- a/src/mame/drivers/hnayayoi.cpp +++ b/src/mame/drivers/hnayayoi.cpp @@ -44,7 +44,6 @@ TODO: #include "cpu/z80/z80.h" #include "sound/2203intf.h" #include "sound/msm5205.h" -#include "machine/74259.h" #include "machine/clock.h" #include "machine/nvram.h" #include "video/mc6845.h" @@ -124,7 +123,7 @@ void hnayayoi_state::hnayayoi_io_map(address_map &map) map(0x09, 0x09).w("crtc", FUNC(hd6845_device::register_w)); map(0x0a, 0x0a).w(FUNC(hnayayoi_state::dynax_blitter_rev1_start_w)); map(0x0c, 0x0c).w(FUNC(hnayayoi_state::dynax_blitter_rev1_clear_w)); - map(0x20, 0x27).w("mainlatch", FUNC(ls259_device::write_d0)); + map(0x20, 0x27).w(m_mainlatch, FUNC(ls259_device::write_d0)); map(0x40, 0x40).w(FUNC(hnayayoi_state::keyboard_w)); map(0x41, 0x41).r(FUNC(hnayayoi_state::keyboard_0_r)); map(0x42, 0x42).r(FUNC(hnayayoi_state::keyboard_1_r)); @@ -146,7 +145,7 @@ void hnayayoi_state::hnfubuki_map(address_map &map) map(0xff09, 0xff09).w("crtc", FUNC(hd6845_device::register_w)); map(0xff0a, 0xff0a).w(FUNC(hnayayoi_state::dynax_blitter_rev1_start_w)); map(0xff0c, 0xff0c).w(FUNC(hnayayoi_state::dynax_blitter_rev1_clear_w)); - map(0xff20, 0xff27).w("mainlatch", FUNC(ls259_device::write_d0)); + map(0xff20, 0xff27).w(m_mainlatch, FUNC(ls259_device::write_d0)); map(0xff40, 0xff40).w(FUNC(hnayayoi_state::keyboard_w)); map(0xff41, 0xff41).r(FUNC(hnayayoi_state::keyboard_0_r)); map(0xff42, 0xff42).r(FUNC(hnayayoi_state::keyboard_1_r)); @@ -177,7 +176,7 @@ void hnayayoi_state::untoucha_io_map(address_map &map) map(0x1a, 0x1f).w(FUNC(hnayayoi_state::dynax_blitter_rev1_param_w)); map(0x20, 0x20).w(FUNC(hnayayoi_state::dynax_blitter_rev1_clear_w)); map(0x28, 0x28).w(FUNC(hnayayoi_state::dynax_blitter_rev1_start_w)); - map(0x30, 0x37).w("mainlatch", FUNC(ls259_device::write_d0)); + map(0x30, 0x37).w(m_mainlatch, FUNC(ls259_device::write_d0)); map(0x50, 0x50).w("ymsnd", FUNC(ym2203_device::write_port_w)); map(0x51, 0x51).r("ymsnd", FUNC(ym2203_device::read_port_r)); map(0x52, 0x52).w("crtc", FUNC(hd6845_device::register_w)); @@ -555,11 +554,11 @@ MACHINE_CONFIG_START(hnayayoi_state::hnayayoi) MCFG_NVRAM_ADD_0FILL("nvram") - ls259_device &mainlatch(LS259(config, "mainlatch")); - mainlatch.q_out_cb<0>().set(FUNC(hnayayoi_state::coin_counter_w)); - mainlatch.q_out_cb<2>().set(m_msm, FUNC(msm5205_device::reset_w)).invert(); - mainlatch.q_out_cb<3>().set(m_msm, FUNC(msm5205_device::vclk_w)); - mainlatch.q_out_cb<4>().set(FUNC(hnayayoi_state::nmi_enable_w)).invert(); + LS259(config, m_mainlatch); + m_mainlatch->q_out_cb<0>().set(FUNC(hnayayoi_state::coin_counter_w)); + m_mainlatch->q_out_cb<2>().set(m_msm, FUNC(msm5205_device::reset_w)).invert(); + m_mainlatch->q_out_cb<3>().set(m_msm, FUNC(msm5205_device::vclk_w)); + m_mainlatch->q_out_cb<4>().set(FUNC(hnayayoi_state::nmi_enable_w)).invert(); /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) @@ -598,8 +597,8 @@ MACHINE_CONFIG_START(hnayayoi_state::hnfubuki) MCFG_DEVICE_PROGRAM_MAP(hnfubuki_map) MCFG_DEVICE_REMOVE_ADDRESS_MAP(AS_IO) - MCFG_DEVICE_MODIFY("mainlatch") // D5 - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(*this, hnayayoi_state, nmi_enable_w)) + // D5 + m_mainlatch->q_out_cb<4>().set(FUNC(hnayayoi_state::nmi_enable_w)); MACHINE_CONFIG_END MACHINE_CONFIG_START(hnayayoi_state::untoucha) @@ -608,11 +607,10 @@ MACHINE_CONFIG_START(hnayayoi_state::untoucha) MCFG_DEVICE_PROGRAM_MAP(untoucha_map) MCFG_DEVICE_IO_MAP(untoucha_io_map) - ls259_device &mainlatch(*subdevice("mainlatch")); - mainlatch.q_out_cb<1>().set(m_msm, FUNC(msm5205_device::vclk_w)); - mainlatch.q_out_cb<2>().set(FUNC(hnayayoi_state::nmi_enable_w)); - mainlatch.q_out_cb<3>().set(m_msm, FUNC(msm5205_device::reset_w)).invert(); - mainlatch.q_out_cb<4>().set_nop(); // ? + m_mainlatch->q_out_cb<1>().set(m_msm, FUNC(msm5205_device::vclk_w)); + m_mainlatch->q_out_cb<2>().set(FUNC(hnayayoi_state::nmi_enable_w)); + m_mainlatch->q_out_cb<3>().set(m_msm, FUNC(msm5205_device::reset_w)).invert(); + m_mainlatch->q_out_cb<4>().set_nop(); // ? MCFG_DEVICE_MODIFY("crtc") MCFG_MC6845_UPDATE_ROW_CB(hnayayoi_state, untoucha_update_row) diff --git a/src/mame/drivers/hp64k.cpp b/src/mame/drivers/hp64k.cpp index c92f5e3a726..2b7a9429e18 100644 --- a/src/mame/drivers/hp64k.cpp +++ b/src/mame/drivers/hp64k.cpp @@ -1392,56 +1392,56 @@ MACHINE_CONFIG_START(hp64k_state::hp64k) MCFG_QUANTUM_TIME(attotime::from_hz(100)) // Actual keyboard refresh rate should be between 1 and 2 kHz - MCFG_TIMER_DRIVER_ADD_PERIODIC("kb_timer" , hp64k_state , hp64k_kb_scan , attotime::from_hz(100)) + MCFG_TIMER_DRIVER_ADD_PERIODIC("kb_timer", hp64k_state, hp64k_kb_scan, attotime::from_hz(100)) // Line sync timer. A line frequency of 50 Hz is assumed. - MCFG_TIMER_DRIVER_ADD_PERIODIC("linesync_timer" , hp64k_state , hp64k_line_sync , attotime::from_hz(50)) + MCFG_TIMER_DRIVER_ADD_PERIODIC("linesync_timer", hp64k_state, hp64k_line_sync, attotime::from_hz(50)) // Clock = 25 MHz / 9 * (112/114) - MCFG_DEVICE_ADD("crtc" , I8275 , 2729045) + MCFG_DEVICE_ADD("crtc", I8275, 2729045) MCFG_VIDEO_SET_SCREEN("screen") MCFG_I8275_CHARACTER_WIDTH(9) - MCFG_I8275_DRAW_CHARACTER_CALLBACK_OWNER(hp64k_state , crtc_display_pixels) - MCFG_I8275_DRQ_CALLBACK(WRITELINE(*this, hp64k_state , hp64k_crtc_drq_w)) - MCFG_I8275_VRTC_CALLBACK(WRITELINE(*this, hp64k_state , hp64k_crtc_vrtc_w)) + MCFG_I8275_DRAW_CHARACTER_CALLBACK_OWNER(hp64k_state, crtc_display_pixels) + MCFG_I8275_DRQ_CALLBACK(WRITELINE(*this, hp64k_state, hp64k_crtc_drq_w)) + MCFG_I8275_VRTC_CALLBACK(WRITELINE(*this, hp64k_state, hp64k_crtc_vrtc_w)) MCFG_SCREEN_ADD_MONOCHROME("screen", RASTER, rgb_t::green()) - MCFG_SCREEN_UPDATE_DEVICE("crtc" , i8275_device , screen_update) + MCFG_SCREEN_UPDATE_DEVICE("crtc", i8275_device, screen_update) MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_SIZE(720 , 390) + MCFG_SCREEN_SIZE(720, 390) MCFG_SCREEN_VISIBLE_AREA(0, 720-1, 0, 390-1) MCFG_PALETTE_ADD_MONOCHROME_HIGHLIGHT("palette") MCFG_DEVICE_ADD("fdc", FD1791, 4_MHz_XTAL / 4) MCFG_WD_FDC_FORCE_READY - MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(*this, hp64k_state , hp64k_flp_intrq_w)) - MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(*this, hp64k_state , hp64k_flp_drq_w)) - MCFG_FLOPPY_DRIVE_ADD("fdc:0" , hp64k_floppies , "525dd" , floppy_image_device::default_floppy_formats) + MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(*this, hp64k_state, hp64k_flp_intrq_w)) + MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(*this, hp64k_state, hp64k_flp_drq_w)) + MCFG_FLOPPY_DRIVE_ADD("fdc:0", hp64k_floppies, "525dd", floppy_image_device::default_floppy_formats) MCFG_SLOT_FIXED(true) - MCFG_FLOPPY_DRIVE_ADD("fdc:1" , hp64k_floppies , "525dd" , floppy_image_device::default_floppy_formats) + MCFG_FLOPPY_DRIVE_ADD("fdc:1", hp64k_floppies, "525dd", floppy_image_device::default_floppy_formats) MCFG_SLOT_FIXED(true) - MCFG_DEVICE_ADD("fdc_rdy0" , TTL74123 , 0) - MCFG_TTL74123_CONNECTION_TYPE(TTL74123_NOT_GROUNDED_NO_DIODE) - MCFG_TTL74123_RESISTOR_VALUE(RES_K(68.1)) + TTL74123(config, m_ss0, 0); + m_ss0->set_connection_type(TTL74123_NOT_GROUNDED_NO_DIODE); + m_ss0->set_resistor_value(RES_K(68.1)); // Warning! Duration formula is not correct for LS123, actual capacitor is 10 uF - MCFG_TTL74123_CAPACITOR_VALUE(CAP_U(16)) - MCFG_TTL74123_B_PIN_VALUE(1) - MCFG_TTL74123_CLEAR_PIN_VALUE(1) - MCFG_TTL74123_OUTPUT_CHANGED_CB(WRITELINE(*this, hp64k_state , hp64k_floppy0_rdy)); - - MCFG_DEVICE_ADD("fdc_rdy1" , TTL74123 , 0) - MCFG_TTL74123_CONNECTION_TYPE(TTL74123_NOT_GROUNDED_NO_DIODE) - MCFG_TTL74123_RESISTOR_VALUE(RES_K(68.1)) - MCFG_TTL74123_CAPACITOR_VALUE(CAP_U(16)) - MCFG_TTL74123_B_PIN_VALUE(1) - MCFG_TTL74123_CLEAR_PIN_VALUE(1) - MCFG_TTL74123_OUTPUT_CHANGED_CB(WRITELINE(*this, hp64k_state , hp64k_floppy1_rdy)); + m_ss0->set_capacitor_value(CAP_U(16)); + m_ss0->set_b_pin_value(1); + m_ss0->set_clear_pin_value(1); + m_ss0->out_cb().set(FUNC(hp64k_state::hp64k_floppy0_rdy)); + + TTL74123(config, m_ss1, 0); + m_ss1->set_connection_type(TTL74123_NOT_GROUNDED_NO_DIODE); + m_ss1->set_resistor_value(RES_K(68.1)); + m_ss1->set_capacitor_value(CAP_U(16)); + m_ss1->set_b_pin_value(1); + m_ss1->set_clear_pin_value(1); + m_ss1->out_cb().set(FUNC(hp64k_state::hp64k_floppy1_rdy)); SPEAKER(config, "mono").front_center(); BEEP(config, m_beeper, 2500).add_route(ALL_OUTPUTS, "mono", 1.00); - MCFG_TIMER_DRIVER_ADD("beep_timer" , hp64k_state , hp64k_beeper_off); + MCFG_TIMER_DRIVER_ADD("beep_timer", hp64k_state, hp64k_beeper_off); COM8116(config, m_baud_rate, 5.0688_MHz_XTAL); m_baud_rate->fr_handler().set(FUNC(hp64k_state::hp64k_baud_clk_w)); @@ -1458,29 +1458,29 @@ MACHINE_CONFIG_START(hp64k_state::hp64k) m_rs232->dcd_handler().set(FUNC(hp64k_state::hp64k_rs232_dcd_w)); m_rs232->cts_handler().set(FUNC(hp64k_state::hp64k_rs232_cts_w)); - MCFG_DEVICE_ADD("phi" , PHI , 0) - MCFG_PHI_INT_WRITE_CB(WRITELINE(*this, hp64k_state , hp64k_phi_int_w)) - MCFG_PHI_DMARQ_WRITE_CB(WRITELINE("cpu" , hp_5061_3011_cpu_device , halt_w)) - MCFG_PHI_SYS_CNTRL_READ_CB(READLINE(*this, hp64k_state , hp64k_phi_sys_ctrl_r)) - MCFG_PHI_DIO_READWRITE_CB(READ8(IEEE488_TAG , ieee488_device , dio_r) , WRITE8(IEEE488_TAG , ieee488_device , host_dio_w)) - MCFG_PHI_EOI_WRITE_CB(WRITELINE(IEEE488_TAG , ieee488_device , host_eoi_w)) - MCFG_PHI_DAV_WRITE_CB(WRITELINE(IEEE488_TAG , ieee488_device , host_dav_w)) - MCFG_PHI_NRFD_WRITE_CB(WRITELINE(IEEE488_TAG , ieee488_device , host_nrfd_w)) - MCFG_PHI_NDAC_WRITE_CB(WRITELINE(IEEE488_TAG , ieee488_device , host_ndac_w)) - MCFG_PHI_IFC_WRITE_CB(WRITELINE(IEEE488_TAG , ieee488_device , host_ifc_w)) - MCFG_PHI_SRQ_WRITE_CB(WRITELINE(IEEE488_TAG , ieee488_device , host_srq_w)) - MCFG_PHI_ATN_WRITE_CB(WRITELINE(IEEE488_TAG , ieee488_device , host_atn_w)) - MCFG_PHI_REN_WRITE_CB(WRITELINE(IEEE488_TAG , ieee488_device , host_ren_w)) + MCFG_DEVICE_ADD("phi", PHI, 0) + MCFG_PHI_INT_WRITE_CB(WRITELINE(*this, hp64k_state, hp64k_phi_int_w)) + MCFG_PHI_DMARQ_WRITE_CB(WRITELINE("cpu" , hp_5061_3011_cpu_device, halt_w)) + MCFG_PHI_SYS_CNTRL_READ_CB(READLINE(*this, hp64k_state, hp64k_phi_sys_ctrl_r)) + MCFG_PHI_DIO_READWRITE_CB(READ8(IEEE488_TAG, ieee488_device, dio_r), WRITE8(IEEE488_TAG, ieee488_device, host_dio_w)) + MCFG_PHI_EOI_WRITE_CB(WRITELINE(IEEE488_TAG, ieee488_device, host_eoi_w)) + MCFG_PHI_DAV_WRITE_CB(WRITELINE(IEEE488_TAG, ieee488_device, host_dav_w)) + MCFG_PHI_NRFD_WRITE_CB(WRITELINE(IEEE488_TAG, ieee488_device, host_nrfd_w)) + MCFG_PHI_NDAC_WRITE_CB(WRITELINE(IEEE488_TAG, ieee488_device, host_ndac_w)) + MCFG_PHI_IFC_WRITE_CB(WRITELINE(IEEE488_TAG, ieee488_device, host_ifc_w)) + MCFG_PHI_SRQ_WRITE_CB(WRITELINE(IEEE488_TAG, ieee488_device, host_srq_w)) + MCFG_PHI_ATN_WRITE_CB(WRITELINE(IEEE488_TAG, ieee488_device, host_atn_w)) + MCFG_PHI_REN_WRITE_CB(WRITELINE(IEEE488_TAG, ieee488_device, host_ren_w)) MCFG_IEEE488_BUS_ADD() - MCFG_IEEE488_EOI_CALLBACK(WRITELINE("phi" , phi_device , eoi_w)) - MCFG_IEEE488_DAV_CALLBACK(WRITELINE("phi" , phi_device , dav_w)) - MCFG_IEEE488_NRFD_CALLBACK(WRITELINE("phi" , phi_device , nrfd_w)) - MCFG_IEEE488_NDAC_CALLBACK(WRITELINE("phi" , phi_device , ndac_w)) - MCFG_IEEE488_IFC_CALLBACK(WRITELINE("phi" , phi_device , ifc_w)) - MCFG_IEEE488_SRQ_CALLBACK(WRITELINE("phi" , phi_device , srq_w)) - MCFG_IEEE488_ATN_CALLBACK(WRITELINE("phi" , phi_device , atn_w)) - MCFG_IEEE488_REN_CALLBACK(WRITELINE("phi" , phi_device , ren_w)) - MCFG_IEEE488_DIO_CALLBACK(WRITE8("phi" , phi_device , bus_dio_w)) + MCFG_IEEE488_EOI_CALLBACK(WRITELINE("phi", phi_device, eoi_w)) + MCFG_IEEE488_DAV_CALLBACK(WRITELINE("phi", phi_device, dav_w)) + MCFG_IEEE488_NRFD_CALLBACK(WRITELINE("phi", phi_device, nrfd_w)) + MCFG_IEEE488_NDAC_CALLBACK(WRITELINE("phi", phi_device, ndac_w)) + MCFG_IEEE488_IFC_CALLBACK(WRITELINE("phi", phi_device, ifc_w)) + MCFG_IEEE488_SRQ_CALLBACK(WRITELINE("phi", phi_device, srq_w)) + MCFG_IEEE488_ATN_CALLBACK(WRITELINE("phi", phi_device, atn_w)) + MCFG_IEEE488_REN_CALLBACK(WRITELINE("phi", phi_device, ren_w)) + MCFG_IEEE488_DIO_CALLBACK(WRITE8("phi", phi_device , bus_dio_w)) MCFG_IEEE488_SLOT_ADD("ieee_rem" , 0 , remote488_devices , nullptr) MACHINE_CONFIG_END diff --git a/src/mame/drivers/hyperspt.cpp b/src/mame/drivers/hyperspt.cpp index fc77b67790e..6279d96e193 100644 --- a/src/mame/drivers/hyperspt.cpp +++ b/src/mame/drivers/hyperspt.cpp @@ -301,14 +301,14 @@ MACHINE_CONFIG_START(hyperspt_state::hyperspt) MCFG_DEVICE_ADD(m_audiocpu, Z80,XTAL(14'318'181)/4) /* verified on pcb */ MCFG_DEVICE_PROGRAM_MAP(hyperspt_sound_map) - MCFG_DEVICE_ADD("mainlatch", LS259, 0) // F2 - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, hyperspt_state, flipscreen_w)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(m_soundbrd, trackfld_audio_device, sh_irqtrigger_w)) // SOUND ON - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(NOOP) // END - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, hyperspt_state, coin_counter_1_w)) // COIN 1 - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(*this, hyperspt_state, coin_counter_2_w)) // COIN 2 - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(NOOP) // SA - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, hyperspt_state, irq_mask_w)) // INT + ls259_device &mainlatch(LS259(config, "mainlatch")); // F2 + mainlatch.q_out_cb<0>().set(FUNC(hyperspt_state::flipscreen_w)); + mainlatch.q_out_cb<1>().set(m_soundbrd, FUNC(trackfld_audio_device::sh_irqtrigger_w)); // SOUND ON + mainlatch.q_out_cb<2>().set_nop(); // END + mainlatch.q_out_cb<3>().set(FUNC(hyperspt_state::coin_counter_1_w)); // COIN 1 + mainlatch.q_out_cb<4>().set(FUNC(hyperspt_state::coin_counter_2_w)); // COIN 2 + mainlatch.q_out_cb<5>().set_nop(); // SA + mainlatch.q_out_cb<7>().set(FUNC(hyperspt_state::irq_mask_w)); // INT MCFG_NVRAM_ADD_0FILL("nvram") diff --git a/src/mame/drivers/inder.cpp b/src/mame/drivers/inder.cpp index d108a2e2f00..6df629382e5 100644 --- a/src/mame/drivers/inder.cpp +++ b/src/mame/drivers/inder.cpp @@ -1490,8 +1490,8 @@ MACHINE_CONFIG_START(inder_state::inder) MCFG_DEVICE_ADD("9b", TTL7474, 0) // HCT74 MCFG_7474_COMP_OUTPUT_CB(WRITELINE(*this, inder_state, qc9b_w)) - MCFG_DEVICE_ADD("13", HCT157, 0) - MCFG_74157_OUT_CB(WRITE8("msm", msm5205_device, data_w)) + HCT157(config, m_13, 0); + m_13->out_callback().set("msm", FUNC(msm5205_device::data_w)); MACHINE_CONFIG_END diff --git a/src/mame/drivers/jackpool.cpp b/src/mame/drivers/jackpool.cpp index e092f654c25..e97ebc18b91 100644 --- a/src/mame/drivers/jackpool.cpp +++ b/src/mame/drivers/jackpool.cpp @@ -245,26 +245,26 @@ MACHINE_CONFIG_START(jackpool_state::jackpool) MCFG_SCREEN_UPDATE_DRIVER(jackpool_state, screen_update_jackpool) MCFG_SCREEN_PALETTE("palette") - MCFG_DEVICE_ADD("latch1", LS259, 0) - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(NOOP) // HOLD3 lamp - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(NOOP) // HOLD4 lamp - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(NOOP) // HOLD2 lamp - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(NOOP) // HOLD1 lamp - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(NOOP) // HOLD5 lamp - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(NOOP) // START1 lamp - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(NOOP) // BET lamp - - MCFG_DEVICE_ADD("latch2", LS259, 0) - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(NOOP) // PAYOUT lamp - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(NOOP) // Coin counter - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(NOOP) // Ticket motor - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(NOOP) // Hopper motor - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, jackpool_state, map_vreg_w)) - - MCFG_DEVICE_ADD("latch3", LS259, 0) - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE("eeprom", eeprom_serial_93cxx_device, cs_write)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE("eeprom", eeprom_serial_93cxx_device, clk_write)) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE("eeprom", eeprom_serial_93cxx_device, di_write)) + ls259_device &latch1(LS259(config, "latch1")); + latch1.q_out_cb<0>().set_nop(); // HOLD3 lamp + latch1.q_out_cb<1>().set_nop(); // HOLD4 lamp + latch1.q_out_cb<2>().set_nop(); // HOLD2 lamp + latch1.q_out_cb<3>().set_nop(); // HOLD1 lamp + latch1.q_out_cb<4>().set_nop(); // HOLD5 lamp + latch1.q_out_cb<5>().set_nop(); // START1 lamp + latch1.q_out_cb<6>().set_nop(); // BET lamp + + ls259_device &latch2(LS259(config, "latch2")); + latch2.q_out_cb<0>().set_nop(); // PAYOUT lamp + latch2.q_out_cb<3>().set_nop(); // Coin counter + latch2.q_out_cb<5>().set_nop(); // Ticket motor + latch2.q_out_cb<6>().set_nop(); // Hopper motor + latch2.q_out_cb<7>().set(FUNC(jackpool_state::map_vreg_w)); + + ls259_device &latch3(LS259(config, "latch3")); + latch3.q_out_cb<0>().set("eeprom", FUNC(eeprom_serial_93cxx_device::cs_write)); + latch3.q_out_cb<1>().set("eeprom", FUNC(eeprom_serial_93cxx_device::clk_write)); + latch3.q_out_cb<2>().set("eeprom", FUNC(eeprom_serial_93cxx_device::di_write)); MCFG_DEVICE_ADD("eeprom", EEPROM_SERIAL_93C46_16BIT) diff --git a/src/mame/drivers/jedi.cpp b/src/mame/drivers/jedi.cpp index 7e08024ca9d..e49f04a595b 100644 --- a/src/mame/drivers/jedi.cpp +++ b/src/mame/drivers/jedi.cpp @@ -345,14 +345,14 @@ MACHINE_CONFIG_START(jedi_state::jedi) MCFG_ADC0808_IN2_CB(IOPORT("STICKX")) MCFG_ADC0808_IN3_CB(CONSTANT(0)) // SPARE - MCFG_DEVICE_ADD("outlatch", LS259, 0) // 14J - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, jedi_state, coin_counter_left_w)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, jedi_state, coin_counter_right_w)) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(NOOP) // LED control - not used - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(NOOP) // LED control - not used - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(*this, jedi_state, foreground_bank_w)) - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(*this, jedi_state, audio_reset_w)) - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, jedi_state, video_off_w)) + ls259_device &outlatch(LS259(config, "outlatch")); // 14J + outlatch.q_out_cb<0>().set(FUNC(jedi_state::coin_counter_left_w)); + outlatch.q_out_cb<1>().set(FUNC(jedi_state::coin_counter_right_w)); + outlatch.q_out_cb<2>().set_nop(); // LED control - not used + outlatch.q_out_cb<3>().set_nop(); // LED control - not used + outlatch.q_out_cb<4>().set(FUNC(jedi_state::foreground_bank_w)); + outlatch.q_out_cb<6>().set(FUNC(jedi_state::audio_reset_w)); + outlatch.q_out_cb<7>().set(FUNC(jedi_state::video_off_w)); MCFG_WATCHDOG_ADD("watchdog") diff --git a/src/mame/drivers/joctronic.cpp b/src/mame/drivers/joctronic.cpp index ae963d7012a..f9ac5e7beb1 100644 --- a/src/mame/drivers/joctronic.cpp +++ b/src/mame/drivers/joctronic.cpp @@ -21,6 +21,7 @@ public: joctronic_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag) , m_maincpu(*this, "maincpu") + , m_mainlatch(*this, "mainlatch") , m_soundcpu(*this, "soundcpu") , m_oki(*this, "oki") , m_adpcm_select(*this, "adpcm_select") @@ -74,6 +75,7 @@ private: void slalom03_sound_map(address_map &map); required_device m_maincpu; + required_device m_mainlatch; required_device m_soundcpu; optional_device m_oki; optional_device m_adpcm_select; @@ -135,7 +137,7 @@ void joctronic_state::maincpu_map(address_map &map) map(0x0000, 0x3fff).mirror(0x4000).rom(); map(0x8000, 0x87ff).mirror(0x0800).ram().share("nvram"); map(0x9000, 0x9007).mirror(0x0ff8).r(FUNC(joctronic_state::csin_r)); // CSIN - map(0xa000, 0xa007).mirror(0x0ff8).w("mainlatch", FUNC(ls259_device::write_d0)); // PORTDS + map(0xa000, 0xa007).mirror(0x0ff8).w(m_mainlatch, FUNC(ls259_device::write_d0)); // PORTDS map(0xc000, 0xc000).mirror(0x0fc7).w(FUNC(joctronic_state::display_1_w)); // CSD1 map(0xc008, 0xc008).mirror(0x0fc7).w(FUNC(joctronic_state::display_2_w)); // CSD2 map(0xc010, 0xc010).mirror(0x0fc7).w(FUNC(joctronic_state::display_3_w)); // CSD3 @@ -185,7 +187,7 @@ void joctronic_state::slalom03_maincpu_map(address_map &map) map.unmap_value_high(); map(0x0000, 0x7fff).rom(); map(0x8000, 0x87ff).mirror(0x0800).ram().share("nvram"); - map(0x9000, 0x9007).mirror(0x0ff8).w("mainlatch", FUNC(ls259_device::write_d0)); // CSPORT + map(0x9000, 0x9007).mirror(0x0ff8).w(m_mainlatch, FUNC(ls259_device::write_d0)); // CSPORT map(0xa008, 0xa008).mirror(0x0fc7).w(FUNC(joctronic_state::display_strobe_w)); // STROBE map(0xa010, 0xa017).mirror(0x0fc0).w(FUNC(joctronic_state::drivers_w)); map(0xa018, 0xa018).mirror(0x0fc7).w(FUNC(joctronic_state::display_ck_w)); // CKD @@ -346,10 +348,10 @@ MACHINE_CONFIG_START(joctronic_state::joctronic) MCFG_NVRAM_ADD_0FILL("nvram") // 5516 - MCFG_DEVICE_ADD("mainlatch", LS259, 0) // IC4 - exact type unknown - //MCFG_ADDRESSABLE_LATCH_PARALLEL_OUT_CB(WRITE8(*this, joctronic_state, display_select_w)) MCFG_DEVCB_MASK(0x07) + LS259(config, m_mainlatch); // IC4 - exact type unknown + //m_mainlatch->parallel_out_cb().set(FUNC(joctronic_state::display_select_w)); MCFG_DEVCB_MASK(0x07) //MCFG_DEVCB_CHAIN_OUTPUT(WRITE8(*this, joctronic_state, ls145_w)) MCFG_DEVCB_RSHIFT(4) - //MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, joctronic_state, display_reset_w)) + //m_mainlatch->q_out_cb<3>().set(FUNC(joctronic_state::display_reset_w)); MCFG_DEVICE_ADD("ctc", Z80CTC, XTAL(12'000'000)/4) // 3 MHz MCFG_Z80CTC_INTR_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0)) @@ -392,10 +394,10 @@ MACHINE_CONFIG_START(joctronic_state::slalom03) MCFG_NVRAM_ADD_0FILL("nvram") // 5516 - MCFG_DEVICE_ADD("mainlatch", LS259, 0) // IC6 - exact type unknown - //MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, joctronic_state, cont_w)) - //MCFG_ADDRESSABLE_LATCH_PARALLEL_OUT_CB(WRITE8(*this, joctronic_state, ls145_w)) MCFG_DEVCB_RSHIFT(3) MCFG_DEVCB_MASK(0x38) - //MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, joctronic_state, slalom03_reset_w)) + LS259(config, m_mainlatch); // IC6 - exact type unknown + //m_mainlatch->q_out_cb<0>().set(FUNC(joctronic_state::cont_w)); + //m_mainlatch->parallel_out_cb().set(FUNC(joctronic_state::ls145_w)); MCFG_DEVCB_RSHIFT(3) MCFG_DEVCB_MASK(0x38) + //m_mainlatch->q_out_cb<7>().set(FUNC(joctronic_state::slalom03_reset_w)); MCFG_DEVICE_ADD("ctc", Z80CTC, XTAL(12'000'000)/2) // 6 MHz MCFG_Z80CTC_INTR_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0)) @@ -423,8 +425,8 @@ MACHINE_CONFIG_START(joctronic_state::slalom03) MCFG_DEVICE_ADD("r2r", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30) - MCFG_DEVICE_ADD("adpcm_select", LS157, 0) - MCFG_74157_OUT_CB(WRITE8("oki", msm5205_device, data_w)) + LS157(config, m_adpcm_select, 0); + m_adpcm_select->out_callback().set("oki", FUNC(msm5205_device::data_w)); MCFG_DEVICE_ADD("oki", MSM5205, XTAL(12'000'000)/2/16) // 375 kHz MCFG_MSM5205_PRESCALER_SELECTOR(S96_4B) // frequency modifiable during operation diff --git a/src/mame/drivers/jp.cpp b/src/mame/drivers/jp.cpp index 59bb093df28..9aa8fae2697 100644 --- a/src/mame/drivers/jp.cpp +++ b/src/mame/drivers/jp.cpp @@ -413,8 +413,8 @@ MACHINE_CONFIG_START(jp_state::jps) MCFG_DEVICE_PROGRAM_MAP(jp_sound_map) MCFG_DEVICE_IRQ_ACKNOWLEDGE_DRIVER(jp_state, sound_int_cb) - MCFG_DEVICE_ADD("adpcm_select", LS157, 0) // not labeled in manual; might even be a CD4019 - MCFG_74157_OUT_CB(WRITE8("msm", msm5205_device, data_w)) + LS157(config, m_adpcm_select, 0); // not labeled in manual; might even be a CD4019 + m_adpcm_select->out_callback().set("msm", FUNC(msm5205_device::data_w)); SPEAKER(config, "msmvol").front_center(); MCFG_DEVICE_ADD("msm", MSM5205, 384'000) // not labeled in manual; clock unknown @@ -422,8 +422,7 @@ MACHINE_CONFIG_START(jp_state::jps) MCFG_MSM5205_PRESCALER_SELECTOR(S48_4B) // unknown MCFG_SOUND_ROUTE(ALL_OUTPUTS, "msmvol", 1.0) - MCFG_DEVICE_MODIFY("latch9") - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(INPUTLINE("soundcpu", INPUT_LINE_NMI)) // only external input for sound board + m_latch[9]->q_out_cb<5>().set_inputline("soundcpu", INPUT_LINE_NMI); // only external input for sound board MACHINE_CONFIG_END /*------------------------------------------------------------------- diff --git a/src/mame/drivers/jpmmps.cpp b/src/mame/drivers/jpmmps.cpp index b9b553ef1a2..934f23538fd 100644 --- a/src/mame/drivers/jpmmps.cpp +++ b/src/mame/drivers/jpmmps.cpp @@ -250,15 +250,15 @@ MACHINE_CONFIG_START(jpmmps_state::jpmmps) // CPU TMS9995, standard variant; no line connections MCFG_TMS99xx_ADD(m_maincpu, TMS9995, MAIN_CLOCK, jpmmps_map, jpmmps_io_map) - MCFG_DEVICE_ADD("mainlatch", LS259, 0) // IC10 - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(NOOP) // watchdog - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(NOOP) // ram en - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(NOOP) // alarm - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(NOOP) // nmi en - //MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(INPUTLINE("reelmcu", INPUT_LINE_RESET)) MCFG_DEVCB_INVERT // reel en - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(NOOP) // io en - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(NOOP) // bb - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(NOOP) // diagnostic led + ls259_device &mainlatch(LS259(config, "mainlatch")); // IC10 + mainlatch.q_out_cb<0>().set_nop(); // watchdog + mainlatch.q_out_cb<1>().set_nop(); // ram en + mainlatch.q_out_cb<2>().set_nop(); // alarm + mainlatch.q_out_cb<3>().set_nop(); // nmi en + //mainlatch.q_out_cb<4>().set_inputline("reelmcu", INPUT_LINE_RESET).invert(); // reel en + mainlatch.q_out_cb<5>().set_nop(); // io en + mainlatch.q_out_cb<6>().set_nop(); // bb + mainlatch.q_out_cb<7>().set_nop(); // diagnostic led //MCFG_DEVICE_ADD("reelmcu", TMS7041, XTAL(5'000'000)) diff --git a/src/mame/drivers/jpms80.cpp b/src/mame/drivers/jpms80.cpp index 2fd63643477..53b3dfb1995 100644 --- a/src/mame/drivers/jpms80.cpp +++ b/src/mame/drivers/jpms80.cpp @@ -138,22 +138,22 @@ MACHINE_CONFIG_START(jpms80_state::jpms80) MCFG_TMS99xx_ADD(m_maincpu, TMS9995, MAIN_CLOCK, jpms80_map, jpms80_io_map) SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("outlatch0", LS259, 0) // I/O IC5 - MCFG_DEVICE_ADD("outlatch1", LS259, 0) // I/O IC6 - MCFG_DEVICE_ADD("outlatch2", LS259, 0) // I/O IC7 - MCFG_DEVICE_ADD("outlatch3", LS259, 0) // I/O IC8 - MCFG_DEVICE_ADD("outlatch4", LS259, 0) // I/O IC9 - MCFG_DEVICE_ADD("outlatch5", LS259, 0) // I/O IC10 - MCFG_DEVICE_ADD("outlatch6", LS259, 0) // I/O IC11 - MCFG_DEVICE_ADD("outlatch7", LS259, 0) // I/O IC12 - MCFG_DEVICE_ADD("outlatch8", LS259, 0) // I/O IC13 - MCFG_DEVICE_ADD("outlatch9", LS259, 0) // I/O IC14 - - MCFG_DEVICE_ADD("outlatch10", LS259, 0) // I/O IC15 - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, jpms80_state, int1_enable_w)) // 50 - INT1 enable (lv3) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, jpms80_state, int2_enable_w)) // 51 - INT2 enable (lv4) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, jpms80_state, watchdog_w)) // 52 - Watchdog - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, jpms80_state, io_enable_w)) // 53 - I/O Enable + LS259(config, "outlatch0"); // I/O IC5 + LS259(config, "outlatch1"); // I/O IC6 + LS259(config, "outlatch2"); // I/O IC7 + LS259(config, "outlatch3"); // I/O IC8 + LS259(config, "outlatch4"); // I/O IC9 + LS259(config, "outlatch5"); // I/O IC10 + LS259(config, "outlatch6"); // I/O IC11 + LS259(config, "outlatch7"); // I/O IC12 + LS259(config, "outlatch8"); // I/O IC13 + LS259(config, "outlatch9"); // I/O IC14 + + ls259_device &outlatch10(LS259(config, "outlatch10")); // I/O IC15 + outlatch10.q_out_cb<0>().set(FUNC(jpms80_state::int1_enable_w)); // 50 - INT1 enable (lv3) + outlatch10.q_out_cb<1>().set(FUNC(jpms80_state::int2_enable_w)); // 51 - INT2 enable (lv4) + outlatch10.q_out_cb<2>().set(FUNC(jpms80_state::watchdog_w)); // 52 - Watchdog + outlatch10.q_out_cb<3>().set(FUNC(jpms80_state::io_enable_w)); // 53 - I/O Enable MCFG_DEVICE_ADD("tms9902duart", TMS9902, DUART_CLOCK) diff --git a/src/mame/drivers/jrpacman.cpp b/src/mame/drivers/jrpacman.cpp index 5cce0687c40..0407b0b9ff2 100644 --- a/src/mame/drivers/jrpacman.cpp +++ b/src/mame/drivers/jrpacman.cpp @@ -286,18 +286,18 @@ MACHINE_CONFIG_START(jrpacman_state::jrpacman) MCFG_DEVICE_PROGRAM_MAP(main_map) MCFG_DEVICE_IO_MAP(port_map) - MCFG_DEVICE_ADD("latch1", LS259, 0) // 5P - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, jrpacman_state, irq_mask_w)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE("namco", namco_device, sound_enable_w)) - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, jrpacman_state, flipscreen_w)) - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, jrpacman_state, coin_counter_w)) - - MCFG_DEVICE_ADD("latch2", LS259, 0) // 1H - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, jrpacman_state, pengo_palettebank_w)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, jrpacman_state, pengo_colortablebank_w)) - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, jrpacman_state, jrpacman_bgpriority_w)) - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(*this, jrpacman_state, jrpacman_charbank_w)) - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE(*this, jrpacman_state, jrpacman_spritebank_w)) + ls259_device &latch1(LS259(config, "latch1")); // 5P + latch1.q_out_cb<0>().set(FUNC(jrpacman_state::irq_mask_w)); + latch1.q_out_cb<1>().set("namco", FUNC(namco_device::sound_enable_w)); + latch1.q_out_cb<3>().set(FUNC(jrpacman_state::flipscreen_w)); + latch1.q_out_cb<7>().set(FUNC(jrpacman_state::coin_counter_w)); + + ls259_device &latch2(LS259(config, "latch2")); // 1H + latch2.q_out_cb<0>().set(FUNC(jrpacman_state::pengo_palettebank_w)); + latch2.q_out_cb<1>().set(FUNC(jrpacman_state::pengo_colortablebank_w)); + latch2.q_out_cb<3>().set(FUNC(jrpacman_state::jrpacman_bgpriority_w)); + latch2.q_out_cb<4>().set(FUNC(jrpacman_state::jrpacman_charbank_w)); + latch2.q_out_cb<5>().set(FUNC(jrpacman_state::jrpacman_spritebank_w)); MCFG_WATCHDOG_ADD("watchdog") diff --git a/src/mame/drivers/junofrst.cpp b/src/mame/drivers/junofrst.cpp index 7fa79b44042..790f08138a4 100644 --- a/src/mame/drivers/junofrst.cpp +++ b/src/mame/drivers/junofrst.cpp @@ -418,13 +418,13 @@ MACHINE_CONFIG_START(junofrst_state::junofrst) MCFG_MCS48_PORT_P1_OUT_CB(WRITE8("dac", dac_byte_interface, data_w)) MCFG_MCS48_PORT_P2_OUT_CB(WRITE8(*this, junofrst_state, i8039_irqen_and_status_w)) - MCFG_DEVICE_ADD("mainlatch", LS259, 0) // B3 - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, junofrst_state, irq_enable_w)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, junofrst_state, coin_counter_2_w)) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, junofrst_state, coin_counter_1_w)) - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(NOOP) - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(*this, junofrst_state, flip_screen_x_w)) // HFF - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE(*this, junofrst_state, flip_screen_y_w)) // VFLIP + ls259_device &mainlatch(LS259(config, "mainlatch")); // B3 + mainlatch.q_out_cb<0>().set(FUNC(junofrst_state::irq_enable_w)); + mainlatch.q_out_cb<1>().set(FUNC(junofrst_state::coin_counter_2_w)); + mainlatch.q_out_cb<2>().set(FUNC(junofrst_state::coin_counter_1_w)); + mainlatch.q_out_cb<3>().set_nop(); + mainlatch.q_out_cb<4>().set(FUNC(junofrst_state::flip_screen_x_w)); // HFF + mainlatch.q_out_cb<5>().set(FUNC(junofrst_state::flip_screen_y_w)); // VFLIP MCFG_WATCHDOG_ADD("watchdog") diff --git a/src/mame/drivers/kchamp.cpp b/src/mame/drivers/kchamp.cpp index cd5a4ee9aa6..60d66ea57ce 100644 --- a/src/mame/drivers/kchamp.cpp +++ b/src/mame/drivers/kchamp.cpp @@ -417,10 +417,10 @@ MACHINE_CONFIG_START(kchamp_state::kchampvs) MCFG_DEVICE_IO_MAP(kchampvs_sound_io_map) /* irq's triggered from main cpu */ /* nmi's from msm5205 */ - MCFG_DEVICE_ADD("mainlatch", LS259, 0) // 8C - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, kchamp_state, flipscreen_w)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, kchamp_state, nmi_enable_w)) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, kchamp_state, sound_reset_w)) + ls259_device &mainlatch(LS259(config, "mainlatch")); // 8C + mainlatch.q_out_cb<0>().set(FUNC(kchamp_state::flipscreen_w)); + mainlatch.q_out_cb<1>().set(FUNC(kchamp_state::nmi_enable_w)); + mainlatch.q_out_cb<2>().set(FUNC(kchamp_state::sound_reset_w)); MCFG_MACHINE_START_OVERRIDE(kchamp_state,kchampvs) @@ -451,8 +451,8 @@ MACHINE_CONFIG_START(kchamp_state::kchampvs) MCFG_DEVICE_ADD("ay2", AY8910, XTAL(12'000'000)/8) /* verified on pcb */ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.3) - MCFG_DEVICE_ADD("adpcm_select", LS157, 0) // at 4C - MCFG_74157_OUT_CB(WRITE8("msm", msm5205_device, data_w)) + LS157(config, m_adpcm_select, 0); // at 4C + m_adpcm_select->out_callback().set("msm", FUNC(msm5205_device::data_w)); MCFG_DEVICE_ADD("msm", MSM5205, 375000) /* verified on pcb, discrete circuit clock */ MCFG_MSM5205_VCK_CALLBACK(WRITELINE(*this, kchamp_state, msmint)) /* interrupt function */ @@ -478,9 +478,9 @@ MACHINE_CONFIG_START(kchamp_state::kchamp) /* irq's triggered from main cpu */ /* nmi's from 125 Hz clock */ - MCFG_DEVICE_ADD("mainlatch", LS259, 0) // IC71 - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, kchamp_state, flipscreen_w)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, kchamp_state, nmi_enable_w)) + ls259_device &mainlatch(LS259(config, "mainlatch")); // IC71 + mainlatch.q_out_cb<0>().set(FUNC(kchamp_state::flipscreen_w)); + mainlatch.q_out_cb<1>().set(FUNC(kchamp_state::nmi_enable_w)); MCFG_MACHINE_START_OVERRIDE(kchamp_state,kchamp) diff --git a/src/mame/drivers/ladybug.cpp b/src/mame/drivers/ladybug.cpp index f3ed463f03c..b554d1c311c 100644 --- a/src/mame/drivers/ladybug.cpp +++ b/src/mame/drivers/ladybug.cpp @@ -744,8 +744,8 @@ MACHINE_CONFIG_START(ladybug_state::ladybug) MCFG_DEVICE_ADD("video", LADYBUG_VIDEO, 4000000) MCFG_LADYBUG_VIDEO_GFXDECODE("gfxdecode") - MCFG_DEVICE_ADD("videolatch", LS259, 0) // L5 on video board or H3 on single board - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, ladybug_state, flipscreen_w)) // no other outputs used + ls259_device &videolatch(LS259(config, "videolatch")); // L5 on video board or H3 on single board + videolatch.q_out_cb<0>().set(FUNC(ladybug_state::flipscreen_w)); // no other outputs used /* sound hardware */ SPEAKER(config, "mono").front_center(); diff --git a/src/mame/drivers/looping.cpp b/src/mame/drivers/looping.cpp index 386932a671c..02c95b0a75e 100644 --- a/src/mame/drivers/looping.cpp +++ b/src/mame/drivers/looping.cpp @@ -638,15 +638,15 @@ MACHINE_CONFIG_START(looping_state::looping) MCFG_COP400_READ_IN_CB(READ8(*this, looping_state, cop_unk_r)) MCFG_COP400_READ_SI_CB(READLINE(*this, looping_state, cop_serial_r)) - MCFG_DEVICE_ADD("mainlatch", LS259, 0) // C9 on CPU board + ls259_device &mainlatch(LS259(config, "mainlatch")); // C9 on CPU board // Q0 = A16 // Q1 = A17 // Q2 = COLOR 9 - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, looping_state, plr2_w)) + mainlatch.q_out_cb<3>().set(FUNC(looping_state::plr2_w)); // Q4 = C0 // Q5 = C1 - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(*this, looping_state, main_irq_ack_w)) - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, looping_state, watchdog_w)) + mainlatch.q_out_cb<6>().set(FUNC(looping_state::main_irq_ack_w)); + mainlatch.q_out_cb<7>().set(FUNC(looping_state::watchdog_w)); MCFG_WATCHDOG_ADD("watchdog") @@ -661,10 +661,10 @@ MACHINE_CONFIG_START(looping_state::looping) MCFG_PALETTE_ADD("palette", 32) MCFG_PALETTE_INIT_OWNER(looping_state, looping) - MCFG_DEVICE_ADD("videolatch", LS259, 0) // E2 on video board - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, looping_state, level2_irq_set)) - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(*this, looping_state, flip_screen_x_w)) - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, looping_state, flip_screen_y_w)) + ls259_device &videolatch(LS259(config, "videolatch")); // E2 on video board + videolatch.q_out_cb<1>().set(FUNC(looping_state::level2_irq_set)); + videolatch.q_out_cb<6>().set(FUNC(looping_state::flip_screen_x_w)); + videolatch.q_out_cb<7>().set(FUNC(looping_state::flip_screen_y_w)); /* sound hardware */ SPEAKER(config, "speaker").front_center(); @@ -683,14 +683,14 @@ MACHINE_CONFIG_START(looping_state::looping) MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0) MCFG_SOUND_ROUTE(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE(0, "dac", -1.0, DAC_VREF_NEG_INPUT) - MCFG_DEVICE_ADD("sen0", LS259, 0) // B3 on sound board - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, looping_state, looping_souint_clr)) - MCFG_ADDRESSABLE_LATCH_PARALLEL_OUT_CB(WRITE8(*this, looping_state, looping_sound_sw)) + ls259_device &sen0(LS259(config, "sen0")); // B3 on sound board + sen0.q_out_cb<0>().set(FUNC(looping_state::looping_souint_clr)); + sen0.parallel_out_cb().set(FUNC(looping_state::looping_sound_sw)); - MCFG_DEVICE_ADD("sen1", LS259, 0) // A1 on sound board with outputs connected to 4016 at B1 - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, looping_state, ay_enable_w)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, looping_state, speech_enable_w)) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, looping_state, ballon_enable_w)) + ls259_device &sen1(LS259(config, "sen1")); // A1 on sound board with outputs connected to 4016 at B1 + sen1.q_out_cb<0>().set(FUNC(looping_state::ay_enable_w)); + sen1.q_out_cb<1>().set(FUNC(looping_state::speech_enable_w)); + sen1.q_out_cb<2>().set(FUNC(looping_state::ballon_enable_w)); MACHINE_CONFIG_END diff --git a/src/mame/drivers/m10.cpp b/src/mame/drivers/m10.cpp index 73c0d6c38a9..a1032ab00d1 100644 --- a/src/mame/drivers/m10.cpp +++ b/src/mame/drivers/m10.cpp @@ -837,23 +837,24 @@ MACHINE_CONFIG_START(m10_state::m10) /* 74LS123 */ - MCFG_DEVICE_ADD("ic8j1", TTL74123, 0) /* completely illegible */ - MCFG_TTL74123_CONNECTION_TYPE(TTL74123_NOT_GROUNDED_DIODE) /* the hook up type */ - MCFG_TTL74123_RESISTOR_VALUE(RES_K(1)) /* resistor connected to RCext */ - MCFG_TTL74123_CAPACITOR_VALUE(CAP_U(1)) /* capacitor connected to Cext and RCext */ - MCFG_TTL74123_A_PIN_VALUE(1) /* A pin - driven by the CRTC */ - MCFG_TTL74123_B_PIN_VALUE(1) /* B pin - pulled high */ - MCFG_TTL74123_CLEAR_PIN_VALUE(1) /* Clear pin - pulled high */ - MCFG_TTL74123_OUTPUT_CHANGED_CB(WRITELINE(*this, m10_state, ic8j1_output_changed)) - MCFG_DEVICE_ADD("ic8j2", TTL74123, 0) - MCFG_TTL74123_CONNECTION_TYPE(TTL74123_NOT_GROUNDED_DIODE) /* the hook up type */ + TTL74123(config, m_ic8j1, 0); /* completely illegible */ + m_ic8j1->set_connection_type(TTL74123_NOT_GROUNDED_DIODE); /* the hook up type */ + m_ic8j1->set_resistor_value(RES_K(1)); /* resistor connected to RCext */ + m_ic8j1->set_capacitor_value(CAP_U(1)); /* capacitor connected to Cext and RCext */ + m_ic8j1->set_a_pin_value(1); /* A pin - driven by the CRTC */ + m_ic8j1->set_b_pin_value(1); /* B pin - pulled high */ + m_ic8j1->set_clear_pin_value(1); /* Clear pin - pulled high */ + m_ic8j1->out_cb().set(FUNC(m10_state::ic8j1_output_changed)); + + TTL74123(config, m_ic8j2, 0); + m_ic8j2->set_connection_type(TTL74123_NOT_GROUNDED_DIODE); /* the hook up type */ /* 10k + 20k variable resistor */ - MCFG_TTL74123_RESISTOR_VALUE(RES_K(22)) /* resistor connected to RCext */ - MCFG_TTL74123_CAPACITOR_VALUE(CAP_U(2.2)) /* capacitor connected to Cext and RCext */ - MCFG_TTL74123_A_PIN_VALUE(1) /* A pin - driven by the CRTC */ - MCFG_TTL74123_B_PIN_VALUE(1) /* B pin - pulled high */ - MCFG_TTL74123_CLEAR_PIN_VALUE(1) /* Clear pin - pulled high */ - MCFG_TTL74123_OUTPUT_CHANGED_CB(WRITELINE(*this, m10_state, ic8j2_output_changed)) + m_ic8j2->set_resistor_value(RES_K(22)); /* resistor connected to RCext */ + m_ic8j2->set_capacitor_value(CAP_U(2.2)); /* capacitor connected to Cext and RCext */ + m_ic8j2->set_a_pin_value(1); /* A pin - driven by the CRTC */ + m_ic8j2->set_b_pin_value(1); /* B pin - pulled high */ + m_ic8j2->set_clear_pin_value(1); /* Clear pin - pulled high */ + m_ic8j2->out_cb().set(FUNC(m10_state::ic8j2_output_changed)); /* sound hardware */ SPEAKER(config, "mono").front_center(); diff --git a/src/mame/drivers/m63.cpp b/src/mame/drivers/m63.cpp index c393c38d3e3..2aaf3d42193 100644 --- a/src/mame/drivers/m63.cpp +++ b/src/mame/drivers/m63.cpp @@ -763,12 +763,12 @@ MACHINE_CONFIG_START(m63_state::m63) MCFG_DEVICE_PROGRAM_MAP(m63_map) MCFG_DEVICE_VBLANK_INT_DRIVER("screen", m63_state, vblank_irq) - MCFG_DEVICE_ADD("outlatch", LS259, 0) // probably chip at E7 obscured by pulldown resistor - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, m63_state, nmi_mask_w)) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, m63_state, m63_flipscreen_w)) - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, m63_state, pal_bank_w)) - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(*this, m63_state, coin1_w)) - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, m63_state, coin2_w)) + ls259_device &outlatch(LS259(config, "outlatch")); // probably chip at E7 obscured by pulldown resistor + outlatch.q_out_cb<0>().set(FUNC(m63_state::nmi_mask_w)); + outlatch.q_out_cb<2>().set(FUNC(m63_state::m63_flipscreen_w)); + outlatch.q_out_cb<3>().set(FUNC(m63_state::pal_bank_w)); + outlatch.q_out_cb<6>().set(FUNC(m63_state::coin1_w)); + outlatch.q_out_cb<7>().set(FUNC(m63_state::coin2_w)); MCFG_DEVICE_ADD("soundcpu",I8039,XTAL(12'000'000)/4) /* ????? */ MCFG_DEVICE_PROGRAM_MAP(i8039_map) @@ -821,10 +821,10 @@ MACHINE_CONFIG_START(m63_state::fghtbskt) MCFG_DEVICE_PROGRAM_MAP(fghtbskt_map) MCFG_DEVICE_VBLANK_INT_DRIVER("screen", m63_state, vblank_irq) - MCFG_DEVICE_ADD("outlatch", LS259, 0) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, m63_state, nmi_mask_w)) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, m63_state, fghtbskt_flipscreen_w)) - //MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, m63_state, fghtbskt_samples_w)) + ls259_device &outlatch(LS259(config, "outlatch")); + outlatch.q_out_cb<1>().set(FUNC(m63_state::nmi_mask_w)); + outlatch.q_out_cb<2>().set(FUNC(m63_state::fghtbskt_flipscreen_w)); + //outlatch.q_out_cb<7>().set(FUNC(m63_state::fghtbskt_samples_w)); MCFG_DEVICE_ADD("soundcpu", I8039,XTAL(12'000'000)/4) /* ????? */ MCFG_DEVICE_PROGRAM_MAP(i8039_map) diff --git a/src/mame/drivers/marineb.cpp b/src/mame/drivers/marineb.cpp index 1e2bd737e4b..65835fe9f1a 100644 --- a/src/mame/drivers/marineb.cpp +++ b/src/mame/drivers/marineb.cpp @@ -41,7 +41,6 @@ write #include "includes/marineb.h" #include "cpu/z80/z80.h" -#include "machine/74259.h" #include "sound/ay8910.h" #include "screen.h" #include "speaker.h" @@ -85,7 +84,7 @@ void marineb_state::marineb_map(address_map &map) map(0x9800, 0x9800).w(FUNC(marineb_state::marineb_column_scroll_w)); map(0x9a00, 0x9a00).w(FUNC(marineb_state::marineb_palette_bank_0_w)); map(0x9c00, 0x9c00).w(FUNC(marineb_state::marineb_palette_bank_1_w)); - map(0xa000, 0xa007).w("outlatch", FUNC(ls259_device::write_d0)); + map(0xa000, 0xa007).w(m_outlatch, FUNC(ls259_device::write_d0)); map(0xa000, 0xa000).portr("P2"); map(0xa800, 0xa800).portr("P1"); map(0xb000, 0xb000).portr("DSW"); @@ -546,10 +545,10 @@ MACHINE_CONFIG_START(marineb_state::marineb) MCFG_DEVICE_PROGRAM_MAP(marineb_map) MCFG_DEVICE_IO_MAP(marineb_io_map) - MCFG_DEVICE_ADD("outlatch", LS259, 0) - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, marineb_state, nmi_mask_w)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, marineb_state, flipscreen_y_w)) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, marineb_state, flipscreen_x_w)) + LS259(config, m_outlatch); + m_outlatch->q_out_cb<0>().set(FUNC(marineb_state::nmi_mask_w)); + m_outlatch->q_out_cb<1>().set(FUNC(marineb_state::flipscreen_y_w)); + m_outlatch->q_out_cb<2>().set(FUNC(marineb_state::flipscreen_x_w)); /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) @@ -588,12 +587,9 @@ void marineb_state::springer(machine_config &config) { marineb(config); - /* basic machine hardware */ - ls259_device &outlatch(*subdevice("outlatch")); - outlatch.q_out_cb<1>().set(FUNC(marineb_state::flipscreen_y_w)).invert(); - outlatch.q_out_cb<2>().set(FUNC(marineb_state::flipscreen_x_w)).invert(); + m_outlatch->q_out_cb<1>().set(FUNC(marineb_state::flipscreen_y_w)).invert(); + m_outlatch->q_out_cb<2>().set(FUNC(marineb_state::flipscreen_x_w)).invert(); - /* video hardware */ subdevice("screen")->set_screen_update(FUNC(marineb_state::screen_update_springer)); } @@ -617,8 +613,7 @@ MACHINE_CONFIG_START(marineb_state::wanted) MCFG_DEVICE_MODIFY("maincpu") MCFG_DEVICE_IO_MAP(wanted_io_map) - MCFG_DEVICE_MODIFY("outlatch") - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, marineb_state, irq_mask_w)) + m_outlatch->q_out_cb<0>().set(FUNC(marineb_state::irq_mask_w)); /* video hardware */ MCFG_GFXDECODE_MODIFY("gfxdecode", gfx_wanted) @@ -651,10 +646,8 @@ void marineb_state::bcruzm12(machine_config &config) { wanted(config); - /* basic machine hardware */ - ls259_device &outlatch(*subdevice("outlatch")); - outlatch.q_out_cb<1>().set(FUNC(marineb_state::flipscreen_y_w)).invert(); - outlatch.q_out_cb<2>().set(FUNC(marineb_state::flipscreen_x_w)).invert(); + m_outlatch->q_out_cb<1>().set(FUNC(marineb_state::flipscreen_y_w)).invert(); + m_outlatch->q_out_cb<2>().set(FUNC(marineb_state::flipscreen_x_w)).invert(); } /*************************************************************************** diff --git a/src/mame/drivers/mario.cpp b/src/mame/drivers/mario.cpp index 4b78e4305ba..036e3d48d49 100644 --- a/src/mame/drivers/mario.cpp +++ b/src/mame/drivers/mario.cpp @@ -348,15 +348,15 @@ MACHINE_CONFIG_START(mario_state::mario_base) MCFG_Z80DMA_IN_MREQ_CB(READ8(*this, mario_state, memory_read_byte)) MCFG_Z80DMA_OUT_MREQ_CB(WRITE8(*this, mario_state, memory_write_byte)) - MCFG_DEVICE_ADD("mainlatch", LS259, 0) // 2L (7E80H) - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, mario_state, gfx_bank_w)) // ~T ROM - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(NOOP) // 2 PSL - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, mario_state, flip_w)) // FLIP - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, mario_state, palette_bank_w)) // CREF 0 - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(*this, mario_state, nmi_mask_w)) // NMI EI - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE("z80dma", z80dma_device, rdy_w)) // DMA SET - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(*this, mario_state, coin_counter_1_w)) // COUNTER 2 (misnumbered on schematic) - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, mario_state, coin_counter_2_w)) // COUNTER 1 (misnumbered on schematic) + ls259_device &mainlatch(LS259(config, "mainlatch")); // 2L (7E80H) + mainlatch.q_out_cb<0>().set(FUNC(mario_state::gfx_bank_w)); // ~T ROM + mainlatch.q_out_cb<1>().set_nop(); // 2 PSL + mainlatch.q_out_cb<2>().set(FUNC(mario_state::flip_w)); // FLIP + mainlatch.q_out_cb<3>().set(FUNC(mario_state::palette_bank_w)); // CREF 0 + mainlatch.q_out_cb<4>().set(FUNC(mario_state::nmi_mask_w)); // NMI EI + mainlatch.q_out_cb<5>().set("z80dma", FUNC(z80dma_device::rdy_w)); // DMA SET + mainlatch.q_out_cb<6>().set(FUNC(mario_state::coin_counter_1_w)); // COUNTER 2 (misnumbered on schematic) + mainlatch.q_out_cb<7>().set(FUNC(mario_state::coin_counter_2_w)); // COUNTER 1 (misnumbered on schematic) /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) diff --git a/src/mame/drivers/mastboy.cpp b/src/mame/drivers/mastboy.cpp index dfd5dce3bb6..3dcab4e0501 100644 --- a/src/mame/drivers/mastboy.cpp +++ b/src/mame/drivers/mastboy.cpp @@ -815,12 +815,12 @@ MACHINE_CONFIG_START(mastboy_state::mastboy) MCFG_EEPROM_2816_ADD("earom") - MCFG_DEVICE_ADD("outlatch", LS259, 0) // IC17 - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, mastboy_state, irq0_ack_w)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE("msm", msm5205_device, s2_w)) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE("msm", msm5205_device, s1_w)) - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE("msm", msm5205_device, reset_w)) - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE("earom", eeprom_parallel_28xx_device, oe_w)) + LS259(config, m_outlatch); // IC17 + m_outlatch->q_out_cb<0>().set(FUNC(mastboy_state::irq0_ack_w)); + m_outlatch->q_out_cb<1>().set("msm", FUNC(msm5205_device::s2_w)); + m_outlatch->q_out_cb<2>().set("msm", FUNC(msm5205_device::s1_w)); + m_outlatch->q_out_cb<3>().set("msm", FUNC(msm5205_device::reset_w)); + m_outlatch->q_out_cb<4>().set("earom", FUNC(eeprom_parallel_28xx_device::oe_w)); MCFG_DEVICE_ADD("bank_c000", ADDRESS_MAP_BANK, 0) MCFG_DEVICE_PROGRAM_MAP(bank_c000_map) diff --git a/src/mame/drivers/maygay1b.cpp b/src/mame/drivers/maygay1b.cpp index bdc46e936a5..ac67cdac64e 100644 --- a/src/mame/drivers/maygay1b.cpp +++ b/src/mame/drivers/maygay1b.cpp @@ -783,14 +783,14 @@ MACHINE_CONFIG_START(maygay1b_state::maygay_m1) pia.writepa_handler().set(FUNC(maygay1b_state::m1_pia_porta_w)); pia.writepb_handler().set(FUNC(maygay1b_state::m1_pia_portb_w)); - MCFG_DEVICE_ADD("mainlatch", HC259, 0) // U29 - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, maygay1b_state, ramen_w)) // m_RAMEN - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, maygay1b_state, alarmen_w)) // AlarmEn - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, maygay1b_state, nmien_w)) // Enable - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, maygay1b_state, rts_w)) // RTS - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(*this, maygay1b_state, psurelay_w)) // PSURelay - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE(*this, maygay1b_state, wdog_w)) // WDog - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(*this, maygay1b_state, srsel_w)) // Srsel + hc259_device &mainlatch(HC259(config, "mainlatch")); // U29 + mainlatch.q_out_cb<0>().set(FUNC(maygay1b_state::ramen_w)); // m_RAMEN + mainlatch.q_out_cb<1>().set(FUNC(maygay1b_state::alarmen_w)); // AlarmEn + mainlatch.q_out_cb<2>().set(FUNC(maygay1b_state::nmien_w)); // Enable + mainlatch.q_out_cb<3>().set(FUNC(maygay1b_state::rts_w)); // RTS + mainlatch.q_out_cb<4>().set(FUNC(maygay1b_state::psurelay_w)); // PSURelay + mainlatch.q_out_cb<5>().set(FUNC(maygay1b_state::wdog_w)); // WDog + mainlatch.q_out_cb<6>().set(FUNC(maygay1b_state::srsel_w)); // Srsel MCFG_S16LF01_ADD("vfd",0) SPEAKER(config, "lspeaker").front_left(); diff --git a/src/mame/drivers/mcr3.cpp b/src/mame/drivers/mcr3.cpp index 2cca6a7bb43..53ef6d7acef 100644 --- a/src/mame/drivers/mcr3.cpp +++ b/src/mame/drivers/mcr3.cpp @@ -1188,15 +1188,15 @@ MACHINE_CONFIG_START(mcr3_state::mcrsc_csd) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) - MCFG_DEVICE_ADD("lamplatch", CD4099, 0) // U1 on Lamp Driver Board - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(OUTPUT("lamp0")) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(OUTPUT("lamp1")) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(OUTPUT("lamp2")) - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(OUTPUT("lamp3")) - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(OUTPUT("lamp4")) - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(OUTPUT("lamp5")) - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(OUTPUT("lamp6")) - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(OUTPUT("lamp7")) + CD4099(config, m_lamplatch); // U1 on Lamp Driver Board + m_lamplatch->q_out_cb<0>().set_output("lamp0"); + m_lamplatch->q_out_cb<1>().set_output("lamp1"); + m_lamplatch->q_out_cb<2>().set_output("lamp2"); + m_lamplatch->q_out_cb<3>().set_output("lamp3"); + m_lamplatch->q_out_cb<4>().set_output("lamp4"); + m_lamplatch->q_out_cb<5>().set_output("lamp5"); + m_lamplatch->q_out_cb<6>().set_output("lamp6"); + m_lamplatch->q_out_cb<7>().set_output("lamp7"); MACHINE_CONFIG_END diff --git a/src/mame/drivers/megazone.cpp b/src/mame/drivers/megazone.cpp index 659132eed99..d08b46c7549 100644 --- a/src/mame/drivers/megazone.cpp +++ b/src/mame/drivers/megazone.cpp @@ -312,11 +312,11 @@ MACHINE_CONFIG_START(megazone_state::megazone) MCFG_QUANTUM_TIME(attotime::from_hz(900)) - MCFG_DEVICE_ADD("mainlatch", LS259, 0) // 13A - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, megazone_state, coin_counter_2_w)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, megazone_state, coin_counter_1_w)) - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE(*this, megazone_state, flipscreen_w)) - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, megazone_state, irq_mask_w)) + ls259_device &mainlatch(LS259(config, "mainlatch")); // 13A + mainlatch.q_out_cb<0>().set(FUNC(megazone_state::coin_counter_2_w)); + mainlatch.q_out_cb<1>().set(FUNC(megazone_state::coin_counter_1_w)); + mainlatch.q_out_cb<5>().set(FUNC(megazone_state::flipscreen_w)); + mainlatch.q_out_cb<7>().set(FUNC(megazone_state::irq_mask_w)); MCFG_WATCHDOG_ADD("watchdog") diff --git a/src/mame/drivers/mephisto.cpp b/src/mame/drivers/mephisto.cpp index b2c5966da10..f123776675e 100644 --- a/src/mame/drivers/mephisto.cpp +++ b/src/mame/drivers/mephisto.cpp @@ -305,14 +305,14 @@ MACHINE_CONFIG_START(mephisto_state::mephisto) MCFG_DEVICE_PROGRAM_MAP(mephisto_mem) MCFG_QUANTUM_TIME(attotime::from_hz(60)) - MCFG_DEVICE_ADD("outlatch", HC259, 0) - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(OUTPUT("led100")) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(OUTPUT("led101")) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(OUTPUT("led102")) - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(OUTPUT("led103")) - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(OUTPUT("led104")) - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(OUTPUT("led105")) - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, mephisto_state, write_led7)) + HC259(config, m_outlatch); + m_outlatch->q_out_cb<0>().set_output("led100"); + m_outlatch->q_out_cb<1>().set_output("led101"); + m_outlatch->q_out_cb<2>().set_output("led102"); + m_outlatch->q_out_cb<3>().set_output("led103"); + m_outlatch->q_out_cb<4>().set_output("led104"); + m_outlatch->q_out_cb<5>().set_output("led105"); + m_outlatch->q_out_cb<7>().set(FUNC(mephisto_state::write_led7)); /* sound hardware */ SPEAKER(config, "mono").front_center(); diff --git a/src/mame/drivers/mermaid.cpp b/src/mame/drivers/mermaid.cpp index fd8c2a7e8c8..2f0b660c138 100644 --- a/src/mame/drivers/mermaid.cpp +++ b/src/mame/drivers/mermaid.cpp @@ -120,7 +120,6 @@ Stephh's notes (based on the games Z80 code and some tests) : #include "includes/mermaid.h" #include "cpu/z80/z80.h" -#include "machine/74259.h" #include "sound/msm5205.h" #include "speaker.h" @@ -426,19 +425,19 @@ MACHINE_CONFIG_START(mermaid_state::mermaid) MCFG_DEVICE_ADD("maincpu", Z80, 4000000) // ??? MCFG_DEVICE_PROGRAM_MAP(mermaid_map) - MCFG_DEVICE_ADD("latch1", LS259, 0) - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, mermaid_state, ay1_enable_w)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, mermaid_state, ay2_enable_w)) - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(NOOP) // ??? - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE(*this, mermaid_state, flip_screen_x_w)) - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(*this, mermaid_state, flip_screen_y_w)) - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, mermaid_state, nmi_mask_w)) + LS259(config, m_latch[0]); + m_latch[0]->q_out_cb<0>().set(FUNC(mermaid_state::ay1_enable_w)); + m_latch[0]->q_out_cb<1>().set(FUNC(mermaid_state::ay2_enable_w)); + m_latch[0]->q_out_cb<4>().set_nop(); // ??? + m_latch[0]->q_out_cb<5>().set(FUNC(mermaid_state::flip_screen_x_w)); + m_latch[0]->q_out_cb<6>().set(FUNC(mermaid_state::flip_screen_y_w)); + m_latch[0]->q_out_cb<7>().set(FUNC(mermaid_state::nmi_mask_w)); - MCFG_DEVICE_ADD("latch2", LS259, 0) - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(NOOP) // ??? - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(*this, mermaid_state, rougien_gfxbankswitch1_w)) - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE(*this, mermaid_state, rougien_gfxbankswitch2_w)) - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(NOOP) // very frequent + LS259(config, m_latch[1]); + m_latch[1]->q_out_cb<0>().set_nop(); // ??? + m_latch[1]->q_out_cb<4>().set(FUNC(mermaid_state::rougien_gfxbankswitch1_w)); + m_latch[1]->q_out_cb<5>().set(FUNC(mermaid_state::rougien_gfxbankswitch2_w)); + m_latch[1]->q_out_cb<7>().set_nop(); // very frequent /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) @@ -469,12 +468,10 @@ MACHINE_CONFIG_END MACHINE_CONFIG_START(mermaid_state::rougien) mermaid(config); - MCFG_DEVICE_MODIFY("latch1") - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, mermaid_state, rougien_sample_playback_w)) + m_latch[0]->q_out_cb<2>().set(FUNC(mermaid_state::rougien_sample_playback_w)); - MCFG_DEVICE_MODIFY("latch2") - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, mermaid_state, rougien_sample_rom_hi_w)) - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, mermaid_state, rougien_sample_rom_lo_w)) + m_latch[1]->q_out_cb<2>().set(FUNC(mermaid_state::rougien_sample_rom_hi_w)); + m_latch[1]->q_out_cb<3>().set(FUNC(mermaid_state::rougien_sample_rom_lo_w)); MCFG_PALETTE_MODIFY("palette") MCFG_PALETTE_INIT_OWNER(mermaid_state,rougien) diff --git a/src/mame/drivers/mikie.cpp b/src/mame/drivers/mikie.cpp index 511d79b4890..e92f653f235 100644 --- a/src/mame/drivers/mikie.cpp +++ b/src/mame/drivers/mikie.cpp @@ -267,13 +267,13 @@ MACHINE_CONFIG_START(mikie_state::mikie) MCFG_DEVICE_ADD("audiocpu", Z80, CLK) // 4E (surface scratched) MCFG_DEVICE_PROGRAM_MAP(sound_map) - MCFG_DEVICE_ADD("mainlatch", LS259, 0) // 6I - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, mikie_state, coin_counter_1_w)) // COIN1 - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, mikie_state, coin_counter_2_w)) // COIN2 - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, mikie_state, sh_irqtrigger_w)) // SOUNDON - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(NOOP) // END (not used?) - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(*this, mikie_state, flipscreen_w)) // FLIP - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, mikie_state, irq_mask_w)) // INT + ls259_device &mainlatch(LS259(config, "mainlatch")); // 6I + mainlatch.q_out_cb<0>().set(FUNC(mikie_state::coin_counter_1_w)); // COIN1 + mainlatch.q_out_cb<1>().set(FUNC(mikie_state::coin_counter_2_w)); // COIN2 + mainlatch.q_out_cb<2>().set(FUNC(mikie_state::sh_irqtrigger_w)); // SOUNDON + mainlatch.q_out_cb<3>().set_nop(); // END (not used?) + mainlatch.q_out_cb<6>().set(FUNC(mikie_state::flipscreen_w)); // FLIP + mainlatch.q_out_cb<7>().set(FUNC(mikie_state::irq_mask_w)); // INT MCFG_WATCHDOG_ADD("watchdog") diff --git a/src/mame/drivers/mirax.cpp b/src/mame/drivers/mirax.cpp index b004861dfa5..c12bf206d73 100644 --- a/src/mame/drivers/mirax.cpp +++ b/src/mame/drivers/mirax.cpp @@ -490,14 +490,14 @@ MACHINE_CONFIG_START(mirax_state::mirax) MCFG_DEVICE_PROGRAM_MAP(mirax_sound_map) MCFG_DEVICE_PERIODIC_INT_DRIVER(mirax_state, irq0_line_hold, 4*60) - MCFG_DEVICE_ADD("mainlatch", LS259, 0) // R10 - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, mirax_state, coin_counter0_w)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, mirax_state, nmi_mask_w)) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, mirax_state, coin_counter1_w)) // only used in 'miraxa' - see notes + ls259_device &mainlatch(LS259(config, "mainlatch")); // R10 + mainlatch.q_out_cb<0>().set(FUNC(mirax_state::coin_counter0_w)); + mainlatch.q_out_cb<1>().set(FUNC(mirax_state::nmi_mask_w)); + mainlatch.q_out_cb<2>().set(FUNC(mirax_state::coin_counter1_w)); // only used in 'miraxa' - see notes // One address flips X, the other flips Y, but I can't tell which is which // Since the value is the same for the 2 addresses, it doesn't really matter - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(*this, mirax_state, flip_screen_x_w)) - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, mirax_state, flip_screen_y_w)) + mainlatch.q_out_cb<6>().set(FUNC(mirax_state::flip_screen_x_w)); + mainlatch.q_out_cb<7>().set(FUNC(mirax_state::flip_screen_y_w)); /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) diff --git a/src/mame/drivers/mitchell.cpp b/src/mame/drivers/mitchell.cpp index 638acd117eb..827a9013c2d 100644 --- a/src/mame/drivers/mitchell.cpp +++ b/src/mame/drivers/mitchell.cpp @@ -1302,8 +1302,8 @@ MACHINE_CONFIG_START(mitchell_state::spangbl) MCFG_MSM5205_PRESCALER_SELECTOR(S96_4B) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) - MCFG_DEVICE_ADD("adpcm_select", LS157, 0) - MCFG_74157_OUT_CB(WRITE8("msm", msm5205_device, data_w)) + LS157(config, m_adpcm_select, 0); + m_adpcm_select->out_callback().set("msm", FUNC(msm5205_device::data_w)); MACHINE_CONFIG_END MACHINE_CONFIG_START(mitchell_state::pangba) diff --git a/src/mame/drivers/mjsister.cpp b/src/mame/drivers/mjsister.cpp index 95208543ff3..03a917d6949 100644 --- a/src/mame/drivers/mjsister.cpp +++ b/src/mame/drivers/mjsister.cpp @@ -500,20 +500,20 @@ MACHINE_CONFIG_START(mjsister_state::mjsister) MCFG_DEVICE_IO_MAP(mjsister_io_map) MCFG_DEVICE_PERIODIC_INT_DRIVER(mjsister_state, interrupt, 2*60) - MCFG_DEVICE_ADD("mainlatch1", LS259, 0) - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, mjsister_state, rombank_w)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, mjsister_state, flip_screen_w)) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, mjsister_state, colorbank_w)) - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, mjsister_state, colorbank_w)) - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(*this, mjsister_state, colorbank_w)) - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE(*this, mjsister_state, video_enable_w)) - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(*this, mjsister_state, irq_enable_w)) - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, mjsister_state, vrambank_w)) - - MCFG_DEVICE_ADD("mainlatch2", LS259, 0) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, mjsister_state, coin_counter_w)) - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE(*this, mjsister_state, dac_bank_w)) - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(*this, mjsister_state, rombank_w)) + LS259(config, m_mainlatch[0]); + m_mainlatch[0]->q_out_cb<0>().set(FUNC(mjsister_state::rombank_w)); + m_mainlatch[0]->q_out_cb<1>().set(FUNC(mjsister_state::flip_screen_w)); + m_mainlatch[0]->q_out_cb<2>().set(FUNC(mjsister_state::colorbank_w)); + m_mainlatch[0]->q_out_cb<3>().set(FUNC(mjsister_state::colorbank_w)); + m_mainlatch[0]->q_out_cb<4>().set(FUNC(mjsister_state::colorbank_w)); + m_mainlatch[0]->q_out_cb<5>().set(FUNC(mjsister_state::video_enable_w)); + m_mainlatch[0]->q_out_cb<6>().set(FUNC(mjsister_state::irq_enable_w)); + m_mainlatch[0]->q_out_cb<7>().set(FUNC(mjsister_state::vrambank_w)); + + LS259(config, m_mainlatch[1]); + m_mainlatch[1]->q_out_cb<2>().set(FUNC(mjsister_state::coin_counter_w)); + m_mainlatch[1]->q_out_cb<5>().set(FUNC(mjsister_state::dac_bank_w)); + m_mainlatch[1]->q_out_cb<6>().set(FUNC(mjsister_state::rombank_w)); /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) diff --git a/src/mame/drivers/mouser.cpp b/src/mame/drivers/mouser.cpp index e7e96fedd8c..af4ea923efb 100644 --- a/src/mame/drivers/mouser.cpp +++ b/src/mame/drivers/mouser.cpp @@ -202,10 +202,10 @@ MACHINE_CONFIG_START(mouser_state::mouser) MCFG_DEVICE_IO_MAP(mouser_sound_io_map) MCFG_DEVICE_PERIODIC_INT_DRIVER(mouser_state, mouser_sound_nmi_assert, 4*60) /* ??? This controls the sound tempo */ - MCFG_DEVICE_ADD("mainlatch", LS259, 0) // type unconfirmed - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, mouser_state, nmi_enable_w)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, mouser_state, flip_screen_x_w)) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, mouser_state, flip_screen_y_w)) + ls259_device &mainlatch(LS259(config, "mainlatch")); // type unconfirmed + mainlatch.q_out_cb<0>().set(FUNC(mouser_state::nmi_enable_w)); + mainlatch.q_out_cb<1>().set(FUNC(mouser_state::flip_screen_x_w)); + mainlatch.q_out_cb<2>().set(FUNC(mouser_state::flip_screen_y_w)); MCFG_GENERIC_LATCH_8_ADD("soundlatch") MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", 0)) diff --git a/src/mame/drivers/mrgame.cpp b/src/mame/drivers/mrgame.cpp index aa9ddfe0b45..6834fb2f581 100644 --- a/src/mame/drivers/mrgame.cpp +++ b/src/mame/drivers/mrgame.cpp @@ -60,6 +60,7 @@ public: , m_audiocpu1(*this, "audiocpu1") , m_audiocpu2(*this, "audiocpu2") , m_videocpu(*this, "videocpu") + , m_selectlatch(*this, "selectlatch") , m_io_dsw0(*this, "DSW0") , m_io_dsw1(*this, "DSW1") , m_io_x0(*this, "X0") @@ -129,6 +130,7 @@ private: required_device m_audiocpu1; required_device m_audiocpu2; required_device m_videocpu; + required_device m_selectlatch; required_ioport m_io_dsw0; required_ioport m_io_dsw1; required_ioport m_io_x0; @@ -156,7 +158,7 @@ void mrgame_state::video_map(address_map &map) map(0x4000, 0x47ff).ram(); map(0x4800, 0x4bff).mirror(0x0400).ram().share("videoram"); map(0x5000, 0x50ff).mirror(0x0700).ram().share("objectram"); - map(0x6800, 0x6807).mirror(0x07f8).w("selectlatch", FUNC(ls259_device::write_d0)); + map(0x6800, 0x6807).mirror(0x07f8).w(m_selectlatch, FUNC(ls259_device::write_d0)); map(0x7000, 0x7000).mirror(0x07ff).nopr(); //AFR - watchdog reset map(0x8100, 0x8103).mirror(0x7efc).rw("ppi", FUNC(i8255_device::read), FUNC(i8255_device::write)); } @@ -167,7 +169,7 @@ void mrgame_state::wcup90_video_map(address_map &map) map(0x8000, 0x87ff).ram(); map(0x8800, 0x8bff).mirror(0x0400).ram().share("videoram"); map(0x9000, 0x90ff).mirror(0x0700).ram().share("objectram"); - map(0xa800, 0xa807).mirror(0x07f8).w("selectlatch", FUNC(ls259_device::write_d0)); + map(0xa800, 0xa807).mirror(0x07f8).w(m_selectlatch, FUNC(ls259_device::write_d0)); map(0xb000, 0xb000).mirror(0x07ff).nopr(); //AFR - watchdog reset map(0xc000, 0xc003).mirror(0x3ffc).rw("ppi", FUNC(i8255_device::read), FUNC(i8255_device::write)); } @@ -552,12 +554,12 @@ MACHINE_CONFIG_START(mrgame_state::mrgame) MCFG_NVRAM_ADD_0FILL("nvram") // 5564 (x2) + battery - ls259_device &select(LS259(config, "selectlatch")); // 5B - select.q_out_cb<0>().set(FUNC(mrgame_state::video_a11_w)); - select.q_out_cb<1>().set(FUNC(mrgame_state::nmi_intst_w)); - select.q_out_cb<3>().set(FUNC(mrgame_state::video_a12_w)); - select.q_out_cb<4>().set(FUNC(mrgame_state::video_a13_w)); - select.q_out_cb<6>().set(FUNC(mrgame_state::flip_w)); + LS259(config, m_selectlatch); // 5B + m_selectlatch->q_out_cb<0>().set(FUNC(mrgame_state::video_a11_w)); + m_selectlatch->q_out_cb<1>().set(FUNC(mrgame_state::nmi_intst_w)); + m_selectlatch->q_out_cb<3>().set(FUNC(mrgame_state::video_a12_w)); + m_selectlatch->q_out_cb<4>().set(FUNC(mrgame_state::video_a13_w)); + m_selectlatch->q_out_cb<6>().set(FUNC(mrgame_state::flip_w)); //watchdog_timer_device &watchdog(WATCHDOG_TIMER(config, "watchdog")); // LS393 at 5D (video board) driven by VBLANK //watchdog.set_vblank_count("screen", 8); @@ -604,8 +606,7 @@ MACHINE_CONFIG_START(mrgame_state::wcup90) MCFG_DEVICE_MODIFY("videocpu") MCFG_DEVICE_PROGRAM_MAP(wcup90_video_map) - MCFG_DEVICE_MODIFY("selectlatch") // U48 - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, mrgame_state, intst_w)) + m_selectlatch->q_out_cb<1>().set(FUNC(mrgame_state::intst_w)); // U48 MCFG_DEVICE_MODIFY("screen") MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, mrgame_state, vblank_int_w)) diff --git a/src/mame/drivers/munchmo.cpp b/src/mame/drivers/munchmo.cpp index 3e7b92aded3..3a3ab92c44e 100644 --- a/src/mame/drivers/munchmo.cpp +++ b/src/mame/drivers/munchmo.cpp @@ -326,14 +326,14 @@ MACHINE_CONFIG_START(munchmo_state::mnchmobl) MCFG_DEVICE_PROGRAM_MAP(sound_map) MCFG_DEVICE_IRQ_ACKNOWLEDGE_DRIVER(munchmo_state, generic_irq_ack) // IORQ clears flip-flop at 1-7H - MCFG_DEVICE_ADD(m_mainlatch, LS259, 0) // 12E - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, munchmo_state, palette_bank_0_w)) // BCL0 2-11E - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, munchmo_state, palette_bank_1_w)) // BCL1 2-11E - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(NOOP) // CL2 2-11E - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(NOOP) // CL3 2-11E - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(*this, munchmo_state, flipscreen_w)) // INV - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(NOOP) // DISP - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(*this, munchmo_state, nmi_enable_w)) // ENI 1-10C + LS259(config, m_mainlatch, 0); // 12E + m_mainlatch->q_out_cb<0>().set(FUNC(munchmo_state::palette_bank_0_w)); // BCL0 2-11E + m_mainlatch->q_out_cb<1>().set(FUNC(munchmo_state::palette_bank_1_w)); // BCL1 2-11E + m_mainlatch->q_out_cb<2>().set_nop(); // CL2 2-11E + m_mainlatch->q_out_cb<3>().set_nop(); // CL3 2-11E + m_mainlatch->q_out_cb<4>().set(FUNC(munchmo_state::flipscreen_w)); // INV + m_mainlatch->q_out_cb<5>().set_nop(); // DISP + m_mainlatch->q_out_cb<6>().set(FUNC(munchmo_state::nmi_enable_w)); // ENI 1-10C /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) diff --git a/src/mame/drivers/mz700.cpp b/src/mame/drivers/mz700.cpp index e61c24c01c2..3ac3248c077 100644 --- a/src/mame/drivers/mz700.cpp +++ b/src/mame/drivers/mz700.cpp @@ -419,7 +419,7 @@ MACHINE_CONFIG_START(mz_state::mz700) MCFG_I8255_IN_PORTC_CB(READ8(*this, mz_state, pio_port_c_r)) MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, mz_state, pio_port_c_w)) - MCFG_DEVICE_ADD("ls145", TTL74145, 0) + TTL74145(config, m_ls145); MCFG_CASSETTE_ADD( "cassette" ) MCFG_CASSETTE_FORMATS(mz700_cassette_formats) diff --git a/src/mame/drivers/nemesis.cpp b/src/mame/drivers/nemesis.cpp index 2ce71783485..7f44a89101f 100644 --- a/src/mame/drivers/nemesis.cpp +++ b/src/mame/drivers/nemesis.cpp @@ -1535,17 +1535,17 @@ MACHINE_CONFIG_START(nemesis_state::gx400) MCFG_DEVICE_ADD("audiocpu", Z80,14318180/4) /* 3.579545 MHz */ MCFG_DEVICE_PROGRAM_MAP(gx400_sound_map) - MCFG_DEVICE_ADD("outlatch", LS259, 0) - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, nemesis_state, coin1_lockout_w)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, nemesis_state, coin2_lockout_w)) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, nemesis_state, sound_irq_w)) - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, nemesis_state, irq4_enable_w)) // ?? - - MCFG_DEVICE_ADD("intlatch", LS259, 0) - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, nemesis_state, irq2_enable_w)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, nemesis_state, irq1_enable_w)) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, nemesis_state, gfx_flipx_w)) - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, nemesis_state, gfx_flipy_w)) + ls259_device &outlatch(LS259(config, "outlatch")); + outlatch.q_out_cb<0>().set(FUNC(nemesis_state::coin1_lockout_w));; + outlatch.q_out_cb<1>().set(FUNC(nemesis_state::coin2_lockout_w)); + outlatch.q_out_cb<2>().set(FUNC(nemesis_state::sound_irq_w)); + outlatch.q_out_cb<7>().set(FUNC(nemesis_state::irq4_enable_w)); // ?? + + ls259_device &intlatch(LS259(config, "intlatch")); + intlatch.q_out_cb<0>().set(FUNC(nemesis_state::irq2_enable_w)); + intlatch.q_out_cb<1>().set(FUNC(nemesis_state::irq1_enable_w)); + intlatch.q_out_cb<2>().set(FUNC(nemesis_state::gfx_flipx_w)); + intlatch.q_out_cb<3>().set(FUNC(nemesis_state::gfx_flipy_w)); MCFG_WATCHDOG_ADD("watchdog") @@ -1608,16 +1608,16 @@ MACHINE_CONFIG_START(nemesis_state::konamigt) MCFG_DEVICE_ADD("audiocpu", Z80,14318180/4) /* 3.579545 MHz */ MCFG_DEVICE_PROGRAM_MAP(sound_map) - MCFG_DEVICE_ADD("outlatch", LS259, 0) - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, nemesis_state, coin2_lockout_w)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, nemesis_state, coin1_lockout_w)) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, nemesis_state, sound_irq_w)) + ls259_device &outlatch(LS259(config, "outlatch")); + outlatch.q_out_cb<0>().set(FUNC(nemesis_state::coin2_lockout_w)); + outlatch.q_out_cb<1>().set(FUNC(nemesis_state::coin1_lockout_w)); + outlatch.q_out_cb<2>().set(FUNC(nemesis_state::sound_irq_w)); - MCFG_DEVICE_ADD("intlatch", LS259, 0) - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, nemesis_state, irq2_enable_w)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, nemesis_state, irq_enable_w)) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, nemesis_state, gfx_flipx_w)) - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, nemesis_state, gfx_flipy_w)) + ls259_device &intlatch(LS259(config, "intlatch")); + intlatch.q_out_cb<0>().set(FUNC(nemesis_state::irq2_enable_w)); + intlatch.q_out_cb<1>().set(FUNC(nemesis_state::irq_enable_w)); + intlatch.q_out_cb<2>().set(FUNC(nemesis_state::gfx_flipx_w)); + intlatch.q_out_cb<3>().set(FUNC(nemesis_state::gfx_flipy_w)); MCFG_WATCHDOG_ADD("watchdog") @@ -1675,17 +1675,17 @@ MACHINE_CONFIG_START(nemesis_state::rf2_gx400) MCFG_DEVICE_ADD("audiocpu", Z80,14318180/4) /* 3.579545 MHz */ MCFG_DEVICE_PROGRAM_MAP(gx400_sound_map) - MCFG_DEVICE_ADD("outlatch", LS259, 0) - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, nemesis_state, coin1_lockout_w)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, nemesis_state, coin2_lockout_w)) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, nemesis_state, sound_irq_w)) - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, nemesis_state, irq4_enable_w)) // ?? + ls259_device &outlatch(LS259(config, "outlatch")); + outlatch.q_out_cb<0>().set(FUNC(nemesis_state::coin1_lockout_w));; + outlatch.q_out_cb<1>().set(FUNC(nemesis_state::coin2_lockout_w)); + outlatch.q_out_cb<2>().set(FUNC(nemesis_state::sound_irq_w)); + outlatch.q_out_cb<7>().set(FUNC(nemesis_state::irq4_enable_w)); // ?? - MCFG_DEVICE_ADD("intlatch", LS259, 0) - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, nemesis_state, irq2_enable_w)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, nemesis_state, irq1_enable_w)) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, nemesis_state, gfx_flipx_w)) - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, nemesis_state, gfx_flipy_w)) + ls259_device &intlatch(LS259(config, "intlatch")); + intlatch.q_out_cb<0>().set(FUNC(nemesis_state::irq2_enable_w)); + intlatch.q_out_cb<1>().set(FUNC(nemesis_state::irq1_enable_w)); + intlatch.q_out_cb<2>().set(FUNC(nemesis_state::gfx_flipx_w)); + intlatch.q_out_cb<3>().set(FUNC(nemesis_state::gfx_flipy_w)); MCFG_WATCHDOG_ADD("watchdog") @@ -1949,10 +1949,10 @@ MACHINE_CONFIG_START(nemesis_state::hcrash) MCFG_DEVICE_ADD("audiocpu", Z80,14318180/4) /* 3.579545 MHz */ MCFG_DEVICE_PROGRAM_MAP(sal_sound_map) - MCFG_DEVICE_ADD("intlatch", LS259, 0) - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(NOOP) // ? - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, nemesis_state, irq2_enable_w)) // or at 0x0c2804 ? - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(NOOP) // ? + ls259_device &intlatch(LS259(config, "intlatch")); + intlatch.q_out_cb<0>().set_nop(); // ? + intlatch.q_out_cb<1>().set(FUNC(nemesis_state::irq2_enable_w)); // or at 0x0c2804 ? + intlatch.q_out_cb<2>().set_nop(); // ? MCFG_WATCHDOG_ADD("watchdog") @@ -2704,17 +2704,17 @@ MACHINE_CONFIG_START(nemesis_state::bubsys) MCFG_DEVICE_ADD("audiocpu", Z80,14318180/4) /* 3.579545 MHz */ MCFG_DEVICE_PROGRAM_MAP(gx400_sound_map) - MCFG_DEVICE_ADD("outlatch", LS259, 0) - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, nemesis_state, coin1_lockout_w)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, nemesis_state, coin2_lockout_w)) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, nemesis_state, sound_irq_w)) - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, nemesis_state, irq4_enable_w)) // ?? - - MCFG_DEVICE_ADD("intlatch", LS259, 0) - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, nemesis_state, irq2_enable_w)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, nemesis_state, irq1_enable_w)) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, nemesis_state, gfx_flipx_w)) - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, nemesis_state, gfx_flipy_w)) + ls259_device &outlatch(LS259(config, "outlatch")); + outlatch.q_out_cb<0>().set(FUNC(nemesis_state::coin1_lockout_w));; + outlatch.q_out_cb<1>().set(FUNC(nemesis_state::coin2_lockout_w)); + outlatch.q_out_cb<2>().set(FUNC(nemesis_state::sound_irq_w)); + outlatch.q_out_cb<7>().set(FUNC(nemesis_state::irq4_enable_w)); // ?? + + ls259_device &intlatch(LS259(config, "intlatch")); + intlatch.q_out_cb<0>().set(FUNC(nemesis_state::irq2_enable_w)); + intlatch.q_out_cb<1>().set(FUNC(nemesis_state::irq1_enable_w)); + intlatch.q_out_cb<2>().set(FUNC(nemesis_state::gfx_flipx_w)); + intlatch.q_out_cb<3>().set(FUNC(nemesis_state::gfx_flipy_w)); MCFG_WATCHDOG_ADD("watchdog") diff --git a/src/mame/drivers/neogeo.cpp b/src/mame/drivers/neogeo.cpp index 1729c48ed3f..2edb3abb784 100644 --- a/src/mame/drivers/neogeo.cpp +++ b/src/mame/drivers/neogeo.cpp @@ -551,7 +551,6 @@ #include "emu.h" #include "includes/neogeo.h" -#include "machine/74259.h" #include "machine/nvram.h" #include "machine/watchdog.h" #include "softlist.h" @@ -1942,13 +1941,13 @@ MACHINE_CONFIG_START(neogeo_base_state::neogeo_base) MCFG_DEVICE_PROGRAM_MAP(audio_map) MCFG_DEVICE_IO_MAP(audio_io_map) - MCFG_DEVICE_ADD("systemlatch", HC259, 0) - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, neogeo_base_state, set_screen_shadow)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, neogeo_base_state, set_use_cart_vectors)) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(NOOP) // memory card 1: write enable/disable - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(NOOP) // memory card 2: write disable/enable - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(NOOP) // memory card: register select enable/set to normal (what does it mean?) - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, neogeo_base_state, set_palette_bank)) + HC259(config, m_systemlatch); + m_systemlatch->q_out_cb<0>().set(FUNC(neogeo_base_state::set_screen_shadow)); + m_systemlatch->q_out_cb<1>().set(FUNC(neogeo_base_state::set_use_cart_vectors)); + m_systemlatch->q_out_cb<2>().set_nop(); // memory card 1: write enable/disable + m_systemlatch->q_out_cb<3>().set_nop(); // memory card 2: write disable/enable + m_systemlatch->q_out_cb<4>().set_nop(); // memory card: register select enable/set to normal (what does it mean?) + m_systemlatch->q_out_cb<7>().set(FUNC(neogeo_base_state::set_palette_bank)); /* video hardware */ config.set_default_layout(layout_neogeo); @@ -1995,9 +1994,8 @@ MACHINE_CONFIG_START(ngarcade_base_state::neogeo_arcade) MCFG_DEVICE_MODIFY("maincpu") MCFG_DEVICE_PROGRAM_MAP(neogeo_main_map) - MCFG_DEVICE_MODIFY("systemlatch") - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE(*this, ngarcade_base_state, set_use_cart_audio)) - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(*this, ngarcade_base_state, set_save_ram_unlock)) + m_systemlatch->q_out_cb<5>().set(FUNC(ngarcade_base_state::set_use_cart_audio)); + m_systemlatch->q_out_cb<6>().set(FUNC(ngarcade_base_state::set_save_ram_unlock)); MCFG_WATCHDOG_ADD("watchdog") MCFG_WATCHDOG_TIME_INIT(attotime::from_ticks(3244030, NEOGEO_MASTER_CLOCK)) diff --git a/src/mame/drivers/nyny.cpp b/src/mame/drivers/nyny.cpp index 3755ae39a82..5de931b5ae1 100644 --- a/src/mame/drivers/nyny.cpp +++ b/src/mame/drivers/nyny.cpp @@ -625,14 +625,14 @@ MACHINE_CONFIG_START(nyny_state::nyny) MCFG_MC6845_OUT_DE_CB(WRITELINE("ic48_1", ttl74123_device, a_w)) /* 74LS123 */ - MCFG_DEVICE_ADD("ic48_1", TTL74123, 0) - MCFG_TTL74123_CONNECTION_TYPE(TTL74123_GROUNDED) /* the hook up type */ - MCFG_TTL74123_RESISTOR_VALUE(RES_K(22)) /* resistor connected to RCext */ - MCFG_TTL74123_CAPACITOR_VALUE(CAP_U(0.01)) /* capacitor connected to Cext and RCext */ - MCFG_TTL74123_A_PIN_VALUE(1) /* A pin - driven by the CRTC */ - MCFG_TTL74123_B_PIN_VALUE(1) /* B pin - pulled high */ - MCFG_TTL74123_CLEAR_PIN_VALUE(1) /* Clear pin - pulled high */ - MCFG_TTL74123_OUTPUT_CHANGED_CB(WRITELINE(*this, nyny_state, ic48_1_74123_output_changed)) + TTL74123(config, m_ic48_1, 0); + m_ic48_1->set_connection_type(TTL74123_GROUNDED); /* the hook up type */ + m_ic48_1->set_resistor_value(RES_K(22)); /* resistor connected to RCext */ + m_ic48_1->set_capacitor_value(CAP_U(0.01)); /* capacitor connected to Cext and RCext */ + m_ic48_1->set_a_pin_value(1); /* A pin - driven by the CRTC */ + m_ic48_1->set_b_pin_value(1); /* B pin - pulled high */ + m_ic48_1->set_clear_pin_value(1); /* Clear pin - pulled high */ + m_ic48_1->out_cb().set(FUNC(nyny_state::ic48_1_74123_output_changed)); PIA6821(config, m_pia1, 0); m_pia1->readpa_handler().set_ioport("IN0"); diff --git a/src/mame/drivers/orbit.cpp b/src/mame/drivers/orbit.cpp index 1bbdbbb2b53..50ec7133996 100644 --- a/src/mame/drivers/orbit.cpp +++ b/src/mame/drivers/orbit.cpp @@ -274,7 +274,7 @@ MACHINE_CONFIG_START(orbit_state::orbit) MCFG_TIMER_DRIVER_ADD_SCANLINE("32v", orbit_state, nmi_32v, "screen", 0, 32) - MCFG_DEVICE_ADD(m_latch, F9334, 0) // M6 + F9334(config, m_latch); // M6 /* BIT0 => UNUSED */ /* BIT1 => LOCKOUT */ /* BIT2 => NMI ENABLE */ @@ -283,10 +283,10 @@ MACHINE_CONFIG_START(orbit_state::orbit) /* BIT5 => PANEL STROBE */ /* BIT6 => HYPER LED */ /* BIT7 => WARNING SND */ - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, orbit_state, coin_lockout_w)) - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(OUTPUT("led0")) - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(OUTPUT("led1")) - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(m_discrete, discrete_device, write_line)) + m_latch->q_out_cb<1>().set(FUNC(orbit_state::coin_lockout_w)); + m_latch->q_out_cb<3>().set_output("led0"); + m_latch->q_out_cb<6>().set_output("led1"); + m_latch->q_out_cb<7>().set(m_discrete, FUNC(discrete_device::write_line)); MCFG_WATCHDOG_ADD("watchdog") diff --git a/src/mame/drivers/pacman.cpp b/src/mame/drivers/pacman.cpp index c635143797d..415d3b1958d 100644 --- a/src/mame/drivers/pacman.cpp +++ b/src/mame/drivers/pacman.cpp @@ -345,7 +345,6 @@ Boards: #include "cpu/s2650/s2650.h" #include "cpu/z80/z80.h" #include "machine/nvram.h" -#include "machine/74259.h" #include "sound/ay8910.h" #include "sound/sn76496.h" #include "screen.h" @@ -1006,7 +1005,7 @@ void pacman_state::pacman_map(address_map &map) map(0x4800, 0x4bff).mirror(0xa000).r(FUNC(pacman_state::pacman_read_nop)).nopw(); map(0x4c00, 0x4fef).mirror(0xa000).ram(); map(0x4ff0, 0x4fff).mirror(0xa000).ram().share("spriteram"); - map(0x5000, 0x5007).mirror(0xaf38).w("mainlatch", FUNC(addressable_latch_device::write_d0)); + map(0x5000, 0x5007).mirror(0xaf38).w(m_mainlatch, FUNC(addressable_latch_device::write_d0)); map(0x5040, 0x505f).mirror(0xaf00).w(m_namco_sound, FUNC(namco_device::pacman_sound_w)); map(0x5060, 0x506f).mirror(0xaf00).writeonly().share("spriteram2"); map(0x5070, 0x507f).mirror(0xaf00).nopw(); @@ -1027,7 +1026,7 @@ void pacman_state::birdiy_map(address_map &map) // AM_RANGE(0x4800, 0x4bff) AM_MIRROR(0xa000) AM_READ(pacman_read_nop) AM_WRITENOP map(0x4c00, 0x4fef).mirror(0xa000).ram(); map(0x4ff0, 0x4fff).mirror(0xa000).ram().share("spriteram"); - map(0x5000, 0x5007).mirror(0xaf38).w("mainlatch", FUNC(ls259_device::write_d0)); + map(0x5000, 0x5007).mirror(0xaf38).w(m_mainlatch, FUNC(ls259_device::write_d0)); map(0x5080, 0x509f).mirror(0xaf00).w(m_namco_sound, FUNC(namco_device::pacman_sound_w)); map(0x50a0, 0x50af).mirror(0xaf00).writeonly().share("spriteram2"); // AM_RANGE(0x5070, 0x507f) AM_MIRROR(0xaf00) AM_WRITENOP @@ -1051,7 +1050,7 @@ void pacman_state::mspacman_map(address_map &map) map(0x4800, 0x4bff).mirror(0xa000).r(FUNC(pacman_state::pacman_read_nop)).nopw(); map(0x4c00, 0x4fef).mirror(0xa000).ram(); map(0x4ff0, 0x4fff).mirror(0xa000).ram().share("spriteram"); - map(0x5000, 0x5007).mirror(0xaf38).w("mainlatch", FUNC(ls259_device::write_d0)); + map(0x5000, 0x5007).mirror(0xaf38).w(m_mainlatch, FUNC(ls259_device::write_d0)); map(0x5040, 0x505f).mirror(0xaf00).w(m_namco_sound, FUNC(namco_device::pacman_sound_w)); map(0x5060, 0x506f).mirror(0xaf00).writeonly().share("spriteram2"); map(0x5070, 0x507f).mirror(0xaf00).nopw(); @@ -1082,7 +1081,7 @@ void pacman_state::woodpek_map(address_map &map) map(0x4800, 0x4bff).mirror(0xa000).r(FUNC(pacman_state::pacman_read_nop)).nopw(); map(0x4c00, 0x4fef).mirror(0xa000).ram(); map(0x4ff0, 0x4fff).mirror(0xa000).ram().share("spriteram"); - map(0x5000, 0x5007).mirror(0xaf38).w("mainlatch", FUNC(ls259_device::write_d0)); + map(0x5000, 0x5007).mirror(0xaf38).w(m_mainlatch, FUNC(ls259_device::write_d0)); map(0x5040, 0x505f).mirror(0xaf00).w(m_namco_sound, FUNC(namco_device::pacman_sound_w)); map(0x5060, 0x506f).mirror(0xaf00).writeonly().share("spriteram2"); map(0x5070, 0x507f).mirror(0xaf00).nopw(); @@ -1110,7 +1109,7 @@ void pacman_state::numcrash_map(address_map &map) map(0x4c00, 0x4fef).ram(); map(0x4ff0, 0x4fff).ram().share("spriteram"); - map(0x5000, 0x5007).w("mainlatch", FUNC(ls259_device::write_d0)); + map(0x5000, 0x5007).w(m_mainlatch, FUNC(ls259_device::write_d0)); map(0x5040, 0x505f).w(m_namco_sound, FUNC(namco_device::pacman_sound_w)); map(0x5060, 0x506f).writeonly().share("spriteram2"); // AM_RANGE(0x5070, 0x507f) AM_WRITENOP @@ -1158,7 +1157,7 @@ void pacman_state::dremshpr_map(address_map &map) map(0x4400, 0x47ff).mirror(0xa000).ram().w(FUNC(pacman_state::pacman_colorram_w)).share("colorram"); map(0x4800, 0x4fef).mirror(0xa000).ram(); map(0x4ff0, 0x4fff).mirror(0xa000).ram().share("spriteram"); - map(0x5000, 0x5007).mirror(0xaf38).w("mainlatch", FUNC(ls259_device::write_d0)); + map(0x5000, 0x5007).mirror(0xaf38).w(m_mainlatch, FUNC(ls259_device::write_d0)); // AM_RANGE(0x5040, 0x505f) AM_MIRROR(0xaf00) AM_DEVWRITE("namco", namco_device, pacman_sound_w) map(0x5060, 0x506f).mirror(0xaf00).writeonly().share("spriteram2"); map(0x5070, 0x507f).mirror(0xaf00).nopw(); @@ -1184,7 +1183,7 @@ void pacman_state::epos_map(address_map &map) map(0x4800, 0x4bff).mirror(0xa000).r(FUNC(pacman_state::pacman_read_nop)).nopw(); map(0x4c00, 0x4fef).mirror(0xa000).ram(); map(0x4ff0, 0x4fff).mirror(0xa000).ram().share("spriteram"); - map(0x5000, 0x5007).mirror(0xaf38).w("mainlatch", FUNC(ls259_device::write_d0)); + map(0x5000, 0x5007).mirror(0xaf38).w(m_mainlatch, FUNC(ls259_device::write_d0)); map(0x5040, 0x505f).mirror(0xaf00).w(m_namco_sound, FUNC(namco_device::pacman_sound_w)); map(0x5060, 0x506f).mirror(0xaf00).writeonly().share("spriteram2"); map(0x5070, 0x507f).mirror(0xaf00).nopw(); @@ -1206,7 +1205,7 @@ void pacman_state::s2650games_map(address_map &map) map(0x1490, 0x149f).mirror(0x6000).writeonly().share("s2650_spriteram"); map(0x14a0, 0x14bf).mirror(0x6000).w(FUNC(pacman_state::s2650games_tilesbank_w)).share("s2650_tileram"); map(0x14c0, 0x14ff).mirror(0x6000).writeonly(); - map(0x1500, 0x1507).mirror(0x6000).w("mainlatch", FUNC(ls259_device::write_d0)); + map(0x1500, 0x1507).mirror(0x6000).w(m_mainlatch, FUNC(ls259_device::write_d0)); map(0x1508, 0x155f).mirror(0x6000).writeonly(); map(0x1560, 0x156f).mirror(0x6000).writeonly().share("spriteram2"); map(0x1570, 0x157f).mirror(0x6000).writeonly(); @@ -1231,7 +1230,7 @@ void pacman_state::rocktrv2_map(address_map &map) map(0x4000, 0x43ff).ram().w(FUNC(pacman_state::pacman_videoram_w)).share("videoram"); map(0x4400, 0x47ff).ram().w(FUNC(pacman_state::pacman_colorram_w)).share("colorram"); map(0x4c00, 0x4fff).ram(); - map(0x5000, 0x5007).w("mainlatch", FUNC(ls259_device::write_d0)); + map(0x5000, 0x5007).w(m_mainlatch, FUNC(ls259_device::write_d0)); map(0x5040, 0x505f).w(m_namco_sound, FUNC(namco_device::pacman_sound_w)); map(0x50c0, 0x50c0).w(m_watchdog, FUNC(watchdog_timer_device::reset_w)); map(0x5fe0, 0x5fe3).w(FUNC(pacman_state::rocktrv2_prot_data_w)).share("rocktrv2_prot"); @@ -1256,7 +1255,7 @@ void pacman_state::bigbucks_map(address_map &map) map(0x4000, 0x43ff).ram().w(FUNC(pacman_state::pacman_videoram_w)).share("videoram"); map(0x4400, 0x47ff).ram().w(FUNC(pacman_state::pacman_colorram_w)).share("colorram"); map(0x4c00, 0x4fff).ram(); - map(0x5000, 0x5007).w("mainlatch", FUNC(ls259_device::write_d0)); + map(0x5000, 0x5007).w(m_mainlatch, FUNC(ls259_device::write_d0)); map(0x5040, 0x505f).w(m_namco_sound, FUNC(namco_device::pacman_sound_w)); map(0x50c0, 0x50c0).w(m_watchdog, FUNC(watchdog_timer_device::reset_w)); map(0x5000, 0x503f).portr("IN0"); @@ -1277,7 +1276,7 @@ void pacman_state::mschamp_map(address_map &map) map(0x4800, 0x4bff).mirror(0xa000).r(FUNC(pacman_state::pacman_read_nop)).nopw(); map(0x4c00, 0x4fef).mirror(0xa000).ram(); map(0x4ff0, 0x4fff).mirror(0xa000).ram().share("spriteram"); - map(0x5000, 0x5007).mirror(0xaf38).w("mainlatch", FUNC(ls259_device::write_d0)); + map(0x5000, 0x5007).mirror(0xaf38).w(m_mainlatch, FUNC(ls259_device::write_d0)); map(0x5040, 0x505f).mirror(0xaf00).w(m_namco_sound, FUNC(namco_device::pacman_sound_w)); map(0x5060, 0x506f).mirror(0xaf00).writeonly().share("spriteram2"); map(0x5070, 0x507f).mirror(0xaf00).nopw(); @@ -1298,7 +1297,7 @@ void pacman_state::superabc_map(address_map &map) map(0x4400, 0x47ff).mirror(0xa000).ram().w(FUNC(pacman_state::pacman_colorram_w)).share("colorram"); map(0x4800, 0x4fef).mirror(0xa000).ram().share("28c16.u17"); // nvram map(0x4ff0, 0x4fff).mirror(0xa000).ram().share("spriteram"); - map(0x5000, 0x5007).mirror(0xaf38).w("mainlatch", FUNC(ls259_device::write_d0)); + map(0x5000, 0x5007).mirror(0xaf38).w(m_mainlatch, FUNC(ls259_device::write_d0)); map(0x5002, 0x5002).mirror(0xaf3c).w(FUNC(pacman_state::superabc_bank_w)); map(0x5040, 0x505f).mirror(0xaf00).w(m_namco_sound, FUNC(namco_device::pacman_sound_w)); map(0x5060, 0x506f).mirror(0xaf00).writeonly().share("spriteram2"); @@ -1322,7 +1321,7 @@ void pacman_state::crushs_map(address_map &map) map(0x4800, 0x4bff).mirror(0xa000).r(FUNC(pacman_state::pacman_read_nop)).nopw(); map(0x4c00, 0x4fef).mirror(0xa000).ram(); map(0x4ff0, 0x4fff).mirror(0xa000).ram().share("spriteram"); - map(0x5000, 0x5007).mirror(0xaf38).w("mainlatch", FUNC(ls259_device::write_d0)); + map(0x5000, 0x5007).mirror(0xaf38).w(m_mainlatch, FUNC(ls259_device::write_d0)); map(0x5040, 0x505f).mirror(0xaf00).nopw(); // doesn't use pacman sound hw map(0x5060, 0x506f).mirror(0xaf00).writeonly().share("spriteram2"); map(0x5070, 0x507f).mirror(0xaf00).nopw(); @@ -1347,7 +1346,7 @@ void pacman_state::pengojpm_map(address_map &map) // AM_RANGE(0x8800, 0x8bff) AM_READ(pacman_read_nop) AM_WRITENOP map(0x8c00, 0x8fef).ram(); map(0x8ff0, 0x8fff).ram().share("spriteram"); - map(0x9000, 0x9007).w("mainlatch", FUNC(ls259_device::write_d0)); + map(0x9000, 0x9007).w(m_mainlatch, FUNC(ls259_device::write_d0)); map(0x9040, 0x905f).w(m_namco_sound, FUNC(namco_device::pacman_sound_w)); map(0x9060, 0x906f).writeonly().share("spriteram2"); map(0x9070, 0x907f).nopw(); @@ -3519,48 +3518,53 @@ GFXDECODE_END * *************************************/ -MACHINE_CONFIG_START(pacman_state::pacman) - +void pacman_state::pacman(machine_config &config, bool latch) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", Z80, MASTER_CLOCK/6) - MCFG_DEVICE_PROGRAM_MAP(pacman_map) - MCFG_DEVICE_IO_MAP(writeport) - - MCFG_DEVICE_ADD("mainlatch", LS259, 0) // 74LS259 at 8K or 4099 at 7K - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, pacman_state, irq_mask_w)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE("namco", namco_device, sound_enable_w)) - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, pacman_state, flipscreen_w)) - //MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(OUTPUT("led0")) - //MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(OUTPUT("led1")) - //MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(*this, pacman_state, coin_lockout_global_w)) - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, pacman_state, coin_counter_w)) -// The Pacman code uses $5004 and $5005 for LED's and $5007 for coin lockout. This hardware does not -// exist on any Pacman or Puckman board I have seen. DW - - MCFG_WATCHDOG_ADD("watchdog") - MCFG_WATCHDOG_VBLANK_INIT("screen", 16) + Z80(config, m_maincpu, MASTER_CLOCK/6); + m_maincpu->set_addrmap(AS_PROGRAM, &pacman_state::pacman_map); + m_maincpu->set_addrmap(AS_IO, &pacman_state::writeport); + + if (latch) + { + LS259(config, m_mainlatch); // 74LS259 at 8K or 4099 at 7K + m_mainlatch->q_out_cb<0>().set(FUNC(pacman_state::irq_mask_w)); + m_mainlatch->q_out_cb<1>().set("namco", FUNC(namco_device::sound_enable_w)); + m_mainlatch->q_out_cb<3>().set(FUNC(pacman_state::flipscreen_w)); + m_mainlatch->q_out_cb<7>().set(FUNC(pacman_state::coin_counter_w)); + + // NOTE(dwidel): The Pacman code uses $5004 and $5005 for LEDs and $5007 for coin lockout. This hardware does not + // exist on any Pacman or Puckman board I have seen. + //m_mainlatch->q_out_cb<4>().set_output("led0"); + //m_mainlatch->q_out_cb<5>().set_output("led1"); + //m_mainlatch->q_out_cb<6>().set(FUNC(pacman_state::coin_lockout_global_w)); + } + + WATCHDOG_TIMER(config, m_watchdog); + m_watchdog->set_vblank_count("screen", 16); /* video hardware */ - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_pacman) - MCFG_PALETTE_ADD("palette", 128*4) - MCFG_PALETTE_INDIRECT_ENTRIES(32) - MCFG_PALETTE_INIT_OWNER(pacman_state,pacman) + GFXDECODE(config, m_gfxdecode, "palette", gfx_pacman); - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_RAW_PARAMS(PIXEL_CLOCK, HTOTAL, HBEND, HBSTART, VTOTAL, VBEND, VBSTART) - MCFG_SCREEN_UPDATE_DRIVER(pacman_state, screen_update_pacman) - MCFG_SCREEN_PALETTE("palette") - MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, pacman_state, vblank_irq)) + PALETTE(config, m_palette, 128*4); + m_palette->set_indirect_entries(32); + m_palette->set_init(DEVICE_SELF_OWNER, FUNC(pacman_state::palette_init_pacman)); + + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_raw(PIXEL_CLOCK, HTOTAL, HBEND, HBSTART, VTOTAL, VBEND, VBSTART); + screen.set_screen_update(FUNC(pacman_state::screen_update_pacman)); + screen.set_palette("palette"); + screen.screen_vblank().set(FUNC(pacman_state::vblank_irq)); MCFG_VIDEO_START_OVERRIDE(pacman_state,pacman) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("namco", NAMCO, MASTER_CLOCK/6/32) - MCFG_NAMCO_AUDIO_VOICES(3) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) -MACHINE_CONFIG_END + NAMCO(config, m_namco_sound, MASTER_CLOCK/6/32); + m_namco_sound->set_voices(3); + m_namco_sound->add_route(ALL_OUTPUTS, "mono", 1.0); +} MACHINE_CONFIG_START(pacman_state::maketrax) pacman(config); @@ -3569,8 +3573,8 @@ MACHINE_CONFIG_END MACHINE_CONFIG_START(pacman_state::korosuke) maketrax(config); - MCFG_DEVICE_MODIFY("mainlatch") // 8K on original boards - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(NOOP) // outputs 4-7 go to protection chip at 6P + // 8K on original boards + m_mainlatch->q_out_cb<7>().set_nop(); // outputs 4-7 go to protection chip at 6P MACHINE_CONFIG_END MACHINE_CONFIG_START(pacman_state::pengojpm) @@ -3588,14 +3592,11 @@ MACHINE_CONFIG_START(pacman_state::birdiy) MCFG_DEVICE_PROGRAM_MAP(birdiy_map) MCFG_DEVICE_REMOVE_ADDRESS_MAP(AS_IO) - MCFG_DEVICE_REPLACE("mainlatch", LS259, 0) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, pacman_state, irq_mask_w)) - //MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE("namco", namco_device, sound_enable_w)) - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, pacman_state, flipscreen_w)) - //MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(OUTPUT("led0")) - //MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(OUTPUT("led1")) - //MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(*this, pacman_state, coin_lockout_global_w)) - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, pacman_state, coin_counter_w)) + // 74LS259 at 8K or 4099 at 7K + m_mainlatch->q_out_cb<0>().set_nop(); + m_mainlatch->q_out_cb<1>().set(FUNC(pacman_state::irq_mask_w)); + m_mainlatch->q_out_cb<3>().set(FUNC(pacman_state::flipscreen_w)); + m_mainlatch->q_out_cb<7>().set(FUNC(pacman_state::coin_counter_w)); MCFG_VIDEO_START_OVERRIDE(pacman_state,birdiy) MACHINE_CONFIG_END @@ -3628,8 +3629,7 @@ MACHINE_CONFIG_START(pacman_state::mspacman) MCFG_DEVICE_MODIFY("maincpu") MCFG_DEVICE_PROGRAM_MAP(mspacman_map) - MCFG_DEVICE_MODIFY("mainlatch") - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(*this, pacman_state, coin_lockout_global_w)) + m_mainlatch->q_out_cb<6>().set(FUNC(pacman_state::coin_lockout_global_w)); MACHINE_CONFIG_END @@ -3648,30 +3648,28 @@ MACHINE_CONFIG_START(pacman_state::numcrash) MCFG_DEVICE_MODIFY("maincpu") MCFG_DEVICE_PROGRAM_MAP(numcrash_map) - MCFG_DEVICE_MODIFY("mainlatch") - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(NOOP) // ??? - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(NOOP) // ??? + m_mainlatch->q_out_cb<3>().set_nop(); // ??? + m_mainlatch->q_out_cb<7>().set_nop(); // ??? MACHINE_CONFIG_END -MACHINE_CONFIG_START(pacman_state::alibaba) - pacman(config); +void pacman_state::alibaba(machine_config &config) +{ + pacman(config, false); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(alibaba_map) - - MCFG_DEVICE_REMOVE("mainlatch") - MCFG_DEVICE_ADD("latch1", LS259, 0) - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(OUTPUT("led0")) - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(OUTPUT("led1")) - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(*this, pacman_state, coin_lockout_global_w)) - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, pacman_state, coin_counter_w)) - MCFG_DEVICE_ADD("latch2", LS259, 0) - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE("namco", namco_device, sound_enable_w)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, pacman_state, flipscreen_w)) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, pacman_state, irq_mask_w)) -MACHINE_CONFIG_END - + m_maincpu->set_addrmap(AS_PROGRAM, &pacman_state::alibaba_map); + + ls259_device &latch1(LS259(config, "latch1")); + latch1.q_out_cb<4>().set_output("led0"); + latch1.q_out_cb<5>().set_output("led1"); + latch1.q_out_cb<6>().set(FUNC(pacman_state::coin_lockout_global_w)); + latch1.q_out_cb<7>().set(FUNC(pacman_state::coin_counter_w)); + + ls259_device &latch2(LS259(config, "latch2")); + latch2.q_out_cb<0>().set("namco", FUNC(namco_device::sound_enable_w)); + latch2.q_out_cb<1>().set(FUNC(pacman_state::flipscreen_w)); + latch2.q_out_cb<2>().set(FUNC(pacman_state::irq_mask_w)); +} MACHINE_CONFIG_START(pacman_state::dremshpr) pacman(config); @@ -3689,8 +3687,7 @@ MACHINE_CONFIG_START(pacman_state::dremshpr) MCFG_DEVICE_ADD("ay8910", AY8910, 14318000/8) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) - MCFG_DEVICE_MODIFY("mainlatch") - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(NOOP) + m_mainlatch->q_out_cb<1>().set_nop(); MACHINE_CONFIG_END @@ -3755,8 +3752,7 @@ MACHINE_CONFIG_START(pacman_state::vanvan) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75) - MCFG_DEVICE_MODIFY("mainlatch") - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(NOOP) + m_mainlatch->q_out_cb<1>().set_nop(); MACHINE_CONFIG_END @@ -3772,8 +3768,7 @@ MACHINE_CONFIG_START(pacman_state::bigbucks) MCFG_SCREEN_MODIFY("screen") MCFG_SCREEN_VISIBLE_AREA(0*8, 36*8-1, 0*8, 28*8-1) - MCFG_DEVICE_MODIFY("mainlatch") - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(NOOP) /*?*/ + m_mainlatch->q_out_cb<7>().set_nop(); /*?*/ MACHINE_CONFIG_END @@ -3786,15 +3781,14 @@ MACHINE_CONFIG_START(pacman_state::s2650games) maincpu.set_addrmap(AS_DATA, &pacman_state::s2650games_dataport); maincpu.sense_handler().set("screen", FUNC(screen_device::vblank)).invert(); - MCFG_DEVICE_MODIFY("mainlatch") - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(NOOP) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(NOOP) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(NOOP) - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, pacman_state, flipscreen_w)) - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(NOOP) - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(NOOP) - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(NOOP) - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, pacman_state, coin_counter_w)) + m_mainlatch->q_out_cb<0>().set_nop(); + m_mainlatch->q_out_cb<1>().set_nop(); + m_mainlatch->q_out_cb<2>().set_nop(); + m_mainlatch->q_out_cb<3>().set(FUNC(pacman_state::flipscreen_w)); + m_mainlatch->q_out_cb<4>().set_nop(); + m_mainlatch->q_out_cb<5>().set_nop(); + m_mainlatch->q_out_cb<6>().set_nop(); + m_mainlatch->q_out_cb<7>().set(FUNC(pacman_state::coin_counter_w)); MCFG_GFXDECODE_MODIFY("gfxdecode", gfx_s2650games) diff --git a/src/mame/drivers/pengo.cpp b/src/mame/drivers/pengo.cpp index 25aee2a29f1..a86a08ffc6b 100644 --- a/src/mame/drivers/pengo.cpp +++ b/src/mame/drivers/pengo.cpp @@ -77,7 +77,9 @@ class pengo_state : public pacman_state { public: pengo_state(const machine_config &mconfig, device_type type, const char *tag) - : pacman_state(mconfig, type, tag), m_decrypted_opcodes(*this, "decrypted_opcodes") + : pacman_state(mconfig, type, tag) + , m_decrypted_opcodes(*this, "decrypted_opcodes") + , m_latch(*this, "latch") { } void jrpacmbl(machine_config &config); @@ -94,6 +96,7 @@ private: DECLARE_WRITE_LINE_MEMBER(vblank_irq); optional_shared_ptr m_decrypted_opcodes; + optional_device m_latch; void decrypted_opcodes_map(address_map &map); void jrpacmbl_map(address_map &map); void pengo_map(address_map &map); @@ -155,7 +158,7 @@ void pengo_state::pengo_map(address_map &map) map(0x9020, 0x902f).writeonly().share("spriteram2"); map(0x9000, 0x903f).portr("DSW1"); map(0x9040, 0x907f).portr("DSW0"); - map(0x9040, 0x9047).w("latch", FUNC(ls259_device::write_d0)); + map(0x9040, 0x9047).w(m_latch, FUNC(ls259_device::write_d0)); map(0x9070, 0x9070).w(m_watchdog, FUNC(watchdog_timer_device::reset_w)); map(0x9080, 0x90bf).portr("IN1"); map(0x90c0, 0x90ff).portr("IN0"); @@ -180,7 +183,7 @@ void pengo_state::jrpacmbl_map(address_map &map) map(0x9020, 0x902f).writeonly().share("spriteram2"); map(0x9030, 0x9030).w(FUNC(pengo_state::jrpacman_scroll_w)); map(0x9040, 0x904f).portr("DSW"); - map(0x9040, 0x9047).w("latch", FUNC(ls259_device::write_d0)); + map(0x9040, 0x9047).w(m_latch, FUNC(ls259_device::write_d0)); map(0x9070, 0x9070).w(m_watchdog, FUNC(watchdog_timer_device::reset_w)); map(0x9080, 0x90bf).portr("P2"); map(0x90c0, 0x90ff).portr("P1"); @@ -388,15 +391,15 @@ MACHINE_CONFIG_START(pengo_state::pengo) MCFG_DEVICE_PROGRAM_MAP(pengo_map) MCFG_DEVICE_OPCODES_MAP(decrypted_opcodes_map) - MCFG_DEVICE_ADD("latch", LS259, 0) // U27 - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, pengo_state, irq_mask_w)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE("namco", namco_device, sound_enable_w)) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, pengo_state, pengo_palettebank_w)) - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, pengo_state, flipscreen_w)) - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(*this, pengo_state, coin_counter_1_w)) - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE(*this, pengo_state, coin_counter_2_w)) - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(*this, pengo_state, pengo_colortablebank_w)) - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, pengo_state, pengo_gfxbank_w)) + LS259(config, m_latch); // U27 + m_latch->q_out_cb<0>().set(FUNC(pengo_state::irq_mask_w)); + m_latch->q_out_cb<1>().set("namco", FUNC(namco_device::sound_enable_w)); + m_latch->q_out_cb<2>().set(FUNC(pengo_state::pengo_palettebank_w)); + m_latch->q_out_cb<3>().set(FUNC(pengo_state::flipscreen_w)); + m_latch->q_out_cb<4>().set(FUNC(pengo_state::coin_counter_1_w)); + m_latch->q_out_cb<5>().set(FUNC(pengo_state::coin_counter_2_w)); + m_latch->q_out_cb<6>().set(FUNC(pengo_state::pengo_colortablebank_w)); + m_latch->q_out_cb<7>().set(FUNC(pengo_state::pengo_gfxbank_w)); MCFG_WATCHDOG_ADD("watchdog") @@ -445,10 +448,9 @@ MACHINE_CONFIG_START(pengo_state::jrpacmbl) MCFG_DEVICE_PROGRAM_MAP(jrpacmbl_map) MCFG_DEVICE_REMOVE_ADDRESS_MAP(AS_OPCODES) - MCFG_DEVICE_MODIFY("latch") - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(*this, pengo_state, jrpacman_bgpriority_w)) - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE(*this, pengo_state, jrpacman_spritebank_w)) - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, pengo_state, jrpacman_charbank_w)) + m_latch->q_out_cb<4>().set(FUNC(pengo_state::jrpacman_bgpriority_w)); + m_latch->q_out_cb<5>().set(FUNC(pengo_state::jrpacman_spritebank_w)); + m_latch->q_out_cb<7>().set(FUNC(pengo_state::jrpacman_charbank_w)); MCFG_VIDEO_START_OVERRIDE(pengo_state,jrpacman) MACHINE_CONFIG_END diff --git a/src/mame/drivers/pitnrun.cpp b/src/mame/drivers/pitnrun.cpp index ac8c224357b..14444025bb9 100644 --- a/src/mame/drivers/pitnrun.cpp +++ b/src/mame/drivers/pitnrun.cpp @@ -283,13 +283,13 @@ MACHINE_CONFIG_START(pitnrun_state::pitnrun) MCFG_DEVICE_PROGRAM_MAP(pitnrun_map) MCFG_DEVICE_VBLANK_INT_DRIVER("screen", pitnrun_state, nmi_source) - MCFG_DEVICE_ADD("mainlatch", LS259, 0) // 7B (mislabeled LS156 on schematic) - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, pitnrun_state, nmi_enable_w)) // NMION - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, pitnrun_state, color_select_w)) - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(NOOP) // COLOR SEL 2 - not used ? - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE(*this, pitnrun_state, char_bank_select_w)) - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(*this, pitnrun_state, hflip_w)) // HFLIP - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, pitnrun_state, vflip_w)) // VFLIP + ls259_device &mainlatch(LS259(config, "mainlatch")); // 7B (mislabeled LS156 on schematic) + mainlatch.q_out_cb<0>().set(FUNC(pitnrun_state::nmi_enable_w)); // NMION + mainlatch.q_out_cb<1>().set(FUNC(pitnrun_state::color_select_w)); + mainlatch.q_out_cb<4>().set_nop(); // COLOR SEL 2 - not used ? + mainlatch.q_out_cb<5>().set(FUNC(pitnrun_state::char_bank_select_w)); + mainlatch.q_out_cb<6>().set(FUNC(pitnrun_state::hflip_w)); // HFLIP + mainlatch.q_out_cb<7>().set(FUNC(pitnrun_state::vflip_w)); // VFLIP MCFG_DEVICE_ADD("audiocpu", Z80, XTAL(5'000'000)/2) /* verified on pcb */ MCFG_DEVICE_PROGRAM_MAP(pitnrun_sound_map) diff --git a/src/mame/drivers/polgar.cpp b/src/mame/drivers/polgar.cpp index 3874f3a056a..293e7353f35 100644 --- a/src/mame/drivers/polgar.cpp +++ b/src/mame/drivers/polgar.cpp @@ -364,13 +364,13 @@ MACHINE_CONFIG_START(mephisto_polgar_state::polgar) MCFG_NVRAM_ADD_0FILL("nvram") - MCFG_DEVICE_ADD("outlatch", HC259, 0) - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(OUTPUT("led100")) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(OUTPUT("led101")) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(OUTPUT("led102")) - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(OUTPUT("led103")) - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(OUTPUT("led104")) - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(OUTPUT("led105")) + hc259_device &outlatch(HC259(config, "outlatch")); + outlatch.q_out_cb<0>().set_output("led100"); + outlatch.q_out_cb<1>().set_output("led101"); + outlatch.q_out_cb<2>().set_output("led102"); + outlatch.q_out_cb<3>().set_output("led103"); + outlatch.q_out_cb<4>().set_output("led104"); + outlatch.q_out_cb<5>().set_output("led105"); MCFG_MEPHISTO_SENSORS_BOARD_ADD("board") MCFG_MEPHISTO_DISPLAY_MODUL_ADD("display") diff --git a/src/mame/drivers/pooyan.cpp b/src/mame/drivers/pooyan.cpp index 5ae1bf497b4..628e849647a 100644 --- a/src/mame/drivers/pooyan.cpp +++ b/src/mame/drivers/pooyan.cpp @@ -199,14 +199,14 @@ MACHINE_CONFIG_START(pooyan_state::pooyan) MCFG_DEVICE_ADD("maincpu", Z80, MASTER_CLOCK/3/2) MCFG_DEVICE_PROGRAM_MAP(main_map) - MCFG_DEVICE_ADD("mainlatch", LS259, 0) // B2 - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, pooyan_state, irq_enable_w)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE("timeplt_audio", timeplt_audio_device, sh_irqtrigger_w)) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE("timeplt_audio", timeplt_audio_device, mute_w)) - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, pooyan_state, coin_counter_1_w)) - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(*this, pooyan_state, coin_counter_2_w)) - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(NOOP) // PAY OUT - not used - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, pooyan_state, flipscreen_w)) + ls259_device &mainlatch(LS259(config, "mainlatch")); // B2 + mainlatch.q_out_cb<0>().set(FUNC(pooyan_state::irq_enable_w)); + mainlatch.q_out_cb<1>().set("timeplt_audio", FUNC(timeplt_audio_device::sh_irqtrigger_w)); + mainlatch.q_out_cb<2>().set("timeplt_audio", FUNC(timeplt_audio_device::mute_w)); + mainlatch.q_out_cb<3>().set(FUNC(pooyan_state::coin_counter_1_w)); + mainlatch.q_out_cb<4>().set(FUNC(pooyan_state::coin_counter_2_w)); + mainlatch.q_out_cb<5>().set_nop(); // PAY OUT - not used + mainlatch.q_out_cb<7>().set(FUNC(pooyan_state::flipscreen_w)); MCFG_WATCHDOG_ADD("watchdog") diff --git a/src/mame/drivers/pturn.cpp b/src/mame/drivers/pturn.cpp index 87d4ad4d968..38ceea02897 100644 --- a/src/mame/drivers/pturn.cpp +++ b/src/mame/drivers/pturn.cpp @@ -526,14 +526,14 @@ MACHINE_CONFIG_START(pturn_state::pturn) MCFG_DEVICE_PROGRAM_MAP(sub_map) MCFG_DEVICE_PERIODIC_INT_DRIVER(pturn_state, sub_intgen, 3*60) - MCFG_DEVICE_ADD("mainlatch", LS259, 0) - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, pturn_state, flip_w)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, pturn_state, nmi_main_enable_w)) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, pturn_state, coin_counter_1_w)) - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, pturn_state, coin_counter_2_w)) - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(*this, pturn_state, bgbank_w)) - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE(*this, pturn_state, fgbank_w)) - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(NOOP) // toggles frequently during gameplay + ls259_device &mainlatch(LS259(config, "mainlatch")); + mainlatch.q_out_cb<0>().set(FUNC(pturn_state::flip_w)); + mainlatch.q_out_cb<1>().set(FUNC(pturn_state::nmi_main_enable_w)); + mainlatch.q_out_cb<2>().set(FUNC(pturn_state::coin_counter_1_w)); + mainlatch.q_out_cb<3>().set(FUNC(pturn_state::coin_counter_2_w)); + mainlatch.q_out_cb<4>().set(FUNC(pturn_state::bgbank_w)); + mainlatch.q_out_cb<5>().set(FUNC(pturn_state::fgbank_w)); + mainlatch.q_out_cb<6>().set_nop(); // toggles frequently during gameplay MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_REFRESH_RATE(60) diff --git a/src/mame/drivers/punchout.cpp b/src/mame/drivers/punchout.cpp index 20cec8cd3ab..bbc39f814a3 100644 --- a/src/mame/drivers/punchout.cpp +++ b/src/mame/drivers/punchout.cpp @@ -634,15 +634,15 @@ MACHINE_CONFIG_START(punchout_state::punchout) MCFG_NVRAM_ADD_0FILL("nvram") - MCFG_DEVICE_ADD("mainlatch", LS259, 0) // 2B - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, punchout_state, nmi_mask_w)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(NOOP) // watchdog reset, seldom used because 08 clears the watchdog as well - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(NOOP) // ? - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(INPUTLINE("audiocpu", INPUT_LINE_RESET)) - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE("vlm", vlm5030_device, rst)) - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE("vlm", vlm5030_device, st)) - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE("vlm", vlm5030_device, vcu)) - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(NOOP) // enable NVRAM? + ls259_device &mainlatch(LS259(config, "mainlatch")); // 2B + mainlatch.q_out_cb<0>().set(FUNC(punchout_state::nmi_mask_w)); + mainlatch.q_out_cb<1>().set_nop(); // watchdog reset, seldom used because 08 clears the watchdog as well + mainlatch.q_out_cb<2>().set_nop(); // ? + mainlatch.q_out_cb<3>().set_inputline("audiocpu", INPUT_LINE_RESET); + mainlatch.q_out_cb<4>().set("vlm", FUNC(vlm5030_device::rst)); + mainlatch.q_out_cb<5>().set("vlm", FUNC(vlm5030_device::st)); + mainlatch.q_out_cb<6>().set("vlm", FUNC(vlm5030_device::vcu)); + mainlatch.q_out_cb<7>().set_nop(); // enable NVRAM? /* video hardware */ MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_punchout) diff --git a/src/mame/drivers/r2dtank.cpp b/src/mame/drivers/r2dtank.cpp index a89dc444f18..3798b9c26fa 100644 --- a/src/mame/drivers/r2dtank.cpp +++ b/src/mame/drivers/r2dtank.cpp @@ -465,14 +465,14 @@ MACHINE_CONFIG_START(r2dtank_state::r2dtank) /* 74LS123 */ - MCFG_DEVICE_ADD("74123", TTL74123, 0) - MCFG_TTL74123_CONNECTION_TYPE(TTL74123_GROUNDED) /* the hook up type */ - MCFG_TTL74123_RESISTOR_VALUE(RES_K(22)) /* resistor connected to RCext */ - MCFG_TTL74123_CAPACITOR_VALUE(CAP_U(0.01)) /* capacitor connected to Cext and RCext */ - MCFG_TTL74123_A_PIN_VALUE(1) /* A pin - driven by the CRTC */ - MCFG_TTL74123_B_PIN_VALUE(1) /* B pin - pulled high */ - MCFG_TTL74123_CLEAR_PIN_VALUE(1) /* Clear pin - pulled high */ - MCFG_TTL74123_OUTPUT_CHANGED_CB(WRITELINE(*this, r2dtank_state, ttl74123_output_changed)) + ttl74123_device &ttl74123(TTL74123(config, "74123", 0)); + ttl74123.set_connection_type(TTL74123_GROUNDED); /* the hook up type */ + ttl74123.set_resistor_value(RES_K(22)); /* resistor connected to RCext */ + ttl74123.set_capacitor_value(CAP_U(0.01)); /* capacitor connected to Cext and RCext */ + ttl74123.set_a_pin_value(1); /* A pin - driven by the CRTC */ + ttl74123.set_b_pin_value(1); /* B pin - pulled high */ + ttl74123.set_clear_pin_value(1); /* Clear pin - pulled high */ + ttl74123.out_cb().set(FUNC(r2dtank_state::ttl74123_output_changed)); PIA6821(config, m_pia_main, 0); m_pia_main->readpa_handler().set_ioport("IN0"); diff --git a/src/mame/drivers/rallyx.cpp b/src/mame/drivers/rallyx.cpp index 7c14781842d..8a40bc601b1 100644 --- a/src/mame/drivers/rallyx.cpp +++ b/src/mame/drivers/rallyx.cpp @@ -821,15 +821,15 @@ MACHINE_CONFIG_START(rallyx_state::rallyx) MCFG_DEVICE_PROGRAM_MAP(rallyx_map) MCFG_DEVICE_IO_MAP(io_map) - MCFG_DEVICE_ADD("mainlatch", LS259, 0) // 259 at 12M or 4099 at 11M on Logic Board I - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, rallyx_state, bang_w)) // BANG - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, rallyx_state, irq_mask_w)) // INT ON - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, rallyx_state, sound_on_w)) // SOUND ON - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, rallyx_state, flip_screen_w)) // FLIP - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(OUTPUT("led0")) - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(OUTPUT("led1")) - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(*this, rallyx_state, coin_lockout_w)) - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, rallyx_state, coin_counter_1_w)) + ls259_device &mainlatch(LS259(config, "mainlatch")); // 259 at 12M or 4099 at 11M on Logic Board I + mainlatch.q_out_cb<0>().set(FUNC(rallyx_state::bang_w)); // BANG + mainlatch.q_out_cb<1>().set(FUNC(rallyx_state::irq_mask_w)); // INT ON + mainlatch.q_out_cb<2>().set(FUNC(rallyx_state::sound_on_w)); // SOUND ON + mainlatch.q_out_cb<3>().set(FUNC(rallyx_state::flip_screen_w)); // FLIP + mainlatch.q_out_cb<4>().set_output("led0"); + mainlatch.q_out_cb<5>().set_output("led1"); + mainlatch.q_out_cb<6>().set(FUNC(rallyx_state::coin_lockout_w)); + mainlatch.q_out_cb<7>().set(FUNC(rallyx_state::coin_counter_1_w)); MCFG_WATCHDOG_ADD("watchdog") @@ -873,15 +873,15 @@ MACHINE_CONFIG_START(rallyx_state::jungler) MCFG_DEVICE_ADD("maincpu", Z80, MASTER_CLOCK/6) /* 3.072 MHz */ MCFG_DEVICE_PROGRAM_MAP(jungler_map) - MCFG_DEVICE_ADD("mainlatch", LS259, 0) // 1C on Loco-Motion - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE("timeplt_audio", timeplt_audio_device, sh_irqtrigger_w)) // SOUNDON - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, rallyx_state, nmi_mask_w)) // INTST - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE("timeplt_audio", timeplt_audio_device, mute_w)) // MUT - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, rallyx_state, flip_screen_w)) // FLIP - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(*this, rallyx_state, coin_counter_1_w)) // OUT1 - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(NOOP) // OUT2 - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(*this, rallyx_state, coin_counter_2_w)) // OUT3 - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, rallyx_state, stars_enable_w)) // STARSON + ls259_device &mainlatch(LS259(config, "mainlatch")); // 1C on Loco-Motion + mainlatch.q_out_cb<0>().set("timeplt_audio", FUNC(timeplt_audio_device::sh_irqtrigger_w)); // SOUNDON + mainlatch.q_out_cb<1>().set(FUNC(rallyx_state::nmi_mask_w)); // INTST + mainlatch.q_out_cb<2>().set("timeplt_audio", FUNC(timeplt_audio_device::mute_w)); // MUT + mainlatch.q_out_cb<3>().set(FUNC(rallyx_state::flip_screen_w)); // FLIP + mainlatch.q_out_cb<4>().set(FUNC(rallyx_state::coin_counter_1_w)); // OUT1 + mainlatch.q_out_cb<5>().set_nop(); // OUT2 + mainlatch.q_out_cb<6>().set(FUNC(rallyx_state::coin_counter_2_w)); // OUT3 + mainlatch.q_out_cb<7>().set(FUNC(rallyx_state::stars_enable_w)); // STARSON MCFG_WATCHDOG_ADD("watchdog") diff --git a/src/mame/drivers/rastan.cpp b/src/mame/drivers/rastan.cpp index ae69eaf95bc..67857457cfa 100644 --- a/src/mame/drivers/rastan.cpp +++ b/src/mame/drivers/rastan.cpp @@ -414,8 +414,8 @@ MACHINE_CONFIG_START(rastan_state::rastan) MCFG_MSM5205_PRESCALER_SELECTOR(S48_4B) /* 8 kHz */ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.60) - MCFG_DEVICE_ADD("adpcm_sel", LS157, 0) - MCFG_74157_OUT_CB(WRITE8("msm", msm5205_device, data_w)) + LS157(config, m_adpcm_sel, 0); + m_adpcm_sel->out_callback().set("msm", FUNC(msm5205_device::data_w)); MCFG_DEVICE_ADD("ciu", PC060HA, 0) MCFG_PC060HA_MASTER_CPU("maincpu") diff --git a/src/mame/drivers/retofinv.cpp b/src/mame/drivers/retofinv.cpp index 3ff3ca9652b..49d87797cb6 100644 --- a/src/mame/drivers/retofinv.cpp +++ b/src/mame/drivers/retofinv.cpp @@ -107,7 +107,6 @@ Notes: #include "includes/retofinv.h" #include "cpu/z80/z80.h" -#include "machine/74259.h" #include "machine/watchdog.h" #include "sound/sn76496.h" #include "screen.h" @@ -432,13 +431,13 @@ MACHINE_CONFIG_START(retofinv_state::retofinv) MCFG_QUANTUM_TIME(attotime::from_hz(6000)) /* 100 CPU slices per frame - enough for the sound CPU to read all commands */ - ls259_device &mainlatch(LS259(config, "mainlatch")); // IC72 - probably shared between CPUs - mainlatch.q_out_cb<0>().set(FUNC(retofinv_state::irq0_ack_w)); - mainlatch.q_out_cb<1>().set(FUNC(retofinv_state::coinlockout_w)); - mainlatch.q_out_cb<2>().set_inputline(m_audiocpu, INPUT_LINE_RESET).invert(); - mainlatch.q_out_cb<3>().set(m_68705, FUNC(taito68705_mcu_device::reset_w)).invert(); - mainlatch.q_out_cb<4>().set(FUNC(retofinv_state::irq1_ack_w)); - mainlatch.q_out_cb<5>().set_inputline(m_subcpu, INPUT_LINE_RESET).invert(); + LS259(config, m_mainlatch); // IC72 - probably shared between CPUs + m_mainlatch->q_out_cb<0>().set(FUNC(retofinv_state::irq0_ack_w)); + m_mainlatch->q_out_cb<1>().set(FUNC(retofinv_state::coinlockout_w)); + m_mainlatch->q_out_cb<2>().set_inputline(m_audiocpu, INPUT_LINE_RESET).invert(); + m_mainlatch->q_out_cb<3>().set(m_68705, FUNC(taito68705_mcu_device::reset_w)).invert(); + m_mainlatch->q_out_cb<4>().set(FUNC(retofinv_state::irq1_ack_w)); + m_mainlatch->q_out_cb<5>().set_inputline(m_subcpu, INPUT_LINE_RESET).invert(); MCFG_WATCHDOG_ADD("watchdog") @@ -481,8 +480,7 @@ MACHINE_CONFIG_START(retofinv_state::retofinvb_nomcu) MCFG_DEVICE_MODIFY("maincpu") MCFG_DEVICE_PROGRAM_MAP(bootleg_map) - MCFG_DEVICE_MODIFY("mainlatch") - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(NOOP) + m_mainlatch->q_out_cb<3>().set_nop(); MCFG_DEVICE_REMOVE("68705") MACHINE_CONFIG_END @@ -493,8 +491,7 @@ MACHINE_CONFIG_START(retofinv_state::retofinvb1_nomcu) MCFG_DEVICE_MODIFY("maincpu") MCFG_DEVICE_PROGRAM_MAP(bootleg_map) - MCFG_DEVICE_MODIFY("mainlatch") - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(NOOP) + m_mainlatch->q_out_cb<3>().set_nop(); MCFG_DEVICE_REMOVE("68705") MACHINE_CONFIG_END diff --git a/src/mame/drivers/rocnrope.cpp b/src/mame/drivers/rocnrope.cpp index 013c481d78a..43374fcf357 100644 --- a/src/mame/drivers/rocnrope.cpp +++ b/src/mame/drivers/rocnrope.cpp @@ -212,13 +212,13 @@ MACHINE_CONFIG_START(rocnrope_state::rocnrope) MCFG_DEVICE_ADD("maincpu", KONAMI1, MASTER_CLOCK / 3 / 4) /* Verified in schematics */ MCFG_DEVICE_PROGRAM_MAP(rocnrope_map) - MCFG_DEVICE_ADD("mainlatch", LS259, 0) // B2 - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, rocnrope_state, flip_screen_w)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE("timeplt_audio", timeplt_audio_device, sh_irqtrigger_w)) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE("timeplt_audio", timeplt_audio_device, mute_w)) - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, rocnrope_state, coin_counter_1_w)) - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(*this, rocnrope_state, coin_counter_2_w)) - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, rocnrope_state, irq_mask_w)) + ls259_device &mainlatch(LS259(config, "mainlatch")); // B2 + mainlatch.q_out_cb<0>().set(FUNC(rocnrope_state::flip_screen_w)); + mainlatch.q_out_cb<1>().set("timeplt_audio", FUNC(timeplt_audio_device::sh_irqtrigger_w)); + mainlatch.q_out_cb<2>().set("timeplt_audio", FUNC(timeplt_audio_device::mute_w)); + mainlatch.q_out_cb<3>().set(FUNC(rocnrope_state::coin_counter_1_w)); + mainlatch.q_out_cb<4>().set(FUNC(rocnrope_state::coin_counter_2_w)); + mainlatch.q_out_cb<7>().set(FUNC(rocnrope_state::irq_mask_w)); MCFG_WATCHDOG_ADD("watchdog") diff --git a/src/mame/drivers/rollrace.cpp b/src/mame/drivers/rollrace.cpp index 0d405a30e85..84591e2d8dc 100644 --- a/src/mame/drivers/rollrace.cpp +++ b/src/mame/drivers/rollrace.cpp @@ -259,14 +259,14 @@ MACHINE_CONFIG_START(rollrace_state::rollrace) MCFG_DEVICE_PROGRAM_MAP(rollrace_sound_map) MCFG_DEVICE_PERIODIC_INT_DRIVER(rollrace_state, sound_timer_irq, 4*60) - MCFG_DEVICE_ADD("mainlatch", LS259, 0) - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, rollrace_state, flipx_w)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, rollrace_state, nmi_mask_w)) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, rollrace_state, coin_counter_1_w)) - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, rollrace_state, coin_counter_2_w)) - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(*this, rollrace_state, charbank_0_w)) - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE(*this, rollrace_state, charbank_1_w)) - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(*this, rollrace_state, spritebank_w)) + ls259_device &mainlatch(LS259(config, "mainlatch")); + mainlatch.q_out_cb<0>().set(FUNC(rollrace_state::flipx_w)); + mainlatch.q_out_cb<1>().set(FUNC(rollrace_state::nmi_mask_w)); + mainlatch.q_out_cb<2>().set(FUNC(rollrace_state::coin_counter_1_w)); + mainlatch.q_out_cb<3>().set(FUNC(rollrace_state::coin_counter_2_w)); + mainlatch.q_out_cb<4>().set(FUNC(rollrace_state::charbank_0_w)); + mainlatch.q_out_cb<5>().set(FUNC(rollrace_state::charbank_1_w)); + mainlatch.q_out_cb<6>().set(FUNC(rollrace_state::spritebank_w)); /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) diff --git a/src/mame/drivers/sauro.cpp b/src/mame/drivers/sauro.cpp index 7b80599f374..12f8ba7f581 100644 --- a/src/mame/drivers/sauro.cpp +++ b/src/mame/drivers/sauro.cpp @@ -126,7 +126,6 @@ Stephh's notes (based on the games Z80 code and some tests) : #include "includes/sauro.h" #include "cpu/z80/z80.h" -#include "machine/74259.h" #include "machine/nvram.h" #include "machine/watchdog.h" #include "sound/3812intf.h" @@ -206,7 +205,7 @@ void sauro_state::sauro_io_map(address_map &map) map(0x80, 0x80).w(FUNC(sauro_state::sauro_sound_command_w)); map(0xa0, 0xa0).w(FUNC(sauro_state::scroll_bg_w)); map(0xa1, 0xa1).w(FUNC(sauro_state::sauro_scroll_fg_w)); - map(0xc0, 0xcf).w("mainlatch", FUNC(ls259_device::write_a0)); + map(0xc0, 0xcf).w(m_mainlatch, FUNC(ls259_device::write_a0)); map(0xe0, 0xe0).w("watchdog", FUNC(watchdog_timer_device::reset_w)); } @@ -248,7 +247,7 @@ void sauro_state::trckydoc_map(address_map &map) map(0xf820, 0xf821).w("ymsnd", FUNC(ym3812_device::write)); map(0xf828, 0xf828).r("watchdog", FUNC(watchdog_timer_device::reset_r)); map(0xf830, 0xf830).w(FUNC(sauro_state::scroll_bg_w)); - map(0xf838, 0xf83f).w("mainlatch", FUNC(ls259_device::write_d0)); + map(0xf838, 0xf83f).w(m_mainlatch, FUNC(ls259_device::write_d0)); } @@ -452,8 +451,8 @@ MACHINE_CONFIG_START(sauro_state::tecfri) /* basic machine hardware */ MCFG_DEVICE_ADD("maincpu", Z80, XTAL(20'000'000)/4) /* verified on pcb */ - MCFG_DEVICE_ADD("mainlatch", LS259, 0) - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(*this, sauro_state, irq_reset_w)) + LS259(config, m_mainlatch); + m_mainlatch->q_out_cb<4>().set(FUNC(sauro_state::irq_reset_w)); MCFG_NVRAM_ADD_1FILL("nvram") @@ -484,10 +483,9 @@ MACHINE_CONFIG_START(sauro_state::trckydoc) MCFG_DEVICE_MODIFY("maincpu") MCFG_DEVICE_PROGRAM_MAP(trckydoc_map) - MCFG_DEVICE_MODIFY("mainlatch") - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, sauro_state, flip_screen_w)) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, sauro_state, coin1_w)) - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, sauro_state, coin2_w)) + m_mainlatch->q_out_cb<1>().set(FUNC(sauro_state::flip_screen_w)); + m_mainlatch->q_out_cb<2>().set(FUNC(sauro_state::coin1_w)); + m_mainlatch->q_out_cb<3>().set(FUNC(sauro_state::coin2_w)); MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_trckydoc) @@ -504,13 +502,13 @@ MACHINE_CONFIG_START(sauro_state::sauro) MCFG_DEVICE_PROGRAM_MAP(sauro_map) MCFG_DEVICE_IO_MAP(sauro_io_map) - MCFG_DEVICE_MODIFY("mainlatch") // Z3 - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, sauro_state, flip_screen_w)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, sauro_state, coin1_w)) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, sauro_state, coin2_w)) - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(NOOP) // sound IRQ trigger? - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE(*this, sauro_state, sauro_palette_bank0_w)) - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(*this, sauro_state, sauro_palette_bank1_w)) + // Z3 + m_mainlatch->q_out_cb<0>().set(FUNC(sauro_state::flip_screen_w)); + m_mainlatch->q_out_cb<1>().set(FUNC(sauro_state::coin1_w)); + m_mainlatch->q_out_cb<2>().set(FUNC(sauro_state::coin2_w)); + m_mainlatch->q_out_cb<3>().set_nop(); // sound IRQ trigger? + m_mainlatch->q_out_cb<5>().set(FUNC(sauro_state::sauro_palette_bank0_w)); + m_mainlatch->q_out_cb<6>().set(FUNC(sauro_state::sauro_palette_bank1_w)); MCFG_DEVICE_ADD("audiocpu", Z80, XTAL(20'000'000) / 5) /* verified on pcb */ MCFG_DEVICE_PROGRAM_MAP(sauro_sound_map) diff --git a/src/mame/drivers/sbasketb.cpp b/src/mame/drivers/sbasketb.cpp index 88174e3f4e0..580f37e47ee 100644 --- a/src/mame/drivers/sbasketb.cpp +++ b/src/mame/drivers/sbasketb.cpp @@ -201,14 +201,14 @@ MACHINE_CONFIG_START(sbasketb_state::sbasketb) MCFG_DEVICE_ADD(m_audiocpu, Z80, XTAL(14'318'181) / 4) /* 3.5795 MHz */ MCFG_DEVICE_PROGRAM_MAP(sbasketb_sound_map) - MCFG_DEVICE_ADD("mainlatch", LS259, 0) // B3 - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, sbasketb_state, flipscreen_w)) // FLIP - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, sbasketb_state, irq_mask_w)) // INTST - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(NOOP) // MUT - not used? - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, sbasketb_state, coin_counter_1_w)) // COIN 1 - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(*this, sbasketb_state, coin_counter_2_w)) // COIN 2 - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE(*this, sbasketb_state, spriteram_select_w)) // OBJ CHE - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(NOOP) // END - not used + ls259_device &mainlatch(LS259(config, "mainlatch")); // B3 + mainlatch.q_out_cb<0>().set(FUNC(sbasketb_state::flipscreen_w)); // FLIP + mainlatch.q_out_cb<1>().set(FUNC(sbasketb_state::irq_mask_w)); // INTST + mainlatch.q_out_cb<2>().set_nop(); // MUT - not used? + mainlatch.q_out_cb<3>().set(FUNC(sbasketb_state::coin_counter_1_w)); // COIN 1 + mainlatch.q_out_cb<4>().set(FUNC(sbasketb_state::coin_counter_2_w)); // COIN 2 + mainlatch.q_out_cb<5>().set(FUNC(sbasketb_state::spriteram_select_w)); // OBJ CHE + mainlatch.q_out_cb<6>().set_nop(); // END - not used MCFG_WATCHDOG_ADD("watchdog") diff --git a/src/mame/drivers/seibuspi.cpp b/src/mame/drivers/seibuspi.cpp index 2100c89ed0b..bde81d03ae4 100644 --- a/src/mame/drivers/seibuspi.cpp +++ b/src/mame/drivers/seibuspi.cpp @@ -1883,8 +1883,8 @@ MACHINE_CONFIG_START(seibuspi_state::spi) MCFG_INTEL_E28F008SA_ADD("soundflash1") // Sharp LH28F008 on newer mainboard revision MCFG_INTEL_E28F008SA_ADD("soundflash2") // " - MCFG_FIFO7200_ADD("soundfifo1", 0x200) // LH5496D, but on single board hw it's one CY7C421 - MCFG_FIFO7200_ADD("soundfifo2", 0x200) // " + FIFO7200(config, m_soundfifo[0], 0x200); // LH5496D, but on single board hw it's one CY7C421 + FIFO7200(config, m_soundfifo[1], 0x200); // " /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) diff --git a/src/mame/drivers/shangkid.cpp b/src/mame/drivers/shangkid.cpp index c771985ddcb..f9de5613fc8 100644 --- a/src/mame/drivers/shangkid.cpp +++ b/src/mame/drivers/shangkid.cpp @@ -488,10 +488,10 @@ MACHINE_CONFIG_START(shangkid_state::dynamski) MCFG_DEVICE_PROGRAM_MAP(dynamski_map) MCFG_DEVICE_IO_MAP(dynamski_portmap) - MCFG_DEVICE_ADD("mainlatch", LS259, 0) - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, shangkid_state, int_enable_1_w)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(NOOP) // screen flip? - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(NOOP) // screen flip? + ls259_device &mainlatch(LS259(config, "mainlatch")); + mainlatch.q_out_cb<0>().set(FUNC(shangkid_state::int_enable_1_w)); + mainlatch.q_out_cb<1>().set_nop(); // screen flip? + mainlatch.q_out_cb<2>().set_nop(); // screen flip? /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) diff --git a/src/mame/drivers/skyarmy.cpp b/src/mame/drivers/skyarmy.cpp index 959fa208a2b..4c3e786bd63 100644 --- a/src/mame/drivers/skyarmy.cpp +++ b/src/mame/drivers/skyarmy.cpp @@ -331,12 +331,12 @@ MACHINE_CONFIG_START(skyarmy_state::skyarmy) MCFG_DEVICE_VBLANK_INT_DRIVER("screen", skyarmy_state, irq0_line_hold) MCFG_DEVICE_PERIODIC_INT_DRIVER(skyarmy_state, nmi_source, 650) /* Hz */ - MCFG_DEVICE_ADD("latch", LS259, 0) // 11C - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, skyarmy_state, coin_counter_w)) - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(*this, skyarmy_state, nmi_enable_w)) // ??? - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE(*this, skyarmy_state, flip_screen_x_w)) - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(*this, skyarmy_state, flip_screen_y_w)) - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(NOOP) // video RAM buffering? + ls259_device &latch(LS259(config, "latch")); // 11C + latch.q_out_cb<0>().set(FUNC(skyarmy_state::coin_counter_w)); + latch.q_out_cb<4>().set(FUNC(skyarmy_state::nmi_enable_w)); // ??? + latch.q_out_cb<5>().set(FUNC(skyarmy_state::flip_screen_x_w)); + latch.q_out_cb<6>().set(FUNC(skyarmy_state::flip_screen_y_w)); + latch.q_out_cb<7>().set_nop(); // video RAM buffering? /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) diff --git a/src/mame/drivers/skydiver.cpp b/src/mame/drivers/skydiver.cpp index f151a2ecae2..9fe01be50cd 100644 --- a/src/mame/drivers/skydiver.cpp +++ b/src/mame/drivers/skydiver.cpp @@ -355,30 +355,32 @@ MACHINE_CONFIG_START(skydiver_state::skydiver) MCFG_WATCHDOG_ADD("watchdog") MCFG_WATCHDOG_VBLANK_INIT("screen", 8) // 128V clocks the same as VBLANK - MCFG_DEVICE_ADD("latch1", F9334, 0) // F12 - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, skydiver_state, lamp_s_w)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, skydiver_state, lamp_k_w)) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, skydiver_state, start_lamp_1_w)) - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, skydiver_state, start_lamp_2_w)) - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(*this, skydiver_state, lamp_y_w)) - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE(*this, skydiver_state, lamp_d_w)) - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE("discrete", discrete_device, write_line)) - MCFG_DEVICE_ADD("latch2", F9334, 0) // H12 - //MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, skydiver_state, jump1_lamps_w)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, skydiver_state, coin_lockout_w)) - //MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, skydiver_state, jump2_lamps_w)) - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE("discrete", discrete_device, write_line)) - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE("discrete", discrete_device, write_line)) - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(*this, skydiver_state, nmion_w)) - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, skydiver_state, width_w)) - MCFG_DEVICE_ADD("latch3", F9334, 0) // A11 - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, skydiver_state, lamp_i_w)) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, skydiver_state, lamp_v_w)) - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, skydiver_state, lamp_e_w)) - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(*this, skydiver_state, lamp_r_w)) - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE("discrete", discrete_device, write_line)) - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE("discrete", discrete_device, write_line)) - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE("discrete", discrete_device, write_line)) + f9334_device &latch1(F9334(config, "latch1")); // F12 + latch1.q_out_cb<0>().set(FUNC(skydiver_state::lamp_s_w)); + latch1.q_out_cb<1>().set(FUNC(skydiver_state::lamp_k_w)); + latch1.q_out_cb<2>().set(FUNC(skydiver_state::start_lamp_1_w)); + latch1.q_out_cb<3>().set(FUNC(skydiver_state::start_lamp_2_w)); + latch1.q_out_cb<4>().set(FUNC(skydiver_state::lamp_y_w)); + latch1.q_out_cb<5>().set(FUNC(skydiver_state::lamp_d_w)); + latch1.q_out_cb<6>().set("discrete", FUNC(discrete_device::write_line)); + + f9334_device &latch2(F9334(config, "latch2")); // H12 + //latch2.q_out_cb<0>().set(FUNC(skydiver_state::jump1_lamps_w)); + latch2.q_out_cb<1>().set(FUNC(skydiver_state::coin_lockout_w)); + //latch2.q_out_cb<3>().set(FUNC(skydiver_state::jump2_lamps_w)); + latch2.q_out_cb<4>().set("discrete", FUNC(discrete_device::write_line)); + latch2.q_out_cb<5>().set("discrete", FUNC(discrete_device::write_line)); + latch2.q_out_cb<6>().set(FUNC(skydiver_state::nmion_w)); + latch2.q_out_cb<7>().set(FUNC(skydiver_state::width_w)); + + f9334_device &latch3(F9334(config, "latch3")); // A11 + latch3.q_out_cb<1>().set(FUNC(skydiver_state::lamp_i_w)); + latch3.q_out_cb<2>().set(FUNC(skydiver_state::lamp_v_w)); + latch3.q_out_cb<3>().set(FUNC(skydiver_state::lamp_e_w)); + latch3.q_out_cb<4>().set(FUNC(skydiver_state::lamp_r_w)); + latch3.q_out_cb<5>().set("discrete", FUNC(discrete_device::write_line)); + latch3.q_out_cb<6>().set("discrete", FUNC(discrete_device::write_line)); + latch3.q_out_cb<7>().set("discrete", FUNC(discrete_device::write_line)); /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) diff --git a/src/mame/drivers/slapfght.cpp b/src/mame/drivers/slapfght.cpp index 933ccd00020..316663cae70 100644 --- a/src/mame/drivers/slapfght.cpp +++ b/src/mame/drivers/slapfght.cpp @@ -896,11 +896,11 @@ MACHINE_CONFIG_START(slapfght_state::perfrman) MCFG_DEVICE_PROGRAM_MAP(perfrman_map) MCFG_DEVICE_IO_MAP(io_map_nomcu) - MCFG_DEVICE_ADD("mainlatch", LS259, 0) - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, slapfght_state, sound_reset_w)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, slapfght_state, flipscreen_w)) - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, slapfght_state, irq_enable_w)) - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(*this, slapfght_state, palette_bank_w)) + ls259_device &mainlatch(LS259(config, "mainlatch")); + mainlatch.q_out_cb<0>().set(FUNC(slapfght_state::sound_reset_w)); + mainlatch.q_out_cb<1>().set(FUNC(slapfght_state::flipscreen_w)); + mainlatch.q_out_cb<3>().set(FUNC(slapfght_state::irq_enable_w)); + mainlatch.q_out_cb<6>().set(FUNC(slapfght_state::palette_bank_w)); MCFG_DEVICE_ADD("audiocpu", Z80, XTAL(16'000'000)/8) // 2MHz? XTAL is known, divider is guessed MCFG_DEVICE_PROGRAM_MAP(perfrman_sound_map) @@ -947,10 +947,10 @@ MACHINE_CONFIG_START(slapfght_state::tigerh) MCFG_DEVICE_PROGRAM_MAP(tigerh_map_mcu) MCFG_DEVICE_IO_MAP(io_map_mcu) - MCFG_DEVICE_ADD("mainlatch", LS259, 0) - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, slapfght_state, sound_reset_w)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, slapfght_state, flipscreen_w)) - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, slapfght_state, irq_enable_w)) + ls259_device &mainlatch(LS259(config, "mainlatch")); + mainlatch.q_out_cb<0>().set(FUNC(slapfght_state::sound_reset_w)); + mainlatch.q_out_cb<1>().set(FUNC(slapfght_state::flipscreen_w)); + mainlatch.q_out_cb<3>().set(FUNC(slapfght_state::irq_enable_w)); MCFG_DEVICE_ADD("audiocpu", Z80, XTAL(36'000'000)/12) // 3MHz MCFG_DEVICE_PROGRAM_MAP(tigerh_sound_map) @@ -1018,11 +1018,11 @@ MACHINE_CONFIG_START(slapfght_state::slapfigh) MCFG_DEVICE_PROGRAM_MAP(slapfigh_map_mcu) MCFG_DEVICE_IO_MAP(io_map_mcu) - MCFG_DEVICE_ADD("mainlatch", LS259, 0) - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, slapfght_state, sound_reset_w)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, slapfght_state, flipscreen_w)) - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, slapfght_state, irq_enable_w)) - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(MEMBANK("bank1")) + ls259_device &mainlatch(LS259(config, "mainlatch")); + mainlatch.q_out_cb<0>().set(FUNC(slapfght_state::slapfght_state::sound_reset_w)); + mainlatch.q_out_cb<1>().set(FUNC(slapfght_state::slapfght_state::flipscreen_w)); + mainlatch.q_out_cb<3>().set(FUNC(slapfght_state::slapfght_state::irq_enable_w)); + mainlatch.q_out_cb<4>().set_membank("bank1"); MCFG_DEVICE_ADD("audiocpu", Z80, XTAL(36'000'000)/12) // 3MHz MCFG_DEVICE_PROGRAM_MAP(tigerh_sound_map) diff --git a/src/mame/drivers/slicer.cpp b/src/mame/drivers/slicer.cpp index 1094b65dcc9..71745df4620 100644 --- a/src/mame/drivers/slicer.cpp +++ b/src/mame/drivers/slicer.cpp @@ -121,15 +121,15 @@ MACHINE_CONFIG_START(slicer_state::slicer) MCFG_FLOPPY_DRIVE_ADD("fdc:2", slicer_floppies, nullptr, floppy_image_device::default_floppy_formats) MCFG_FLOPPY_DRIVE_ADD("fdc:3", slicer_floppies, nullptr, floppy_image_device::default_floppy_formats) - MCFG_DEVICE_ADD("drivelatch", LS259, 0) // U29 - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE("sasi", scsi_port_device, write_sel)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE("sasi", scsi_port_device, write_rst)) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, slicer_state, drive_sel_w<3>)) - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, slicer_state, drive_sel_w<2>)) - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(*this, slicer_state, drive_sel_w<1>)) - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE(*this, slicer_state, drive_sel_w<0>)) - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(*this, slicer_state, drive_size_w)) - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE("fdc", fd1797_device, dden_w)) + ls259_device &drivelatch(LS259(config, "drivelatch")); // U29 + drivelatch.q_out_cb<0>().set("sasi", FUNC(scsi_port_device::write_sel)); + drivelatch.q_out_cb<1>().set("sasi", FUNC(scsi_port_device::write_rst)); + drivelatch.q_out_cb<2>().set(FUNC(slicer_state::drive_sel_w<3>)); + drivelatch.q_out_cb<3>().set(FUNC(slicer_state::drive_sel_w<2>)); + drivelatch.q_out_cb<4>().set(FUNC(slicer_state::drive_sel_w<1>)); + drivelatch.q_out_cb<5>().set(FUNC(slicer_state::drive_sel_w<0>)); + drivelatch.q_out_cb<6>().set(FUNC(slicer_state::drive_size_w)); + drivelatch.q_out_cb<7>().set("fdc", FUNC(fd1797_device::dden_w)); MCFG_DEVICE_ADD("sasi", SCSI_PORT, 0) MCFG_SCSI_DATA_INPUT_BUFFER("sasi_data_in") diff --git a/src/mame/drivers/sonson.cpp b/src/mame/drivers/sonson.cpp index d74285fc582..b8966be6c7a 100644 --- a/src/mame/drivers/sonson.cpp +++ b/src/mame/drivers/sonson.cpp @@ -236,11 +236,11 @@ MACHINE_CONFIG_START(sonson_state::sonson) MCFG_DEVICE_PROGRAM_MAP(sound_map) MCFG_DEVICE_PERIODIC_INT_DRIVER(sonson_state, irq0_line_hold, 4*60) /* FIRQs are triggered by the main CPU */ - MCFG_DEVICE_ADD("mainlatch", LS259, 0) // A9 - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, sonson_state, flipscreen_w)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, sonson_state, sh_irqtrigger_w)) - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(*this, sonson_state, coin2_counter_w)) - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, sonson_state, coin1_counter_w)) + ls259_device &mainlatch(LS259(config, "mainlatch")); // A9 + mainlatch.q_out_cb<0>().set(FUNC(sonson_state::flipscreen_w)); + mainlatch.q_out_cb<1>().set(FUNC(sonson_state::sh_irqtrigger_w)); + mainlatch.q_out_cb<6>().set(FUNC(sonson_state::coin2_counter_w)); + mainlatch.q_out_cb<7>().set(FUNC(sonson_state::coin1_counter_w)); /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) diff --git a/src/mame/drivers/spcforce.cpp b/src/mame/drivers/spcforce.cpp index 7984f3d8465..aea542beec6 100644 --- a/src/mame/drivers/spcforce.cpp +++ b/src/mame/drivers/spcforce.cpp @@ -40,7 +40,6 @@ TODO: #include "cpu/i8085/i8085.h" #include "cpu/mcs48/mcs48.h" -#include "machine/74259.h" #include "machine/gen_latch.h" #include "emupal.h" #include "screen.h" @@ -134,7 +133,7 @@ void spcforce_state::spcforce_map(address_map &map) map(0x7000, 0x7000).portr("DSW").w("soundlatch", FUNC(generic_latch_8_device::write)); map(0x7001, 0x7001).portr("P1").w(FUNC(spcforce_state::soundtrigger_w)); map(0x7002, 0x7002).portr("P2").w(FUNC(spcforce_state::misc_outputs_w)); - map(0x7008, 0x700f).w("mainlatch", FUNC(ls259_device::write_d0)); + map(0x7008, 0x700f).w(m_mainlatch, FUNC(ls259_device::write_d0)); map(0x8000, 0x83ff).ram().share("videoram"); map(0x9000, 0x93ff).ram().share("colorram"); map(0xa000, 0xa3ff).ram().share("scrollram"); @@ -300,10 +299,10 @@ MACHINE_CONFIG_START(spcforce_state::spcforce) MCFG_MCS48_PORT_P2_OUT_CB(WRITE8(*this, spcforce_state, SN76496_select_w)) MCFG_MCS48_PORT_T0_IN_CB(READLINE(*this, spcforce_state, t0_r)) - MCFG_DEVICE_ADD("mainlatch", LS259, 0) - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, spcforce_state, flip_screen_w)) - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(*this, spcforce_state, irq_mask_w)) - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, spcforce_state, unknown_w)) + LS259(config, m_mainlatch); + m_mainlatch->q_out_cb<3>().set(FUNC(spcforce_state::flip_screen_w)); + m_mainlatch->q_out_cb<6>().set(FUNC(spcforce_state::irq_mask_w)); + m_mainlatch->q_out_cb<7>().set(FUNC(spcforce_state::unknown_w)); /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) @@ -336,13 +335,13 @@ MACHINE_CONFIG_START(spcforce_state::spcforce) MCFG_SN76496_READY_HANDLER(WRITELINE(*this, spcforce_state, write_sn3_ready)) MACHINE_CONFIG_END -MACHINE_CONFIG_START(spcforce_state::meteors) +void spcforce_state::meteors(machine_config &config) +{ spcforce(config); - MCFG_DEVICE_MODIFY("mainlatch") - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(NOOP) - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE(*this, spcforce_state, irq_mask_w)) // ?? - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(*this, spcforce_state, flip_screen_w)) // irq mask isn't here, gets written too early causing the game to not boot, see startup code -MACHINE_CONFIG_END + m_mainlatch->q_out_cb<3>().set_nop(); + m_mainlatch->q_out_cb<5>().set(FUNC(spcforce_state::irq_mask_w)); // ?? + m_mainlatch->q_out_cb<6>().set(FUNC(spcforce_state::flip_screen_w)); // irq mask isn't here, gets written too early causing the game to not boot, see startup code +} /*************************************************************************** diff --git a/src/mame/drivers/spiders.cpp b/src/mame/drivers/spiders.cpp index 0e1bf1c4f9e..8f3f00a9de9 100644 --- a/src/mame/drivers/spiders.cpp +++ b/src/mame/drivers/spiders.cpp @@ -570,14 +570,14 @@ MACHINE_CONFIG_START(spiders_state::spiders) m_pia[3]->writepb_handler().set(FUNC(spiders_state::spiders_audio_b_w)); m_pia[3]->irqa_handler().set_inputline("audiocpu", M6802_IRQ_LINE); - MCFG_DEVICE_ADD("ic60", TTL74123, 0) - MCFG_TTL74123_CONNECTION_TYPE(TTL74123_GROUNDED) /* the hook up type */ - MCFG_TTL74123_RESISTOR_VALUE(RES_K(22)) /* resistor connected to RCext */ - MCFG_TTL74123_CAPACITOR_VALUE(CAP_U(0.01)) /* capacitor connected to Cext and RCext */ - MCFG_TTL74123_A_PIN_VALUE(1) /* A pin - driven by the CRTC */ - MCFG_TTL74123_B_PIN_VALUE(1) /* B pin - pulled high */ - MCFG_TTL74123_CLEAR_PIN_VALUE(1) /* Clear pin - pulled high */ - MCFG_TTL74123_OUTPUT_CHANGED_CB(WRITELINE(*this, spiders_state, ic60_74123_output_changed)) + ttl74123_device &ic60(TTL74123(config, "ic60", 0)); + ic60.set_connection_type(TTL74123_GROUNDED); /* the hook up type */ + ic60.set_resistor_value(RES_K(22)); /* resistor connected to RCext */ + ic60.set_capacitor_value(CAP_U(0.01)); /* capacitor connected to Cext and RCext */ + ic60.set_a_pin_value(1); /* A pin - driven by the CRTC */ + ic60.set_b_pin_value(1); /* B pin - pulled high */ + ic60.set_clear_pin_value(1); /* Clear pin - pulled high */ + ic60.out_cb().set(FUNC(spiders_state::ic60_74123_output_changed)); /* audio hardware */ spiders_audio(config); diff --git a/src/mame/drivers/spinb.cpp b/src/mame/drivers/spinb.cpp index c3ea03f73f4..27a05e4091e 100644 --- a/src/mame/drivers/spinb.cpp +++ b/src/mame/drivers/spinb.cpp @@ -730,14 +730,14 @@ MACHINE_CONFIG_START(spinb_state::spinb) MCFG_DEVICE_ADD("ic5a", TTL7474, 0) MCFG_7474_COMP_OUTPUT_CB(WRITELINE(*this, spinb_state, ic5a_w)) - MCFG_DEVICE_ADD("ic14a", HC157, 0) // actually IC15 on Jolly Park - MCFG_74157_OUT_CB(WRITE8("msm_a", msm5205_device, data_w)) + HC157(config, m_ic14a, 0); // actually IC15 on Jolly Park + m_ic14a->out_callback().set("msm_a", FUNC(msm5205_device::data_w)); MCFG_DEVICE_ADD("ic5m", TTL7474, 0) MCFG_7474_COMP_OUTPUT_CB(WRITELINE(*this, spinb_state, ic5m_w)) - MCFG_DEVICE_ADD("ic14m", HC157, 0) // actually IC15 on Jolly Park - MCFG_74157_OUT_CB(WRITE8("msm_m", msm5205_device, data_w)) + HC157(config, m_ic14m, 0); // actually IC15 on Jolly Park + m_ic14m->out_callback().set("msm_m", FUNC(msm5205_device::data_w)); MACHINE_CONFIG_END MACHINE_CONFIG_START(spinb_state::jolypark) diff --git a/src/mame/drivers/splash.cpp b/src/mame/drivers/splash.cpp index 874ac35b008..7504b20bf27 100644 --- a/src/mame/drivers/splash.cpp +++ b/src/mame/drivers/splash.cpp @@ -496,11 +496,11 @@ MACHINE_CONFIG_START(splash_state::splash) MCFG_DEVICE_PROGRAM_MAP(splash_sound_map) MCFG_DEVICE_PERIODIC_INT_DRIVER(splash_state, nmi_line_pulse, 60*64) /* needed for the msm5205 to play the samples */ - MCFG_DEVICE_ADD("outlatch", LS259, 0) // A8 - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, splash_state, coin1_lockout_w)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, splash_state, coin2_lockout_w)) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, splash_state, coin1_counter_w)) - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, splash_state, coin2_counter_w)) + LS259(config, m_outlatch); // A8 + m_outlatch->q_out_cb<0>().set(FUNC(splash_state::coin1_lockout_w)); + m_outlatch->q_out_cb<1>().set(FUNC(splash_state::coin2_lockout_w)); + m_outlatch->q_out_cb<2>().set(FUNC(splash_state::coin1_counter_w)); + m_outlatch->q_out_cb<3>().set(FUNC(splash_state::coin2_counter_w)); /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) diff --git a/src/mame/drivers/sprint2.cpp b/src/mame/drivers/sprint2.cpp index 749e7b89f79..cec24af87c2 100644 --- a/src/mame/drivers/sprint2.cpp +++ b/src/mame/drivers/sprint2.cpp @@ -516,13 +516,13 @@ MACHINE_CONFIG_START(sprint2_state::sprint2) SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); - MCFG_DEVICE_ADD("outlatch", F9334, 0) // at H8 - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE("discrete", discrete_device, write_line)) // also DOMINOS_ATTRACT_EN - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE("discrete", discrete_device, write_line)) // also DOMINOS_TUMBLE_EN - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE("discrete", discrete_device, write_line)) - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(OUTPUT("led0")) // START LAMP1 - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(OUTPUT("led1")) // START LAMP2 - //MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(*this, sprint2_state, sprint2_spare_w)) + F9334(config, m_outlatch); // at H8 + m_outlatch->q_out_cb<0>().set("discrete", FUNC(discrete_device::write_line)); // also DOMINOS_ATTRACT_EN + m_outlatch->q_out_cb<1>().set("discrete", FUNC(discrete_device::write_line)); // also DOMINOS_TUMBLE_EN + m_outlatch->q_out_cb<2>().set("discrete", FUNC(discrete_device::write_line)); + m_outlatch->q_out_cb<3>().set_output("led0"); // START LAMP1 + m_outlatch->q_out_cb<4>().set_output("led1"); // START LAMP2 + //m_outlatch->q_out_cb<6>().set(FUNC(sprint2_state::sprint2_spare_w)); MCFG_DEVICE_ADD("discrete", DISCRETE, sprint2_discrete) MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) @@ -559,12 +559,12 @@ MACHINE_CONFIG_START(sprint2_state::dominos) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) MACHINE_CONFIG_END -MACHINE_CONFIG_START(sprint2_state::dominos4) +void sprint2_state::dominos4(machine_config &config) +{ dominos(config); - MCFG_DEVICE_MODIFY("outlatch") - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(OUTPUT("led2")) // START LAMP3 - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(OUTPUT("led3")) // START LAMP4 -MACHINE_CONFIG_END + m_outlatch->q_out_cb<5>().set_output("led2"); // START LAMP3 + m_outlatch->q_out_cb<6>().set_output("led3"); // START LAMP4 +} ROM_START( sprint1 ) ROM_REGION( 0x10000, "maincpu", 0 ) diff --git a/src/mame/drivers/sprint4.cpp b/src/mame/drivers/sprint4.cpp index 2f3851b4586..5efaa9cfd26 100644 --- a/src/mame/drivers/sprint4.cpp +++ b/src/mame/drivers/sprint4.cpp @@ -404,15 +404,15 @@ MACHINE_CONFIG_START(sprint4_state::sprint4) SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); - MCFG_DEVICE_ADD("latch", F9334, 0) // at E11 - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(OUTPUT("led0")) // START LAMP 1 - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(OUTPUT("led1")) // START LAMP 2 - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(OUTPUT("led2")) // START LAMP 3 - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(OUTPUT("led3")) // START LAMP 4 - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE("discrete", discrete_device, write_line)) - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE("discrete", discrete_device, write_line)) - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE("discrete", discrete_device, write_line)) - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE("discrete", discrete_device, write_line)) + f9334_device &latch(F9334(config, "latch")); // at E11 + latch.q_out_cb<0>().set_output("led0"); // START LAMP 1 + latch.q_out_cb<1>().set_output("led1"); // START LAMP 2 + latch.q_out_cb<2>().set_output("led2"); // START LAMP 3 + latch.q_out_cb<3>().set_output("led3"); // START LAMP 4 + latch.q_out_cb<4>().set("discrete", FUNC(discrete_device::write_line)); + latch.q_out_cb<5>().set("discrete", FUNC(discrete_device::write_line)); + latch.q_out_cb<6>().set("discrete", FUNC(discrete_device::write_line)); + latch.q_out_cb<7>().set("discrete", FUNC(discrete_device::write_line)); MCFG_DEVICE_ADD("discrete", DISCRETE, sprint4_discrete) MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) diff --git a/src/mame/drivers/stactics.cpp b/src/mame/drivers/stactics.cpp index c85ab37b883..497d414840e 100644 --- a/src/mame/drivers/stactics.cpp +++ b/src/mame/drivers/stactics.cpp @@ -315,30 +315,30 @@ MACHINE_CONFIG_START(stactics_state::stactics) MCFG_DEVICE_PROGRAM_MAP(main_map) MCFG_DEVICE_VBLANK_INT_DRIVER("screen", stactics_state, interrupt) - MCFG_DEVICE_ADD("outlatch", LS259, 0) // 50 - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, stactics_state, coin_lockout_1_w)) // COIN REJECT 1 - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, stactics_state, coin_lockout_2_w)) // COIN REJECT 2 - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(*this, stactics_state, palette_bank_w)) // FLM COL 0 - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, stactics_state, palette_bank_w)) // FLM COL 1 - - MCFG_DEVICE_ADD("audiolatch", LS259, 0) // 58 - TODO: implement these switches - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(NOOP) // MUTE - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(NOOP) // INV. DISTANCE A - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(NOOP) // INV. DISTANCE B - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(NOOP) // UFO - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(NOOP) // INVADER - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(NOOP) // EMEGENCY (sic) - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(*this, stactics_state, motor_w)) // overlaps rocket sound - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(NOOP) // SOUND ON - - MCFG_DEVICE_ADD("lamplatch", LS259, 0) // 96 - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, stactics_state, base_lamp_w<4>)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, stactics_state, base_lamp_w<3>)) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, stactics_state, base_lamp_w<2>)) - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, stactics_state, base_lamp_w<1>)) - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(*this, stactics_state, base_lamp_w<0>)) - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE(*this, stactics_state, start_lamp_w)) - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(*this, stactics_state, barrier_lamp_w)) + LS259(config, m_outlatch); // 50 + m_outlatch->q_out_cb<0>().set(FUNC(stactics_state::coin_lockout_1_w)); // COIN REJECT 1 + m_outlatch->q_out_cb<1>().set(FUNC(stactics_state::coin_lockout_2_w)); // COIN REJECT 2 + m_outlatch->q_out_cb<6>().set(FUNC(stactics_state::palette_bank_w)); // FLM COL 0 + m_outlatch->q_out_cb<7>().set(FUNC(stactics_state::palette_bank_w)); // FLM COL 1 + + ls259_device &audiolatch(LS259(config, "audiolatch")); // 58 - TODO: implement these switches + audiolatch.q_out_cb<0>().set_nop(); // MUTE + audiolatch.q_out_cb<1>().set_nop(); // INV. DISTANCE A + audiolatch.q_out_cb<2>().set_nop(); // INV. DISTANCE B + audiolatch.q_out_cb<3>().set_nop(); // UFO + audiolatch.q_out_cb<4>().set_nop(); // INVADER + audiolatch.q_out_cb<5>().set_nop(); // EMEGENCY (sic) + audiolatch.q_out_cb<6>().set(FUNC(stactics_state::motor_w)); // overlaps rocket sound + audiolatch.q_out_cb<7>().set_nop(); // SOUND ON + + ls259_device &lamplatch(LS259(config, "lamplatch")); // 96 + lamplatch.q_out_cb<0>().set(FUNC(stactics_state::base_lamp_w<4>)); + lamplatch.q_out_cb<1>().set(FUNC(stactics_state::base_lamp_w<3>)); + lamplatch.q_out_cb<2>().set(FUNC(stactics_state::base_lamp_w<2>)); + lamplatch.q_out_cb<3>().set(FUNC(stactics_state::base_lamp_w<1>)); + lamplatch.q_out_cb<4>().set(FUNC(stactics_state::base_lamp_w<0>)); + lamplatch.q_out_cb<5>().set(FUNC(stactics_state::start_lamp_w)); + lamplatch.q_out_cb<6>().set(FUNC(stactics_state::barrier_lamp_w)); /* video hardware */ stactics_video(config); diff --git a/src/mame/drivers/starshp1.cpp b/src/mame/drivers/starshp1.cpp index 36ee9d022dc..8805ac187c9 100644 --- a/src/mame/drivers/starshp1.cpp +++ b/src/mame/drivers/starshp1.cpp @@ -302,15 +302,15 @@ MACHINE_CONFIG_START(starshp1_state::starshp1) MCFG_DEVICE_PROGRAM_MAP(starshp1_map) MCFG_DEVICE_VBLANK_INT_DRIVER("screen", starshp1_state, starshp1_interrupt) - MCFG_DEVICE_ADD("misclatch", F9334, 0) // C8 - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, starshp1_state, ship_explode_w)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, starshp1_state, circle_mod_w)) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, starshp1_state, circle_kill_w)) - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, starshp1_state, starfield_kill_w)) - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(*this, starshp1_state, inverse_w)) - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(NOOP) // BLACK HOLE, not used - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(*this, starshp1_state, mux_w)) - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, starshp1_state, led_w)) + f9334_device &misclatch(F9334(config, "misclatch")); // C8 + misclatch.q_out_cb<0>().set(FUNC(starshp1_state::ship_explode_w)); + misclatch.q_out_cb<1>().set(FUNC(starshp1_state::circle_mod_w)); + misclatch.q_out_cb<2>().set(FUNC(starshp1_state::circle_kill_w)); + misclatch.q_out_cb<3>().set(FUNC(starshp1_state::starfield_kill_w)); + misclatch.q_out_cb<4>().set(FUNC(starshp1_state::inverse_w)); + misclatch.q_out_cb<5>().set_nop(); // BLACK HOLE, not used + misclatch.q_out_cb<6>().set(FUNC(starshp1_state::mux_w)); + misclatch.q_out_cb<7>().set(FUNC(starshp1_state::led_w)); /* video hardware */ @@ -332,14 +332,14 @@ MACHINE_CONFIG_START(starshp1_state::starshp1) MCFG_DEVICE_ADD("discrete", DISCRETE, starshp1_discrete) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) - MCFG_DEVICE_ADD("audiolatch", F9334, 0) // D9 - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, starshp1_state, attract_w)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, starshp1_state, phasor_w)) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE("discrete", discrete_device, write_line)) - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE("discrete", discrete_device, write_line)) - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE("discrete", discrete_device, write_line)) - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE("discrete", discrete_device, write_line)) - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE("discrete", discrete_device, write_line)) + f9334_device &audiolatch(F9334(config, "audiolatch")); // D9 + audiolatch.q_out_cb<0>().set(FUNC(starshp1_state::attract_w)); + audiolatch.q_out_cb<1>().set(FUNC(starshp1_state::phasor_w)); + audiolatch.q_out_cb<2>().set("discrete", FUNC(discrete_device::write_line)); + audiolatch.q_out_cb<3>().set("discrete", FUNC(discrete_device::write_line)); + audiolatch.q_out_cb<4>().set("discrete", FUNC(discrete_device::write_line)); + audiolatch.q_out_cb<5>().set("discrete", FUNC(discrete_device::write_line)); + audiolatch.q_out_cb<6>().set("discrete", FUNC(discrete_device::write_line)); MACHINE_CONFIG_END diff --git a/src/mame/drivers/stuntair.cpp b/src/mame/drivers/stuntair.cpp index 408beb3f85d..09cab88127e 100644 --- a/src/mame/drivers/stuntair.cpp +++ b/src/mame/drivers/stuntair.cpp @@ -527,15 +527,15 @@ MACHINE_CONFIG_START(stuntair_state::stuntair) MCFG_DEVICE_IO_MAP(stuntair_sound_portmap) MCFG_DEVICE_PERIODIC_INT_DRIVER(stuntair_state, irq0_line_hold, 420) // drives music tempo, timing is approximate based on PCB audio recording.. and where is irq ack? - MCFG_DEVICE_ADD("mainlatch", LS259, 0) // type and location not verified - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(NOOP) // set but never cleared - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, stuntair_state, nmi_enable_w)) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(NOOP) // cleared at start - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, stuntair_state, spritebank1_w)) - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(NOOP) // cleared at start - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE(*this, stuntair_state, spritebank0_w)) - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(NOOP) // cleared at start - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(NOOP) // cleared at start + ls259_device &mainlatch(LS259(config, "mainlatch")); // type and location not verified + mainlatch.q_out_cb<0>().set_nop(); // set but never cleared + mainlatch.q_out_cb<1>().set(FUNC(stuntair_state::nmi_enable_w)); + mainlatch.q_out_cb<2>().set_nop(); // cleared at start + mainlatch.q_out_cb<3>().set(FUNC(stuntair_state::spritebank1_w)); + mainlatch.q_out_cb<4>().set_nop(); // cleared at start + mainlatch.q_out_cb<5>().set(FUNC(stuntair_state::spritebank0_w)); + mainlatch.q_out_cb<6>().set_nop(); // cleared at start + mainlatch.q_out_cb<7>().set_nop(); // cleared at start MCFG_NVRAM_ADD_0FILL("nvram") diff --git a/src/mame/drivers/sub.cpp b/src/mame/drivers/sub.cpp index 6aae529452a..5c8ccc2ce26 100644 --- a/src/mame/drivers/sub.cpp +++ b/src/mame/drivers/sub.cpp @@ -316,11 +316,11 @@ MACHINE_CONFIG_START(sub_state::sub) MCFG_DEVICE_IO_MAP(subm_sound_io) MCFG_DEVICE_PERIODIC_INT_DRIVER(sub_state, sound_irq, 120) //??? - MCFG_DEVICE_ADD("mainlatch", LS259, 0) - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, sub_state, int_mask_w)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, sub_state, flipscreen_w)) - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(NOOP) // same as Q0? - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(NOOP) + ls259_device &mainlatch(LS259(config, "mainlatch")); + mainlatch.q_out_cb<0>().set(FUNC(sub_state::int_mask_w)); + mainlatch.q_out_cb<1>().set(FUNC(sub_state::flipscreen_w)); + mainlatch.q_out_cb<3>().set_nop(); // same as Q0? + mainlatch.q_out_cb<5>().set_nop(); MCFG_WATCHDOG_ADD("watchdog") diff --git a/src/mame/drivers/sym1.cpp b/src/mame/drivers/sym1.cpp index 9b521617f56..fd7a53ae953 100644 --- a/src/mame/drivers/sym1.cpp +++ b/src/mame/drivers/sym1.cpp @@ -347,13 +347,13 @@ void sym1_state::sym1(machine_config &config) riot.pb_wr_callback().set(FUNC(sym1_state::riot_b_w)); TTL74145(config, m_ttl74145, 0); - m_ttl74145->output_line0_callback().set(FUNC(sym1_state::sym1_74145_output_0_w)); - m_ttl74145->output_line1_callback().set(FUNC(sym1_state::sym1_74145_output_1_w)); - m_ttl74145->output_line2_callback().set(FUNC(sym1_state::sym1_74145_output_2_w)); - m_ttl74145->output_line3_callback().set(FUNC(sym1_state::sym1_74145_output_3_w)); - m_ttl74145->output_line4_callback().set(FUNC(sym1_state::sym1_74145_output_4_w)); - m_ttl74145->output_line5_callback().set(FUNC(sym1_state::sym1_74145_output_5_w)); - m_ttl74145->output_line6_callback().set("speaker", FUNC(speaker_sound_device::level_w)); + m_ttl74145->output_line_callback<0>().set(FUNC(sym1_state::sym1_74145_output_0_w)); + m_ttl74145->output_line_callback<1>().set(FUNC(sym1_state::sym1_74145_output_1_w)); + m_ttl74145->output_line_callback<2>().set(FUNC(sym1_state::sym1_74145_output_2_w)); + m_ttl74145->output_line_callback<3>().set(FUNC(sym1_state::sym1_74145_output_3_w)); + m_ttl74145->output_line_callback<4>().set(FUNC(sym1_state::sym1_74145_output_4_w)); + m_ttl74145->output_line_callback<5>().set(FUNC(sym1_state::sym1_74145_output_5_w)); + m_ttl74145->output_line_callback<6>().set("speaker", FUNC(speaker_sound_device::level_w)); // lines 7-9 not connected VIA6522(config, "via1", SYM1_CLOCK).irq_handler().set("mainirq", FUNC(input_merger_device::in_w<0>)); diff --git a/src/mame/drivers/system16.cpp b/src/mame/drivers/system16.cpp index 532ba140f9f..b65582e8a86 100644 --- a/src/mame/drivers/system16.cpp +++ b/src/mame/drivers/system16.cpp @@ -2144,8 +2144,8 @@ MACHINE_CONFIG_START(segas1x_bootleg_state::datsu_2x_ym2203_msm5205) MCFG_SOUND_ROUTE(2, "mono", 0.50) MCFG_SOUND_ROUTE(3, "mono", 0.80) - MCFG_DEVICE_ADD("adpcm_select", LS157, 0) - MCFG_74157_OUT_CB(WRITE8("5205", msm5205_device, data_w)) + LS157(config, m_adpcm_select, 0); + m_adpcm_select->out_callback().set("5205", FUNC(msm5205_device::data_w)); MCFG_DEVICE_ADD("5205", MSM5205, 384000) MCFG_MSM5205_VCLK_CB(WRITELINE(*this, segas1x_bootleg_state, datsu_msm5205_callback)) diff --git a/src/mame/drivers/taito_l.cpp b/src/mame/drivers/taito_l.cpp index 23ba4ff3c05..a6d3cfc5505 100644 --- a/src/mame/drivers/taito_l.cpp +++ b/src/mame/drivers/taito_l.cpp @@ -1518,13 +1518,13 @@ MACHINE_CONFIG_START(fhawk_state::fhawk) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("ymsnd", YM2203, 12_MHz_XTAL/4) /* verified on pcb */ - MCFG_YM2203_IRQ_HANDLER(INPUTLINE("audiocpu", 0)) - MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(*this, fhawk_state, portA_w)) - MCFG_SOUND_ROUTE(0, "mono", 0.20) - MCFG_SOUND_ROUTE(1, "mono", 0.20) - MCFG_SOUND_ROUTE(2, "mono", 0.20) - MCFG_SOUND_ROUTE(3, "mono", 0.80) + ym2203_device &ymsnd(YM2203(config, "ymsnd", 12_MHz_XTAL/4)); /* verified on pcb */ + ymsnd.irq_handler().set_inputline("audiocpu", 0); + ymsnd.port_a_write_callback().set(FUNC(fhawk_state::portA_w)); + ymsnd.add_route(0, "mono", 0.20); + ymsnd.add_route(1, "mono", 0.20); + ymsnd.add_route(2, "mono", 0.20); + ymsnd.add_route(3, "mono", 0.80); MCFG_DEVICE_ADD("ciu", PC060HA, 0) MCFG_PC060HA_MASTER_CPU("slave") @@ -1593,11 +1593,11 @@ MACHINE_CONFIG_START(taitol_2cpu_state::raimais) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("ymsnd", YM2610, 8_MHz_XTAL) /* verified on pcb (8Mhz OSC is also for the 2nd z80) */ - MCFG_YM2610_IRQ_HANDLER(INPUTLINE("audiocpu", 0)) - MCFG_SOUND_ROUTE(0, "mono", 0.25) - MCFG_SOUND_ROUTE(1, "mono", 1.0) - MCFG_SOUND_ROUTE(2, "mono", 1.0) + ym2610_device &ymsnd(YM2610(config, "ymsnd", 8_MHz_XTAL)); /* verified on pcb (8Mhz OSC is also for the 2nd z80) */ + ymsnd.irq_handler().set_inputline("audiocpu", 0); + ymsnd.add_route(0, "mono", 0.25); + ymsnd.add_route(1, "mono", 1.0); + ymsnd.add_route(2, "mono", 1.0); MCFG_DEVICE_ADD("tc0140syt", TC0140SYT, 0) MCFG_TC0140SYT_MASTER_CPU("slave") @@ -1605,18 +1605,18 @@ MACHINE_CONFIG_START(taitol_2cpu_state::raimais) MACHINE_CONFIG_END -MACHINE_CONFIG_START(taitol_2cpu_state::kurikint) - +void taitol_2cpu_state::kurikint(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", Z80, XTAL(13'330'560)/2) /* verified freq on pin122 of TC0090LVC cpu */ - MCFG_DEVICE_PROGRAM_MAP(kurikint_map) - MCFG_DEVICE_IRQ_ACKNOWLEDGE_DRIVER(taitol_state, irq_callback) + Z80(config, m_main_cpu, XTAL(13'330'560)/2); /* verified freq on pin122 of TC0090LVC cpu */ + m_main_cpu->set_addrmap(AS_PROGRAM, &taitol_2cpu_state::kurikint_map); + m_main_cpu->set_irq_acknowledge_callback(FUNC(taitol_state::irq_callback)); - MCFG_DEVICE_ADD("audiocpu", Z80, 12_MHz_XTAL/3) /* verified on pcb */ - MCFG_DEVICE_PROGRAM_MAP(kurikint_2_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", taitol_state, irq0_line_hold) + Z80(config, m_audio_cpu, 12_MHz_XTAL/3); /* verified on pcb */ + m_audio_cpu->set_addrmap(AS_PROGRAM, &taitol_2cpu_state::kurikint_2_map); + m_audio_cpu->set_vblank_int("screen", FUNC(taitol_state::irq0_line_hold)); - MCFG_QUANTUM_TIME(attotime::from_hz(6000)) + config.m_minimum_quantum = attotime::from_hz(6000); tc0040ioc_device &tc0040ioc(TC0040IOC(config, "tc0040ioc", 0)); tc0040ioc.read_0_callback().set_ioport("DSWA"); @@ -1637,20 +1637,30 @@ MACHINE_CONFIG_START(taitol_2cpu_state::kurikint) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("ymsnd", YM2203, 12_MHz_XTAL/4) /* verified on pcb */ - MCFG_SOUND_ROUTE(0, "mono", 0.20) - MCFG_SOUND_ROUTE(1, "mono", 0.20) - MCFG_SOUND_ROUTE(2, "mono", 0.20) - MCFG_SOUND_ROUTE(3, "mono", 0.80) -MACHINE_CONFIG_END + ym2203_device &ymsnd(YM2203(config, "ymsnd", 12_MHz_XTAL/4)); /* verified on pcb */ + ymsnd.add_route(0, "mono", 0.20); + ymsnd.add_route(1, "mono", 0.20); + ymsnd.add_route(2, "mono", 0.20); + ymsnd.add_route(3, "mono", 0.80); +} +void taitol_1cpu_state::add_muxes(machine_config &config) +{ + LS157_X2(config, m_mux[0], 0); + m_mux[0]->a_in_callback().set_ioport("DSWA"); + m_mux[0]->b_in_callback().set_ioport("DSWB"); -MACHINE_CONFIG_START(taitol_1cpu_state::plotting) + LS157_X2(config, m_mux[1], 0); + m_mux[1]->a_in_callback().set_ioport("IN0"); + m_mux[1]->b_in_callback().set_ioport("IN1"); +} +void taitol_1cpu_state::base(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", Z80, XTAL(13'330'560)/2) /* verified freq on pin122 of TC0090LVC cpu */ - MCFG_DEVICE_PROGRAM_MAP(plotting_map) - MCFG_DEVICE_IRQ_ACKNOWLEDGE_DRIVER(taitol_state, irq_callback) + Z80(config, m_main_cpu, XTAL(13'330'560)/2); /* verified freq on pin122 of TC0090LVC cpu */ + m_main_cpu->set_addrmap(AS_PROGRAM, &taitol_1cpu_state::plotting_map); + m_main_cpu->set_irq_acknowledge_callback(FUNC(taitol_state::irq_callback)); MCFG_MACHINE_START_OVERRIDE(taitol_state, taito_l) MCFG_MACHINE_RESET_OVERRIDE(taitol_state, taito_l) @@ -1661,96 +1671,82 @@ MACHINE_CONFIG_START(taitol_1cpu_state::plotting) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("ymsnd", YM2203, XTAL(13'330'560)/4) /* verified on pcb */ - MCFG_AY8910_PORT_A_READ_CB(READ8("dswmux", ls157_x2_device, output_r)) - MCFG_AY8910_PORT_B_READ_CB(READ8("inmux", ls157_x2_device, output_r)) - MCFG_SOUND_ROUTE(0, "mono", 0.20) - MCFG_SOUND_ROUTE(1, "mono", 0.20) - MCFG_SOUND_ROUTE(2, "mono", 0.20) - MCFG_SOUND_ROUTE(3, "mono", 0.80) - - MCFG_DEVICE_ADD("dswmux", LS157_X2, 0) - MCFG_74157_A_IN_CB(IOPORT("DSWA")) - MCFG_74157_B_IN_CB(IOPORT("DSWB")) - - MCFG_DEVICE_ADD("inmux", LS157_X2, 0) - MCFG_74157_A_IN_CB(IOPORT("IN0")) - MCFG_74157_B_IN_CB(IOPORT("IN1")) -MACHINE_CONFIG_END - - -MACHINE_CONFIG_START(taitol_1cpu_state::puzznic) - plotting(config); - - /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(puzznic_map) + YM2203(config, m_ymsnd, XTAL(13'330'560)/4); /* verified on pcb */ + m_ymsnd->port_a_read_callback().set("dswmux", FUNC(ls157_x2_device::output_r)); + m_ymsnd->port_b_read_callback().set("inmux", FUNC(ls157_x2_device::output_r)); + m_ymsnd->add_route(0, "mono", 0.20); + m_ymsnd->add_route(1, "mono", 0.20); + m_ymsnd->add_route(2, "mono", 0.20); + m_ymsnd->add_route(3, "mono", 0.80); +} - MCFG_DEVICE_ADD("mcu", ARKANOID_68705P3, 3_MHz_XTAL) -MACHINE_CONFIG_END +void taitol_1cpu_state::plotting(machine_config &config) +{ + base(config); + add_muxes(config); +} -MACHINE_CONFIG_START(taitol_1cpu_state::puzznici) - plotting(config); +void taitol_1cpu_state::puzznic(machine_config &config) +{ + base(config); + add_muxes(config); + m_main_cpu->set_addrmap(AS_PROGRAM, &taitol_1cpu_state::puzznic_map); - /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(puzznici_map) -MACHINE_CONFIG_END + ARKANOID_68705P3(config, "mcu", 3_MHz_XTAL); +} +void taitol_1cpu_state::puzznici(machine_config &config) +{ + base(config); + add_muxes(config); + m_main_cpu->set_addrmap(AS_PROGRAM, &taitol_1cpu_state::puzznici_map); +} -MACHINE_CONFIG_START(horshoes_state::horshoes) - plotting(config); +void horshoes_state::horshoes(machine_config &config) +{ + base(config); + add_muxes(config); - /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(horshoes_map) + m_main_cpu->set_addrmap(AS_PROGRAM, &horshoes_state::horshoes_map); - MCFG_DEVICE_ADD("upd4701", UPD4701A, 0) - MCFG_UPD4701_PORTX("AN0") - MCFG_UPD4701_PORTY("AN1") -MACHINE_CONFIG_END + UPD4701A(config, m_upd4701, 0); + m_upd4701->set_portx_tag("AN0"); + m_upd4701->set_portx_tag("AN1"); +} -MACHINE_CONFIG_START(taitol_1cpu_state::palamed) +void taitol_1cpu_state::palamed(machine_config &config) +{ plotting(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(palamed_map) - - MCFG_DEVICE_ADD("ppi", I8255, 0) // Toshiba TMP8255AP-5 - MCFG_I8255_IN_PORTA_CB(IOPORT("IN0")) - MCFG_I8255_IN_PORTB_CB(IOPORT("IN1")) - MCFG_I8255_IN_PORTC_CB(IOPORT("IN2")) + m_main_cpu->set_addrmap(AS_PROGRAM, &taitol_1cpu_state::palamed_map); - MCFG_DEVICE_MODIFY("ymsnd") - MCFG_AY8910_PORT_A_READ_CB(IOPORT("DSWA")) - MCFG_AY8910_PORT_B_READ_CB(IOPORT("DSWB")) + i8255_device &ppi(I8255(config, "ppi", 0)); // Toshiba TMP8255AP-5 + ppi.in_pa_callback().set_ioport("IN0"); + ppi.in_pb_callback().set_ioport("IN1"); + ppi.in_pc_callback().set_ioport("IN2"); - MCFG_DEVICE_REMOVE("dswmux") - MCFG_DEVICE_REMOVE("inmux") -MACHINE_CONFIG_END + m_ymsnd->port_a_read_callback().set_ioport("DSWA"); + m_ymsnd->port_b_read_callback().set_ioport("DSWB"); +} -MACHINE_CONFIG_START(taitol_1cpu_state::cachat) +void taitol_1cpu_state::cachat(machine_config &config) +{ plotting(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(cachat_map) - - MCFG_DEVICE_ADD("ppi", I8255, 0) // NEC D70155C - MCFG_I8255_IN_PORTA_CB(IOPORT("IN0")) - MCFG_I8255_IN_PORTB_CB(IOPORT("IN1")) - MCFG_I8255_IN_PORTC_CB(IOPORT("IN2")) + m_main_cpu->set_addrmap(AS_PROGRAM, &taitol_1cpu_state::cachat_map); - MCFG_DEVICE_MODIFY("ymsnd") - MCFG_AY8910_PORT_A_READ_CB(IOPORT("DSWA")) - MCFG_AY8910_PORT_B_READ_CB(IOPORT("DSWB")) + i8255_device &ppi(I8255(config, "ppi", 0)); // NEC D70155C + ppi.in_pa_callback().set_ioport("IN0"); + ppi.in_pb_callback().set_ioport("IN1"); + ppi.in_pc_callback().set_ioport("IN2"); - MCFG_DEVICE_REMOVE("dswmux") - MCFG_DEVICE_REMOVE("inmux") -MACHINE_CONFIG_END + m_ymsnd->port_a_read_callback().set_ioport("DSWA"); + m_ymsnd->port_b_read_callback().set_ioport("DSWB"); +} MACHINE_CONFIG_START(taitol_2cpu_state::evilston) @@ -1785,11 +1781,11 @@ MACHINE_CONFIG_START(taitol_2cpu_state::evilston) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("ymsnd", YM2203, 12_MHz_XTAL/4) /* not verified */ - MCFG_SOUND_ROUTE(0, "mono", 0.25) - MCFG_SOUND_ROUTE(1, "mono", 0.25) - MCFG_SOUND_ROUTE(2, "mono", 0.25) - MCFG_SOUND_ROUTE(3, "mono", 0.80) + ym2203_device &ymsnd(YM2203(config, "ymsnd", 12_MHz_XTAL/4)); /* not verified */ + ymsnd.add_route(0, "mono", 0.25); + ymsnd.add_route(1, "mono", 0.25); + ymsnd.add_route(2, "mono", 0.25); + ymsnd.add_route(3, "mono", 0.80); MACHINE_CONFIG_END diff --git a/src/mame/drivers/tankbatt.cpp b/src/mame/drivers/tankbatt.cpp index 7e161152288..eeb4e9d83c1 100644 --- a/src/mame/drivers/tankbatt.cpp +++ b/src/mame/drivers/tankbatt.cpp @@ -276,20 +276,20 @@ MACHINE_CONFIG_START(tankbatt_state::tankbatt) MCFG_DEVICE_PROGRAM_MAP(main_map) MCFG_DEVICE_VBLANK_INT_DRIVER("screen", tankbatt_state, interrupt) - MCFG_DEVICE_ADD("mainlatch", CD4099, 0) // latches at 4H and 5H (are the empty 4J and 5J locations for LS259 substitution?) - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(NOOP) //coin counter mirror? - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, tankbatt_state, interrupt_enable_w)) - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, tankbatt_state, sh_engine_w)) - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(*this, tankbatt_state, sh_fire_w)) - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE(*this, tankbatt_state, sh_expl_w)) // bit 7 also set by ASL instruction - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(NOOP) // bit 7 also set by ASL instruction - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, tankbatt_state, demo_interrupt_enable_w)) - - MCFG_DEVICE_ADD("outlatch", CD4099, 0) - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(OUTPUT("led0")) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(OUTPUT("led1")) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, tankbatt_state, coincounter_w)) - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, tankbatt_state, coinlockout_w)) + cd4099_device &mainlatch(CD4099(config, "mainlatch")); // latches at 4H and 5H (are the empty 4J and 5J locations for LS259 substitution?) + mainlatch.q_out_cb<0>().set_nop(); //coin counter mirror? + mainlatch.q_out_cb<2>().set(FUNC(tankbatt_state::interrupt_enable_w)); + mainlatch.q_out_cb<3>().set(FUNC(tankbatt_state::sh_engine_w)); + mainlatch.q_out_cb<4>().set(FUNC(tankbatt_state::sh_fire_w)); + mainlatch.q_out_cb<5>().set(FUNC(tankbatt_state::sh_expl_w)); // bit 7 also set by ASL instruction + mainlatch.q_out_cb<6>().set_nop(); // bit 7 also set by ASL instruction + mainlatch.q_out_cb<7>().set(FUNC(tankbatt_state::demo_interrupt_enable_w)); + + cd4099_device &outlatch(CD4099(config, "outlatch")); + outlatch.q_out_cb<0>().set_output("led0"); + outlatch.q_out_cb<1>().set_output("led1"); + outlatch.q_out_cb<2>().set(FUNC(tankbatt_state::coincounter_w)); + outlatch.q_out_cb<3>().set(FUNC(tankbatt_state::coinlockout_w)); /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) diff --git a/src/mame/drivers/targeth.cpp b/src/mame/drivers/targeth.cpp index 8988f0adeea..a729d863f2a 100644 --- a/src/mame/drivers/targeth.cpp +++ b/src/mame/drivers/targeth.cpp @@ -281,9 +281,9 @@ MACHINE_CONFIG_START(targeth_state::targeth) MCFG_DEVICE_ADD("gaelco_ds5002fp", GAELCO_DS5002FP, XTAL(24'000'000) / 2) MCFG_DEVICE_ADDRESS_MAP(0, mcu_hostmem_map) - MCFG_DEVICE_ADD("outlatch", LS259, 0) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, targeth_state, coin1_counter_w)) - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, targeth_state, coin2_counter_w)) + LS259(config, m_outlatch); + m_outlatch->q_out_cb<2>().set(FUNC(targeth_state::coin1_counter_w)); + m_outlatch->q_out_cb<3>().set(FUNC(targeth_state::coin2_counter_w)); /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) diff --git a/src/mame/drivers/thepit.cpp b/src/mame/drivers/thepit.cpp index d419c1266ba..8e3f6091b47 100644 --- a/src/mame/drivers/thepit.cpp +++ b/src/mame/drivers/thepit.cpp @@ -156,7 +156,6 @@ Player 2 and Player 1 share the same controls ! #include "includes/thepit.h" #include "cpu/z80/z80.h" -#include "machine/74259.h" #include "machine/gen_latch.h" #include "machine/watchdog.h" #include "sound/ay8910.h" @@ -218,7 +217,7 @@ void thepit_state::thepit_main_map(address_map &map) map(0xa000, 0xa000).r(FUNC(thepit_state::input_port_0_r)).nopw(); // Not hooked up according to the schematics map(0xa800, 0xa800).portr("IN1"); map(0xb000, 0xb000).portr("DSW"); - map(0xb000, 0xb007).w("mainlatch", FUNC(ls259_device::write_d0)); + map(0xb000, 0xb007).w(m_mainlatch, FUNC(ls259_device::write_d0)); map(0xb800, 0xb800).r("watchdog", FUNC(watchdog_timer_device::reset_r)).w("soundlatch", FUNC(generic_latch_8_device::write)); } @@ -234,7 +233,7 @@ void thepit_state::desertdan_main_map(address_map &map) map(0xa000, 0xa000).r(FUNC(thepit_state::input_port_0_r)).nopw(); // Not hooked up according to the schematics map(0xa800, 0xa800).portr("IN1"); map(0xb000, 0xb000).portr("DSW"); - map(0xb000, 0xb007).w("mainlatch", FUNC(ls259_device::write_d0)); + map(0xb000, 0xb007).w(m_mainlatch, FUNC(ls259_device::write_d0)); map(0xb800, 0xb800).r("watchdog", FUNC(watchdog_timer_device::reset_r)).w("soundlatch", FUNC(generic_latch_8_device::write)); } @@ -251,7 +250,7 @@ void thepit_state::intrepid_main_map(address_map &map) map(0xa000, 0xa000).r(FUNC(thepit_state::input_port_0_r)); map(0xa800, 0xa800).portr("IN1"); map(0xb000, 0xb000).portr("DSW"); - map(0xb000, 0xb007).w("mainlatch", FUNC(ls259_device::write_d0)); + map(0xb000, 0xb007).w(m_mainlatch, FUNC(ls259_device::write_d0)); map(0xb800, 0xb800).r("watchdog", FUNC(watchdog_timer_device::reset_r)).w("soundlatch", FUNC(generic_latch_8_device::write)); } @@ -728,12 +727,12 @@ MACHINE_CONFIG_START(thepit_state::thepit) MCFG_DEVICE_IO_MAP(audio_io_map) MCFG_DEVICE_VBLANK_INT_DRIVER("screen", thepit_state, irq0_line_hold) - MCFG_DEVICE_ADD("mainlatch", LS259, 0) // IC42 - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, thepit_state, nmi_mask_w)) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(NOOP) // marked "LOCK OUT" on Centuri schematic but never written - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, thepit_state, sound_enable_w)) - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(*this, thepit_state, flip_screen_x_w)) - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, thepit_state, flip_screen_y_w)) + LS259(config, m_mainlatch); // IC42 + m_mainlatch->q_out_cb<0>().set(FUNC(thepit_state::nmi_mask_w)); + m_mainlatch->q_out_cb<2>().set_nop(); // marked "LOCK OUT" on Centuri schematic but never written + m_mainlatch->q_out_cb<3>().set(FUNC(thepit_state::sound_enable_w)); + m_mainlatch->q_out_cb<6>().set(FUNC(thepit_state::flip_screen_x_w)); + m_mainlatch->q_out_cb<7>().set(FUNC(thepit_state::flip_screen_y_w)); MCFG_WATCHDOG_ADD("watchdog") @@ -760,11 +759,11 @@ MACHINE_CONFIG_START(thepit_state::thepit) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) MACHINE_CONFIG_END -MACHINE_CONFIG_START(thepit_state::fitter) +void thepit_state::fitter(machine_config &config) +{ thepit(config); - MCFG_DEVICE_MODIFY("mainlatch") // IC42 - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, thepit_state, coin_lockout_w)) -MACHINE_CONFIG_END + m_mainlatch->q_out_cb<2>().set(FUNC(thepit_state::coin_lockout_w)); +} MACHINE_CONFIG_START(thepit_state::desertdn) fitter(config); @@ -787,8 +786,7 @@ MACHINE_CONFIG_START(thepit_state::intrepid) MCFG_DEVICE_MODIFY("maincpu") MCFG_DEVICE_PROGRAM_MAP(intrepid_main_map) - MCFG_DEVICE_MODIFY("mainlatch") // 2F on Funny Mouse main board; IC46 on Port Man main board - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE(*this, thepit_state, intrepid_graphics_bank_w)) + m_mainlatch->q_out_cb<5>().set(FUNC(thepit_state::intrepid_graphics_bank_w)); /* video hardware */ MCFG_GFXDECODE_MODIFY("gfxdecode", gfx_intrepid) diff --git a/src/mame/drivers/thoop2.cpp b/src/mame/drivers/thoop2.cpp index 3207c88a6ab..8835d482c21 100644 --- a/src/mame/drivers/thoop2.cpp +++ b/src/mame/drivers/thoop2.cpp @@ -275,13 +275,13 @@ MACHINE_CONFIG_START(thoop2_state::thoop2) MCFG_DEVICE_ADD("gaelco_ds5002fp", GAELCO_DS5002FP, XTAL(24'000'000) / 2) // 12MHz verified MCFG_DEVICE_ADDRESS_MAP(0, mcu_hostmem_map) - MCFG_DEVICE_ADD("outlatch", LS259, 0) - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, thoop2_state, coin1_lockout_w)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, thoop2_state, coin2_lockout_w)) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, thoop2_state, coin1_counter_w)) - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, thoop2_state, coin2_counter_w)) - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(NOOP) // unknown. Sound related? - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(NOOP) // unknown + LS259(config, m_outlatch); + m_outlatch->q_out_cb<0>().set(FUNC(thoop2_state::coin1_lockout_w)); + m_outlatch->q_out_cb<1>().set(FUNC(thoop2_state::coin2_lockout_w)); + m_outlatch->q_out_cb<2>().set(FUNC(thoop2_state::coin1_counter_w)); + m_outlatch->q_out_cb<3>().set(FUNC(thoop2_state::coin2_counter_w)); + m_outlatch->q_out_cb<4>().set_nop(); // unknown. Sound related? + m_outlatch->q_out_cb<5>().set_nop(); // unknown MCFG_WATCHDOG_ADD("watchdog") diff --git a/src/mame/drivers/timeplt.cpp b/src/mame/drivers/timeplt.cpp index d8babbc723e..62e53dbcdd5 100644 --- a/src/mame/drivers/timeplt.cpp +++ b/src/mame/drivers/timeplt.cpp @@ -431,15 +431,15 @@ MACHINE_CONFIG_START(timeplt_state::timeplt) MCFG_DEVICE_ADD("maincpu", Z80, MASTER_CLOCK/3/2) /* not confirmed, but common for Konami games of the era */ MCFG_DEVICE_PROGRAM_MAP(timeplt_main_map) - MCFG_DEVICE_ADD("mainlatch", LS259, 0) // B3 - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, timeplt_state, nmi_enable_w)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, timeplt_state, flipscreen_w)) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE("timeplt_audio", timeplt_audio_device, sh_irqtrigger_w)) - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE("timeplt_audio", timeplt_audio_device, mute_w)) - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(*this, timeplt_state, video_enable_w)) - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE(*this, timeplt_state, coin_counter_1_w)) - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(*this, timeplt_state, coin_counter_2_w)) - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(NOOP) // PAY OUT - not used + LS259(config, m_mainlatch); // B3 + m_mainlatch->q_out_cb<0>().set(FUNC(timeplt_state::nmi_enable_w)); + m_mainlatch->q_out_cb<1>().set(FUNC(timeplt_state::flipscreen_w)); + m_mainlatch->q_out_cb<2>().set("timeplt_audio", FUNC(timeplt_audio_device::sh_irqtrigger_w)); + m_mainlatch->q_out_cb<3>().set("timeplt_audio", FUNC(timeplt_audio_device::mute_w)); + m_mainlatch->q_out_cb<4>().set(FUNC(timeplt_state::video_enable_w)); + m_mainlatch->q_out_cb<5>().set(FUNC(timeplt_state::coin_counter_1_w)); + m_mainlatch->q_out_cb<6>().set(FUNC(timeplt_state::coin_counter_2_w)); + m_mainlatch->q_out_cb<7>().set_nop(); // PAY OUT - not used MCFG_WATCHDOG_ADD("watchdog") @@ -473,11 +473,10 @@ MACHINE_CONFIG_START(timeplt_state::psurge) MCFG_DEVICE_MODIFY("screen") MCFG_SCREEN_VBLANK_CALLBACK(INPUTLINE("maincpu", INPUT_LINE_NMI)) - MCFG_DEVICE_MODIFY("mainlatch") - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(NOOP) - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(NOOP) - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(NOOP) - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(NOOP) + m_mainlatch->q_out_cb<0>().set_nop(); + m_mainlatch->q_out_cb<4>().set_nop(); + m_mainlatch->q_out_cb<5>().set_nop(); + m_mainlatch->q_out_cb<6>().set_nop(); MCFG_VIDEO_START_OVERRIDE(timeplt_state,psurge) MACHINE_CONFIG_END diff --git a/src/mame/drivers/toaplan1.cpp b/src/mame/drivers/toaplan1.cpp index bd70faecd6b..5a25300c79e 100644 --- a/src/mame/drivers/toaplan1.cpp +++ b/src/mame/drivers/toaplan1.cpp @@ -1920,11 +1920,11 @@ MACHINE_CONFIG_START(toaplan1_rallybik_state::rallybik) MCFG_QUANTUM_TIME(attotime::from_hz(600)) - MCFG_DEVICE_ADD("coinlatch", LS259, 0) // 19L - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(*this, toaplan1_rallybik_state, coin_counter_1_w)) - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE(*this, toaplan1_rallybik_state, coin_counter_2_w)) - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(*this, toaplan1_rallybik_state, coin_lockout_1_w)) - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, toaplan1_rallybik_state, coin_lockout_2_w)) + ls259_device &coinlatch(LS259(config, "coinlatch")); // 19L + coinlatch.q_out_cb<4>().set(FUNC(toaplan1_rallybik_state::coin_counter_1_w)); + coinlatch.q_out_cb<5>().set(FUNC(toaplan1_rallybik_state::coin_counter_2_w)); + coinlatch.q_out_cb<6>().set(FUNC(toaplan1_rallybik_state::coin_lockout_1_w)); + coinlatch.q_out_cb<7>().set(FUNC(toaplan1_rallybik_state::coin_lockout_2_w)); MCFG_MACHINE_RESET_OVERRIDE(toaplan1_state,toaplan1) diff --git a/src/mame/drivers/tp84.cpp b/src/mame/drivers/tp84.cpp index efd400c41b8..76f43e8f3e6 100644 --- a/src/mame/drivers/tp84.cpp +++ b/src/mame/drivers/tp84.cpp @@ -344,12 +344,12 @@ MACHINE_CONFIG_START(tp84_state::tp84) MCFG_QUANTUM_TIME(attotime::from_hz(6000)) /* 100 CPU slices per frame - an high value to ensure proper */ /* synchronization of the CPUs */ - MCFG_DEVICE_ADD("mainlatch", LS259, 0) // 3B - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, tp84_state, irq_enable_w)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, tp84_state, coin_counter_2_w)) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, tp84_state, coin_counter_1_w)) - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(*this, tp84_state, flip_screen_x_w)) - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE(*this, tp84_state, flip_screen_y_w)) + ls259_device &mainlatch(LS259(config, "mainlatch", 0)); // 3B + mainlatch.q_out_cb<0>().set(FUNC(tp84_state::irq_enable_w)); + mainlatch.q_out_cb<1>().set(FUNC(tp84_state::coin_counter_2_w)); + mainlatch.q_out_cb<2>().set(FUNC(tp84_state::coin_counter_1_w)); + mainlatch.q_out_cb<4>().set(FUNC(tp84_state::flip_screen_x_w)); + mainlatch.q_out_cb<5>().set(FUNC(tp84_state::flip_screen_y_w)); MCFG_WATCHDOG_ADD("watchdog") diff --git a/src/mame/drivers/trackfld.cpp b/src/mame/drivers/trackfld.cpp index a9a9b752b30..230ea47a91c 100644 --- a/src/mame/drivers/trackfld.cpp +++ b/src/mame/drivers/trackfld.cpp @@ -188,7 +188,6 @@ MAIN BOARD: #include "cpu/z80/z80.h" #include "cpu/m6800/m6800.h" #include "cpu/m6809/m6809.h" -#include "machine/74259.h" #include "machine/konami1.h" #include "machine/nvram.h" #include "machine/watchdog.h" @@ -233,7 +232,7 @@ WRITE_LINE_MEMBER(trackfld_state::irq_mask_w) void trackfld_state::main_map(address_map &map) { map(0x1000, 0x1000).mirror(0x007f).w("watchdog", FUNC(watchdog_timer_device::reset_w)); /* AFE */ - map(0x1080, 0x1087).mirror(0x0078).w("mainlatch", FUNC(ls259_device::write_d0)); + map(0x1080, 0x1087).mirror(0x0078).w(m_mainlatch, FUNC(ls259_device::write_d0)); map(0x1100, 0x1100).mirror(0x007f).w("soundlatch", FUNC(generic_latch_8_device::write)); /* 32 */ map(0x1200, 0x1200).mirror(0x007f).portr("DSW2"); map(0x1280, 0x1280).mirror(0x007c).portr("SYSTEM"); @@ -283,7 +282,7 @@ void trackfld_state::yieartf_map(address_map &map) map(0x0002, 0x0002).w(FUNC(trackfld_state::trackfld_VLM5030_control_w)); map(0x0003, 0x0003).w(m_vlm, FUNC(vlm5030_device::data_w)); map(0x1000, 0x1000).mirror(0x007f).w("watchdog", FUNC(watchdog_timer_device::reset_w)); /* AFE */ - map(0x1080, 0x1087).mirror(0x0078).w("mainlatch", FUNC(ls259_device::write_d0)); + map(0x1080, 0x1087).mirror(0x0078).w(m_mainlatch, FUNC(ls259_device::write_d0)); // AM_RANGE(0x1100, 0x1100) AM_MIRROR(0x007f) AM_DEVWRITE("soundlatch", generic_latch_8_device, write) /* 32 */ map(0x1200, 0x1200).mirror(0x007f).portr("DSW2"); map(0x1280, 0x1280).mirror(0x007c).portr("SYSTEM"); @@ -308,7 +307,7 @@ void trackfld_state::reaktor_map(address_map &map) map(0x0000, 0x7fff).rom(); /* all usual addresses +0x8000 */ map(0x9000, 0x9000).w("watchdog", FUNC(watchdog_timer_device::reset_w)); - map(0x9080, 0x9087).w("mainlatch", FUNC(ls259_device::write_d0)); + map(0x9080, 0x9087).w(m_mainlatch, FUNC(ls259_device::write_d0)); map(0x9100, 0x9100).w("soundlatch", FUNC(generic_latch_8_device::write)); map(0x9200, 0x9200).portr("DSW2"); map(0x9280, 0x9280).portr("SYSTEM"); @@ -340,7 +339,7 @@ void trackfld_state::reaktor_io_map(address_map &map) void trackfld_state::mastkin_map(address_map &map) { map(0x1000, 0x1000).w("watchdog", FUNC(watchdog_timer_device::reset_w)); - map(0x10b0, 0x10b7).nopr().w("mainlatch", FUNC(ls259_device::write_d0)); + map(0x10b0, 0x10b7).nopr().w(m_mainlatch, FUNC(ls259_device::write_d0)); map(0x1100, 0x1100).w("soundlatch", FUNC(generic_latch_8_device::write)); map(0x1200, 0x1200).portr("DSW2"); map(0x1280, 0x1280).portr("SYSTEM"); @@ -365,7 +364,7 @@ void trackfld_state::wizzquiz_map(address_map &map) { map(0x0000, 0x007f).ram(); map(0x1000, 0x1000).rw("watchdog", FUNC(watchdog_timer_device::reset_r), FUNC(watchdog_timer_device::reset_w)); - map(0x1080, 0x1087).w("mainlatch", FUNC(ls259_device::write_d0)); + map(0x1080, 0x1087).w(m_mainlatch, FUNC(ls259_device::write_d0)); map(0x1100, 0x1100).w("soundlatch", FUNC(generic_latch_8_device::write)); map(0x1200, 0x1200).portr("DSW2"); map(0x1280, 0x1280).portr("SYSTEM"); @@ -908,15 +907,15 @@ MACHINE_CONFIG_START(trackfld_state::trackfld) MCFG_MACHINE_START_OVERRIDE(trackfld_state,trackfld) MCFG_MACHINE_RESET_OVERRIDE(trackfld_state,trackfld) - MCFG_DEVICE_ADD("mainlatch", LS259, 0) // 1D - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, trackfld_state, flipscreen_w)) // FLIP - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE("trackfld_audio", trackfld_audio_device, sh_irqtrigger_w)) // 26 = SOUND ON - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(NOOP) // 25 = MUT? - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, trackfld_state, coin_counter_1_w)) // 24 = OUT1 - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(*this, trackfld_state, coin_counter_2_w)) // 23 = OUT2 - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(NOOP) // CN3.2 - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(NOOP) // CN3.4 - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, trackfld_state, irq_mask_w)) // INT + LS259(config, m_mainlatch); // 1D + m_mainlatch->q_out_cb<0>().set(FUNC(trackfld_state::flipscreen_w)); // FLIP + m_mainlatch->q_out_cb<1>().set("trackfld_audio", FUNC(trackfld_audio_device::sh_irqtrigger_w)); // 26 = SOUND ON + m_mainlatch->q_out_cb<2>().set_nop(); // 25 = MUT? + m_mainlatch->q_out_cb<3>().set(FUNC(trackfld_state::coin_counter_1_w)); // 24 = OUT1 + m_mainlatch->q_out_cb<4>().set(FUNC(trackfld_state::coin_counter_2_w)); // 23 = OUT2 + m_mainlatch->q_out_cb<5>().set_nop(); // CN3.2 + m_mainlatch->q_out_cb<6>().set_nop(); // CN3.4 + m_mainlatch->q_out_cb<7>().set(FUNC(trackfld_state::irq_mask_w)); // INT MCFG_NVRAM_ADD_0FILL("nvram") @@ -984,15 +983,15 @@ MACHINE_CONFIG_START(trackfld_state::yieartf) MCFG_MACHINE_START_OVERRIDE(trackfld_state,trackfld) MCFG_MACHINE_RESET_OVERRIDE(trackfld_state,trackfld) - MCFG_DEVICE_ADD("mainlatch", LS259, 0) - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, trackfld_state, flipscreen_w)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE("trackfld_audio", trackfld_audio_device, sh_irqtrigger_w)) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, trackfld_state, nmi_mask_w)) - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, trackfld_state, coin_counter_1_w)) - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(*this, trackfld_state, coin_counter_2_w)) - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(NOOP) - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(NOOP) - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, trackfld_state, irq_mask_w)) + ls259_device &mainlatch(LS259(config, "mainlatch")); // 1D + mainlatch.q_out_cb<0>().set(FUNC(trackfld_state::flipscreen_w)); + mainlatch.q_out_cb<1>().set("trackfld_audio", FUNC(trackfld_audio_device::sh_irqtrigger_w)); + mainlatch.q_out_cb<2>().set(FUNC(trackfld_state::nmi_mask_w)); + mainlatch.q_out_cb<3>().set(FUNC(trackfld_state::coin_counter_1_w)); + mainlatch.q_out_cb<4>().set(FUNC(trackfld_state::coin_counter_2_w)); + mainlatch.q_out_cb<5>().set_nop(); + mainlatch.q_out_cb<6>().set_nop(); + mainlatch.q_out_cb<7>().set(FUNC(trackfld_state::irq_mask_w)); MCFG_NVRAM_ADD_0FILL("nvram") @@ -1095,9 +1094,8 @@ MACHINE_CONFIG_START(trackfld_state::mastkin) MCFG_DEVICE_REPLACE(m_maincpu, MC6809E, MASTER_CLOCK/6/2) /* a guess for now */ MCFG_DEVICE_PROGRAM_MAP(mastkin_map) - MCFG_DEVICE_MODIFY("mainlatch") - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(NOOP) // actually not used - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(NOOP) // actually not used + m_mainlatch->q_out_cb<3>().set_nop(); // actually not used + m_mainlatch->q_out_cb<4>().set_nop(); // actually not used MACHINE_CONFIG_END MACHINE_CONFIG_START(trackfld_state::wizzquiz) @@ -1110,8 +1108,7 @@ MACHINE_CONFIG_START(trackfld_state::wizzquiz) m_screen->set_screen_vblank(DEVCB_WRITELINE(*this, trackfld_state, vblank_nmi)); - MCFG_DEVICE_MODIFY("mainlatch") - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, trackfld_state, nmi_mask_w)) + m_mainlatch->q_out_cb<7>().set(FUNC(trackfld_state::nmi_mask_w)); MACHINE_CONFIG_END MACHINE_CONFIG_START(trackfld_state::reaktor) diff --git a/src/mame/drivers/tsamurai.cpp b/src/mame/drivers/tsamurai.cpp index 96fedf0651e..9caeb6e83e8 100644 --- a/src/mame/drivers/tsamurai.cpp +++ b/src/mame/drivers/tsamurai.cpp @@ -732,12 +732,12 @@ MACHINE_CONFIG_START(tsamurai_state::tsamurai) MCFG_MACHINE_START_OVERRIDE(tsamurai_state,tsamurai) - MCFG_DEVICE_ADD("mainlatch", LS259, 0) - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, tsamurai_state, flip_screen_w)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, tsamurai_state, nmi_enable_w)) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, tsamurai_state, textbank1_w)) - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, tsamurai_state, coin1_counter_w)) - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(*this, tsamurai_state, coin2_counter_w)) + ls259_device &mainlatch(LS259(config, "mainlatch")); + mainlatch.q_out_cb<0>().set(FUNC(tsamurai_state::flip_screen_w)); + mainlatch.q_out_cb<1>().set(FUNC(tsamurai_state::nmi_enable_w)); + mainlatch.q_out_cb<2>().set(FUNC(tsamurai_state::textbank1_w)); + mainlatch.q_out_cb<3>().set(FUNC(tsamurai_state::coin1_counter_w)); + mainlatch.q_out_cb<4>().set(FUNC(tsamurai_state::coin2_counter_w)); /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) @@ -780,12 +780,12 @@ MACHINE_CONFIG_START(tsamurai_state::vsgongf) MCFG_MACHINE_START_OVERRIDE(tsamurai_state,vsgongf) - MCFG_DEVICE_ADD("mainlatch", LS259, 0) // 4L - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(NOOP) // vreg? always 0 - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, tsamurai_state, nmi_enable_w)) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, tsamurai_state, coin1_counter_w)) - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, tsamurai_state, coin2_counter_w)) - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(*this, tsamurai_state, textbank1_w)) + ls259_device &mainlatch(LS259(config, "mainlatch")); // 4L + mainlatch.q_out_cb<0>().set_nop(); // vreg? always 0 + mainlatch.q_out_cb<1>().set(FUNC(tsamurai_state::nmi_enable_w)); + mainlatch.q_out_cb<2>().set(FUNC(tsamurai_state::coin1_counter_w)); + mainlatch.q_out_cb<3>().set(FUNC(tsamurai_state::coin2_counter_w)); + mainlatch.q_out_cb<4>().set(FUNC(tsamurai_state::textbank1_w)); /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) @@ -834,13 +834,13 @@ MACHINE_CONFIG_START(tsamurai_state::m660) MCFG_MACHINE_START_OVERRIDE(tsamurai_state,m660) - MCFG_DEVICE_ADD("mainlatch", LS259, 0) - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, tsamurai_state, flip_screen_w)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, tsamurai_state, nmi_enable_w)) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, tsamurai_state, textbank1_w)) - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, tsamurai_state, coin1_counter_w)) - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(*this, tsamurai_state, coin2_counter_w)) - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, tsamurai_state, textbank2_w)) + ls259_device &mainlatch(LS259(config, "mainlatch")); + mainlatch.q_out_cb<0>().set(FUNC(tsamurai_state::flip_screen_w)); + mainlatch.q_out_cb<1>().set(FUNC(tsamurai_state::nmi_enable_w)); + mainlatch.q_out_cb<2>().set(FUNC(tsamurai_state::textbank1_w)); + mainlatch.q_out_cb<3>().set(FUNC(tsamurai_state::coin1_counter_w)); + mainlatch.q_out_cb<4>().set(FUNC(tsamurai_state::coin2_counter_w)); + mainlatch.q_out_cb<7>().set(FUNC(tsamurai_state::textbank2_w)); /* video hardware */ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); diff --git a/src/mame/drivers/tti.cpp b/src/mame/drivers/tti.cpp index 1435dad107d..1ded05ab12d 100644 --- a/src/mame/drivers/tti.cpp +++ b/src/mame/drivers/tti.cpp @@ -76,10 +76,10 @@ MACHINE_CONFIG_START(tti_state::tti) MCFG_DEVICE_ADD("novram", EEPROM_SERIAL_X24C44_16BIT) MCFG_EEPROM_SERIAL_DO_CALLBACK(WRITELINE("mfp", mc68901_device, i0_w)) - MCFG_DEVICE_ADD("bitlatch", LS259, 0) // U17 - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE("novram", eeprom_serial_x24c44_device, di_write)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE("novram", eeprom_serial_x24c44_device, clk_write)) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE("novram", eeprom_serial_x24c44_device, cs_write)) + ls259_device &bitlatch(LS259(config, "bitlatch")); // U17 + bitlatch.q_out_cb<0>().set("novram", FUNC(eeprom_serial_x24c44_device::di_write)); + bitlatch.q_out_cb<1>().set("novram", FUNC(eeprom_serial_x24c44_device::clk_write)); + bitlatch.q_out_cb<2>().set("novram", FUNC(eeprom_serial_x24c44_device::cs_write)); MACHINE_CONFIG_END ROM_START( tti ) diff --git a/src/mame/drivers/tubep.cpp b/src/mame/drivers/tubep.cpp index 1949d4af032..35062587c75 100644 --- a/src/mame/drivers/tubep.cpp +++ b/src/mame/drivers/tubep.cpp @@ -840,13 +840,13 @@ MACHINE_CONFIG_START(tubep_state::tubep) MCFG_QUANTUM_TIME(attotime::from_hz(6000)) - MCFG_DEVICE_ADD("mainlatch", LS259, 0) - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, tubep_state, coin1_counter_w)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, tubep_state, coin2_counter_w)) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(NOOP) //something... - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE(*this, tubep_state, screen_flip_w)) - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(*this, tubep_state, background_romselect_w)) - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, tubep_state, colorproms_A4_line_w)) + ls259_device &mainlatch(LS259(config, "mainlatch")); + mainlatch.q_out_cb<0>().set(FUNC(tubep_state::coin1_counter_w)); + mainlatch.q_out_cb<1>().set(FUNC(tubep_state::coin2_counter_w)); + mainlatch.q_out_cb<5>().set_nop(); //something... + mainlatch.q_out_cb<5>().set(FUNC(tubep_state::screen_flip_w)); + mainlatch.q_out_cb<6>().set(FUNC(tubep_state::background_romselect_w)); + mainlatch.q_out_cb<7>().set(FUNC(tubep_state::colorproms_A4_line_w)); MCFG_MACHINE_START_OVERRIDE(tubep_state,tubep) MCFG_MACHINE_RESET_OVERRIDE(tubep_state,tubep) @@ -915,10 +915,10 @@ MACHINE_CONFIG_START(tubep_state::rjammer) MCFG_DEVICE_ADD("mcu",NSC8105,6000000) /* 6 MHz Xtal - divided internally ??? */ MCFG_DEVICE_PROGRAM_MAP(nsc_map) - MCFG_DEVICE_ADD("mainlatch", LS259, 0) // 3A - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, tubep_state, coin1_counter_w)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, tubep_state, coin2_counter_w)) - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE(*this, tubep_state, screen_flip_w)) + ls259_device &mainlatch(LS259(config, "mainlatch")); // 3A + mainlatch.q_out_cb<0>().set(FUNC(tubep_state::coin1_counter_w)); + mainlatch.q_out_cb<1>().set(FUNC(tubep_state::coin2_counter_w)); + mainlatch.q_out_cb<5>().set(FUNC(tubep_state::screen_flip_w)); MCFG_MACHINE_START_OVERRIDE(tubep_state,rjammer) MCFG_MACHINE_RESET_OVERRIDE(tubep_state,rjammer) diff --git a/src/mame/drivers/turbo.cpp b/src/mame/drivers/turbo.cpp index ca10b5ab48e..d9e85ff30b1 100644 --- a/src/mame/drivers/turbo.cpp +++ b/src/mame/drivers/turbo.cpp @@ -875,10 +875,10 @@ MACHINE_CONFIG_START(turbo_state::turbo) MCFG_I8279_OUT_DISP_CB(WRITE8(*this, turbo_state, digit_w)) // display A&B MCFG_I8279_IN_RL_CB(IOPORT("DSW1")) // kbd RL lines - MCFG_DEVICE_ADD("outlatch", LS259, 0) // IC125 - outputs passed through CN5 - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, turbo_state, coin_meter_1_w)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, turbo_state, coin_meter_2_w)) - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, turbo_state, start_lamp_w)) + ls259_device &outlatch(LS259(config, "outlatch")); // IC125 - outputs passed through CN5 + outlatch.q_out_cb<0>().set(FUNC(turbo_state::coin_meter_1_w)); + outlatch.q_out_cb<1>().set(FUNC(turbo_state::coin_meter_2_w)); + outlatch.q_out_cb<3>().set(FUNC(turbo_state::start_lamp_w)); /* video hardware */ MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_turbo) diff --git a/src/mame/drivers/tutankhm.cpp b/src/mame/drivers/tutankhm.cpp index 31e1bed4726..375b3106409 100644 --- a/src/mame/drivers/tutankhm.cpp +++ b/src/mame/drivers/tutankhm.cpp @@ -232,15 +232,15 @@ MACHINE_CONFIG_START(tutankhm_state::tutankhm) MCFG_DEVICE_ADD("maincpu", MC6809E, XTAL(18'432'000)/12) /* 1.5 MHz ??? */ MCFG_DEVICE_PROGRAM_MAP(main_map) - MCFG_DEVICE_ADD("mainlatch", LS259, 0) // C3 - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, tutankhm_state, irq_enable_w)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(NOOP) // PAY OUT - not used - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, tutankhm_state, coin_counter_2_w)) - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, tutankhm_state, coin_counter_1_w)) - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(NOOP) // starfield? - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE("timeplt_audio", timeplt_audio_device, mute_w)) - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(*this, tutankhm_state, flip_screen_x_w)) - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, tutankhm_state, flip_screen_y_w)) + ls259_device &mainlatch(LS259(config, "mainlatch")); // C3 + mainlatch.q_out_cb<0>().set(FUNC(tutankhm_state::irq_enable_w)); + mainlatch.q_out_cb<1>().set_nop(); // PAY OUT - not used + mainlatch.q_out_cb<2>().set(FUNC(tutankhm_state::coin_counter_2_w)); + mainlatch.q_out_cb<3>().set(FUNC(tutankhm_state::coin_counter_1_w)); + mainlatch.q_out_cb<4>().set_nop(); // starfield? + mainlatch.q_out_cb<5>().set("timeplt_audio", FUNC(timeplt_audio_device::mute_w)); + mainlatch.q_out_cb<6>().set(FUNC(tutankhm_state::flip_screen_x_w)); + mainlatch.q_out_cb<7>().set(FUNC(tutankhm_state::flip_screen_y_w)); MCFG_WATCHDOG_ADD("watchdog") diff --git a/src/mame/drivers/twincobr.cpp b/src/mame/drivers/twincobr.cpp index 30745ba6d95..4d5a8a987ae 100644 --- a/src/mame/drivers/twincobr.cpp +++ b/src/mame/drivers/twincobr.cpp @@ -385,7 +385,6 @@ Shark Zame #include "cpu/mcs48/mcs48.h" #include "cpu/tms32010/tms32010.h" #include "cpu/z80/z80.h" -#include "machine/74259.h" #include "sound/3812intf.h" #include "speaker.h" @@ -413,8 +412,8 @@ void twincobr_state::main_program_map(address_map &map) map(0x078004, 0x078005).portr("P1"); map(0x078006, 0x078007).portr("P2"); map(0x078008, 0x078009).portr("VBLANK"); /* V-Blank & FShark Coin/Start */ - map(0x07800b, 0x07800b).w("coinlatch", FUNC(ls259_device::write_nibble_d0)); /* Flying Shark DSP Comms & coin stuff */ - map(0x07800d, 0x07800d).w("mainlatch", FUNC(ls259_device::write_nibble_d0)); /* Twin Cobra DSP Comms & system control */ + map(0x07800b, 0x07800b).w(m_coinlatch, FUNC(ls259_device::write_nibble_d0)); /* Flying Shark DSP Comms & coin stuff */ + map(0x07800d, 0x07800d).w(m_mainlatch, FUNC(ls259_device::write_nibble_d0)); /* Twin Cobra DSP Comms & system control */ map(0x07a000, 0x07afff).rw(FUNC(twincobr_state::twincobr_sharedram_r), FUNC(twincobr_state::twincobr_sharedram_w)); /* 16-bit on 68000 side, 8-bit on Z80 side */ map(0x07e000, 0x07e001).rw(FUNC(twincobr_state::twincobr_txram_r), FUNC(twincobr_state::twincobr_txram_w)); /* data for text video RAM */ map(0x07e002, 0x07e003).rw(FUNC(twincobr_state::twincobr_bgram_r), FUNC(twincobr_state::twincobr_bgram_w)); /* data for bg video RAM */ @@ -435,7 +434,7 @@ void twincobr_state::sound_io_map(address_map &map) map.global_mask(0xff); map(0x00, 0x01).rw("ymsnd", FUNC(ym3812_device::read), FUNC(ym3812_device::write)); map(0x10, 0x10).portr("SYSTEM"); /* Twin Cobra - Coin/Start */ - map(0x20, 0x20).w("coinlatch", FUNC(ls259_device::write_nibble_d0)); /* Twin Cobra coin count-lockout */ + map(0x20, 0x20).w(m_coinlatch, FUNC(ls259_device::write_nibble_d0)); /* Twin Cobra coin count-lockout */ map(0x40, 0x40).portr("DSWA"); map(0x50, 0x50).portr("DSWB"); } @@ -671,19 +670,19 @@ MACHINE_CONFIG_START(twincobr_state::twincobr) MCFG_MACHINE_RESET_OVERRIDE(twincobr_state,twincobr) - MCFG_DEVICE_ADD("mainlatch", LS259, 0) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, twincobr_state, int_enable_w)) - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, twincobr_state, flipscreen_w)) - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(*this, twincobr_state, bg_ram_bank_w)) - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE(*this, twincobr_state, fg_rom_bank_w)) - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(*this, twincobr_state, dsp_int_w)) - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, twincobr_state, display_on_w)) + LS259(config, m_mainlatch); + m_mainlatch->q_out_cb<2>().set(FUNC(twincobr_state::int_enable_w)); + m_mainlatch->q_out_cb<3>().set(FUNC(twincobr_state::flipscreen_w)); + m_mainlatch->q_out_cb<4>().set(FUNC(twincobr_state::bg_ram_bank_w)); + m_mainlatch->q_out_cb<5>().set(FUNC(twincobr_state::fg_rom_bank_w)); + m_mainlatch->q_out_cb<6>().set(FUNC(twincobr_state::dsp_int_w)); + m_mainlatch->q_out_cb<7>().set(FUNC(twincobr_state::display_on_w)); - MCFG_DEVICE_ADD("coinlatch", LS259, 0) - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(*this, twincobr_state, coin_counter_1_w)) - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE(*this, twincobr_state, coin_counter_2_w)) - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(*this, twincobr_state, coin_lockout_1_w)) - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, twincobr_state, coin_lockout_2_w)) + LS259(config, m_coinlatch); + m_coinlatch->q_out_cb<4>().set(FUNC(twincobr_state::coin_counter_1_w)); + m_coinlatch->q_out_cb<5>().set(FUNC(twincobr_state::coin_counter_2_w)); + m_coinlatch->q_out_cb<6>().set(FUNC(twincobr_state::coin_lockout_1_w)); + m_coinlatch->q_out_cb<7>().set(FUNC(twincobr_state::coin_lockout_2_w)); /* video hardware */ MCFG_MC6845_ADD("crtc", HD6845, "screen", XTAL(28'000'000)/8) /* 3.5MHz measured on CLKin */ @@ -724,11 +723,8 @@ MACHINE_CONFIG_END MACHINE_CONFIG_START(twincobr_state::fshark) twincobr(config); - MCFG_DEVICE_MODIFY("mainlatch") - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(NOOP) - - MCFG_DEVICE_MODIFY("coinlatch") - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, twincobr_state, dsp_int_w)) + m_mainlatch->q_out_cb<6>().set_nop(); + m_coinlatch->q_out_cb<0>().set(FUNC(twincobr_state::dsp_int_w)); MCFG_DEVICE_MODIFY("scu") MCFG_TOAPLAN_SCU_SET_XOFFSETS(32, 14) diff --git a/src/mame/drivers/ultratnk.cpp b/src/mame/drivers/ultratnk.cpp index 4f4c99ed9a5..aff11fd30f2 100644 --- a/src/mame/drivers/ultratnk.cpp +++ b/src/mame/drivers/ultratnk.cpp @@ -295,12 +295,12 @@ MACHINE_CONFIG_START(ultratnk_state::ultratnk) MCFG_DEVICE_ADD("maincpu", M6502, PIXEL_CLOCK / 8) MCFG_DEVICE_PROGRAM_MAP(ultratnk_cpu_map) - MCFG_DEVICE_ADD("latch", F9334, 0) // E11 - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, ultratnk_state, lockout_w)) - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(OUTPUT("led0")) // LED1 (left player start) - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(OUTPUT("led1")) // LED2 (right player start) - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE("discrete", discrete_device, write_line)) - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE("discrete", discrete_device, write_line)) + f9334_device &latch(F9334(config, "latch")); // E11 + latch.q_out_cb<3>().set(FUNC(ultratnk_state::lockout_w)); + latch.q_out_cb<4>().set_output("led0"); // LED1 (left player start) + latch.q_out_cb<5>().set_output("led1"); // LED2 (right player start) + latch.q_out_cb<6>().set("discrete", FUNC(discrete_device::write_line)); + latch.q_out_cb<7>().set("discrete", FUNC(discrete_device::write_line)); MCFG_WATCHDOG_ADD("watchdog") MCFG_WATCHDOG_VBLANK_INIT("screen", 8) diff --git a/src/mame/drivers/unixpc.cpp b/src/mame/drivers/unixpc.cpp index a598d04b01b..2a00f9ea3dd 100644 --- a/src/mame/drivers/unixpc.cpp +++ b/src/mame/drivers/unixpc.cpp @@ -344,13 +344,13 @@ MACHINE_CONFIG_START(unixpc_state::unixpc) MCFG_DEVICE_ADD("maincpu", M68010, 40_MHz_XTAL / 4) MCFG_DEVICE_PROGRAM_MAP(unixpc_mem) - MCFG_DEVICE_ADD("gcr", LS259) // 7K - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, unixpc_state, error_enable_w)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, unixpc_state, parity_enable_w)) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, unixpc_state, bpplus_w)) - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, unixpc_state, romlmap_w)) + LS259(config, m_gcr); // 7K + m_gcr->q_out_cb<0>().set(FUNC(unixpc_state::error_enable_w)); + m_gcr->q_out_cb<1>().set(FUNC(unixpc_state::parity_enable_w)); + m_gcr->q_out_cb<2>().set(FUNC(unixpc_state::bpplus_w)); + m_gcr->q_out_cb<3>().set(FUNC(unixpc_state::romlmap_w)); - MCFG_DEVICE_ADD("tcr", LS259) // 10K + LS259(config, m_tcr); // 10K output_latch_device &mreg(OUTPUT_LATCH(config, "mreg")); mreg.bit_handler<0>().set_output("led_0").invert(); diff --git a/src/mame/drivers/vertigo.cpp b/src/mame/drivers/vertigo.cpp index 04668c18a7d..a2523e7a68c 100644 --- a/src/mame/drivers/vertigo.cpp +++ b/src/mame/drivers/vertigo.cpp @@ -134,8 +134,8 @@ MACHINE_CONFIG_START(vertigo_state::vertigo) MCFG_PIT8253_OUT1_HANDLER(WRITELINE(*this, vertigo_state, v_irq3_w)) MCFG_PIT8253_CLK2(24_MHz_XTAL / 100) - MCFG_DEVICE_ADD("74148", TTL74148, 0) - MCFG_74148_OUTPUT_CB(vertigo_state, update_irq) + TTL74148(config, m_ttl74148, 0); + m_ttl74148->out_cb().set(FUNC(vertigo_state::update_irq)); /* motor controller */ MCFG_DEVICE_ADD("motorcpu", M68705P3, 24_MHz_XTAL / 6) diff --git a/src/mame/drivers/wardner.cpp b/src/mame/drivers/wardner.cpp index e5d752ad325..9879fae18f8 100644 --- a/src/mame/drivers/wardner.cpp +++ b/src/mame/drivers/wardner.cpp @@ -404,19 +404,19 @@ MACHINE_CONFIG_START(wardner_state::wardner) MCFG_QUANTUM_TIME(attotime::from_hz(6000)) /* 100 CPU slices per frame */ - MCFG_DEVICE_ADD("mainlatch", LS259, 0) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, wardner_state, int_enable_w)) - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, wardner_state, flipscreen_w)) - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(*this, wardner_state, bg_ram_bank_w)) - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE(*this, wardner_state, fg_rom_bank_w)) - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(*this, wardner_state, display_on_w)) - - MCFG_DEVICE_ADD("coinlatch", LS259, 0) - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, wardner_state, dsp_int_w)) - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(*this, wardner_state, coin_counter_1_w)) - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE(*this, wardner_state, coin_counter_2_w)) - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(*this, wardner_state, coin_lockout_1_w)) - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, wardner_state, coin_lockout_2_w)) + ls259_device &mainlatch(LS259(config, "mainlatch")); + mainlatch.q_out_cb<2>().set(FUNC(wardner_state::int_enable_w)); + mainlatch.q_out_cb<3>().set(FUNC(wardner_state::flipscreen_w)); + mainlatch.q_out_cb<4>().set(FUNC(wardner_state::bg_ram_bank_w)); + mainlatch.q_out_cb<5>().set(FUNC(wardner_state::fg_rom_bank_w)); + mainlatch.q_out_cb<6>().set(FUNC(wardner_state::display_on_w)); + + ls259_device &coinlatch(LS259(config, "coinlatch")); + coinlatch.q_out_cb<0>().set(FUNC(wardner_state::dsp_int_w)); + coinlatch.q_out_cb<4>().set(FUNC(wardner_state::coin_counter_1_w)); + coinlatch.q_out_cb<5>().set(FUNC(wardner_state::coin_counter_2_w)); + coinlatch.q_out_cb<6>().set(FUNC(wardner_state::coin_lockout_1_w)); + coinlatch.q_out_cb<7>().set(FUNC(wardner_state::coin_lockout_2_w)); /* video hardware */ MCFG_MC6845_ADD("crtc", HD6845, "screen", XTAL(14'000'000)/4) /* 3.5MHz measured on CLKin */ diff --git a/src/mame/drivers/warpwarp.cpp b/src/mame/drivers/warpwarp.cpp index 4c4d65ede23..984ce8adcdc 100644 --- a/src/mame/drivers/warpwarp.cpp +++ b/src/mame/drivers/warpwarp.cpp @@ -138,7 +138,6 @@ Notes: #include "includes/warpwarp.h" #include "cpu/i8085/i8085.h" -#include "machine/74259.h" #include "screen.h" #include "speaker.h" @@ -291,14 +290,14 @@ void warpwarp_state::geebee_map(address_map &map) map(0x4000, 0x40ff).ram(); map(0x5000, 0x53ff).r(FUNC(warpwarp_state::geebee_in_r)); map(0x6000, 0x6fff).w(FUNC(warpwarp_state::geebee_out6_w)); - map(0x7000, 0x7007).mirror(0x0ff8).w("latch", FUNC(ls259_device::write_d0)); + map(0x7000, 0x7007).mirror(0x0ff8).w(m_latch, FUNC(ls259_device::write_d0)); } void warpwarp_state::geebee_port_map(address_map &map) { map(0x50, 0x53).r(FUNC(warpwarp_state::geebee_in_r)); map(0x60, 0x6f).w(FUNC(warpwarp_state::geebee_out6_w)); - map(0x70, 0x77).mirror(0x08).w("latch", FUNC(ls259_device::write_d0)); + map(0x70, 0x77).mirror(0x08).w(m_latch, FUNC(ls259_device::write_d0)); } @@ -311,7 +310,7 @@ void warpwarp_state::bombbee_map(address_map &map) map(0x6000, 0x600f).rw(FUNC(warpwarp_state::warpwarp_sw_r), FUNC(warpwarp_state::warpwarp_out0_w)); map(0x6010, 0x601f).r(FUNC(warpwarp_state::warpwarp_vol_r)).w(m_warpwarp_sound, FUNC(warpwarp_sound_device::music1_w)); map(0x6020, 0x602f).r(FUNC(warpwarp_state::warpwarp_dsw1_r)).w(m_warpwarp_sound, FUNC(warpwarp_sound_device::music2_w)); - map(0x6030, 0x6037).mirror(0x0008).w("latch", FUNC(ls259_device::write_d0)); + map(0x6030, 0x6037).mirror(0x0008).w(m_latch, FUNC(ls259_device::write_d0)); } void warpwarp_state::warpwarp_map(address_map &map) @@ -323,7 +322,7 @@ void warpwarp_state::warpwarp_map(address_map &map) map(0xc000, 0xc00f).rw(FUNC(warpwarp_state::warpwarp_sw_r), FUNC(warpwarp_state::warpwarp_out0_w)); map(0xc010, 0xc01f).r(FUNC(warpwarp_state::warpwarp_vol_r)).w(m_warpwarp_sound, FUNC(warpwarp_sound_device::music1_w)); map(0xc020, 0xc02f).r(FUNC(warpwarp_state::warpwarp_dsw1_r)).w(m_warpwarp_sound, FUNC(warpwarp_sound_device::music2_w)); - map(0xc030, 0xc037).mirror(0x0008).w("latch", FUNC(ls259_device::write_d0)); + map(0xc030, 0xc037).mirror(0x0008).w(m_latch, FUNC(ls259_device::write_d0)); } @@ -720,15 +719,15 @@ MACHINE_CONFIG_START(warpwarp_state::geebee) MCFG_DEVICE_PROGRAM_MAP(geebee_map) MCFG_DEVICE_IO_MAP(geebee_port_map) - MCFG_DEVICE_ADD("latch", LS259, 0) // 5N - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(OUTPUT("led0")) // LAMP 1 - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(OUTPUT("led1")) // LAMP 2 - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(OUTPUT("led2")) // LAMP 3 - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, warpwarp_state, counter_w)) - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(*this, warpwarp_state, lock_out_w)) - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE(*this, warpwarp_state, geebee_bgw_w)) - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(*this, warpwarp_state, ball_on_w)) - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, warpwarp_state, inv_w)) + LS259(config, m_latch); // 5N + m_latch->q_out_cb<0>().set_output("led0"); // LAMP 1 + m_latch->q_out_cb<1>().set_output("led1"); // LAMP 2 + m_latch->q_out_cb<2>().set_output("led2"); // LAMP 3 + m_latch->q_out_cb<3>().set(FUNC(warpwarp_state::counter_w)); + m_latch->q_out_cb<4>().set(FUNC(warpwarp_state::lock_out_w)); + m_latch->q_out_cb<5>().set(FUNC(warpwarp_state::geebee_bgw_w)); + m_latch->q_out_cb<6>().set(FUNC(warpwarp_state::ball_on_w)); + m_latch->q_out_cb<7>().set(FUNC(warpwarp_state::inv_w)); /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) @@ -750,11 +749,11 @@ MACHINE_CONFIG_START(warpwarp_state::geebee) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) MACHINE_CONFIG_END -MACHINE_CONFIG_START(warpwarp_state::geebeeb) +void warpwarp_state::geebeeb(machine_config &config) +{ geebee(config); - MCFG_DEVICE_MODIFY("latch") - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(NOOP) // remove coin lockout -MACHINE_CONFIG_END + m_latch->q_out_cb<4>().set_nop(); // remove coin lockout +} MACHINE_CONFIG_START(warpwarp_state::navarone) geebee(config); @@ -786,15 +785,15 @@ MACHINE_CONFIG_START(warpwarp_state::bombbee) MCFG_DEVICE_ADD("maincpu", I8080, MASTER_CLOCK/9) MCFG_DEVICE_PROGRAM_MAP(bombbee_map) - MCFG_DEVICE_ADD("latch", LS259, 0) // 6L on Warp Warp - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(OUTPUT("led0")) // LAMP 1 - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(OUTPUT("led1")) // LAMP 2 - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(OUTPUT("led2")) // LAMP 3 - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(NOOP) // n.c. - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(*this, warpwarp_state, lock_out_w)) - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE(*this, warpwarp_state, counter_w)) - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(*this, warpwarp_state, ball_on_w)) - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, warpwarp_state, inv_w)) + LS259(config, m_latch); // 6L on Warp Warp + m_latch->q_out_cb<0>().set_output("led0"); // LAMP 1 + m_latch->q_out_cb<1>().set_output("led1"); // LAMP 2 + m_latch->q_out_cb<2>().set_output("led2"); // LAMP 3 + m_latch->q_out_cb<3>().set_nop(); // n.c. + m_latch->q_out_cb<4>().set(FUNC(warpwarp_state::lock_out_w)); + m_latch->q_out_cb<5>().set(FUNC(warpwarp_state::counter_w)); + m_latch->q_out_cb<6>().set(FUNC(warpwarp_state::ball_on_w)); + m_latch->q_out_cb<7>().set(FUNC(warpwarp_state::inv_w)); MCFG_WATCHDOG_ADD("watchdog") diff --git a/src/mame/drivers/williams.cpp b/src/mame/drivers/williams.cpp index 220c728717a..24da2bf427a 100644 --- a/src/mame/drivers/williams.cpp +++ b/src/mame/drivers/williams.cpp @@ -503,7 +503,6 @@ Reference video: https://www.youtube.com/watch?v=R5OeC6Wc_yI #include "emu.h" #include "includes/williams.h" -#include "machine/74157.h" #include "machine/input_merger.h" #include "machine/nvram.h" #include "sound/dac.h" @@ -1592,13 +1591,13 @@ MACHINE_CONFIG_START(williams_state::williams_muxed) m_pia[0]->cb2_handler().set("mux_0", FUNC(ls157_device::select_w)); m_pia[0]->cb2_handler().append("mux_1", FUNC(ls157_device::select_w)); - MCFG_DEVICE_ADD("mux_0", LS157, 0) // IC3 on interface board (actually LS257 with OC tied low) - MCFG_74157_A_IN_CB(IOPORT("INP2")) - MCFG_74157_B_IN_CB(IOPORT("INP1")) + LS157(config, m_mux0, 0); // IC3 on interface board (actually LS257 with OC tied low) + m_mux0->a_in_callback().set_ioport("INP2"); + m_mux0->b_in_callback().set_ioport("INP1"); - MCFG_DEVICE_ADD("mux_1", LS157, 0) // IC4 on interface board (actually LS257 with OC tied low) - MCFG_74157_A_IN_CB(IOPORT("INP2A")) - MCFG_74157_B_IN_CB(IOPORT("INP1A")) + LS157(config, m_mux1, 0); // IC4 on interface board (actually LS257 with OC tied low) + m_mux1->a_in_callback().set_ioport("INP2A"); + m_mux1->b_in_callback().set_ioport("INP1A"); MACHINE_CONFIG_END @@ -1689,9 +1688,9 @@ MACHINE_CONFIG_START(blaster_state::blastkit) // All multiplexers on Blaster interface board are really LS257 with OC tied to GND (which is equivalent to LS157) - MCFG_DEVICE_ADD("mux_a", LS157_X2, 0) - MCFG_74157_A_IN_CB(IOPORT("IN3")) - MCFG_74157_B_IN_CB(READ8(*this, williams_state, williams_49way_port_0_r)) + LS157_X2(config, m_muxa, 0); + m_muxa->a_in_callback().set_ioport("IN3"); + m_muxa->b_in_callback().set(FUNC(williams_state::williams_49way_port_0_r)); MACHINE_CONFIG_END @@ -1708,13 +1707,13 @@ MACHINE_CONFIG_START(blaster_state::blaster) m_pia[0]->cb2_handler().set("mux_a", FUNC(ls157_x2_device::select_w)); m_pia[0]->cb2_handler().append("mux_b", FUNC(ls157_device::select_w)); - MCFG_DEVICE_MODIFY("mux_a") // IC7 (for PA0-PA3) + IC5 (for PA4-PA7) - MCFG_74157_A_IN_CB(READ8(*this, williams_state, williams_49way_port_0_r)) - MCFG_74157_B_IN_CB(IOPORT("IN3")) + // IC7 (for PA0-PA3) + IC5 (for PA4-PA7) + m_muxa->a_in_callback().set(FUNC(williams_state::williams_49way_port_0_r)); + m_muxa->b_in_callback().set_ioport("IN3"); - MCFG_DEVICE_ADD("mux_b", LS157, 0) // IC3 - MCFG_74157_A_IN_CB(IOPORT("INP1")) - MCFG_74157_B_IN_CB(IOPORT("INP2")) + LS157(config, m_muxb, 0); // IC3 + m_muxb->a_in_callback().set_ioport("INP1"); + m_muxb->b_in_callback().set_ioport("INP2"); MCFG_INPUT_MERGER_ANY_HIGH("soundirq_b") MCFG_INPUT_MERGER_OUTPUT_HANDLER(INPUTLINE("soundcpu_b", M6808_IRQ_LINE)) @@ -1820,9 +1819,9 @@ MACHINE_CONFIG_START(williams2_state::inferno) m_pia[0]->readpa_handler().set("mux", FUNC(ls157_x2_device::output_r)); m_pia[0]->ca2_handler().set("mux", FUNC(ls157_x2_device::select_w)); - MCFG_DEVICE_ADD("mux", LS157_X2, 0) // IC45 (for PA4-PA7) + IC46 (for PA0-PA3) on CPU board - MCFG_74157_A_IN_CB(IOPORT("INP1")) - MCFG_74157_B_IN_CB(IOPORT("INP2")) + LS157_X2(config, m_mux, 0); // IC45 (for PA4-PA7) + IC46 (for PA0-PA3) on CPU board + m_mux->a_in_callback().set_ioport("INP1"); + m_mux->b_in_callback().set_ioport("INP2"); MACHINE_CONFIG_END @@ -1862,9 +1861,9 @@ MACHINE_CONFIG_START(tshoot_state::tshoot) MCFG_DEVICE_MODIFY("pia_2") m_pia[2]->cb2_handler().set(FUNC(tshoot_state::maxvol_w)); - MCFG_DEVICE_ADD("mux", LS157_X2, 0) // U2 + U3 on interface board - MCFG_74157_A_IN_CB(IOPORT("INP1")) - MCFG_74157_B_IN_CB(IOPORT("INP2")) + LS157_X2(config, m_mux, 0); // U2 + U3 on interface board + m_mux->a_in_callback().set_ioport("INP1"); + m_mux->b_in_callback().set_ioport("INP2"); MACHINE_CONFIG_END @@ -1893,9 +1892,9 @@ MACHINE_CONFIG_START(joust2_state::joust2) m_pia[1]->irqa_handler().set("mainirq", FUNC(input_merger_any_high_device::in_w<0>)); m_pia[1]->irqb_handler().set("mainirq", FUNC(input_merger_any_high_device::in_w<1>)); - MCFG_DEVICE_ADD("mux", LS157, 0) - MCFG_74157_A_IN_CB(IOPORT("INP1")) - MCFG_74157_B_IN_CB(IOPORT("INP2")) + LS157(config, m_mux, 0); + m_mux->a_in_callback().set_ioport("INP1"); + m_mux->b_in_callback().set_ioport("INP2"); MACHINE_CONFIG_END diff --git a/src/mame/drivers/wink.cpp b/src/mame/drivers/wink.cpp index 81820d350b9..04b849a6c4f 100644 --- a/src/mame/drivers/wink.cpp +++ b/src/mame/drivers/wink.cpp @@ -388,15 +388,15 @@ MACHINE_CONFIG_START(wink_state::wink) MCFG_DEVICE_PROGRAM_MAP(wink_map) MCFG_DEVICE_IO_MAP(wink_io) - MCFG_DEVICE_ADD("mainlatch", LS259, 0) - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, wink_state, nmi_enable_w)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, wink_state, player_mux_w)) //??? no mux on the pcb. - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, wink_state, tile_banking_w)) - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(NOOP) //? - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(NOOP) //cab Knocker like in q-bert! - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE(*this, wink_state, coin_counter_w<0>)) - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(*this, wink_state, coin_counter_w<1>)) - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, wink_state, coin_counter_w<2>)) + ls259_device &mainlatch(LS259(config, "mainlatch")); + mainlatch.q_out_cb<0>().set(FUNC(wink_state::nmi_enable_w)); + mainlatch.q_out_cb<1>().set(FUNC(wink_state::player_mux_w)); //??? no mux on the pcb. + mainlatch.q_out_cb<2>().set(FUNC(wink_state::tile_banking_w)); + mainlatch.q_out_cb<3>().set_nop(); //? + mainlatch.q_out_cb<4>().set_nop(); //cab Knocker like in q-bert! + mainlatch.q_out_cb<5>().set(FUNC(wink_state::coin_counter_w<0>)); + mainlatch.q_out_cb<6>().set(FUNC(wink_state::coin_counter_w<1>)); + mainlatch.q_out_cb<7>().set(FUNC(wink_state::coin_counter_w<2>)); MCFG_DEVICE_ADD("audiocpu", Z80, 12000000 / 8) MCFG_DEVICE_PROGRAM_MAP(wink_sound_map) diff --git a/src/mame/drivers/wrally.cpp b/src/mame/drivers/wrally.cpp index e6d7650645f..8d485f27bd9 100644 --- a/src/mame/drivers/wrally.cpp +++ b/src/mame/drivers/wrally.cpp @@ -287,15 +287,15 @@ MACHINE_CONFIG_START(wrally_state::wrally) MCFG_PALETTE_ADD("palette", 1024*8) MCFG_PALETTE_FORMAT(xxxxBBBBRRRRGGGG) - MCFG_DEVICE_ADD("outlatch", LS259, 0) - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, wrally_state, coin1_lockout_w)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, wrally_state, coin2_lockout_w)) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, wrally_state, coin1_counter_w)) - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, wrally_state, coin2_counter_w)) - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(NOOP) /* Sound muting */ - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE(*this, wrally_state, flipscreen_w)) /* Flip screen */ - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(NOOP) /* ??? */ - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(NOOP) /* ??? */ + LS259(config, m_outlatch); + m_outlatch->q_out_cb<0>().set(FUNC(wrally_state::coin1_lockout_w)); + m_outlatch->q_out_cb<1>().set(FUNC(wrally_state::coin2_lockout_w)); + m_outlatch->q_out_cb<2>().set(FUNC(wrally_state::coin1_counter_w)); + m_outlatch->q_out_cb<3>().set(FUNC(wrally_state::coin2_counter_w)); + m_outlatch->q_out_cb<4>().set_nop(); /* Sound muting */ + m_outlatch->q_out_cb<5>().set(FUNC(wrally_state::flipscreen_w)); /* Flip screen */ + m_outlatch->q_out_cb<6>().set_nop(); /* ??? */ + m_outlatch->q_out_cb<7>().set_nop(); /* ??? */ /* sound hardware */ SPEAKER(config, "mono").front_center(); diff --git a/src/mame/drivers/xorworld.cpp b/src/mame/drivers/xorworld.cpp index 97be602e24c..8296111aa99 100644 --- a/src/mame/drivers/xorworld.cpp +++ b/src/mame/drivers/xorworld.cpp @@ -166,10 +166,10 @@ MACHINE_CONFIG_START(xorworld_state::xorworld) MCFG_DEVICE_ADD("eeprom", EEPROM_SERIAL_93C46_16BIT) - MCFG_DEVICE_ADD("mainlatch", LS259, 0) - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE("eeprom", eeprom_serial_93cxx_device, cs_write)) // CS (active low) - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE("eeprom", eeprom_serial_93cxx_device, clk_write)) // SK (active high) - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE("eeprom", eeprom_serial_93cxx_device, di_write)) // EEPROM data (DIN) + ls259_device &mainlatch(LS259(config, "mainlatch")); + mainlatch.q_out_cb<4>().set("eeprom", FUNC(eeprom_serial_93cxx_device::cs_write)); // CS (active low) + mainlatch.q_out_cb<5>().set("eeprom", FUNC(eeprom_serial_93cxx_device::clk_write)); // SK (active high) + mainlatch.q_out_cb<6>().set("eeprom", FUNC(eeprom_serial_93cxx_device::di_write)); // EEPROM data (DIN) // video hardware MCFG_SCREEN_ADD("screen", RASTER) diff --git a/src/mame/drivers/xtheball.cpp b/src/mame/drivers/xtheball.cpp index e6106a1c766..d9294cf1062 100644 --- a/src/mame/drivers/xtheball.cpp +++ b/src/mame/drivers/xtheball.cpp @@ -306,16 +306,16 @@ MACHINE_CONFIG_START(xtheball_state::xtheball) MCFG_NVRAM_ADD_1FILL("nvram") - MCFG_DEVICE_ADD("latch1", HC259, 0) - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE("ticket", ticket_dispenser_device, motor_w)) + hc259_device &latch1(HC259(config, "latch1")); + latch1.q_out_cb<7>().set("ticket", FUNC(ticket_dispenser_device::motor_w)); // Q4 = meter, Q6 = tickets, Q7 = tickets? - MCFG_DEVICE_ADD("latch2", HC259, 0) - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(OUTPUT("led0")) // start lamp + hc259_device &latch2(HC259(config, "latch2")); + latch2.q_out_cb<0>().set_output("led0"); // start lamp // Q1-Q7 = more lamps? - MCFG_DEVICE_ADD("latch3", HC259, 0) - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, xtheball_state, foreground_mode_w)) + hc259_device &latch3(HC259(config, "latch3")); + latch3.q_out_cb<3>().set(FUNC(xtheball_state::foreground_mode_w)); // Q3 = video foreground control? MCFG_TICKET_DISPENSER_ADD("ticket", attotime::from_msec(100), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH) diff --git a/src/mame/drivers/yunsung8.cpp b/src/mame/drivers/yunsung8.cpp index 697f7664602..3e8b6b14391 100644 --- a/src/mame/drivers/yunsung8.cpp +++ b/src/mame/drivers/yunsung8.cpp @@ -373,8 +373,8 @@ MACHINE_CONFIG_START(yunsung8_state::yunsung8) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) - MCFG_DEVICE_ADD("adpcm_select", LS157, 0) - MCFG_74157_OUT_CB(WRITE8("msm", msm5205_device, data_w)) + LS157(config, m_adpcm_select, 0); + m_adpcm_select->out_callback().set("msm", FUNC(msm5205_device::data_w)); MCFG_DEVICE_ADD("msm", MSM5205, XTAL(400'000)) /* verified on pcb */ MCFG_MSM5205_VCLK_CB(WRITELINE(*this, yunsung8_state, adpcm_int)) /* interrupt function */ diff --git a/src/mame/drivers/zaccaria.cpp b/src/mame/drivers/zaccaria.cpp index bb61ad69e7a..b5516ae7664 100644 --- a/src/mame/drivers/zaccaria.cpp +++ b/src/mame/drivers/zaccaria.cpp @@ -341,12 +341,12 @@ MACHINE_CONFIG_START(zaccaria_state::zaccaria) MCFG_WATCHDOG_ADD("watchdog") - MCFG_DEVICE_ADD("mainlatch", LS259, 0) // 3G on 1B1141 I/O (Z80) board - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, zaccaria_state, flip_screen_x_w)) // VCMA - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, zaccaria_state, flip_screen_y_w)) // HCMA - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE("audiopcb", zac1b11142_audio_device, ressound_w)) // RESSOUND - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(*this, zaccaria_state, coin_w)) // COUNT - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, zaccaria_state, nmi_mask_w)) // INTST + ls259_device &mainlatch(LS259(config, "mainlatch")); // 3G on 1B1141 I/O (Z80) board + mainlatch.q_out_cb<0>().set(FUNC(zaccaria_state::flip_screen_x_w)); // VCMA + mainlatch.q_out_cb<1>().set(FUNC(zaccaria_state::flip_screen_y_w)); // HCMA + mainlatch.q_out_cb<2>().set("audiopcb", FUNC(zac1b11142_audio_device::ressound_w)); // RESSOUND + mainlatch.q_out_cb<6>().set(FUNC(zaccaria_state::coin_w)); // COUNT + mainlatch.q_out_cb<7>().set(FUNC(zaccaria_state::nmi_mask_w)); // INTST MCFG_DEVICE_ADD("ppi8255", I8255A, 0) MCFG_I8255_IN_PORTA_CB(IOPORT("P1")) diff --git a/src/mame/drivers/zaxxon.cpp b/src/mame/drivers/zaxxon.cpp index 2ed0cdbc535..b482de42abb 100644 --- a/src/mame/drivers/zaxxon.cpp +++ b/src/mame/drivers/zaxxon.cpp @@ -926,19 +926,19 @@ MACHINE_CONFIG_START(zaxxon_state::root) MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, zaxxon_state, zaxxon_sound_b_w)) MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, zaxxon_state, zaxxon_sound_c_w)) - MCFG_DEVICE_ADD("mainlatch1", LS259, 0) // U55 on Zaxxon IC Board A - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, zaxxon_state, coin_enable_w)) // COIN EN A - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, zaxxon_state, coin_enable_w)) // COIN EN B - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, zaxxon_state, coin_enable_w)) // SERV EN - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, zaxxon_state, coin_counter_a_w)) // COUNT A - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(*this, zaxxon_state, coin_counter_b_w)) // COUNT B - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(*this, zaxxon_state, flipscreen_w)) // FLIP - - MCFG_DEVICE_ADD("mainlatch2", LS259, 0) // U56 on Zaxxon IC Board A - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, zaxxon_state, int_enable_w)) // INTON - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, zaxxon_state, fg_color_w)) // CREF 1 - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(*this, zaxxon_state, bg_color_w)) // CREF 3 - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, zaxxon_state, bg_enable_w)) // BEN + LS259(config, m_mainlatch[0]); // U55 on Zaxxon IC Board A + m_mainlatch[0]->q_out_cb<0>().set(FUNC(zaxxon_state::coin_enable_w)); // COIN EN A + m_mainlatch[0]->q_out_cb<1>().set(FUNC(zaxxon_state::coin_enable_w)); // COIN EN B + m_mainlatch[0]->q_out_cb<2>().set(FUNC(zaxxon_state::coin_enable_w)); // SERV EN + m_mainlatch[0]->q_out_cb<3>().set(FUNC(zaxxon_state::coin_counter_a_w)); // COUNT A + m_mainlatch[0]->q_out_cb<4>().set(FUNC(zaxxon_state::coin_counter_b_w)); // COUNT B + m_mainlatch[0]->q_out_cb<6>().set(FUNC(zaxxon_state::flipscreen_w)); // FLIP + + LS259(config, m_mainlatch[1]); // U56 on Zaxxon IC Board A + m_mainlatch[1]->q_out_cb<0>().set(FUNC(zaxxon_state::int_enable_w)); // INTON + m_mainlatch[1]->q_out_cb<1>().set(FUNC(zaxxon_state::fg_color_w)); // CREF 1 + m_mainlatch[1]->q_out_cb<6>().set(FUNC(zaxxon_state::bg_color_w)); // CREF 3 + m_mainlatch[1]->q_out_cb<7>().set(FUNC(zaxxon_state::bg_enable_w)); // BEN /* video hardware */ MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_zaxxon) @@ -1031,8 +1031,7 @@ MACHINE_CONFIG_START(zaxxon_state::ixion) MCFG_SEGACRPT_SET_DECRYPTED_TAG(":decrypted_opcodes") MCFG_SEGACRPT_SET_SIZE(0x6000) - MCFG_DEVICE_MODIFY("mainlatch1") - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(NOOP) // flip screen not used + m_mainlatch[0]->q_out_cb<6>().set_nop(); // flip screen not used MACHINE_CONFIG_END MACHINE_CONFIG_START(zaxxon_state::congo) @@ -1046,15 +1045,15 @@ MACHINE_CONFIG_START(zaxxon_state::congo) MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, zaxxon_state, congo_sound_b_w)) MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, zaxxon_state, congo_sound_c_w)) - MCFG_DEVICE_MODIFY("mainlatch1") // U52 on Control Board - MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE(*this, zaxxon_state, bg_enable_w)) // BEN - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, zaxxon_state, int_enable_w)) // INTON + // U52 on Control Board + m_mainlatch[0]->q_out_cb<5>().set(FUNC(zaxxon_state::bg_enable_w)); // BEN + m_mainlatch[0]->q_out_cb<7>().set(FUNC(zaxxon_state::int_enable_w)); // INTON - MCFG_DEVICE_MODIFY("mainlatch2") // U53 on Control Board - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(NOOP) // not used - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, zaxxon_state, bg_color_w)) // CREF 3 - MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(*this, zaxxon_state, congo_fg_bank_w)) // BS - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, zaxxon_state, congo_color_bank_w)) // CBS + // U53 on Control Board + m_mainlatch[0]->q_out_cb<0>().set_nop(); // not used + m_mainlatch[0]->q_out_cb<3>().set(FUNC(zaxxon_state::bg_color_w)); // CREF 3 + m_mainlatch[0]->q_out_cb<6>().set(FUNC(zaxxon_state::congo_fg_bank_w)); // BS + m_mainlatch[0]->q_out_cb<7>().set(FUNC(zaxxon_state::congo_color_bank_w)); // CBS MCFG_DEVICE_ADD("audiocpu", Z80, SOUND_CLOCK) MCFG_DEVICE_PROGRAM_MAP(congo_sound_map) diff --git a/src/mame/drivers/zn.cpp b/src/mame/drivers/zn.cpp index 49a9b94bcd0..11f265565cd 100644 --- a/src/mame/drivers/zn.cpp +++ b/src/mame/drivers/zn.cpp @@ -2690,8 +2690,8 @@ MACHINE_CONFIG_START(zn_state::coh1002msnd) MCFG_DEVICE_PROGRAM_MAP(cbaj_z80_map) MCFG_DEVICE_IO_MAP(cbaj_z80_port_map) - MCFG_FIFO7200_ADD("cbaj_fifo1", 0x400) // LH540202 - MCFG_FIFO7200_ADD("cbaj_fifo2", 0x400) // " + FIFO7200(config, m_cbaj_fifo[0], 0x400); // LH540202 + FIFO7200(config, m_cbaj_fifo[1], 0x400); // " MCFG_QUANTUM_TIME(attotime::from_hz(6000)) @@ -5437,7 +5437,7 @@ GAME( 1995, sfchampu, sfchamp, coh1000ta, znt, zn_state, empty_init, RO GAME( 1995, sfchampj, sfchamp, coh1000ta, znt, zn_state, empty_init, ROT0, "Taito", "Super Football Champ (Ver 2.4J)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) GAME( 1995, psyforce, coh1000t, coh1000ta, znt, zn_state, empty_init, ROT0, "Taito", "Psychic Force (Ver 2.4O)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) GAME( 1995, psyforcej, psyforce, coh1000ta, znt, zn_state, empty_init, ROT0, "Taito", "Psychic Force (Ver 2.4J)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) -GAME( 1995, psyforcex, psyforce, coh1000ta, znt, zn_state, empty_init, ROT0, "Taito", "Psychic Force EX (Ver 2.0J)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) +GAME( 1995, psyforcex, psyforce, coh1000ta, znt, zn_state, empty_init, ROT0, "Taito", "Psychic Force EX (Ver 2.0J)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) GAME( 1996, mgcldate, mgcldtex, coh1000ta, znt, zn_state, empty_init, ROT0, "Taito", "Magical Date / Magical Date - dokidoki kokuhaku daisakusen (Ver 2.02J)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) GAME( 1997, mgcldtex, coh1000t, coh1000ta, znt, zn_state, empty_init, ROT0, "Taito", "Magical Date EX / Magical Date - sotsugyou kokuhaku daisakusen (Ver 2.01J)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) diff --git a/src/mame/includes/avalnche.h b/src/mame/includes/avalnche.h index 4116ef7f9f7..f32a56e5500 100644 --- a/src/mame/includes/avalnche.h +++ b/src/mame/includes/avalnche.h @@ -6,10 +6,9 @@ *************************************************************************/ +#include "machine/74259.h" #include "sound/discrete.h" - - class avalnche_state : public driver_device { public: @@ -17,10 +16,13 @@ public: : driver_device(mconfig, type, tag), m_videoram(*this, "videoram"), m_discrete(*this, "discrete"), - m_maincpu(*this, "maincpu") { } + m_maincpu(*this, "maincpu"), + m_latch(*this, "latch") { } required_shared_ptr m_videoram; optional_device m_discrete; + required_device m_maincpu; + required_device m_latch; uint8_t m_avalance_video_inverted; @@ -35,7 +37,6 @@ public: DECLARE_WRITE_LINE_MEMBER(catch_aud0_w); DECLARE_WRITE_LINE_MEMBER(catch_aud1_w); DECLARE_WRITE_LINE_MEMBER(catch_aud2_w); - required_device m_maincpu; void avalnche_base(machine_config &config); void acatch(machine_config &config); void acatch_sound(machine_config &config); diff --git a/src/mame/includes/bagman.h b/src/mame/includes/bagman.h index adc00f277d5..135596da4b3 100644 --- a/src/mame/includes/bagman.h +++ b/src/mame/includes/bagman.h @@ -16,6 +16,7 @@ public: bagman_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu"), + m_mainlatch(*this, "mainlatch"), m_gfxdecode(*this, "gfxdecode"), m_palette(*this, "palette"), m_tmsprom(*this, "tmsprom"), @@ -25,6 +26,7 @@ public: m_spriteram(*this, "spriteram") { } + void bagman_base(machine_config &config); void botanic(machine_config &config); void sbagman(machine_config &config); void bagman(machine_config &config); @@ -67,6 +69,7 @@ protected: private: required_device m_maincpu; + required_device m_mainlatch; required_device m_gfxdecode; required_device m_palette; optional_device m_tmsprom; diff --git a/src/mame/includes/carpolo.h b/src/mame/includes/carpolo.h index e36fa4114d7..be80fa20ec4 100644 --- a/src/mame/includes/carpolo.h +++ b/src/mame/includes/carpolo.h @@ -124,7 +124,7 @@ private: DECLARE_WRITE_LINE_MEMBER(ls153_za_w); DECLARE_WRITE_LINE_MEMBER(ls153_zb_w); - TTL74148_OUTPUT_CB(ttl74148_3s_cb); + DECLARE_WRITE8_MEMBER(ttl74148_3s_cb); void remap_sprite_code(int bank, int code, int *remapped_code, int *flipy); void normalize_coordinates(int *x1, int *y1, int *x2, int *y2); diff --git a/src/mame/includes/centiped.h b/src/mame/includes/centiped.h index 728f44d0b12..20b52e065ee 100644 --- a/src/mame/includes/centiped.h +++ b/src/mame/includes/centiped.h @@ -10,6 +10,7 @@ #pragma once +#include "machine/74259.h" #include "machine/eepromser.h" #include "machine/er2055.h" #include "machine/timer.h" @@ -28,6 +29,7 @@ public: m_paletteram(*this, "paletteram"), m_bullsdrt_tiles_bankram(*this, "bullsdrt_bank"), m_maincpu(*this, "maincpu"), + m_outlatch(*this, "outlatch"), m_earom(*this, "earom"), m_eeprom(*this, "eeprom"), m_gfxdecode(*this, "gfxdecode"), @@ -59,6 +61,7 @@ private: optional_shared_ptr m_bullsdrt_tiles_bankram; required_device m_maincpu; + required_device m_outlatch; optional_device m_earom; optional_device m_eeprom; required_device m_gfxdecode; diff --git a/src/mame/includes/champbas.h b/src/mame/includes/champbas.h index 1827a1d206f..8f0af3d570c 100644 --- a/src/mame/includes/champbas.h +++ b/src/mame/includes/champbas.h @@ -10,6 +10,7 @@ #pragma once +#include "machine/74259.h" #include "machine/alpha8201.h" #include "machine/timer.h" #include "machine/watchdog.h" @@ -22,6 +23,7 @@ public: champbas_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu"), + m_mainlatch(*this, "mainlatch"), m_alpha_8201(*this, "alpha_8201"), m_watchdog(*this, "watchdog"), m_gfxdecode(*this, "gfxdecode"), @@ -81,6 +83,7 @@ protected: // devices, memory pointers required_device m_maincpu; + required_device m_mainlatch; optional_device m_alpha_8201; required_device m_watchdog; required_device m_gfxdecode; diff --git a/src/mame/includes/fastfred.h b/src/mame/includes/fastfred.h index fd090b0abd6..be8769a0bc3 100644 --- a/src/mame/includes/fastfred.h +++ b/src/mame/includes/fastfred.h @@ -7,18 +7,21 @@ ***************************************************************************/ +#include "machine/74259.h" #include "includes/galaxold.h" class fastfred_state : public galaxold_state { public: fastfred_state(const machine_config &mconfig, device_type type, const char *tag) - : galaxold_state(mconfig, type, tag), - m_videoram(*this, "videoram"), - m_spriteram(*this, "spriteram"), - m_attributesram(*this, "attributesram"), - m_background_color(*this, "bgcolor"), - m_imago_fg_videoram(*this, "imago_fg_vram") { } + : galaxold_state(mconfig, type, tag) + , m_outlatch(*this, "outlatch") + , m_videoram(*this, "videoram") + , m_spriteram(*this, "spriteram") + , m_attributesram(*this, "attributesram") + , m_background_color(*this, "bgcolor") + , m_imago_fg_videoram(*this, "imago_fg_vram") + { } void jumpcoas(machine_config &config); void imago(machine_config &config); @@ -33,6 +36,7 @@ public: void init_boggy84b(); private: + required_device m_outlatch; required_shared_ptr m_videoram; required_shared_ptr m_spriteram; required_shared_ptr m_attributesram; diff --git a/src/mame/includes/freekick.h b/src/mame/includes/freekick.h index 5d6749ce2ee..da360babc90 100644 --- a/src/mame/includes/freekick.h +++ b/src/mame/includes/freekick.h @@ -1,6 +1,7 @@ // license:BSD-3-Clause // copyright-holders:Tomasz Slanina,David Haywood +#include "machine/74259.h" #include "emupal.h" class freekick_state : public driver_device @@ -13,6 +14,7 @@ public: m_maincpu(*this, "maincpu"), m_gfxdecode(*this, "gfxdecode"), m_palette(*this, "palette"), + m_outlatch(*this, "outlatch"), m_bank1(*this, "bank1"), m_bank1d(*this, "bank1d") { } @@ -81,6 +83,7 @@ private: required_device m_maincpu; required_device m_gfxdecode; required_device m_palette; + required_device m_outlatch; optional_memory_bank m_bank1, m_bank1d; void decrypted_opcodes_map(address_map &map); void freekick_io_map(address_map &map); diff --git a/src/mame/includes/hnayayoi.h b/src/mame/includes/hnayayoi.h index 30192fdd840..bbd318c723a 100644 --- a/src/mame/includes/hnayayoi.h +++ b/src/mame/includes/hnayayoi.h @@ -10,6 +10,7 @@ #pragma once +#include "machine/74259.h" #include "sound/msm5205.h" #include "video/mc6845.h" #include "emupal.h" @@ -20,6 +21,7 @@ public: hnayayoi_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu"), + m_mainlatch(*this, "mainlatch"), m_msm(*this, "msm"), m_palette(*this, "palette") { } @@ -64,6 +66,7 @@ private: void draw_layer_interleaved(bitmap_rgb32 &bitmap, const rectangle &cliprect, uint16_t row, uint16_t y, uint8_t x_count, int left_pixmap, int right_pixmap, int palbase, bool transp); DECLARE_WRITE_LINE_MEMBER(irqhandler); required_device m_maincpu; + required_device m_mainlatch; required_device m_msm; required_device m_palette; void hnayayoi_io_map(address_map &map); diff --git a/src/mame/includes/marineb.h b/src/mame/includes/marineb.h index 64c5c25a8b6..baa5064772f 100644 --- a/src/mame/includes/marineb.h +++ b/src/mame/includes/marineb.h @@ -5,6 +5,7 @@ #pragma once +#include "machine/74259.h" #include "emupal.h" class marineb_state : public driver_device @@ -18,7 +19,8 @@ public: m_maincpu(*this, "maincpu"), m_audiocpu(*this, "audiocpu"), m_gfxdecode(*this, "gfxdecode"), - m_palette(*this, "palette") + m_palette(*this, "palette"), + m_outlatch(*this, "outlatch") { } void springer(machine_config &config); @@ -47,6 +49,7 @@ private: optional_device m_audiocpu; required_device m_gfxdecode; required_device m_palette; + required_device m_outlatch; bool m_irq_mask; DECLARE_WRITE_LINE_MEMBER(irq_mask_w); diff --git a/src/mame/includes/mermaid.h b/src/mame/includes/mermaid.h index 877959e0b00..e5d193b9f1a 100644 --- a/src/mame/includes/mermaid.h +++ b/src/mame/includes/mermaid.h @@ -6,6 +6,7 @@ *************************************************************************/ +#include "machine/74259.h" #include "machine/ripple_counter.h" #include "sound/msm5205.h" #include "sound/ay8910.h" @@ -29,7 +30,8 @@ public: m_ay8910(*this, "ay%u", 1), m_gfxdecode(*this, "gfxdecode"), m_screen(*this, "screen"), - m_palette(*this, "palette") + m_palette(*this, "palette"), + m_latch(*this, "latch%u", 1U) { } @@ -73,6 +75,7 @@ private: required_device m_gfxdecode; required_device m_screen; required_device m_palette; + required_device_array m_latch; uint8_t m_nmi_mask; DECLARE_WRITE8_MEMBER(mermaid_ay8910_write_port_w); diff --git a/src/mame/includes/neogeo.h b/src/mame/includes/neogeo.h index 2dcf356dd0c..9c18198534b 100644 --- a/src/mame/includes/neogeo.h +++ b/src/mame/includes/neogeo.h @@ -14,6 +14,7 @@ #include "cpu/m68000/m68000.h" #include "cpu/z80/z80.h" #include "sound/2610intf.h" +#include "machine/74259.h" #include "machine/gen_latch.h" #include "machine/input_merger.h" #include "machine/upd1990a.h" @@ -49,6 +50,7 @@ protected: , m_screen(*this, "screen") , m_palette(*this, "palette") , m_memcard(*this, "memcard") + , m_systemlatch(*this, "systemlatch") , m_soundlatch(*this, "soundlatch") , m_soundlatch2(*this, "soundlatch2") , m_region_maincpu(*this, "maincpu") @@ -123,6 +125,7 @@ protected: required_device m_screen; optional_device m_palette; optional_device m_memcard; + required_device m_systemlatch; required_device m_soundlatch; required_device m_soundlatch2; diff --git a/src/mame/includes/pacman.h b/src/mame/includes/pacman.h index 076c10e2f69..37bde0abccc 100644 --- a/src/mame/includes/pacman.h +++ b/src/mame/includes/pacman.h @@ -5,6 +5,7 @@ #pragma once +#include "machine/74259.h" #include "machine/watchdog.h" #include "sound/namco.h" #include "emupal.h" @@ -21,6 +22,7 @@ public: pacman_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag) , m_maincpu(*this, "maincpu") + , m_mainlatch(*this, "mainlatch") , m_namco_sound(*this, "namco") , m_watchdog(*this, "watchdog") , m_spriteram(*this, "spriteram") @@ -65,6 +67,7 @@ public: void woodpek_map(address_map &map); void writeport(address_map &map); protected: + optional_device m_mainlatch; optional_device m_namco_sound; required_device m_watchdog; optional_shared_ptr m_spriteram; @@ -227,7 +230,7 @@ public: void crush4(machine_config &config); void bigbucks(machine_config &config); void porky(machine_config &config); - void pacman(machine_config &config); + void pacman(machine_config &config, bool latch = true); void _8bpm(machine_config &config); void maketrax(machine_config &config); void korosuke(machine_config &config); diff --git a/src/mame/includes/retofinv.h b/src/mame/includes/retofinv.h index 784a918e803..66d6402f714 100644 --- a/src/mame/includes/retofinv.h +++ b/src/mame/includes/retofinv.h @@ -5,9 +5,9 @@ #pragma once -#include "machine/taito68705interface.h" - +#include "machine/74259.h" #include "machine/gen_latch.h" +#include "machine/taito68705interface.h" #include "emupal.h" class retofinv_state : public driver_device @@ -21,6 +21,7 @@ public: , m_68705(*this, "68705") , m_gfxdecode(*this, "gfxdecode") , m_palette(*this, "palette") + , m_mainlatch(*this, "mainlatch") , m_soundlatch(*this, "soundlatch") , m_fg_videoram(*this, "fg_videoram") , m_sharedram(*this, "sharedram") @@ -74,6 +75,7 @@ private: optional_device m_68705; required_device m_gfxdecode; required_device m_palette; + required_device m_mainlatch; required_device m_soundlatch; required_shared_ptr m_fg_videoram; diff --git a/src/mame/includes/sauro.h b/src/mame/includes/sauro.h index 4e3f34df336..5edb6df55d7 100644 --- a/src/mame/includes/sauro.h +++ b/src/mame/includes/sauro.h @@ -1,6 +1,7 @@ // license:BSD-3-Clause // copyright-holders:Zsolt Vasvari +#include "machine/74259.h" #include "machine/gen_latch.h" #include "sound/sp0256.h" #include "emupal.h" @@ -14,6 +15,7 @@ public: m_gfxdecode(*this, "gfxdecode"), m_palette(*this, "palette"), m_sp0256(*this, "speech"), + m_mainlatch(*this, "mainlatch"), m_soundlatch(*this, "soundlatch"), m_spriteram(*this, "spriteram"), m_videoram(*this, "videoram"), @@ -33,6 +35,7 @@ private: required_device m_gfxdecode; required_device m_palette; optional_device m_sp0256; + optional_device m_mainlatch; optional_device m_soundlatch; // sauro only required_shared_ptr m_spriteram; diff --git a/src/mame/includes/spcforce.h b/src/mame/includes/spcforce.h index c5a34668322..ebda843b00b 100644 --- a/src/mame/includes/spcforce.h +++ b/src/mame/includes/spcforce.h @@ -1,6 +1,7 @@ // license:BSD-3-Clause // copyright-holders:Zsolt Vasvari +#include "machine/74259.h" #include "sound/sn76496.h" #include "emupal.h" @@ -10,6 +11,7 @@ public: spcforce_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu"), + m_mainlatch(*this, "mainlatch"), m_audiocpu(*this, "audiocpu"), m_gfxdecode(*this, "gfxdecode"), m_palette(*this, "palette"), @@ -51,6 +53,7 @@ private: virtual void machine_start() override; required_device m_maincpu; + required_device m_mainlatch; required_device m_audiocpu; required_device m_gfxdecode; required_device m_palette; diff --git a/src/mame/includes/taito_l.h b/src/mame/includes/taito_l.h index c5b0df46027..2d47ee07348 100644 --- a/src/mame/includes/taito_l.h +++ b/src/mame/includes/taito_l.h @@ -126,6 +126,7 @@ public: void raimais_2_map(address_map &map); void raimais_3_map(address_map &map); void raimais_map(address_map &map); + protected: virtual void state_register() override; virtual void taito_machine_reset() override; @@ -223,6 +224,8 @@ public: DECLARE_MACHINE_RESET(palamed); DECLARE_MACHINE_RESET(cachat); + void base(machine_config &config); + void add_muxes(machine_config &config); void palamed(machine_config &config); void plotting(machine_config &config); void puzznici(machine_config &config); diff --git a/src/mame/includes/thepit.h b/src/mame/includes/thepit.h index fe746339e94..7c09fc849b9 100644 --- a/src/mame/includes/thepit.h +++ b/src/mame/includes/thepit.h @@ -1,6 +1,7 @@ // license:BSD-3-Clause // copyright-holders:Zsolt Vasvari +#include "machine/74259.h" #include "emupal.h" class thepit_state : public driver_device @@ -9,6 +10,7 @@ public: thepit_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu"), + m_mainlatch(*this, "mainlatch"), m_gfxdecode(*this, "gfxdecode"), m_palette(*this, "palette"), m_videoram(*this, "videoram"), @@ -26,6 +28,7 @@ public: private: required_device m_maincpu; + required_device m_mainlatch; required_device m_gfxdecode; required_device m_palette; diff --git a/src/mame/includes/trackfld.h b/src/mame/includes/trackfld.h index a27727b5ba6..dc5f54827d2 100644 --- a/src/mame/includes/trackfld.h +++ b/src/mame/includes/trackfld.h @@ -11,6 +11,7 @@ #pragma once #include "audio/trackfld.h" +#include "machine/74259.h" #include "sound/dac.h" #include "sound/sn76496.h" #include "sound/vlm5030.h" @@ -30,6 +31,7 @@ public: m_videoram(*this, "videoram"), m_colorram(*this, "colorram"), m_maincpu(*this, "maincpu"), + m_mainlatch(*this, "mainlatch"), m_audiocpu(*this, "audiocpu"), m_soundbrd(*this, "trackfld_audio"), m_sn(*this, "snsnd"), @@ -86,6 +88,7 @@ private: /* devices */ required_device m_maincpu; + optional_device m_mainlatch; optional_device m_audiocpu; optional_device m_soundbrd; optional_device m_sn; diff --git a/src/mame/includes/twincobr.h b/src/mame/includes/twincobr.h index 6d92b8bc539..16f687075af 100644 --- a/src/mame/includes/twincobr.h +++ b/src/mame/includes/twincobr.h @@ -9,6 +9,7 @@ #pragma once +#include "machine/74259.h" #include "video/mc6845.h" #include "video/bufsprite.h" #include "video/toaplan_scu.h" @@ -28,7 +29,9 @@ public: m_spritegen(*this, "scu"), m_gfxdecode(*this, "gfxdecode"), m_screen(*this, "screen"), - m_palette(*this, "palette") + m_palette(*this, "palette"), + m_mainlatch(*this, "mainlatch"), + m_coinlatch(*this, "coinlatch") { } void twincobr(machine_config &config); @@ -136,6 +139,8 @@ protected: required_device m_gfxdecode; required_device m_screen; required_device m_palette; + required_device m_mainlatch; + required_device m_coinlatch; void DSP_io_map(address_map &map); void DSP_program_map(address_map &map); diff --git a/src/mame/includes/vertigo.h b/src/mame/includes/vertigo.h index a3ce392725b..fe70c5c47cd 100644 --- a/src/mame/includes/vertigo.h +++ b/src/mame/includes/vertigo.h @@ -51,7 +51,7 @@ private: TIMER_CALLBACK_MEMBER(sound_command_w); DECLARE_WRITE_LINE_MEMBER(v_irq4_w); DECLARE_WRITE_LINE_MEMBER(v_irq3_w); - TTL74148_OUTPUT_CB(update_irq); + DECLARE_WRITE8_MEMBER(update_irq); virtual void machine_start() override; virtual void machine_reset() override; diff --git a/src/mame/includes/warpwarp.h b/src/mame/includes/warpwarp.h index 8917d0c764f..072c61dc81e 100644 --- a/src/mame/includes/warpwarp.h +++ b/src/mame/includes/warpwarp.h @@ -1,6 +1,7 @@ // license:BSD-3-Clause // copyright-holders:Chris Hardy +#include "machine/74259.h" #include "machine/watchdog.h" #include "audio/geebee.h" #include "audio/warpwarp.h" @@ -19,6 +20,7 @@ public: m_geebee_videoram(*this, "geebee_videoram"), m_videoram(*this, "videoram"), m_palette(*this, "palette"), + m_latch(*this, "latch"), m_in0(*this, "IN0"), m_in1(*this, "IN1"), m_in2(*this, "IN2"), @@ -53,6 +55,7 @@ private: optional_shared_ptr m_geebee_videoram; optional_shared_ptr m_videoram; optional_device m_palette; + optional_device m_latch; optional_ioport m_in0; optional_ioport m_in1; optional_ioport m_in2; diff --git a/src/mame/includes/williams.h b/src/mame/includes/williams.h index 7a3c32183fa..2502f00751a 100644 --- a/src/mame/includes/williams.h +++ b/src/mame/includes/williams.h @@ -7,15 +7,16 @@ **************************************************************************/ -#include "cpu/m6809/m6809.h" +#include "audio/williams.h" #include "cpu/m6800/m6800.h" -#include "sound/hc55516.h" +#include "cpu/m6809/m6809.h" +#include "machine/6821pia.h" +#include "machine/74157.h" +#include "machine/bankdev.h" #include "machine/ticket.h" #include "machine/timer.h" #include "machine/watchdog.h" -#include "machine/6821pia.h" -#include "machine/bankdev.h" -#include "audio/williams.h" +#include "sound/hc55516.h" #include "emupal.h" #include "screen.h" @@ -29,6 +30,11 @@ public: m_mainbank(*this, "mainbank"), m_maincpu(*this, "maincpu"), m_soundcpu(*this, "soundcpu"), + m_mux(*this, "mux"), + m_mux0(*this, "mux_0"), + m_mux1(*this, "mux_1"), + m_muxa(*this, "mux_a"), + m_muxb(*this, "mux_b"), m_bankc000(*this, "bankc000"), m_watchdog(*this, "watchdog"), m_screen(*this, "screen"), @@ -125,6 +131,11 @@ protected: required_device m_maincpu; required_device m_soundcpu; + optional_device m_mux; + optional_device m_mux0; + optional_device m_mux1; + optional_device m_muxa; + optional_device m_muxb; optional_device m_bankc000; required_device m_watchdog; required_device m_screen; diff --git a/src/mame/machine/carpolo.cpp b/src/mame/machine/carpolo.cpp index 636987a260b..b58b8a1a3b1 100644 --- a/src/mame/machine/carpolo.cpp +++ b/src/mame/machine/carpolo.cpp @@ -57,7 +57,7 @@ #define CAR_BORDER_EXTRA_BITS 0x50 -TTL74148_OUTPUT_CB(carpolo_state::ttl74148_3s_cb) +WRITE8_MEMBER(carpolo_state::ttl74148_3s_cb) { m_maincpu->set_input_line(M6502_IRQ_LINE, m_ttl74148_3s->output_valid_r() ? CLEAR_LINE : ASSERT_LINE); } diff --git a/src/mame/machine/vertigo.cpp b/src/mame/machine/vertigo.cpp index 4f4a7b56ec2..da3ea2c1ef6 100644 --- a/src/mame/machine/vertigo.cpp +++ b/src/mame/machine/vertigo.cpp @@ -19,12 +19,12 @@ * *************************************/ -TTL74148_OUTPUT_CB(vertigo_state::update_irq) +WRITE8_MEMBER(vertigo_state::update_irq) { if (m_irq_state < 7) m_maincpu->set_input_line(m_irq_state ^ 7, CLEAR_LINE); - m_irq_state = m_ttl74148->output_r(); + m_irq_state = data; if (m_irq_state < 7) m_maincpu->set_input_line(m_irq_state ^ 7, ASSERT_LINE); -- cgit v1.2.3