From d185880c34f81dad033039a2d519076237edbac1 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Wed, 17 Oct 2012 06:57:18 +0000 Subject: [PATCH] changed 7474 to use devcb2 (no whatsnew) --- src/emu/machine/7474.c | 62 +++--------------------------------- src/emu/machine/7474.h | 33 +++++++------------ src/mame/audio/scramble.c | 6 ++-- src/mame/drivers/carpolo.c | 24 +++++++------- src/mame/drivers/dambustr.c | 4 +-- src/mame/drivers/galaxold.c | 4 +-- src/mame/drivers/scobra.c | 12 +++---- src/mame/drivers/scramble.c | 12 +++---- src/mame/includes/carpolo.h | 11 +++---- src/mame/includes/galaxold.h | 9 +++--- src/mame/includes/scramble.h | 2 +- src/mame/machine/carpolo.c | 12 ++++--- src/mame/machine/galaxold.c | 9 +++--- 13 files changed, 69 insertions(+), 131 deletions(-) diff --git a/src/emu/machine/7474.c b/src/emu/machine/7474.c index 0c5570913a9..c66b92c8ede 100644 --- a/src/emu/machine/7474.c +++ b/src/emu/machine/7474.c @@ -54,65 +54,13 @@ const device_type MACHINE_TTL7474 = &device_creator; //------------------------------------------------- ttl7474_device::ttl7474_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : device_t(mconfig, MACHINE_TTL7474, "7474", tag, owner, clock) + : device_t(mconfig, MACHINE_TTL7474, "7474", tag, owner, clock), + m_output_func(*this), + m_comp_output_func(*this) { - memset(&m_output_cb, 0, sizeof(m_output_cb)); - memset(&m_comp_output_cb, 0, sizeof(m_comp_output_cb)); init(); } - -//------------------------------------------------- -// static_set_target_tag - configuration helper -// to set the target tag -//------------------------------------------------- - -void ttl7474_device::static_set_target_tag(device_t &device, const char *tag) -{ - ttl7474_device &ttl7474 = downcast(device); - ttl7474.m_output_cb.tag = tag; - ttl7474.m_comp_output_cb.tag = tag; -} - - -//------------------------------------------------- -// static_set_output_cb - configuration helper -// to set the output callback -//------------------------------------------------- - -void ttl7474_device::static_set_output_cb(device_t &device, write_line_device_func callback) -{ - ttl7474_device &ttl7474 = downcast(device); - if (callback != NULL) - { - ttl7474.m_output_cb.type = DEVCB_TYPE_DEVICE; - ttl7474.m_output_cb.index = 0; - ttl7474.m_output_cb.writeline = callback; - } - else - ttl7474.m_output_cb.type = DEVCB_TYPE_NULL; -} - - -//------------------------------------------------- -// static_set_comp_output_cb - configuration -// helper to set the comp. output callback -//------------------------------------------------- - -void ttl7474_device::static_set_comp_output_cb(device_t &device, write_line_device_func callback) -{ - ttl7474_device &ttl7474 = downcast(device); - if (callback != NULL) - { - ttl7474.m_comp_output_cb.type = DEVCB_TYPE_DEVICE; - ttl7474.m_comp_output_cb.index = 0; - ttl7474.m_comp_output_cb.writeline = callback; - } - else - ttl7474.m_comp_output_cb.type = DEVCB_TYPE_NULL; -} - - //------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- @@ -129,8 +77,8 @@ void ttl7474_device::device_start() save_item(NAME(m_last_output)); save_item(NAME(m_last_output_comp)); - m_output_func.resolve(m_output_cb, *this); - m_comp_output_func.resolve(m_comp_output_cb, *this); + m_output_func.resolve_safe(); + m_comp_output_func.resolve_safe(); } diff --git a/src/emu/machine/7474.h b/src/emu/machine/7474.h index 026b7d1c5db..c246f36a31e 100644 --- a/src/emu/machine/7474.h +++ b/src/emu/machine/7474.h @@ -50,26 +50,21 @@ // INTERFACE CONFIGURATION MACROS //************************************************************************** -#define MCFG_7474_ADD(_tag, _target_tag, _output_cb, _comp_output_cb) \ +#define MCFG_7474_ADD(_tag, _output_cb, _comp_output_cb) \ MCFG_DEVICE_ADD(_tag, MACHINE_TTL7474, 0) \ - MCFG_7474_TARGET_TAG(_target_tag) \ MCFG_7474_OUTPUT_CB(_output_cb) \ MCFG_7474_COMP_OUTPUT_CB(_comp_output_cb) -#define MCFG_7474_REPLACE(_tag, _target_tag, _output_cb, _comp_output_cb) \ +#define MCFG_7474_REPLACE(_tag, _output_cb, _comp_output_cb) \ MCFG_DEVICE_REPLACE(_tag, TTL7474, 0) \ - MCFG_7474_TARGET_TAG(_target_tag) \ MCFG_7474_OUTPUT_CB(_output_cb) \ MCFG_7474_COMP_OUTPUT_CB(_comp_output_cb) -#define MCFG_7474_TARGET_TAG(_target_tag) \ - ttl7474_device::static_set_target_tag(*device, _target_tag); \ +#define MCFG_7474_OUTPUT_CB(_devcb) \ + devcb = &ttl7474_device::set_output_cb(*device, DEVCB2_##_devcb); \ -#define MCFG_7474_OUTPUT_CB(_cb) \ - ttl7474_device::static_set_output_cb(*device, _cb); \ - -#define MCFG_7474_COMP_OUTPUT_CB(_cb) \ - ttl7474_device::static_set_comp_output_cb(*device, _cb); \ +#define MCFG_7474_COMP_OUTPUT_CB(_devcb) \ + devcb = &ttl7474_device::set_comp_output_cb(*device, DEVCB2_##_devcb); \ @@ -85,10 +80,9 @@ public: // construction/destruction ttl7474_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - // inline configuration helpers - static void static_set_target_tag(device_t &device, const char *tag); - static void static_set_output_cb(device_t &device, write_line_device_func callback); - static void static_set_comp_output_cb(device_t &device, write_line_device_func callback); + // static configuration helpers + template static devcb2_base &set_output_cb(device_t &device, _Object object) { return downcast(device).m_output_func.set_callback(object); } + template static devcb2_base &set_comp_output_cb(device_t &device, _Object object) { return downcast(device).m_comp_output_func.set_callback(object); } // public interfaces DECLARE_WRITE_LINE_MEMBER( clear_w ); @@ -104,15 +98,10 @@ protected: virtual void device_reset(); virtual void device_post_load() { } virtual void device_clock_changed() { } - - // configuration state - devcb_write_line m_output_cb; - devcb_write_line m_comp_output_cb; - private: // callbacks - devcb_resolved_write_line m_output_func; - devcb_resolved_write_line m_comp_output_func; + devcb2_write_line m_output_func; + devcb2_write_line m_comp_output_func; // inputs UINT8 m_clear; // pin 1/13 diff --git a/src/mame/audio/scramble.c b/src/mame/audio/scramble.c index 2228d7ab0d8..f9f59e19c4c 100644 --- a/src/mame/audio/scramble.c +++ b/src/mame/audio/scramble.c @@ -110,12 +110,12 @@ static IRQ_CALLBACK(scramble_sh_irq_callback) return 0xff; } -WRITE_LINE_DEVICE_HANDLER( scramble_sh_7474_q_callback ) +WRITE_LINE_MEMBER(scramble_state::scramble_sh_7474_q_callback) { /* the Q bar is connected to the Z80's INT line. But since INT is complemented, */ /* we need to complement Q bar */ - if (device->machine().device("audiocpu")) - device->machine().device("audiocpu")->execute().set_input_line(0, !state ? ASSERT_LINE : CLEAR_LINE); + if (machine().device("audiocpu")) + machine().device("audiocpu")->execute().set_input_line(0, !state ? ASSERT_LINE : CLEAR_LINE); } WRITE8_MEMBER(scramble_state::hotshock_sh_irqtrigger_w) diff --git a/src/mame/drivers/carpolo.c b/src/mame/drivers/carpolo.c index 92d6a0bd04c..a511f7aa6da 100644 --- a/src/mame/drivers/carpolo.c +++ b/src/mame/drivers/carpolo.c @@ -251,18 +251,18 @@ static MACHINE_CONFIG_START( carpolo, carpolo_state ) MCFG_PIA6821_ADD("pia0", carpolo_pia0_intf) MCFG_PIA6821_ADD("pia1", carpolo_pia1_intf) - MCFG_7474_ADD("7474_2s_1", "74148_3s", NULL, carpolo_7474_2s_1_q_cb) - MCFG_7474_ADD("7474_2s_2", "74148_3s", NULL, carpolo_7474_2s_2_q_cb) - MCFG_7474_ADD("7474_2u_1", "74148_3s", NULL, carpolo_7474_2u_1_q_cb) - MCFG_7474_ADD("7474_2u_2", "74148_3s", NULL, carpolo_7474_2u_2_q_cb) - MCFG_7474_ADD("7474_1f_1", NULL, NULL, NULL) - MCFG_7474_ADD("7474_1f_2", NULL, NULL, NULL) - MCFG_7474_ADD("7474_1d_1", NULL, NULL, NULL) - MCFG_7474_ADD("7474_1d_2", NULL, NULL, NULL) - MCFG_7474_ADD("7474_1c_1", NULL, NULL, NULL) - MCFG_7474_ADD("7474_1c_2", NULL, NULL, NULL) - MCFG_7474_ADD("7474_1a_1", NULL, NULL, NULL) - MCFG_7474_ADD("7474_1a_2", NULL, NULL, NULL) + MCFG_7474_ADD("7474_2s_1", NOOP, WRITELINE(carpolo_state, carpolo_7474_2s_1_q_cb)) + MCFG_7474_ADD("7474_2s_2", NOOP, WRITELINE(carpolo_state, carpolo_7474_2s_2_q_cb)) + MCFG_7474_ADD("7474_2u_1", NOOP, WRITELINE(carpolo_state, carpolo_7474_2u_1_q_cb)) + MCFG_7474_ADD("7474_2u_2", NOOP, WRITELINE(carpolo_state, carpolo_7474_2u_2_q_cb)) + MCFG_7474_ADD("7474_1f_1", NOOP, NOOP) + MCFG_7474_ADD("7474_1f_2", NOOP, NOOP) + MCFG_7474_ADD("7474_1d_1", NOOP, NOOP) + MCFG_7474_ADD("7474_1d_2", NOOP, NOOP) + MCFG_7474_ADD("7474_1c_1", NOOP, NOOP) + MCFG_7474_ADD("7474_1c_2", NOOP, NOOP) + MCFG_7474_ADD("7474_1a_1", NOOP, NOOP) + MCFG_7474_ADD("7474_1a_2", NOOP, NOOP) MCFG_74148_ADD("74148_3s", carpolo_ttl74148_intf) MCFG_74153_ADD("74153_1k", carpolo_ttl74153_intf) diff --git a/src/mame/drivers/dambustr.c b/src/mame/drivers/dambustr.c index 0aef6a5acfd..2c46b7e3fa6 100644 --- a/src/mame/drivers/dambustr.c +++ b/src/mame/drivers/dambustr.c @@ -251,8 +251,8 @@ static MACHINE_CONFIG_START( dambustr, dambustr_state ) MCFG_MACHINE_RESET_OVERRIDE(dambustr_state,galaxold) - MCFG_7474_ADD("7474_9m_1", "7474_9m_1", galaxold_7474_9m_1_callback, NULL) - MCFG_7474_ADD("7474_9m_2", "7474_9m_1", NULL, galaxold_7474_9m_2_q_callback) + MCFG_7474_ADD("7474_9m_1", WRITELINE(dambustr_state,galaxold_7474_9m_1_callback), NOOP) + MCFG_7474_ADD("7474_9m_2", NOOP, WRITELINE(dambustr_state,galaxold_7474_9m_2_q_callback)) MCFG_TIMER_DRIVER_ADD("int_timer", dambustr_state, galaxold_interrupt_timer) diff --git a/src/mame/drivers/galaxold.c b/src/mame/drivers/galaxold.c index 51d68a65d1b..8773550e655 100644 --- a/src/mame/drivers/galaxold.c +++ b/src/mame/drivers/galaxold.c @@ -2176,8 +2176,8 @@ static MACHINE_CONFIG_START( galaxold_base, galaxold_state ) MCFG_MACHINE_RESET_OVERRIDE(galaxold_state,galaxold) - MCFG_7474_ADD("7474_9m_1", "7474_9m_1", galaxold_7474_9m_1_callback, NULL) - MCFG_7474_ADD("7474_9m_2", "7474_9m_1", NULL, galaxold_7474_9m_2_q_callback) + MCFG_7474_ADD("7474_9m_1", WRITELINE(galaxold_state,galaxold_7474_9m_1_callback), NOOP) + MCFG_7474_ADD("7474_9m_2", NOOP, WRITELINE(galaxold_state,galaxold_7474_9m_2_q_callback)) MCFG_TIMER_DRIVER_ADD("int_timer", galaxold_state, galaxold_interrupt_timer) diff --git a/src/mame/drivers/scobra.c b/src/mame/drivers/scobra.c index 0b3a140c157..8cb8bace9ff 100644 --- a/src/mame/drivers/scobra.c +++ b/src/mame/drivers/scobra.c @@ -735,15 +735,15 @@ static MACHINE_CONFIG_START( type1, scobra_state ) MCFG_CPU_PROGRAM_MAP(scobra_sound_map) MCFG_CPU_IO_MAP(scobra_sound_io_map) - MCFG_7474_ADD("konami_7474", "konami_7474", NULL, scramble_sh_7474_q_callback) + MCFG_7474_ADD("konami_7474", NOOP, WRITELINE(scobra_state,scramble_sh_7474_q_callback)) MCFG_MACHINE_RESET_OVERRIDE(scobra_state,scramble) MCFG_I8255A_ADD( "ppi8255_0", scramble_ppi_0_intf ) MCFG_I8255A_ADD( "ppi8255_1", scramble_ppi_1_intf ) - MCFG_7474_ADD("7474_9m_1", "7474_9m_1", galaxold_7474_9m_1_callback, NULL) - MCFG_7474_ADD("7474_9m_2", "7474_9m_1", NULL, galaxold_7474_9m_2_q_callback) + MCFG_7474_ADD("7474_9m_1", WRITELINE(scobra_state,galaxold_7474_9m_1_callback), NOOP) + MCFG_7474_ADD("7474_9m_2", NOOP, WRITELINE(scobra_state,galaxold_7474_9m_2_q_callback)) MCFG_TIMER_DRIVER_ADD("int_timer", scobra_state, galaxold_interrupt_timer) @@ -857,12 +857,12 @@ static MACHINE_CONFIG_START( hustler, scobra_state ) MCFG_CPU_PROGRAM_MAP(hustler_sound_map) MCFG_CPU_IO_MAP(hustler_sound_io_map) - MCFG_7474_ADD("konami_7474", "konami_7474", NULL, scramble_sh_7474_q_callback) + MCFG_7474_ADD("konami_7474", NOOP, WRITELINE(scobra_state,scramble_sh_7474_q_callback)) MCFG_MACHINE_RESET_OVERRIDE(scobra_state,scramble) - MCFG_7474_ADD("7474_9m_1", "7474_9m_1", galaxold_7474_9m_1_callback, NULL) - MCFG_7474_ADD("7474_9m_2", "7474_9m_1", NULL, galaxold_7474_9m_2_q_callback) + MCFG_7474_ADD("7474_9m_1", WRITELINE(scobra_state,galaxold_7474_9m_1_callback), NOOP) + MCFG_7474_ADD("7474_9m_2", NOOP, WRITELINE(scobra_state,galaxold_7474_9m_2_q_callback)) MCFG_TIMER_DRIVER_ADD("int_timer", scobra_state, galaxold_interrupt_timer) diff --git a/src/mame/drivers/scramble.c b/src/mame/drivers/scramble.c index 25a926f3f41..47048034be1 100644 --- a/src/mame/drivers/scramble.c +++ b/src/mame/drivers/scramble.c @@ -1326,10 +1326,10 @@ static MACHINE_CONFIG_START( scramble, scramble_state ) MCFG_CPU_PROGRAM_MAP(scramble_sound_map) MCFG_CPU_IO_MAP(scramble_sound_io_map) - MCFG_7474_ADD("7474_9m_1", "7474_9m_1", galaxold_7474_9m_1_callback, NULL) - MCFG_7474_ADD("7474_9m_2", "7474_9m_1", NULL, galaxold_7474_9m_2_q_callback) + MCFG_7474_ADD("7474_9m_1", WRITELINE(scramble_state,galaxold_7474_9m_1_callback), NOOP) + MCFG_7474_ADD("7474_9m_2", NOOP, WRITELINE(scramble_state,galaxold_7474_9m_2_q_callback)) - MCFG_7474_ADD("konami_7474", "konami_7474", NULL, scramble_sh_7474_q_callback) + MCFG_7474_ADD("konami_7474", NOOP, WRITELINE(scramble_state,scramble_sh_7474_q_callback)) MCFG_TIMER_DRIVER_ADD("int_timer", scramble_state, galaxold_interrupt_timer) @@ -1558,9 +1558,9 @@ static MACHINE_CONFIG_START( ad2083, scramble_state ) MCFG_CPU_ADD("maincpu", Z80, 18432000/6) /* 3.072 MHz */ MCFG_CPU_PROGRAM_MAP(ad2083_map) - MCFG_7474_ADD("konami_7474", "konami_7474", NULL, scramble_sh_7474_q_callback) - MCFG_7474_ADD("7474_9m_1", "7474_9m_1", galaxold_7474_9m_1_callback, NULL) - MCFG_7474_ADD("7474_9m_2", "7474_9m_1", NULL, galaxold_7474_9m_2_q_callback) + MCFG_7474_ADD("konami_7474", NOOP, WRITELINE(scramble_state,scramble_sh_7474_q_callback)) + MCFG_7474_ADD("7474_9m_1", WRITELINE(scramble_state,galaxold_7474_9m_1_callback), NOOP) + MCFG_7474_ADD("7474_9m_2", NOOP, WRITELINE(scramble_state,galaxold_7474_9m_2_q_callback)) MCFG_TIMER_DRIVER_ADD("int_timer", scramble_state, galaxold_interrupt_timer) diff --git a/src/mame/includes/carpolo.h b/src/mame/includes/carpolo.h index 1e45ba93ea2..e7d7bf9658d 100644 --- a/src/mame/includes/carpolo.h +++ b/src/mame/includes/carpolo.h @@ -78,6 +78,11 @@ public: DECLARE_READ8_MEMBER(pia_0_port_b_r); DECLARE_READ8_MEMBER(pia_1_port_a_r); DECLARE_READ8_MEMBER(pia_1_port_b_r); + DECLARE_WRITE_LINE_MEMBER(carpolo_7474_2s_1_q_cb); + DECLARE_WRITE_LINE_MEMBER(carpolo_7474_2s_2_q_cb); + DECLARE_WRITE_LINE_MEMBER(carpolo_7474_2u_1_q_cb); + DECLARE_WRITE_LINE_MEMBER(carpolo_7474_2u_2_q_cb); + }; @@ -87,12 +92,6 @@ extern const pia6821_interface carpolo_pia0_intf; extern const pia6821_interface carpolo_pia1_intf; void carpolo_74148_3s_cb(device_t *device); - -WRITE_LINE_DEVICE_HANDLER( carpolo_7474_2s_1_q_cb ); -WRITE_LINE_DEVICE_HANDLER( carpolo_7474_2s_2_q_cb ); -WRITE_LINE_DEVICE_HANDLER( carpolo_7474_2u_1_q_cb ); -WRITE_LINE_DEVICE_HANDLER( carpolo_7474_2u_2_q_cb ); - void carpolo_generate_car_car_interrupt(running_machine &machine, int car1, int car2); void carpolo_generate_ball_screen_interrupt(running_machine &machine, UINT8 cause); void carpolo_generate_car_goal_interrupt(running_machine &machine, int car, int right_goal); diff --git a/src/mame/includes/galaxold.h b/src/mame/includes/galaxold.h index 1bf08d71476..a41ca8fa87d 100644 --- a/src/mame/includes/galaxold.h +++ b/src/mame/includes/galaxold.h @@ -183,17 +183,16 @@ public: TIMER_CALLBACK_MEMBER(stars_blink_callback); TIMER_CALLBACK_MEMBER(stars_scroll_callback); TIMER_DEVICE_CALLBACK_MEMBER(galaxold_interrupt_timer); + DECLARE_WRITE_LINE_MEMBER(galaxold_7474_9m_2_q_callback); + DECLARE_WRITE_LINE_MEMBER(galaxold_7474_9m_1_callback); + + }; /*----------- defined in video/galaxold.c -----------*/ void galaxold_init_stars(running_machine &machine, int colors_offset); void galaxold_draw_stars(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect); -/*----------- defined in machine/galaxold.c -----------*/ - -WRITE_LINE_DEVICE_HANDLER( galaxold_7474_9m_2_q_callback ); -WRITE_LINE_DEVICE_HANDLER( galaxold_7474_9m_1_callback ); - #define galaxold_coin_counter_0_w galaxold_coin_counter_w #endif diff --git a/src/mame/includes/scramble.h b/src/mame/includes/scramble.h index 1c21f28267c..e5503443e8f 100644 --- a/src/mame/includes/scramble.h +++ b/src/mame/includes/scramble.h @@ -55,6 +55,7 @@ public: DECLARE_MACHINE_RESET(explorer); DECLARE_WRITE8_MEMBER(scramble_protection_w); DECLARE_READ8_MEMBER(scramble_protection_r); + DECLARE_WRITE_LINE_MEMBER(scramble_sh_7474_q_callback); }; @@ -75,7 +76,6 @@ DECLARE_WRITE8_HANDLER( hunchbks_mirror_w ); /*----------- defined in audio/scramble.c -----------*/ void scramble_sh_init(running_machine &machine); -WRITE_LINE_DEVICE_HANDLER( scramble_sh_7474_q_callback ); DECLARE_READ8_DEVICE_HANDLER( scramble_portB_r ); diff --git a/src/mame/machine/carpolo.c b/src/mame/machine/carpolo.c index 413ddfd65bb..784bfe41eac 100644 --- a/src/mame/machine/carpolo.c +++ b/src/mame/machine/carpolo.c @@ -65,26 +65,30 @@ void carpolo_74148_3s_cb(device_t *device) /* the outputs of the flip-flops are connected to the priority encoder */ -WRITE_LINE_DEVICE_HANDLER( carpolo_7474_2s_1_q_cb ) +WRITE_LINE_MEMBER(carpolo_state::carpolo_7474_2s_1_q_cb) { + device_t *device = machine().device("74148_3s"); ttl74148_input_line_w(device, COIN1_PRIORITY_LINE, state); ttl74148_update(device); } -WRITE_LINE_DEVICE_HANDLER( carpolo_7474_2s_2_q_cb ) +WRITE_LINE_MEMBER(carpolo_state::carpolo_7474_2s_2_q_cb) { + device_t *device = machine().device("74148_3s"); ttl74148_input_line_w(device, COIN2_PRIORITY_LINE, state); ttl74148_update(device); } -WRITE_LINE_DEVICE_HANDLER( carpolo_7474_2u_1_q_cb ) +WRITE_LINE_MEMBER(carpolo_state::carpolo_7474_2u_1_q_cb) { + device_t *device = machine().device("74148_3s"); ttl74148_input_line_w(device, COIN3_PRIORITY_LINE, state); ttl74148_update(device); } -WRITE_LINE_DEVICE_HANDLER( carpolo_7474_2u_2_q_cb ) +WRITE_LINE_MEMBER(carpolo_state::carpolo_7474_2u_2_q_cb) { + device_t *device = machine().device("74148_3s"); ttl74148_input_line_w(device, COIN4_PRIORITY_LINE, state); ttl74148_update(device); } diff --git a/src/mame/machine/galaxold.c b/src/mame/machine/galaxold.c index 495fb9a4a2c..57c13fc7c52 100644 --- a/src/mame/machine/galaxold.c +++ b/src/mame/machine/galaxold.c @@ -28,18 +28,17 @@ static IRQ_CALLBACK(hunchbkg_irq_callback) } /* FIXME: remove trampoline */ -WRITE_LINE_DEVICE_HANDLER( galaxold_7474_9m_2_q_callback ) +WRITE_LINE_MEMBER(galaxold_state::galaxold_7474_9m_2_q_callback) { /* Q bar clocks the other flip-flop, Q is VBLANK (not visible to the CPU) */ - downcast(device)->clock_w(state); + downcast(machine().device("7474_9m_1"))->clock_w(state); } -WRITE_LINE_DEVICE_HANDLER( galaxold_7474_9m_1_callback ) +WRITE_LINE_MEMBER(galaxold_state::galaxold_7474_9m_1_callback) { - galaxold_state *drvstate = device->machine().driver_data(); /* Q goes to the NMI line */ - device->machine().device("maincpu")->execute().set_input_line(drvstate->m_irq_line, state ? CLEAR_LINE : ASSERT_LINE); + machine().device("maincpu")->execute().set_input_line(m_irq_line, state ? CLEAR_LINE : ASSERT_LINE); } WRITE8_MEMBER(galaxold_state::galaxold_nmi_enable_w)