summaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
authorGravatarGravatar smf- <smf-@users.noreply.github.com>2014-01-10 21:11:15 +0000
committerGravatarGravatar smf- <smf-@users.noreply.github.com>2014-01-10 21:11:15 +0000
commit81cafc3d2931d94e947f260fe2366704e3782a16 (patch)
tree5af8789cc1e13813473e3a09c7191a69c7fda118 /src
parentfc59ec00a093224ffd1f56a8accae2abaf1f6cbf (diff)
standardised 7474 MCFG and reduced number of run time lookups (nw)
Diffstat (limited to 'src')
-rw-r--r--src/emu/machine/7474.c4
-rw-r--r--src/emu/machine/7474.h13
-rw-r--r--src/mame/audio/scramble.c28
-rw-r--r--src/mame/drivers/carpolo.c33
-rw-r--r--src/mame/drivers/dambustr.c8
-rw-r--r--src/mame/drivers/galaxold.c8
-rw-r--r--src/mame/drivers/scobra.c21
-rw-r--r--src/mame/drivers/scramble.c30
-rw-r--r--src/mame/includes/galaxold.h10
-rw-r--r--src/mame/includes/scramble.h23
-rw-r--r--src/mame/machine/galaxold.c24
-rw-r--r--src/mame/machine/scramble.c2
12 files changed, 109 insertions, 95 deletions
diff --git a/src/emu/machine/7474.c b/src/emu/machine/7474.c
index ced313d42b7..9876e8f9e20 100644
--- a/src/emu/machine/7474.c
+++ b/src/emu/machine/7474.c
@@ -47,14 +47,14 @@
//**************************************************************************
// device type definition
-const device_type MACHINE_TTL7474 = &device_creator<ttl7474_device>;
+const device_type TTL7474 = &device_creator<ttl7474_device>;
//-------------------------------------------------
// ttl7474_device - constructor
//-------------------------------------------------
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, "7474", __FILE__),
+ : device_t(mconfig, TTL7474, "7474", tag, owner, clock, "7474", __FILE__),
m_output_func(*this),
m_comp_output_func(*this)
{
diff --git a/src/emu/machine/7474.h b/src/emu/machine/7474.h
index e66b25aef97..67f7a8bff03 100644
--- a/src/emu/machine/7474.h
+++ b/src/emu/machine/7474.h
@@ -50,18 +50,9 @@
// INTERFACE CONFIGURATION MACROS
//**************************************************************************
-#define MCFG_7474_ADD(_tag, _output_cb, _comp_output_cb) \
- MCFG_DEVICE_ADD(_tag, MACHINE_TTL7474, 0) \
- MCFG_7474_OUTPUT_CB(_output_cb) \
- MCFG_7474_COMP_OUTPUT_CB(_comp_output_cb)
-
-#define MCFG_7474_REPLACE(_tag, _output_cb, _comp_output_cb) \
- MCFG_DEVICE_REPLACE(_tag, TTL7474, 0) \
- MCFG_7474_OUTPUT_CB(_output_cb) \
- MCFG_7474_COMP_OUTPUT_CB(_comp_output_cb)
-
#define MCFG_7474_OUTPUT_CB(_devcb) \
devcb = &ttl7474_device::set_output_cb(*device, DEVCB2_##_devcb);
+
#define MCFG_7474_COMP_OUTPUT_CB(_devcb) \
devcb = &ttl7474_device::set_comp_output_cb(*device, DEVCB2_##_devcb);
@@ -122,7 +113,7 @@ private:
// device type definition
-extern const device_type MACHINE_TTL7474;
+extern const device_type TTL7474;
#endif /* __TTL7474_H__ */
diff --git a/src/mame/audio/scramble.c b/src/mame/audio/scramble.c
index e347d2b7151..ce40b0ebfb4 100644
--- a/src/mame/audio/scramble.c
+++ b/src/mame/audio/scramble.c
@@ -77,35 +77,29 @@ READ8_DEVICE_HANDLER( frogger_portB_r )
return frogger_timer[(space.machine().device<cpu_device>("audiocpu")->total_cycles()/512) % 10];
}
-WRITE8_DEVICE_HANDLER( scramble_sh_irqtrigger_w )
+WRITE8_MEMBER( scramble_state::scramble_sh_irqtrigger_w )
{
- ttl7474_device *target = space.machine().device<ttl7474_device>("konami_7474");
-
/* the complement of bit 3 is connected to the flip-flop's clock */
- target->clock_w((~data & 0x08) >> 3);
+ m_konami_7474->clock_w((~data & 0x08) >> 3);
/* bit 4 is sound disable */
- space.machine().sound().system_mute((data & 0x10) >> 4);
+ machine().sound().system_mute((data & 0x10) >> 4);
}
-WRITE8_DEVICE_HANDLER( mrkougar_sh_irqtrigger_w )
+WRITE8_MEMBER( scramble_state::mrkougar_sh_irqtrigger_w )
{
- ttl7474_device *target = space.machine().device<ttl7474_device>("konami_7474");
-
/* the complement of bit 3 is connected to the flip-flop's clock */
- target->clock_w((~data & 0x08) >> 3);
+ m_konami_7474->clock_w((~data & 0x08) >> 3);
}
-static IRQ_CALLBACK(scramble_sh_irq_callback)
+IRQ_CALLBACK_MEMBER(scramble_state::scramble_sh_irq_callback)
{
- ttl7474_device *target = device->machine().device<ttl7474_device>("konami_7474");
-
/* interrupt acknowledge clears the flip-flop --
we need to pulse the CLR line because MAME's core never clears this
line, only asserts it */
- target->clear_w(0);
+ m_konami_7474->clear_w(0);
- target->clear_w(1);
+ m_konami_7474->clear_w(1);
return 0xff;
}
@@ -161,12 +155,12 @@ WRITE8_MEMBER(scramble_state::frogger_filter_w)
filter_w(machine().device("filter.0.2"), (offset >> 10) & 3);
}
-void scramble_sh_init(running_machine &machine)
+void scramble_state::sh_init()
{
- machine.device("audiocpu")->execute().set_irq_acknowledge_callback(scramble_sh_irq_callback);
+ m_audiocpu->set_irq_acknowledge_callback(device_irq_acknowledge_delegate(FUNC(scramble_state::scramble_sh_irq_callback),this));
/* PR is always 0, D is always 1 */
- machine.device<ttl7474_device>("konami_7474")->d_w(1);
+ m_konami_7474->d_w(1);
}
diff --git a/src/mame/drivers/carpolo.c b/src/mame/drivers/carpolo.c
index b45c7624f23..dae2f2b7585 100644
--- a/src/mame/drivers/carpolo.c
+++ b/src/mame/drivers/carpolo.c
@@ -18,7 +18,6 @@
#include "emu.h"
#include "cpu/m6502/m6502.h"
-#include "machine/7474.h"
#include "machine/74153.h"
#include "machine/6821pia.h"
#include "includes/carpolo.h"
@@ -260,18 +259,26 @@ static MACHINE_CONFIG_START( carpolo, carpolo_state )
MCFG_PIA_CA2_HANDLER(WRITELINE(carpolo_state, coin3_interrupt_clear_w))
MCFG_PIA_CB2_HANDLER(WRITELINE(carpolo_state, coin4_interrupt_clear_w))
- 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_DEVICE_ADD("7474_2s_1", TTL7474, 0)
+ MCFG_7474_COMP_OUTPUT_CB(WRITELINE(carpolo_state, carpolo_7474_2s_1_q_cb))
+
+ MCFG_DEVICE_ADD("7474_2s_2", TTL7474, 0)
+ MCFG_7474_COMP_OUTPUT_CB(WRITELINE(carpolo_state, carpolo_7474_2s_2_q_cb))
+
+ MCFG_DEVICE_ADD("7474_2u_1", TTL7474, 0)
+ MCFG_7474_COMP_OUTPUT_CB(WRITELINE(carpolo_state, carpolo_7474_2u_1_q_cb))
+
+ MCFG_DEVICE_ADD("7474_2u_2", TTL7474, 0)
+ MCFG_7474_COMP_OUTPUT_CB(WRITELINE(carpolo_state, carpolo_7474_2u_2_q_cb))
+
+ MCFG_DEVICE_ADD("7474_1f_1", TTL7474, 0)
+ MCFG_DEVICE_ADD("7474_1f_2", TTL7474, 0)
+ MCFG_DEVICE_ADD("7474_1d_1", TTL7474, 0)
+ MCFG_DEVICE_ADD("7474_1d_2", TTL7474, 0)
+ MCFG_DEVICE_ADD("7474_1c_1", TTL7474, 0)
+ MCFG_DEVICE_ADD("7474_1c_2", TTL7474, 0)
+ MCFG_DEVICE_ADD("7474_1a_1", TTL7474, 0)
+ MCFG_DEVICE_ADD("7474_1a_2", TTL7474, 0)
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 58cf4dce62c..650f2113368 100644
--- a/src/mame/drivers/dambustr.c
+++ b/src/mame/drivers/dambustr.c
@@ -51,7 +51,6 @@ Stephh's notes (based on the games Z80 code and some tests) :
#include "cpu/z80/z80.h"
#include "audio/galaxian.h"
#include "includes/galaxold.h"
-#include "machine/7474.h"
class dambustr_state : public galaxold_state
@@ -253,8 +252,11 @@ static MACHINE_CONFIG_START( dambustr, dambustr_state )
MCFG_MACHINE_RESET_OVERRIDE(dambustr_state,galaxold)
- 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_DEVICE_ADD("7474_9m_1", TTL7474, 0)
+ MCFG_7474_OUTPUT_CB(WRITELINE(dambustr_state,galaxold_7474_9m_1_callback))
+
+ MCFG_DEVICE_ADD("7474_9m_2", TTL7474, 0)
+ MCFG_7474_COMP_OUTPUT_CB(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 7c54ee5a2ea..9e8d38728c0 100644
--- a/src/mame/drivers/galaxold.c
+++ b/src/mame/drivers/galaxold.c
@@ -364,7 +364,6 @@ Stephh's notes (based on the games Z80 code and some tests) for other games :
#include "emu.h"
#include "cpu/z80/z80.h"
#include "cpu/s2650/s2650.h"
-#include "machine/7474.h"
#include "sound/ay8910.h"
#include "sound/sn76496.h"
#include "sound/dac.h"
@@ -2351,8 +2350,11 @@ static MACHINE_CONFIG_START( galaxold_base, galaxold_state )
MCFG_MACHINE_RESET_OVERRIDE(galaxold_state,galaxold)
- 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_DEVICE_ADD("7474_9m_1", TTL7474, 0)
+ MCFG_7474_OUTPUT_CB(WRITELINE(galaxold_state,galaxold_7474_9m_1_callback))
+
+ MCFG_DEVICE_ADD("7474_9m_2", TTL7474, 0)
+ MCFG_7474_COMP_OUTPUT_CB(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 49879cc2f52..0e871451eda 100644
--- a/src/mame/drivers/scobra.c
+++ b/src/mame/drivers/scobra.c
@@ -35,7 +35,6 @@ Notes/Tidbits:
#include "emu.h"
#include "cpu/z80/z80.h"
#include "machine/i8255.h"
-#include "machine/7474.h"
#include "sound/ay8910.h"
#include "includes/scramble.h"
@@ -735,15 +734,19 @@ 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", NOOP, WRITELINE(scobra_state,scramble_sh_7474_q_callback))
+ MCFG_DEVICE_ADD("konami_7474", TTL7474, 0)
+ MCFG_7474_COMP_OUTPUT_CB(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", 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_DEVICE_ADD("7474_9m_1", TTL7474, 0)
+ MCFG_7474_OUTPUT_CB(WRITELINE(scobra_state,galaxold_7474_9m_1_callback))
+
+ MCFG_DEVICE_ADD("7474_9m_2", TTL7474, 0)
+ MCFG_7474_COMP_OUTPUT_CB(WRITELINE(scobra_state,galaxold_7474_9m_2_q_callback))
MCFG_TIMER_DRIVER_ADD("int_timer", scobra_state, galaxold_interrupt_timer)
@@ -857,12 +860,16 @@ 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", NOOP, WRITELINE(scobra_state,scramble_sh_7474_q_callback))
+ MCFG_DEVICE_ADD("konami_7474", TTL7474, 0)
+ MCFG_7474_COMP_OUTPUT_CB(WRITELINE(scobra_state,scramble_sh_7474_q_callback))
MCFG_MACHINE_RESET_OVERRIDE(scobra_state,scramble)
- 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_DEVICE_ADD("7474_9m_1", TTL7474, 0)
+ MCFG_7474_OUTPUT_CB(WRITELINE(scobra_state,galaxold_7474_9m_1_callback))
+
+ MCFG_DEVICE_ADD("7474_9m_2", TTL7474, 0)
+ MCFG_7474_COMP_OUTPUT_CB(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 e1487222918..b5a8589abe1 100644
--- a/src/mame/drivers/scramble.c
+++ b/src/mame/drivers/scramble.c
@@ -30,7 +30,6 @@ Notes:
#include "cpu/s2650/s2650.h"
#include "sound/ay8910.h"
#include "sound/dac.h"
-#include "machine/7474.h"
#include "machine/i8255.h"
#include "includes/scramble.h"
@@ -1362,7 +1361,7 @@ I8255A_INTERFACE( scramble_ppi_1_intf )
DEVCB_NULL, /* Port A read */
DEVCB_DRIVER_MEMBER(driver_device, soundlatch_byte_w),/* Port A write */
DEVCB_NULL, /* Port B read */
- DEVCB_HANDLER(scramble_sh_irqtrigger_w),/* Port B write */
+ DEVCB_DRIVER_MEMBER(scramble_state, scramble_sh_irqtrigger_w),/* Port B write */
DEVCB_NULL, /* Port C read */
DEVCB_NULL /* Port C write */
};
@@ -1372,7 +1371,7 @@ I8255A_INTERFACE( stratgyx_ppi_1_intf )
DEVCB_NULL, /* Port A read */
DEVCB_DRIVER_MEMBER(driver_device, soundlatch_byte_w),/* Port A write */
DEVCB_NULL, /* Port B read */
- DEVCB_HANDLER(scramble_sh_irqtrigger_w),/* Port B write */
+ DEVCB_DRIVER_MEMBER(scramble_state, scramble_sh_irqtrigger_w),/* Port B write */
DEVCB_INPUT_PORT("IN3"), /* Port C read */
DEVCB_NULL /* Port C write */
};
@@ -1382,7 +1381,7 @@ I8255A_INTERFACE( scramble_protection_ppi_1_intf )
DEVCB_NULL, /* Port A read */
DEVCB_DRIVER_MEMBER(driver_device, soundlatch_byte_w),/* Port A write */
DEVCB_NULL, /* Port B read */
- DEVCB_HANDLER(scramble_sh_irqtrigger_w),/* Port B write */
+ DEVCB_DRIVER_MEMBER(scramble_state, scramble_sh_irqtrigger_w),/* Port B write */
DEVCB_DRIVER_MEMBER(scramble_state, scramble_protection_r), /* Port C read */
DEVCB_DRIVER_MEMBER(scramble_state, scramble_protection_w) /* Port C write */
};
@@ -1392,7 +1391,7 @@ I8255A_INTERFACE( mrkougar_ppi_1_intf )
DEVCB_NULL, /* Port A read */
DEVCB_DRIVER_MEMBER(driver_device, soundlatch_byte_w),/* Port A write */
DEVCB_NULL, /* Port B read */
- DEVCB_HANDLER(mrkougar_sh_irqtrigger_w),/* Port B write */
+ DEVCB_DRIVER_MEMBER(scramble_state, mrkougar_sh_irqtrigger_w),/* Port B write */
DEVCB_NULL, /* Port C read */
DEVCB_NULL /* Port C write */
};
@@ -1451,10 +1450,14 @@ 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", 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_DEVICE_ADD("7474_9m_1", TTL7474, 0)
+ MCFG_7474_OUTPUT_CB(WRITELINE(scramble_state,galaxold_7474_9m_1_callback))
- MCFG_7474_ADD("konami_7474", NOOP, WRITELINE(scramble_state,scramble_sh_7474_q_callback))
+ MCFG_DEVICE_ADD("7474_9m_2", TTL7474, 0)
+ MCFG_7474_COMP_OUTPUT_CB(WRITELINE(scramble_state,galaxold_7474_9m_2_q_callback))
+
+ MCFG_DEVICE_ADD("konami_7474", TTL7474, 0)
+ MCFG_7474_COMP_OUTPUT_CB(WRITELINE(scramble_state,scramble_sh_7474_q_callback))
MCFG_TIMER_DRIVER_ADD("int_timer", scramble_state, galaxold_interrupt_timer)
@@ -1687,9 +1690,14 @@ 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", 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_DEVICE_ADD("konami_7474", TTL7474, 0)
+ MCFG_7474_COMP_OUTPUT_CB(WRITELINE(scramble_state,scramble_sh_7474_q_callback))
+
+ MCFG_DEVICE_ADD("7474_9m_1", TTL7474, 0)
+ MCFG_7474_OUTPUT_CB(WRITELINE(scramble_state,galaxold_7474_9m_1_callback))
+
+ MCFG_DEVICE_ADD("7474_9m_2", TTL7474, 0)
+ MCFG_7474_COMP_OUTPUT_CB(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/galaxold.h b/src/mame/includes/galaxold.h
index 7df88192ea1..7143a3f12a8 100644
--- a/src/mame/includes/galaxold.h
+++ b/src/mame/includes/galaxold.h
@@ -13,6 +13,8 @@
#ifndef __GALAXOLD_H__
#define __GALAXOLD_H__
+#include "machine/7474.h"
+
/* star circuit */
#define STAR_COUNT 252
struct star
@@ -33,7 +35,11 @@ public:
m_rockclim_videoram(*this,"rockclim_vram"),
m_racknrol_tiles_bank(*this,"racknrol_tbank"),
m_maincpu(*this, "maincpu"),
- m_audiocpu(*this, "audiocpu") { }
+ m_audiocpu(*this, "audiocpu"),
+ m_7474_9m_1(*this, "7474_9m_1"),
+ m_7474_9m_2(*this, "7474_9m_2")
+ {
+ }
required_shared_ptr<UINT8> m_videoram;
required_shared_ptr<UINT8> m_spriteram;
@@ -241,6 +247,8 @@ public:
void machine_reset_common(int line);
required_device<cpu_device> m_maincpu;
optional_device<cpu_device> m_audiocpu;
+ optional_device<ttl7474_device> m_7474_9m_1;
+ optional_device<ttl7474_device> m_7474_9m_2;
};
#define galaxold_coin_counter_0_w galaxold_coin_counter_w
diff --git a/src/mame/includes/scramble.h b/src/mame/includes/scramble.h
index 6330ce4d78d..672cb48768e 100644
--- a/src/mame/includes/scramble.h
+++ b/src/mame/includes/scramble.h
@@ -6,11 +6,14 @@ class scramble_state : public galaxold_state
public:
scramble_state(const machine_config &mconfig, device_type type, const char *tag)
: galaxold_state(mconfig, type, tag),
- m_ppi8255_0(*this, "ppi8255_0"),
- m_ppi8255_1(*this, "ppi8255_1"),
- m_soundram(*this, "soundram")
- { }
-
+ m_konami_7474(*this, "konami_7474"),
+ m_ppi8255_0(*this, "ppi8255_0"),
+ m_ppi8255_1(*this, "ppi8255_1"),
+ m_soundram(*this, "soundram")
+ {
+ }
+
+ optional_device<ttl7474_device> m_konami_7474;
optional_device<i8255_device> m_ppi8255_0;
optional_device<i8255_device> m_ppi8255_1;
optional_shared_ptr<UINT8> m_soundram;
@@ -83,6 +86,10 @@ public:
DECLARE_WRITE8_MEMBER( cavelon_banksw_w );
DECLARE_READ8_MEMBER( hunchbks_mirror_r );
DECLARE_WRITE8_MEMBER( hunchbks_mirror_w );
+ void sh_init();
+ DECLARE_WRITE8_MEMBER( scramble_sh_irqtrigger_w );
+ DECLARE_WRITE8_MEMBER( mrkougar_sh_irqtrigger_w );
+ IRQ_CALLBACK_MEMBER( scramble_sh_irq_callback );
};
@@ -94,17 +101,11 @@ extern const i8255_interface(stratgyx_ppi_1_intf);
/*----------- defined in audio/scramble.c -----------*/
-void scramble_sh_init(running_machine &machine);
-
-
DECLARE_READ8_DEVICE_HANDLER( scramble_portB_r );
DECLARE_READ8_DEVICE_HANDLER( frogger_portB_r );
DECLARE_READ8_DEVICE_HANDLER( hotshock_soundlatch_r );
-DECLARE_WRITE8_DEVICE_HANDLER( scramble_sh_irqtrigger_w );
-DECLARE_WRITE8_DEVICE_HANDLER( mrkougar_sh_irqtrigger_w );
-
DECLARE_WRITE8_DEVICE_HANDLER( harem_portA_w );
DECLARE_WRITE8_DEVICE_HANDLER( harem_portB_w );
diff --git a/src/mame/machine/galaxold.c b/src/mame/machine/galaxold.c
index c7420c0c346..89ebd21d8cd 100644
--- a/src/mame/machine/galaxold.c
+++ b/src/mame/machine/galaxold.c
@@ -8,7 +8,6 @@
***************************************************************************/
#include "emu.h"
-#include "machine/7474.h"
#include "includes/galaxold.h"
@@ -32,7 +31,7 @@ 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<ttl7474_device *>(machine().device("7474_9m_1"))->clock_w(state);
+ m_7474_9m_1->clock_w(state);
}
WRITE_LINE_MEMBER(galaxold_state::galaxold_7474_9m_1_callback)
@@ -43,20 +42,17 @@ WRITE_LINE_MEMBER(galaxold_state::galaxold_7474_9m_1_callback)
WRITE8_MEMBER(galaxold_state::galaxold_nmi_enable_w)
{
- ttl7474_device *target = machine().device<ttl7474_device>("7474_9m_1");
- target->preset_w(data ? 1 : 0);
+ m_7474_9m_1->preset_w(data ? 1 : 0);
}
TIMER_DEVICE_CALLBACK_MEMBER(galaxold_state::galaxold_interrupt_timer)
{
- ttl7474_device *target = machine().device<ttl7474_device>("7474_9m_2");
-
/* 128V, 64V and 32V go to D */
- target->d_w(((param & 0xe0) != 0xe0) ? 1 : 0);
+ m_7474_9m_2->d_w(((param & 0xe0) != 0xe0) ? 1 : 0);
/* 16V clocks the flip-flop */
- target->clock_w(((param & 0x10) == 0x10) ? 1 : 0);
+ m_7474_9m_2->clock_w(((param & 0x10) == 0x10) ? 1 : 0);
param = (param + 0x10) & 0xff;
@@ -66,17 +62,15 @@ TIMER_DEVICE_CALLBACK_MEMBER(galaxold_state::galaxold_interrupt_timer)
void galaxold_state::machine_reset_common(int line)
{
- ttl7474_device *ttl7474_9m_1 = machine().device<ttl7474_device>("7474_9m_1");
- ttl7474_device *ttl7474_9m_2 = machine().device<ttl7474_device>("7474_9m_2");
m_irq_line = line;
/* initalize main CPU interrupt generator flip-flops */
- ttl7474_9m_2->preset_w(1);
- ttl7474_9m_2->clear_w (1);
+ m_7474_9m_2->preset_w(1);
+ m_7474_9m_2->clear_w (1);
- ttl7474_9m_1->clear_w (1);
- ttl7474_9m_1->d_w (0);
- ttl7474_9m_1->preset_w(0);
+ m_7474_9m_1->clear_w (1);
+ m_7474_9m_1->d_w (0);
+ m_7474_9m_1->preset_w(0);
/* start a timer to generate interrupts */
timer_device *int_timer = machine().device<timer_device>("int_timer");
diff --git a/src/mame/machine/scramble.c b/src/mame/machine/scramble.c
index 92eb1428b28..d9cf23c953e 100644
--- a/src/mame/machine/scramble.c
+++ b/src/mame/machine/scramble.c
@@ -18,7 +18,7 @@ MACHINE_RESET_MEMBER(scramble_state,scramble)
MACHINE_RESET_CALL_MEMBER(galaxold);
if (m_audiocpu != NULL)
- scramble_sh_init(machine());
+ sh_init();
m_security_2B_counter = 0;
}