changed 7474 to use devcb2 (no whatsnew)

This commit is contained in:
Miodrag Milanovic 2012-10-17 06:57:18 +00:00
parent c3f749b8a6
commit d185880c34
13 changed files with 69 additions and 131 deletions

View File

@ -54,65 +54,13 @@ const device_type MACHINE_TTL7474 = &device_creator<ttl7474_device>;
//------------------------------------------------- //-------------------------------------------------
ttl7474_device::ttl7474_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) 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(); 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<ttl7474_device &>(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<ttl7474_device &>(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<ttl7474_device &>(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 // 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));
save_item(NAME(m_last_output_comp)); save_item(NAME(m_last_output_comp));
m_output_func.resolve(m_output_cb, *this); m_output_func.resolve_safe();
m_comp_output_func.resolve(m_comp_output_cb, *this); m_comp_output_func.resolve_safe();
} }

View File

@ -50,26 +50,21 @@
// INTERFACE CONFIGURATION MACROS // 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_DEVICE_ADD(_tag, MACHINE_TTL7474, 0) \
MCFG_7474_TARGET_TAG(_target_tag) \
MCFG_7474_OUTPUT_CB(_output_cb) \ MCFG_7474_OUTPUT_CB(_output_cb) \
MCFG_7474_COMP_OUTPUT_CB(_comp_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_DEVICE_REPLACE(_tag, TTL7474, 0) \
MCFG_7474_TARGET_TAG(_target_tag) \
MCFG_7474_OUTPUT_CB(_output_cb) \ MCFG_7474_OUTPUT_CB(_output_cb) \
MCFG_7474_COMP_OUTPUT_CB(_comp_output_cb) MCFG_7474_COMP_OUTPUT_CB(_comp_output_cb)
#define MCFG_7474_TARGET_TAG(_target_tag) \ #define MCFG_7474_OUTPUT_CB(_devcb) \
ttl7474_device::static_set_target_tag(*device, _target_tag); \ devcb = &ttl7474_device::set_output_cb(*device, DEVCB2_##_devcb); \
#define MCFG_7474_OUTPUT_CB(_cb) \ #define MCFG_7474_COMP_OUTPUT_CB(_devcb) \
ttl7474_device::static_set_output_cb(*device, _cb); \ devcb = &ttl7474_device::set_comp_output_cb(*device, DEVCB2_##_devcb); \
#define MCFG_7474_COMP_OUTPUT_CB(_cb) \
ttl7474_device::static_set_comp_output_cb(*device, _cb); \
@ -85,10 +80,9 @@ public:
// construction/destruction // construction/destruction
ttl7474_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); ttl7474_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
// inline configuration helpers // static configuration helpers
static void static_set_target_tag(device_t &device, const char *tag); template<class _Object> static devcb2_base &set_output_cb(device_t &device, _Object object) { return downcast<ttl7474_device &>(device).m_output_func.set_callback(object); }
static void static_set_output_cb(device_t &device, write_line_device_func callback); template<class _Object> static devcb2_base &set_comp_output_cb(device_t &device, _Object object) { return downcast<ttl7474_device &>(device).m_comp_output_func.set_callback(object); }
static void static_set_comp_output_cb(device_t &device, write_line_device_func callback);
// public interfaces // public interfaces
DECLARE_WRITE_LINE_MEMBER( clear_w ); DECLARE_WRITE_LINE_MEMBER( clear_w );
@ -104,15 +98,10 @@ protected:
virtual void device_reset(); virtual void device_reset();
virtual void device_post_load() { } virtual void device_post_load() { }
virtual void device_clock_changed() { } virtual void device_clock_changed() { }
// configuration state
devcb_write_line m_output_cb;
devcb_write_line m_comp_output_cb;
private: private:
// callbacks // callbacks
devcb_resolved_write_line m_output_func; devcb2_write_line m_output_func;
devcb_resolved_write_line m_comp_output_func; devcb2_write_line m_comp_output_func;
// inputs // inputs
UINT8 m_clear; // pin 1/13 UINT8 m_clear; // pin 1/13

View File

@ -110,12 +110,12 @@ static IRQ_CALLBACK(scramble_sh_irq_callback)
return 0xff; 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, */ /* the Q bar is connected to the Z80's INT line. But since INT is complemented, */
/* we need to complement Q bar */ /* we need to complement Q bar */
if (device->machine().device("audiocpu")) if (machine().device("audiocpu"))
device->machine().device("audiocpu")->execute().set_input_line(0, !state ? ASSERT_LINE : CLEAR_LINE); machine().device("audiocpu")->execute().set_input_line(0, !state ? ASSERT_LINE : CLEAR_LINE);
} }
WRITE8_MEMBER(scramble_state::hotshock_sh_irqtrigger_w) WRITE8_MEMBER(scramble_state::hotshock_sh_irqtrigger_w)

View File

@ -251,18 +251,18 @@ static MACHINE_CONFIG_START( carpolo, carpolo_state )
MCFG_PIA6821_ADD("pia0", carpolo_pia0_intf) MCFG_PIA6821_ADD("pia0", carpolo_pia0_intf)
MCFG_PIA6821_ADD("pia1", carpolo_pia1_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_1", NOOP, WRITELINE(carpolo_state, 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_2s_2", NOOP, WRITELINE(carpolo_state, 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_1", NOOP, WRITELINE(carpolo_state, 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_2u_2", NOOP, WRITELINE(carpolo_state, carpolo_7474_2u_2_q_cb))
MCFG_7474_ADD("7474_1f_1", NULL, NULL, NULL) MCFG_7474_ADD("7474_1f_1", NOOP, NOOP)
MCFG_7474_ADD("7474_1f_2", NULL, NULL, NULL) MCFG_7474_ADD("7474_1f_2", NOOP, NOOP)
MCFG_7474_ADD("7474_1d_1", NULL, NULL, NULL) MCFG_7474_ADD("7474_1d_1", NOOP, NOOP)
MCFG_7474_ADD("7474_1d_2", NULL, NULL, NULL) MCFG_7474_ADD("7474_1d_2", NOOP, NOOP)
MCFG_7474_ADD("7474_1c_1", NULL, NULL, NULL) MCFG_7474_ADD("7474_1c_1", NOOP, NOOP)
MCFG_7474_ADD("7474_1c_2", NULL, NULL, NULL) MCFG_7474_ADD("7474_1c_2", NOOP, NOOP)
MCFG_7474_ADD("7474_1a_1", NULL, NULL, NULL) MCFG_7474_ADD("7474_1a_1", NOOP, NOOP)
MCFG_7474_ADD("7474_1a_2", NULL, NULL, NULL) MCFG_7474_ADD("7474_1a_2", NOOP, NOOP)
MCFG_74148_ADD("74148_3s", carpolo_ttl74148_intf) MCFG_74148_ADD("74148_3s", carpolo_ttl74148_intf)
MCFG_74153_ADD("74153_1k", carpolo_ttl74153_intf) MCFG_74153_ADD("74153_1k", carpolo_ttl74153_intf)

View File

@ -251,8 +251,8 @@ static MACHINE_CONFIG_START( dambustr, dambustr_state )
MCFG_MACHINE_RESET_OVERRIDE(dambustr_state,galaxold) 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_1", WRITELINE(dambustr_state,galaxold_7474_9m_1_callback), NOOP)
MCFG_7474_ADD("7474_9m_2", "7474_9m_1", NULL, galaxold_7474_9m_2_q_callback) 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) MCFG_TIMER_DRIVER_ADD("int_timer", dambustr_state, galaxold_interrupt_timer)

View File

@ -2176,8 +2176,8 @@ static MACHINE_CONFIG_START( galaxold_base, galaxold_state )
MCFG_MACHINE_RESET_OVERRIDE(galaxold_state,galaxold) 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_1", WRITELINE(galaxold_state,galaxold_7474_9m_1_callback), NOOP)
MCFG_7474_ADD("7474_9m_2", "7474_9m_1", NULL, galaxold_7474_9m_2_q_callback) 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) MCFG_TIMER_DRIVER_ADD("int_timer", galaxold_state, galaxold_interrupt_timer)

View File

@ -735,15 +735,15 @@ static MACHINE_CONFIG_START( type1, scobra_state )
MCFG_CPU_PROGRAM_MAP(scobra_sound_map) MCFG_CPU_PROGRAM_MAP(scobra_sound_map)
MCFG_CPU_IO_MAP(scobra_sound_io_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_MACHINE_RESET_OVERRIDE(scobra_state,scramble)
MCFG_I8255A_ADD( "ppi8255_0", scramble_ppi_0_intf ) MCFG_I8255A_ADD( "ppi8255_0", scramble_ppi_0_intf )
MCFG_I8255A_ADD( "ppi8255_1", scramble_ppi_1_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_1", WRITELINE(scobra_state,galaxold_7474_9m_1_callback), NOOP)
MCFG_7474_ADD("7474_9m_2", "7474_9m_1", NULL, galaxold_7474_9m_2_q_callback) 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) 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_PROGRAM_MAP(hustler_sound_map)
MCFG_CPU_IO_MAP(hustler_sound_io_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_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_1", WRITELINE(scobra_state,galaxold_7474_9m_1_callback), NOOP)
MCFG_7474_ADD("7474_9m_2", "7474_9m_1", NULL, galaxold_7474_9m_2_q_callback) 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) MCFG_TIMER_DRIVER_ADD("int_timer", scobra_state, galaxold_interrupt_timer)

View File

@ -1326,10 +1326,10 @@ static MACHINE_CONFIG_START( scramble, scramble_state )
MCFG_CPU_PROGRAM_MAP(scramble_sound_map) MCFG_CPU_PROGRAM_MAP(scramble_sound_map)
MCFG_CPU_IO_MAP(scramble_sound_io_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_1", WRITELINE(scramble_state,galaxold_7474_9m_1_callback), NOOP)
MCFG_7474_ADD("7474_9m_2", "7474_9m_1", NULL, galaxold_7474_9m_2_q_callback) 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) 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_ADD("maincpu", Z80, 18432000/6) /* 3.072 MHz */
MCFG_CPU_PROGRAM_MAP(ad2083_map) MCFG_CPU_PROGRAM_MAP(ad2083_map)
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_7474_ADD("7474_9m_1", "7474_9m_1", galaxold_7474_9m_1_callback, NULL) MCFG_7474_ADD("7474_9m_1", WRITELINE(scramble_state,galaxold_7474_9m_1_callback), NOOP)
MCFG_7474_ADD("7474_9m_2", "7474_9m_1", NULL, galaxold_7474_9m_2_q_callback) 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) MCFG_TIMER_DRIVER_ADD("int_timer", scramble_state, galaxold_interrupt_timer)

View File

@ -78,6 +78,11 @@ public:
DECLARE_READ8_MEMBER(pia_0_port_b_r); DECLARE_READ8_MEMBER(pia_0_port_b_r);
DECLARE_READ8_MEMBER(pia_1_port_a_r); DECLARE_READ8_MEMBER(pia_1_port_a_r);
DECLARE_READ8_MEMBER(pia_1_port_b_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; extern const pia6821_interface carpolo_pia1_intf;
void carpolo_74148_3s_cb(device_t *device); 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_car_car_interrupt(running_machine &machine, int car1, int car2);
void carpolo_generate_ball_screen_interrupt(running_machine &machine, UINT8 cause); 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); void carpolo_generate_car_goal_interrupt(running_machine &machine, int car, int right_goal);

View File

@ -183,17 +183,16 @@ public:
TIMER_CALLBACK_MEMBER(stars_blink_callback); TIMER_CALLBACK_MEMBER(stars_blink_callback);
TIMER_CALLBACK_MEMBER(stars_scroll_callback); TIMER_CALLBACK_MEMBER(stars_scroll_callback);
TIMER_DEVICE_CALLBACK_MEMBER(galaxold_interrupt_timer); 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 -----------*/ /*----------- defined in video/galaxold.c -----------*/
void galaxold_init_stars(running_machine &machine, int colors_offset); void galaxold_init_stars(running_machine &machine, int colors_offset);
void galaxold_draw_stars(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect); 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 #define galaxold_coin_counter_0_w galaxold_coin_counter_w
#endif #endif

View File

@ -55,6 +55,7 @@ public:
DECLARE_MACHINE_RESET(explorer); DECLARE_MACHINE_RESET(explorer);
DECLARE_WRITE8_MEMBER(scramble_protection_w); DECLARE_WRITE8_MEMBER(scramble_protection_w);
DECLARE_READ8_MEMBER(scramble_protection_r); 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 -----------*/ /*----------- defined in audio/scramble.c -----------*/
void scramble_sh_init(running_machine &machine); void scramble_sh_init(running_machine &machine);
WRITE_LINE_DEVICE_HANDLER( scramble_sh_7474_q_callback );
DECLARE_READ8_DEVICE_HANDLER( scramble_portB_r ); DECLARE_READ8_DEVICE_HANDLER( scramble_portB_r );

View File

@ -65,26 +65,30 @@ void carpolo_74148_3s_cb(device_t *device)
/* the outputs of the flip-flops are connected to the priority encoder */ /* 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_input_line_w(device, COIN1_PRIORITY_LINE, state);
ttl74148_update(device); 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_input_line_w(device, COIN2_PRIORITY_LINE, state);
ttl74148_update(device); 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_input_line_w(device, COIN3_PRIORITY_LINE, state);
ttl74148_update(device); 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_input_line_w(device, COIN4_PRIORITY_LINE, state);
ttl74148_update(device); ttl74148_update(device);
} }

View File

@ -28,18 +28,17 @@ static IRQ_CALLBACK(hunchbkg_irq_callback)
} }
/* FIXME: remove trampoline */ /* 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 bar clocks the other flip-flop,
Q is VBLANK (not visible to the CPU) */ Q is VBLANK (not visible to the CPU) */
downcast<ttl7474_device *>(device)->clock_w(state); downcast<ttl7474_device *>(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<galaxold_state>();
/* Q goes to the NMI line */ /* 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) WRITE8_MEMBER(galaxold_state::galaxold_nmi_enable_w)