summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Aaron Giles <aaron@aarongiles.com>2012-04-18 19:40:59 +0000
committer Aaron Giles <aaron@aarongiles.com>2012-04-18 19:40:59 +0000
commit523c35daed51c8320c03e4ccf19038466ec11215 (patch)
tree16747c8c99e35e91cc555c38001eae85c61b054c
parent6718512f0a32d7b6efbdb7a052ebad866f906bb4 (diff)
Now that memory_bank is exposed as an object, removed all the global
bank manipulation APIs from memory_manager, and instead added a memory_manager::bank("tag") function which will return a pointer to the representative memory_bank. Operations can then be performed as expected directly on the memory_bank. Most code did not need an update yet, as I haven't done the search/replace to move away from global functions (which still exist for now). Added device_t::subbank("tag") to return a bank that is owned by the given device. Switched YM2151 interfaces over to devcb callbacks. Created proper sound devices for the Williams NARC, CVSD and ADPCM sound boards. Updated midyunit, midtunit, williams(joust2), and mcr68(archrivl/pigskin/trisport) to use the new devices.
-rw-r--r--src/emu/device.c17
-rw-r--r--src/emu/device.h1
-rw-r--r--src/emu/memory.c189
-rw-r--r--src/emu/memory.h31
-rw-r--r--src/emu/sound/2151intf.c24
-rw-r--r--src/emu/sound/2151intf.h4
-rw-r--r--src/mame/audio/atarijsa.c12
-rw-r--r--src/mame/audio/midway.c91
-rw-r--r--src/mame/audio/midway.h18
-rw-r--r--src/mame/audio/seibu.c2
-rw-r--r--src/mame/audio/t5182.c2
-rw-r--r--src/mame/audio/williams.c1198
-rw-r--r--src/mame/audio/williams.h230
-rw-r--r--src/mame/drivers/aliens.c4
-rw-r--r--src/mame/drivers/amspdwy.c2
-rw-r--r--src/mame/drivers/aquarium.c2
-rw-r--r--src/mame/drivers/asuka.c4
-rw-r--r--src/mame/drivers/atarisy1.c2
-rw-r--r--src/mame/drivers/blockout.c2
-rw-r--r--src/mame/drivers/boogwing.c4
-rw-r--r--src/mame/drivers/cabal.c2
-rw-r--r--src/mame/drivers/cave.c2
-rw-r--r--src/mame/drivers/cbuster.c2
-rw-r--r--src/mame/drivers/chinagat.c2
-rw-r--r--src/mame/drivers/chqflag.c2
-rw-r--r--src/mame/drivers/cninja.c6
-rw-r--r--src/mame/drivers/cps1.c2
-rw-r--r--src/mame/drivers/crimfght.c4
-rw-r--r--src/mame/drivers/cyberbal.c2
-rw-r--r--src/mame/drivers/darkseal.c2
-rw-r--r--src/mame/drivers/dassault.c4
-rw-r--r--src/mame/drivers/dblewing.c2
-rw-r--r--src/mame/drivers/dbz.c2
-rw-r--r--src/mame/drivers/ddragon.c4
-rw-r--r--src/mame/drivers/ddragon3.c2
-rw-r--r--src/mame/drivers/deco32.c8
-rw-r--r--src/mame/drivers/dietgo.c2
-rw-r--r--src/mame/drivers/dooyong.c2
-rw-r--r--src/mame/drivers/exzisus.c2
-rw-r--r--src/mame/drivers/fantland.c2
-rw-r--r--src/mame/drivers/funkyjet.c2
-rw-r--r--src/mame/drivers/gotcha.c2
-rw-r--r--src/mame/drivers/hyprduel.c2
-rw-r--r--src/mame/drivers/lemmings.c2
-rw-r--r--src/mame/drivers/m107.c2
-rw-r--r--src/mame/drivers/m72.c2
-rw-r--r--src/mame/drivers/m90.c4
-rw-r--r--src/mame/drivers/m92.c2
-rw-r--r--src/mame/drivers/madmotor.c2
-rw-r--r--src/mame/drivers/mcr.c11
-rw-r--r--src/mame/drivers/mcr3.c21
-rw-r--r--src/mame/drivers/mcr68.c47
-rw-r--r--src/mame/drivers/megasys1.c2
-rw-r--r--src/mame/drivers/metro.c2
-rw-r--r--src/mame/drivers/midtunit.c50
-rw-r--r--src/mame/drivers/midyunit.c157
-rw-r--r--src/mame/drivers/mlanding.c4
-rw-r--r--src/mame/drivers/mpu4.c2
-rw-r--r--src/mame/drivers/mugsmash.c2
-rw-r--r--src/mame/drivers/namcos1.c2
-rw-r--r--src/mame/drivers/nemesis.c2
-rw-r--r--src/mame/drivers/nmk16.c2
-rw-r--r--src/mame/drivers/opwolf.c4
-rw-r--r--src/mame/drivers/rainbow.c4
-rw-r--r--src/mame/drivers/rastan.c4
-rw-r--r--src/mame/drivers/rohga.c4
-rw-r--r--src/mame/drivers/rpunch.c2
-rw-r--r--src/mame/drivers/segahang.c2
-rw-r--r--src/mame/drivers/segas16a.c4
-rw-r--r--src/mame/drivers/segas24.c2
-rw-r--r--src/mame/drivers/segaxbd.c2
-rw-r--r--src/mame/drivers/segaybd.c2
-rw-r--r--src/mame/drivers/sf.c2
-rw-r--r--src/mame/drivers/shadfrce.c2
-rw-r--r--src/mame/drivers/shisen.c2
-rw-r--r--src/mame/drivers/sidearms.c2
-rw-r--r--src/mame/drivers/silvmil.c2
-rw-r--r--src/mame/drivers/snowbros.c2
-rw-r--r--src/mame/drivers/supbtime.c2
-rw-r--r--src/mame/drivers/surpratk.c2
-rw-r--r--src/mame/drivers/taito_x.c2
-rw-r--r--src/mame/drivers/tatsumi.c2
-rw-r--r--src/mame/drivers/tecmo16.c2
-rw-r--r--src/mame/drivers/tmnt.c2
-rw-r--r--src/mame/drivers/topspeed.c4
-rw-r--r--src/mame/drivers/tumbleb.c2
-rw-r--r--src/mame/drivers/tumblep.c2
-rw-r--r--src/mame/drivers/vaportra.c2
-rw-r--r--src/mame/drivers/vball.c2
-rw-r--r--src/mame/drivers/vigilant.c2
-rw-r--r--src/mame/drivers/williams.c7
-rw-r--r--src/mame/drivers/wwfsstar.c2
-rw-r--r--src/mame/drivers/wwfwfest.c2
-rw-r--r--src/mame/includes/mcr68.h4
-rw-r--r--src/mame/includes/midtunit.h10
-rw-r--r--src/mame/includes/midyunit.h8
-rw-r--r--src/mame/includes/williams.h4
-rw-r--r--src/mame/machine/mcr.c3
-rw-r--r--src/mame/machine/mcr68.c3
-rw-r--r--src/mame/machine/midtunit.c23
-rw-r--r--src/mame/machine/midyunit.c39
-rw-r--r--src/mame/machine/williams.c12
102 files changed, 1327 insertions, 1077 deletions
diff --git a/src/emu/device.c b/src/emu/device.c
index bcb336e1564..a153b7441d2 100644
--- a/src/emu/device.c
+++ b/src/emu/device.c
@@ -203,6 +203,23 @@ const memory_region *device_t::subregion(const char *_tag) const
//-------------------------------------------------
+// subregion - return a pointer to the memory
+// bank info for a given bank
+//-------------------------------------------------
+
+memory_bank *device_t::subbank(const char *_tag) const
+{
+ // safety first
+ if (this == NULL)
+ return NULL;
+
+ // build a fully-qualified name and look it up
+ astring fullpath;
+ return machine().memory().bank(subtag(fullpath, _tag));
+}
+
+
+//-------------------------------------------------
// static_set_clock - set/change the clock on
// a device
//-------------------------------------------------
diff --git a/src/emu/device.h b/src/emu/device.h
index 605c1e66195..b47f3bafe07 100644
--- a/src/emu/device.h
+++ b/src/emu/device.h
@@ -184,6 +184,7 @@ public:
astring &subtag(astring &dest, const char *tag) const;
astring &siblingtag(astring &dest, const char *tag) const { return (this != NULL && m_owner != NULL) ? m_owner->subtag(dest, tag) : dest.cpy(tag); }
const memory_region *subregion(const char *tag) const;
+ memory_bank *subbank(const char *tag) const;
device_t *subdevice(const char *tag) const;
device_t *siblingdevice(const char *tag) const;
template<class _DeviceClass> inline _DeviceClass *subdevice(const char *tag) const { return downcast<_DeviceClass *>(subdevice(tag)); }
diff --git a/src/emu/memory.c b/src/emu/memory.c
index 978415f116c..192662f0d72 100644
--- a/src/emu/memory.c
+++ b/src/emu/memory.c
@@ -1558,125 +1558,6 @@ memory_manager::memory_manager(running_machine &machine)
//**************************************************************************
//-------------------------------------------------
-// configure_bank - configure the addresses for a
-// bank
-//-------------------------------------------------
-
-void memory_manager::configure_bank(const char *tag, int startentry, int numentries, void *base, offs_t stride)
-{
- configure_bank(machine().root_device(), tag, startentry, numentries, base, stride);
-}
-
-void memory_manager::configure_bank(device_t &device, const char *tag, int startentry, int numentries, void *base, offs_t stride)
-{
- // validation checks
- astring fulltag;
- memory_bank *bank = m_bankmap.find_hash_only(device.subtag(fulltag, tag));
- if (bank == NULL)
- fatalerror("configure_bank called for unknown bank '%s'", fulltag.cstr());
- if (base == NULL)
- fatalerror("configure_bank called NULL base");
-
- // fill in the requested bank entries (backwards to improve allocation)
- for (int entrynum = startentry + numentries - 1; entrynum >= startentry; entrynum--)
- bank->configure(entrynum, reinterpret_cast<UINT8 *>(base) + (entrynum - startentry) * stride);
-}
-
-
-//-------------------------------------------------
-// configure_bank_decrypted - configure the
-// decrypted addresses for a bank
-//-------------------------------------------------
-
-void memory_manager::configure_bank_decrypted(const char *tag, int startentry, int numentries, void *base, offs_t stride)
-{
- memory_configure_bank_decrypted(machine().root_device(), tag, startentry, numentries, base, stride);
-}
-
-void memory_manager::configure_bank_decrypted(device_t &device, const char *tag, int startentry, int numentries, void *base, offs_t stride)
-{
- // validation checks
- astring fulltag;
- memory_bank *bank = m_bankmap.find_hash_only(device.subtag(fulltag, tag));
- if (bank == NULL)
- fatalerror("configure_bank_decrypted called for unknown bank '%s'", fulltag.cstr());
- if (base == NULL)
- fatalerror("configure_bank_decrypted called NULL base");
-
- // fill in the requested bank entries (backwards to improve allocation)
- for (int entrynum = startentry + numentries - 1; entrynum >= startentry; entrynum--)
- bank->configure_decrypted(entrynum, reinterpret_cast<UINT8 *>(base) + (entrynum - startentry) * stride);
-}
-
-
-//-------------------------------------------------
-// set_bank - select one pre-configured entry to
-// be the new bank base
-//-------------------------------------------------
-
-void memory_manager::set_bank(const char *tag, int entrynum)
-{
- set_bank(machine().root_device(), tag, entrynum);
-}
-
-void memory_manager::set_bank(device_t &device, const char *tag, int entrynum)
-{
- // validation checks
- astring fulltag;
- memory_bank *bank = m_bankmap.find_hash_only(device.subtag(fulltag, tag));
- if (bank == NULL)
- fatalerror("set_bank called for unknown bank '%s'", fulltag.cstr());
-
- // set the base
- bank->set_entry(entrynum);
-}
-
-
-//-------------------------------------------------
-// get_bank - return the currently selected bank
-//-------------------------------------------------
-
-int memory_manager::bank(const char *tag)
-{
- return bank(machine().root_device(), tag);
-}
-
-int memory_manager::bank(device_t &device, const char *tag)
-{
- // validation checks
- astring fulltag;
- memory_bank *bank = m_bankmap.find_hash_only(device.subtag(fulltag, tag));
- if (bank == NULL)
- fatalerror("bank() called for unknown bank '%s'", fulltag.cstr());
-
- // return the current entry
- return bank->entry();
-}
-
-
-//-------------------------------------------------
-// set_bankptr - set the base of a bank
-//-------------------------------------------------
-
-void memory_manager::set_bankptr(const char *tag, void *base)
-{
- set_bankptr(machine().root_device(), tag, base);
-}
-
-void memory_manager::set_bankptr(device_t &device, const char *tag, void *base)
-{
- // validation checks
- astring fulltag;
- memory_bank *bank = m_bankmap.find_hash_only(device.subtag(fulltag, tag));
- if (bank == NULL)
- throw emu_fatalerror("memory_set_bankptr called for unknown bank '%s'", fulltag.cstr());
-
- // set the base
- bank->set_base(base);
-}
-
-
-//-------------------------------------------------
// shared - get a pointer to a shared memory
// region by tag
//-------------------------------------------------
@@ -3015,18 +2896,18 @@ memory_bank &address_space::bank_find_or_allocate(const char *tag, offs_t addrst
adjust_addresses(bytestart, byteend, bytemask, bytemirror);
// if this bank is named, look it up
- memory_bank *bank = NULL;
+ memory_bank *membank = NULL;
if (tag != NULL)
- bank = manager().m_bankmap.find_hash_only(tag);
+ membank = manager().bank(tag);
// else try to find an exact match
else
- for (bank = manager().m_banklist.first(); bank != NULL; bank = bank->next())
- if (bank->anonymous() && bank->references_space(*this, ROW_READWRITE) && bank->matches_exactly(bytestart, byteend))
+ for (membank = manager().m_banklist.first(); membank != NULL; membank = membank->next())
+ if (membank->anonymous() && membank->references_space(*this, ROW_READWRITE) && membank->matches_exactly(bytestart, byteend))
break;
// if we don't have a bank yet, find a free one
- if (bank == NULL)
+ if (membank == NULL)
{
// handle failure
int banknum = manager().m_banknext++;
@@ -3039,17 +2920,17 @@ memory_bank &address_space::bank_find_or_allocate(const char *tag, offs_t addrst
}
// allocate the bank
- bank = global_alloc(memory_bank(*this, banknum, bytestart, byteend, tag));
- manager().m_banklist.append(*bank);
+ membank = global_alloc(memory_bank(*this, banknum, bytestart, byteend, tag));
+ manager().m_banklist.append(*membank);
// for named banks, add to the map and register for save states
if (tag != NULL)
- manager().m_bankmap.add_unique_hash(tag, bank, false);
+ manager().m_bankmap.add_unique_hash(tag, membank, false);
}
// add a reference for this space
- bank->add_reference(*this, readorwrite);
- return *bank;
+ membank->add_reference(*this, readorwrite);
+ return *membank;
}
@@ -4463,14 +4344,14 @@ void memory_bank::expand_entries(int entrynum)
//-------------------------------------------------
-// configure - configure an entry
+// configure_entry - configure an entry
//-------------------------------------------------
-void memory_bank::configure(int entrynum, void *base)
+void memory_bank::configure_entry(int entrynum, void *base)
{
// must be positive
if (entrynum < 0)
- throw emu_fatalerror("memory_bank::configure called with out-of-range entry %d", entrynum);
+ throw emu_fatalerror("memory_bank::configure_entry called with out-of-range entry %d", entrynum);
// if we haven't allocated this many entries yet, expand our array
if (entrynum >= m_entry_count)
@@ -4486,15 +4367,27 @@ void memory_bank::configure(int entrynum, void *base)
//-------------------------------------------------
-// configure_decrypted - configure a decrypted
-// entry
+// configure_entries - configure multiple entries
//-------------------------------------------------
-void memory_bank::configure_decrypted(int entrynum, void *base)
+void memory_bank::configure_entries(int startentry, int numentries, void *base, offs_t stride)
+{
+ // fill in the requested bank entries (backwards to improve allocation)
+ for (int entrynum = startentry + numentries - 1; entrynum >= startentry; entrynum--)
+ configure_entry(entrynum, reinterpret_cast<UINT8 *>(base) + (entrynum - startentry) * stride);
+}
+
+
+//-------------------------------------------------
+// configure_decrypted_entry - configure a
+// decrypted entry
+//-------------------------------------------------
+
+void memory_bank::configure_decrypted_entry(int entrynum, void *base)
{
// must be positive
if (entrynum < 0)
- throw emu_fatalerror("memory_bank::configure called with out-of-range entry %d", entrynum);
+ throw emu_fatalerror("memory_bank::configure_decrypted_entry called with out-of-range entry %d", entrynum);
// if we haven't allocated this many entries yet, expand our array
if (entrynum >= m_entry_count)
@@ -4509,6 +4402,18 @@ void memory_bank::configure_decrypted(int entrynum, void *base)
}
+//-------------------------------------------------
+// configure_decrypted_entries - configure
+// multiple decrypted entries
+//-------------------------------------------------
+
+void memory_bank::configure_decrypted_entries(int startentry, int numentries, void *base, offs_t stride)
+{
+ // fill in the requested bank entries (backwards to improve allocation)
+ for (int entrynum = startentry + numentries - 1; entrynum >= startentry; entrynum--)
+ configure_decrypted_entry(entrynum, reinterpret_cast<UINT8 *>(base) + (entrynum - startentry) * stride);
+}
+
//**************************************************************************
// HANDLER ENTRY
@@ -5637,17 +5542,13 @@ void handler_entry_write::write_stub_legacy(address_space &space, offs_t offset,
// configure the addresses for a bank
-void memory_configure_bank(running_machine &machine, const char *tag, int startentry, int numentries, void *base, offs_t stride) { machine.memory().configure_bank(tag, startentry, numentries, base, stride); }
-void memory_configure_bank(device_t &device, const char *tag, int startentry, int numentries, void *base, offs_t stride) { device.machine().memory().configure_bank(device, tag, startentry, numentries, base, stride); }
+void memory_configure_bank(running_machine &machine, const char *tag, int startentry, int numentries, void *base, offs_t stride) { machine.root_device().subbank(tag)->configure_entries(startentry, numentries, base, stride); }
// configure the decrypted addresses for a bank
-void memory_configure_bank_decrypted(running_machine &machine, const char *tag, int startentry, int numentries, void *base, offs_t stride) { machine.memory().configure_bank_decrypted(tag, startentry, numentries, base, stride); }
-void memory_configure_bank_decrypted(device_t &device, const char *tag, int startentry, int numentries, void *base, offs_t stride) { device.machine().memory().configure_bank_decrypted(device, tag, startentry, numentries, base, stride); }
+void memory_configure_bank_decrypted(running_machine &machine, const char *tag, int startentry, int numentries, void *base, offs_t stride) { machine.root_device().subbank(tag)->configure_decrypted_entries(startentry, numentries, base, stride); }
// select one pre-configured entry to be the new bank base
-void memory_set_bank(running_machine &machine, const char *tag, int entrynum) { machine.memory().set_bank(tag, entrynum); }
-void memory_set_bank(device_t &device, const char *tag, int entrynum) { device.machine().memory().set_bank(device, tag, entrynum); }
+void memory_set_bank(running_machine &machine, const char *tag, int entrynum) { machine.root_device().subbank(tag)->set_entry(entrynum); }
// set the absolute address of a bank base
-void memory_set_bankptr(running_machine &machine, const char *tag, void *base) { machine.memory().set_bankptr(tag, base); }
-void memory_set_bankptr(device_t &device, const char *tag, void *base) { device.machine().memory().set_bankptr(device, tag, base); }
+void memory_set_bankptr(running_machine &machine, const char *tag, void *base) { machine.root_device().subbank(tag)->set_base(base); }
diff --git a/src/emu/memory.h b/src/emu/memory.h
index dd2dae8de3a..7e5b12faade 100644
--- a/src/emu/memory.h
+++ b/src/emu/memory.h
@@ -679,8 +679,10 @@ public:
void set_base_decrypted(void *base);
// configure and set entries
- void configure(int entrynum, void *base);
- void configure_decrypted(int entrynum, void *base);
+ void configure_entry(int entrynum, void *base);
+ void configure_entries(int startentry, int numentries, void *base, offs_t stride);
+ void configure_decrypted_entry(int entrynum, void *base);
+ void configure_decrypted_entries(int startentry, int numentries, void *base, offs_t stride);
void set_entry(int entrynum);
private:
@@ -753,26 +755,7 @@ public:
running_machine &machine() const { return m_machine; }
address_space *first_space() const { return m_spacelist.first(); }
memory_bank *first_bank() const { return m_banklist.first(); }
-
- // configure the addresses for a bank
- void configure_bank(const char *tag, int startentry, int numentries, void *base, offs_t stride);
- void configure_bank(device_t &device, const char *tag, int startentry, int numentries, void *base, offs_t stride);
-
- // configure the decrypted addresses for a bank
- void configure_bank_decrypted(const char *tag, int startentry, int numentries, void *base, offs_t stride);
- void configure_bank_decrypted(device_t &device, const char *tag, int startentry, int numentries, void *base, offs_t stride);
-
- // select one pre-configured entry to be the new bank base
- void set_bank(const char *tag, int entrynum);
- void set_bank(device_t &device, const char *tag, int entrynum);
-
- // return the currently selected bank
- int bank(const char *tag);
- int bank(device_t &device, const char *tag);
-
- // set the absolute address of a bank base
- void set_bankptr(const char *tag, void *base) ATTR_NONNULL(3);
- void set_bankptr(device_t &device, const char *tag, void *base) ATTR_NONNULL(3);
+ memory_bank *bank(const char *tag) const { return m_bankmap.find_hash_only(tag); }
// get a pointer to a shared memory region by tag
memory_share *shared(const char *tag);
@@ -922,19 +905,15 @@ extern const char *const address_space_names[ADDRESS_SPACES];
// configure the addresses for a bank
void memory_configure_bank(running_machine &machine, const char *tag, int startentry, int numentries, void *base, offs_t stride) ATTR_NONNULL(5);
-void memory_configure_bank(device_t &device, const char *tag, int startentry, int numentries, void *base, offs_t stride) ATTR_NONNULL(5);
// configure the decrypted addresses for a bank
void memory_configure_bank_decrypted(running_machine &machine, const char *tag, int startentry, int numentries, void *base, offs_t stride) ATTR_NONNULL(5);
-void memory_configure_bank_decrypted(device_t &device, const char *tag, int startentry, int numentries, void *base, offs_t stride) ATTR_NONNULL(5);
// select one pre-configured entry to be the new bank base
void memory_set_bank(running_machine &machine, const char *tag, int entrynum);
-void memory_set_bank(device_t &device, const char *tag, int entrynum);
// set the absolute address of a bank base
void memory_set_bankptr(running_machine &machine, const char *tag, void *base) ATTR_NONNULL(3);
-void memory_set_bankptr(device_t &device, const char *tag, void *base) ATTR_NONNULL(3);
diff --git a/src/emu/sound/2151intf.c b/src/emu/sound/2151intf.c
index 94526decd34..cdb49e8651f 100644
--- a/src/emu/sound/2151intf.c
+++ b/src/emu/sound/2151intf.c
@@ -19,7 +19,8 @@ struct _ym2151_state
emu_timer * timer[2];
void * chip;
UINT8 lastreg;
- const ym2151_interface *intf;
+ devcb_resolved_write_line irqhandler;
+ devcb_resolved_write8 portwritehandler;
};
@@ -37,14 +38,27 @@ static STREAM_UPDATE( ym2151_update )
ym2151_update_one(info->chip, outputs, samples);
}
+static void ym2151_irq_frontend(device_t *device, int irq)
+{
+ ym2151_state *info = get_safe_token(device);
+ info->irqhandler(irq);
+}
+
+static void ym2151_port_write_frontend(device_t *device, offs_t offset, UINT8 data)
+{
+ ym2151_state *info = get_safe_token(device);
+ info->portwritehandler(offset, data);
+}
static DEVICE_START( ym2151 )
{
- static const ym2151_interface dummy = { 0 };
+ static const ym2151_interface dummy = { DEVCB_NULL };
ym2151_state *info = get_safe_token(device);
int rate;
- info->intf = device->static_config() ? (const ym2151_interface *)device->static_config() : &dummy;
+ const ym2151_interface *intf = device->static_config() ? (const ym2151_interface *)device->static_config() : &dummy;
+ info->irqhandler.resolve(intf->irqhandler, *device);
+ info->portwritehandler.resolve(intf->portwritehandler, *device);
rate = device->clock()/64;
@@ -54,8 +68,8 @@ static DEVICE_START( ym2151 )
info->chip = ym2151_init(device,device->clock(),rate);
assert_always(info->chip != NULL, "Error creating YM2151 chip");
- ym2151_set_irq_handler(info->chip,info->intf->irqhandler);
- ym2151_set_port_write_handler(info->chip,info->intf->portwritehandler);
+ ym2151_set_irq_handler(info->chip,ym2151_irq_frontend);
+ ym2151_set_port_write_handler(info->chip,ym2151_port_write_frontend);
}
diff --git a/src/emu/sound/2151intf.h b/src/emu/sound/2151intf.h
index b3b0c32e069..b568192049e 100644
--- a/src/emu/sound/2151intf.h
+++ b/src/emu/sound/2151intf.h
@@ -8,8 +8,8 @@
typedef struct _ym2151_interface ym2151_interface;
struct _ym2151_interface
{
- void (*irqhandler)(device_t *device, int irq);
- write8_device_func portwritehandler;
+ devcb_write_line irqhandler;
+ devcb_write8 portwritehandler;
};
READ8_DEVICE_HANDLER( ym2151_r );
diff --git a/src/mame/audio/atarijsa.c b/src/mame/audio/atarijsa.c
index 1517aa58c5d..4126fe86df2 100644
--- a/src/mame/audio/atarijsa.c
+++ b/src/mame/audio/atarijsa.c
@@ -548,7 +548,7 @@ static WRITE8_HANDLER( jsa3_io_w )
/* update the OKI bank */
if (oki6295 != NULL)
- memory_set_bank(space->machine(), "bank12", (space->machine().memory().bank("bank12") & 2) | ((data >> 1) & 1));
+ memory_set_bank(space->machine(), "bank12", (space->machine().memory().bank("bank12")->entry() & 2) | ((data >> 1) & 1));
/* update the bank */
memcpy(bank_base, &bank_source_data[0x1000 * ((data >> 6) & 3)], 0x1000);
@@ -572,7 +572,7 @@ static WRITE8_HANDLER( jsa3_io_w )
/* update the OKI bank */
if (oki6295 != NULL)
- memory_set_bank(space->machine(), "bank12", (space->machine().memory().bank("bank12") & 1) | ((data >> 3) & 2));
+ memory_set_bank(space->machine(), "bank12", (space->machine().memory().bank("bank12")->entry() & 1) | ((data >> 3) & 2));
/* update the volumes */
ym2151_volume = ((data >> 1) & 7) * 100 / 7;
@@ -681,7 +681,7 @@ static WRITE8_HANDLER( jsa3s_io_w )
if ((data&1) == 0) devtag_reset(space->machine(), "ymsnd");
/* update the OKI bank */
- memory_set_bank(space->machine(), "bank12", (space->machine().memory().bank("bank12") & 2) | ((data >> 1) & 1));
+ memory_set_bank(space->machine(), "bank12", (space->machine().memory().bank("bank12")->entry() & 2) | ((data >> 1) & 1));
/* update the bank */
memcpy(bank_base, &bank_source_data[0x1000 * ((data >> 6) & 3)], 0x1000);
@@ -705,7 +705,7 @@ static WRITE8_HANDLER( jsa3s_io_w )
*/
/* update the OKI bank */
- memory_set_bank(space->machine(), "bank12", (space->machine().memory().bank("bank12") & 1) | ((data >> 3) & 2));
+ memory_set_bank(space->machine(), "bank12", (space->machine().memory().bank("bank12")->entry() & 1) | ((data >> 3) & 2));
memory_set_bank(space->machine(), "bank14", data >> 6);
/* update the volumes */
@@ -790,8 +790,8 @@ ADDRESS_MAP_END
static const ym2151_interface ym2151_config =
{
- atarigen_ym2151_irq_gen,
- ym2151_ctl_w
+ DEVCB_LINE(atarigen_ym2151_irq_gen),
+ DEVCB_HANDLER(ym2151_ctl_w)
};
diff --git a/src/mame/audio/midway.c b/src/mame/audio/midway.c
index 1f185eaf1f1..84887eb5fee 100644
--- a/src/mame/audio/midway.c
+++ b/src/mame/audio/midway.c
@@ -44,11 +44,9 @@
-/*************************************
- *
- * Constants
- *
- *************************************/
+//**************************************************************************
+// CONSTANTS
+//**************************************************************************
#define SSIO_CLOCK XTAL_16MHz
#define CSDELUXE_CLOCK XTAL_16MHz
@@ -58,79 +56,6 @@
-/*************************************
- *
- * Global variables
- *
- *************************************/
-
-static UINT8 mcr_sound_config;
-
-
-
-/*************************************
- *
- * Generic MCR sound initialization
- *
- *************************************/
-
-void mcr_sound_init(running_machine &machine, UINT8 config)
-{
- mcr_sound_config = config;
-
- // Advanced Audio
- if (mcr_sound_config & MCR_WILLIAMS_SOUND)
- williams_cvsd_init(machine);
-}
-
-
-void mcr_sound_reset(running_machine &machine)
-{
- // SSIO
- if (mcr_sound_config & MCR_SSIO)
- {
- machine.device<midway_ssio_device>("ssio")->reset_write(1);
- machine.device<midway_ssio_device>("ssio")->reset_write(0);
- }
-
- // Turbo Chip Squeak
- if (mcr_sound_config & MCR_TURBO_CHIP_SQUEAK)
- {
- machine.device<midway_turbo_chip_squeak_device>("tcs")->reset_write(1);
- machine.device<midway_turbo_chip_squeak_device>("tcs")->reset_write(0);
- }
-
- // Chip Squeak Deluxe
- if (mcr_sound_config & MCR_CHIP_SQUEAK_DELUXE)
- {
- machine.device<midway_chip_squeak_deluxe_device>("csd")->reset_write(1);
- machine.device<midway_chip_squeak_deluxe_device>("csd")->reset_write(0);
- }
-
- // Sounds Good
- if (mcr_sound_config & MCR_SOUNDS_GOOD)
- {
- machine.device<midway_sounds_good_device>("sg")->reset_write(1);
- machine.device<midway_sounds_good_device>("sg")->reset_write(0);
- }
-
- // Squawk n Talk
- if (mcr_sound_config & MCR_SQUAWK_N_TALK)
- {
- machine.device<midway_squawk_n_talk_device>("snt")->reset_write(1);
- machine.device<midway_squawk_n_talk_device>("snt")->reset_write(0);
- }
-
- // Advanced Audio
- if (mcr_sound_config & MCR_WILLIAMS_SOUND)
- {
- williams_cvsd_reset_w(machine, 1);
- williams_cvsd_reset_w(machine, 0);
- }
-}
-
-
-
//**************************************************************************
// GLOBAL VARIABLES
//**************************************************************************
@@ -508,7 +433,7 @@ ADDRESS_MAP_END
// machine configuration
//-------------------------------------------------
-MACHINE_CONFIG_FRAGMENT( midway_ssio )
+static MACHINE_CONFIG_FRAGMENT( midway_ssio )
MCFG_CPU_ADD("cpu", Z80, SSIO_CLOCK/2/4)
MCFG_CPU_PROGRAM_MAP(ssio_map)
MCFG_DEVICE_PERIODIC_INT_DEVICE(DEVICE_SELF_OWNER, midway_ssio_device, clock_14024, SSIO_CLOCK/2/16/10)
@@ -743,7 +668,7 @@ static const pia6821_interface csdeluxe_pia_intf =
// machine configuration
//-------------------------------------------------
-MACHINE_CONFIG_FRAGMENT(midway_chip_squeak_deluxe)
+static MACHINE_CONFIG_FRAGMENT(midway_chip_squeak_deluxe)
MCFG_CPU_ADD("cpu", M68000, CSDELUXE_CLOCK/2)
MCFG_CPU_PROGRAM_MAP(csdeluxe_map)
@@ -930,7 +855,7 @@ static const pia6821_interface soundsgood_pia_intf =
// machine configuration
//-------------------------------------------------
-MACHINE_CONFIG_FRAGMENT(midway_sounds_good)
+static MACHINE_CONFIG_FRAGMENT(midway_sounds_good)
MCFG_CPU_ADD("cpu", M68000, SOUNDSGOOD_CLOCK/2)
MCFG_CPU_PROGRAM_MAP(soundsgood_map)
@@ -1111,7 +1036,7 @@ static const pia6821_interface turbocs_pia_intf =
// machine configuration
//-------------------------------------------------
-MACHINE_CONFIG_FRAGMENT(midway_turbo_chip_squeak)
+static MACHINE_CONFIG_FRAGMENT(midway_turbo_chip_squeak)
MCFG_CPU_ADD("cpu", M6809E, TURBOCS_CLOCK)
MCFG_CPU_PROGRAM_MAP(turbocs_map)
@@ -1356,7 +1281,7 @@ static const pia6821_interface squawkntalk_pia1_intf =
// machine configuration
//-------------------------------------------------
-MACHINE_CONFIG_FRAGMENT(midway_squawk_n_talk)
+static MACHINE_CONFIG_FRAGMENT(midway_squawk_n_talk)
MCFG_CPU_ADD("cpu", M6802, SQUAWKTALK_CLOCK)
MCFG_CPU_PROGRAM_MAP(squawkntalk_map)
diff --git a/src/mame/audio/midway.h b/src/mame/audio/midway.h
index 985cd2501c8..328fdd3e940 100644
--- a/src/mame/audio/midway.h
+++ b/src/mame/audio/midway.h
@@ -310,24 +310,6 @@ private:
};
-/************ Generic MCR routines ***************/
-
-void mcr_sound_init(running_machine &machine, UINT8 config);
-void mcr_sound_reset(running_machine &machine);
-
-
-
-/************ Sound Configuration ***************/
-
-#define MCR_SSIO 0x01
-#define MCR_CHIP_SQUEAK_DELUXE 0x02
-#define MCR_SOUNDS_GOOD 0x04
-#define MCR_TURBO_CHIP_SQUEAK 0x08
-#define MCR_SQUAWK_N_TALK 0x10
-#define MCR_WILLIAMS_SOUND 0x20
-
-
-
/************ SSIO input ports ***************/
#define SSIO_INPUT_PORTS(ssio) \
diff --git a/src/mame/audio/seibu.c b/src/mame/audio/seibu.c
index 1984b540737..ee2202f30aa 100644
--- a/src/mame/audio/seibu.c
+++ b/src/mame/audio/seibu.c
@@ -470,7 +470,7 @@ const ym3812_interface seibu_ym3812_interface =
const ym2151_interface seibu_ym2151_interface =
{
- seibu_ym2151_irqhandler
+ DEVCB_LINE(seibu_ym2151_irqhandler)
};
const ym2203_interface seibu_ym2203_interface =
diff --git a/src/mame/audio/t5182.c b/src/mame/audio/t5182.c
index 3b182d02086..f0d19842ef7 100644
--- a/src/mame/audio/t5182.c
+++ b/src/mame/audio/t5182.c
@@ -272,7 +272,7 @@ static READ8_HANDLER(t5182_sharedram_semaphore_main_r)
const ym2151_interface t5182_ym2151_interface =
{
- t5182_ym2151_irq_handler
+ DEVCB_LINE(t5182_ym2151_irq_handler)
};
diff --git a/src/mame/audio/williams.c b/src/mame/audio/williams.c
index 21688d7a965..4910c64f8b2 100644
--- a/src/mame/audio/williams.c
+++ b/src/mame/audio/williams.c
@@ -1,5 +1,42 @@
/***************************************************************************
+ audio/williams.h
+
+ Functions to emulate general the various Williams/Midway sound cards.
+
+****************************************************************************
+
+ Copyright Aaron Giles
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in
+ the documentation and/or other materials provided with the
+ distribution.
+ * Neither the name 'MAME' nor the names of its contributors may be
+ used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
+ IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
+ INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+
+****************************************************************************
+
Midway/Williams Audio Boards
----------------------------
@@ -43,714 +80,909 @@
-/***************************************************************************
- STATIC GLOBALS
-****************************************************************************/
+//**************************************************************************
+// GLOBAL VARIABLES
+//**************************************************************************
-typedef struct _williams_audio_state williams_audio_state;
-struct _williams_audio_state
-{
- UINT8 sound_int_state;
+extern const device_type WILLIAMS_NARC_SOUND = &device_creator<williams_narc_sound_device>;
+extern const device_type WILLIAMS_CVSD_SOUND = &device_creator<williams_cvsd_sound_device>;
+extern const device_type WILLIAMS_ADPCM_SOUND = &device_creator<williams_adpcm_sound_device>;
- UINT8 audio_talkback;
- UINT8 audio_sync;
- device_t *sound_cpu;
- device_t *soundalt_cpu;
-};
-static williams_audio_state audio;
+//**************************************************************************
+// CVSD SOUND BOARD
+//**************************************************************************
-/***************************************************************************
- FUNCTION PROTOTYPES
-****************************************************************************/
+//-------------------------------------------------
+// williams_cvsd_sound_device - constructor
+//-------------------------------------------------
-static void init_audio_state(running_machine &machine);
+williams_cvsd_sound_device::williams_cvsd_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, WILLIAMS_CVSD_SOUND, "Williams CVSD Sound Board", "wmscvsd", tag, owner, clock),
+ device_mixer_interface(mconfig, *this),
+ m_cpu(*this, "cpu"),
+ m_pia(*this, "pia"),
+ m_hc55516(*this, "cvsd"),
+ m_talkback(0)
+{
+}
-static void cvsd_ym2151_irq(device_t *device, int state);
-static void adpcm_ym2151_irq(device_t *device, int state);
-static WRITE_LINE_DEVICE_HANDLER( cvsd_irqa );
-static WRITE_LINE_DEVICE_HANDLER( cvsd_irqb );
-static WRITE8_HANDLER( cvsd_bank_select_w );
-static WRITE8_DEVICE_HANDLER( cvsd_talkback_w );
-static WRITE8_DEVICE_HANDLER( cvsd_digit_clock_clear_w );
-static WRITE8_DEVICE_HANDLER( cvsd_clock_set_w );
+//-------------------------------------------------
+// write - handle an external write to the input
+// latch
+//-------------------------------------------------
-static READ8_HANDLER( adpcm_command_r );
-static WRITE8_HANDLER( adpcm_bank_select_w );
-static WRITE8_DEVICE_HANDLER( adpcm_6295_bank_select_w );
-static WRITE8_HANDLER( adpcm_talkback_w );
+WRITE16_MEMBER(williams_cvsd_sound_device::write)
+{
+ synchronize(0, data);
+}
-static READ8_HANDLER( narc_command_r );
-static READ8_HANDLER( narc_command2_r );
-static WRITE8_HANDLER( narc_command2_w );
-static WRITE8_HANDLER( narc_master_bank_select_w );
-static WRITE8_HANDLER( narc_slave_bank_select_w );
-static WRITE8_HANDLER( narc_master_talkback_w );
-static WRITE8_HANDLER( narc_master_sync_w );
-static WRITE8_HANDLER( narc_slave_talkback_w );
-static WRITE8_HANDLER( narc_slave_sync_w );
+//-------------------------------------------------
+// reset_write - write to the reset line
+//-------------------------------------------------
+WRITE_LINE_MEMBER(williams_cvsd_sound_device::reset_write)
+{
+ // going high halts the CPU
+ if (state)
+ {
+ bank_select_w(*m_cpu->space(), 0, 0);
+ device_reset();
+ m_cpu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE);
+ }
-/***************************************************************************
- PROCESSOR STRUCTURES
-****************************************************************************/
+ // going low resets and reactivates the CPU
+ else
+ m_cpu->set_input_line(INPUT_LINE_RESET, CLEAR_LINE);
+}
-/* CVSD readmem/writemem structures */
-static ADDRESS_MAP_START( williams_cvsd_map, AS_PROGRAM, 8, driver_device )
- AM_RANGE(0x0000, 0x07ff) AM_MIRROR(0x1800) AM_RAM
- AM_RANGE(0x2000, 0x2001) AM_MIRROR(0x1ffe) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w)
- AM_RANGE(0x4000, 0x4003) AM_MIRROR(0x1ffc) AM_DEVREADWRITE("cvsdpia", pia6821_device, read, write)
- AM_RANGE(0x6000, 0x6000) AM_MIRROR(0x07ff) AM_DEVWRITE_LEGACY("cvsd", cvsd_digit_clock_clear_w)
- AM_RANGE(0x6800, 0x6800) AM_MIRROR(0x07ff) AM_DEVWRITE_LEGACY("cvsd", cvsd_clock_set_w)
- AM_RANGE(0x7800, 0x7800) AM_MIRROR(0x07ff) AM_WRITE_LEGACY(cvsd_bank_select_w)
- AM_RANGE(0x8000, 0xffff) AM_ROMBANK("bank5")
-ADDRESS_MAP_END
+//-------------------------------------------------
+// bank_select_w - change memory banks
+//-------------------------------------------------
-/* NARC master readmem/writemem structures */
-static ADDRESS_MAP_START( williams_narc_master_map, AS_PROGRAM, 8, driver_device )
- AM_RANGE(0x0000, 0x1fff) AM_RAM
- AM_RANGE(0x2000, 0x2001) AM_MIRROR(0x03fe) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w)
- AM_RANGE(0x2800, 0x2800) AM_MIRROR(0x03ff) AM_WRITE_LEGACY(narc_master_talkback_w)
- AM_RANGE(0x2c00, 0x2c00) AM_MIRROR(0x03ff) AM_WRITE_LEGACY(narc_command2_w)
- AM_RANGE(0x3000, 0x3000) AM_MIRROR(0x03ff) AM_DEVWRITE_LEGACY("dac1", dac_w)
- AM_RANGE(0x3400, 0x3400) AM_MIRROR(0x03ff) AM_READ_LEGACY(narc_command_r)
- AM_RANGE(0x3800, 0x3800) AM_MIRROR(0x03ff) AM_WRITE_LEGACY(narc_master_bank_select_w)
- AM_RANGE(0x3c00, 0x3c00) AM_MIRROR(0x03ff) AM_WRITE_LEGACY(narc_master_sync_w)
- AM_RANGE(0x4000, 0xbfff) AM_ROMBANK("bank5")
- AM_RANGE(0xc000, 0xffff) AM_ROMBANK("bank6")
-ADDRESS_MAP_END
+WRITE8_MEMBER(williams_cvsd_sound_device::bank_select_w)
+{
+ subbank("rombank")->set_entry(data & 0x0f);
+}
-/* NARC slave readmem/writemem structures */
-static ADDRESS_MAP_START( williams_narc_slave_map, AS_PROGRAM, 8, driver_device )
- AM_RANGE(0x0000, 0x1fff) AM_RAM
- AM_RANGE(0x2000, 0x2000) AM_MIRROR(0x03ff) AM_DEVWRITE_LEGACY("cvsd", cvsd_clock_set_w)
- AM_RANGE(0x2400, 0x2400) AM_MIRROR(0x03ff) AM_DEVWRITE_LEGACY("cvsd", cvsd_digit_clock_clear_w)
- AM_RANGE(0x2800, 0x2800) AM_MIRROR(0x03ff) AM_WRITE_LEGACY(narc_slave_talkback_w)
- AM_RANGE(0x3000, 0x3000) AM_MIRROR(0x03ff) AM_DEVWRITE_LEGACY("dac2", dac_w)
- AM_RANGE(0x3400, 0x3400) AM_MIRROR(0x03ff) AM_READ_LEGACY(narc_command2_r)
- AM_RANGE(0x3800, 0x3800) AM_MIRROR(0x03ff) AM_WRITE_LEGACY(narc_slave_bank_select_w)
- AM_RANGE(0x3c00, 0x3c00) AM_MIRROR(0x03ff) AM_WRITE_LEGACY(narc_slave_sync_w)
- AM_RANGE(0x4000, 0xbfff) AM_ROMBANK("bank7")
- AM_RANGE(0xc000, 0xffff) AM_ROMBANK("bank8")
-ADDRESS_MAP_END
+//-------------------------------------------------
+// talkback_w - write to the talkback latch
+//-------------------------------------------------
-/* ADPCM readmem/writemem structures */
-static ADDRESS_MAP_START( williams_adpcm_map, AS_PROGRAM, 8, driver_device )
- AM_RANGE(0x0000, 0x1fff) AM_RAM
- AM_RANGE(0x2000, 0x2000) AM_MIRROR(0x03ff) AM_WRITE_LEGACY(adpcm_bank_select_w)
- AM_RANGE(0x2400, 0x2401) AM_MIRROR(0x03fe) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w)
- AM_RANGE(0x2800, 0x2800) AM_MIRROR(0x03ff) AM_DEVWRITE_LEGACY("dac", dac_w)
- AM_RANGE(0x2c00, 0x2c00) AM_MIRROR(0x03ff) AM_DEVREADWRITE("oki", okim6295_device, read, write)
- AM_RANGE(0x3000, 0x3000) AM_MIRROR(0x03ff) AM_READ_LEGACY(adpcm_command_r)
- AM_RANGE(0x3400, 0x3400) AM_MIRROR(0x03ff) AM_DEVWRITE_LEGACY("oki", adpcm_6295_bank_select_w)
- AM_RANGE(0x3c00, 0x3c00) AM_MIRROR(0x03ff) AM_WRITE_LEGACY(adpcm_talkback_w)
- AM_RANGE(0x4000, 0xbfff) AM_ROMBANK("bank5")
- AM_RANGE(0xc000, 0xffff) AM_ROMBANK("bank6")
-ADDRESS_MAP_END
+WRITE8_MEMBER(williams_cvsd_sound_device::talkback_w)
+{
+ m_talkback = data;
+ logerror("CVSD Talkback = %02X\n", data);
+}
+//-------------------------------------------------
+// cvsd_digit_clock_clear_w - clear the clock on
+// the HC55516 and clock the data
+//-------------------------------------------------
-/* PIA structure */
-static const pia6821_interface cvsd_pia_intf =
+WRITE8_MEMBER(williams_cvsd_sound_device::cvsd_digit_clock_clear_w)
{
- DEVCB_NULL, /* port A in */
- DEVCB_NULL, /* port B in */
- DEVCB_NULL, /* line CA1 in */
- DEVCB_NULL, /* line CB1 in */
- DEVCB_NULL, /* line CA2 in */
- DEVCB_NULL, /* line CB2 in */
- DEVCB_DEVICE_HANDLER("dac", dac_w), /* port A out */
- DEVCB_HANDLER(cvsd_talkback_w), /* port B out */
- DEVCB_NULL, /* line CA2 out */
- DEVCB_NULL, /* port CB2 out */
- DEVCB_LINE(cvsd_irqa), /* IRQA */
- DEVCB_LINE(cvsd_irqb) /* IRQB */
-};
-
+ hc55516_digit_w(m_hc55516, data);
+ hc55516_clock_w(m_hc55516, 0);
+}
-/***************************************************************************
- AUDIO STRUCTURES
-****************************************************************************/
+//-------------------------------------------------
+// cvsd_clock_set_w - set the clock on the HC55516
+//-------------------------------------------------
-/* YM2151 structure (CVSD variant) */
-static const ym2151_interface cvsd_ym2151_interface =
+WRITE8_MEMBER(williams_cvsd_sound_device::cvsd_clock_set_w)
{
- cvsd_ym2151_irq
-};
+ hc55516_clock_w(m_hc55516, 1);
+}
-/* YM2151 structure (ADPCM variant) */
-static const ym2151_interface adpcm_ym2151_interface =
-{
- adpcm_ym2151_irq
-};
+//-------------------------------------------------
+// ym2151_irq_w - process IRQ signal changes from
+// the YM2151
+//-------------------------------------------------
+WRITE_LINE_MEMBER(williams_cvsd_sound_device::ym2151_irq_w)
+{
+ m_pia->ca1_w(!state);
+}
-/***************************************************************************
- MACHINE DRIVERS
-****************************************************************************/
+//-------------------------------------------------
+// pia_irqa - process IRQ A signal changes from
+// the 6821
+//-------------------------------------------------
-MACHINE_CONFIG_FRAGMENT( williams_cvsd_sound )
- MCFG_CPU_ADD("cvsdcpu", M6809E, CVSD_MASTER_CLOCK)
- MCFG_CPU_PROGRAM_MAP(williams_cvsd_map)
+WRITE_LINE_MEMBER(williams_cvsd_sound_device::pia_irqa)
+{
+ m_cpu->set_input_line(M6809_FIRQ_LINE, state ? ASSERT_LINE : CLEAR_LINE);
+}
- MCFG_PIA6821_ADD("cvsdpia", cvsd_pia_intf)
- MCFG_SPEAKER_STANDARD_MONO("mono")
+//-------------------------------------------------
+// pia_irqb - process IRQ B signal changes from
+// the 6821
+//-------------------------------------------------
- MCFG_SOUND_ADD("ymsnd", YM2151, CVSD_FM_CLOCK)
- MCFG_SOUND_CONFIG(cvsd_ym2151_interface)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10)
+WRITE_LINE_MEMBER(williams_cvsd_sound_device::pia_irqb)
+{
+ m_cpu->set_input_line(INPUT_LINE_NMI, state ? ASSERT_LINE : CLEAR_LINE);
+}
- MCFG_SOUND_ADD("dac", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
- MCFG_SOUND_ADD("cvsd", HC55516, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.60)
-MACHINE_CONFIG_END
+//-------------------------------------------------
+// audio CPU map
+//-------------------------------------------------
+static ADDRESS_MAP_START( williams_cvsd_map, AS_PROGRAM, 8, williams_cvsd_sound_device )
+ AM_RANGE(0x0000, 0x07ff) AM_MIRROR(0x1800) AM_RAM
+ AM_RANGE(0x2000, 0x2001) AM_MIRROR(0x1ffe) AM_DEVREADWRITE_LEGACY("ym2151", ym2151_r, ym2151_w)
+ AM_RANGE(0x4000, 0x4003) AM_MIRROR(0x1ffc) AM_DEVREADWRITE("pia", pia6821_device, read, write)
+ AM_RANGE(0x6000, 0x6000) AM_MIRROR(0x07ff) AM_WRITE(cvsd_digit_clock_clear_w)
+ AM_RANGE(0x6800, 0x6800) AM_MIRROR(0x07ff) AM_WRITE(cvsd_clock_set_w)
+ AM_RANGE(0x7800, 0x7800) AM_MIRROR(0x07ff) AM_WRITE(bank_select_w)
+ AM_RANGE(0x8000, 0xffff) AM_ROMBANK("rombank")
+ADDRESS_MAP_END
-MACHINE_CONFIG_FRAGMENT( williams_narc_sound )
- MCFG_CPU_ADD("narc1cpu", M6809E, NARC_MASTER_CLOCK)
- MCFG_CPU_PROGRAM_MAP(williams_narc_master_map)
- MCFG_CPU_ADD("narc2cpu", M6809E, NARC_MASTER_CLOCK)
- MCFG_CPU_PROGRAM_MAP(williams_narc_slave_map)
+//-------------------------------------------------
+// 6821 PIA interface
+//-------------------------------------------------
- MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
+static const pia6821_interface cvsd_pia_intf =
+{
+ DEVCB_NULL, // port A in
+ DEVCB_NULL, // port B in
+ DEVCB_NULL, // line CA1 in
+ DEVCB_NULL, // line CB1 in
+ DEVCB_NULL, // line CA2 in
+ DEVCB_NULL, // line CB2 in
+ DEVCB_DEVICE_HANDLER("dac", dac_w), // port A out
+ DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, williams_cvsd_sound_device, talkback_w), // port B out
+ DEVCB_NULL, // line CA2 out
+ DEVCB_NULL, // port CB2 out
+ DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, williams_cvsd_sound_device, pia_irqa), // IRQA
+ DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, williams_cvsd_sound_device, pia_irqb) // IRQB
+};
- MCFG_SOUND_ADD("ymsnd", YM2151, NARC_FM_CLOCK)
- MCFG_SOUND_CONFIG(adpcm_ym2151_interface)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.10)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.10)
- MCFG_SOUND_ADD("dac1", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.50)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.50)
+//-------------------------------------------------
+// YM2151 configuration
+//-------------------------------------------------
- MCFG_SOUND_ADD("dac2", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.50)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.50)
+static const ym2151_interface cvsd_ym2151_interface =
+{
+ DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, williams_cvsd_sound_device, ym2151_irq_w)
+};
- MCFG_SOUND_ADD("cvsd", HC55516, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.60)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.60)
-MACHINE_CONFIG_END
+//-------------------------------------------------
+// machine configuration
+//-------------------------------------------------
-MACHINE_CONFIG_FRAGMENT( williams_adpcm_sound )
- MCFG_CPU_ADD("adpcm", M6809E, ADPCM_MASTER_CLOCK)
- MCFG_CPU_PROGRAM_MAP(williams_adpcm_map)
+static MACHINE_CONFIG_FRAGMENT( williams_cvsd_sound )
+ MCFG_CPU_ADD("cpu", M6809E, CVSD_MASTER_CLOCK)
+ MCFG_CPU_PROGRAM_MAP(williams_cvsd_map)
- MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_PIA6821_ADD("pia", cvsd_pia_intf)
- MCFG_SOUND_ADD("ymsnd", YM2151, ADPCM_FM_CLOCK)
- MCFG_SOUND_CONFIG(adpcm_ym2151_interface)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10)
+ MCFG_SOUND_ADD("ym2151", YM2151, CVSD_FM_CLOCK)
+ MCFG_SOUND_CONFIG(cvsd_ym2151_interface)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, DEVICE_SELF_OWNER, 0.10)
MCFG_SOUND_ADD("dac", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, DEVICE_SELF_OWNER, 0.50)
- MCFG_OKIM6295_ADD("oki", ADPCM_MASTER_CLOCK/8, OKIM6295_PIN7_HIGH) // clock frequency & pin 7 not verified
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ MCFG_SOUND_ADD("cvsd", HC55516, 0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, DEVICE_SELF_OWNER, 0.60)
MACHINE_CONFIG_END
+//-------------------------------------------------
+// device_mconfig_additions - return a pointer to
+// the device's machine fragment
+//-------------------------------------------------
-/***************************************************************************
- INITIALIZATION
-****************************************************************************/
-
-void williams_cvsd_init(running_machine &machine)
+machine_config_constructor williams_cvsd_sound_device::device_mconfig_additions() const
{
- williams_audio_state *state = &audio;
- UINT8 *ROM;
- int bank;
+ return MACHINE_CONFIG_NAME( williams_cvsd_sound );
+}
- /* configure the CPU */
- state->sound_cpu = machine.device("cvsdcpu");
- state->soundalt_cpu = NULL;
- /* configure master CPU banks */
- ROM = machine.region("cvsdcpu")->base();
- for (bank = 0; bank < 16; bank++)
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void williams_cvsd_sound_device::device_start()
+{
+ // configure master CPU banks
+ UINT8 *rom = subregion("cpu")->base();
+ for (int bank = 0; bank < 16; bank++)
{
- /*
- D0/D1 -> selects: 0=U4 1=U19 2=U20 3=n/c
- D2 -> A15
- D3 -> A16
- */
+ //
+ // D0/D1 -> selects: 0=U4 1=U19 2=U20 3=n/c
+ // D2 -> A15
+ // D3 -> A16
+ //
offs_t offset = 0x8000 * ((bank >> 2) & 3) + 0x20000 * (bank & 3);
- memory_configure_bank(machine, "bank5", bank, 1, &ROM[0x10000 + offset], 0);
+ subbank("rombank")->configure_entry(bank, &rom[0x10000 + offset]);
}
- memory_set_bank(machine, "bank5", 0);
+ subbank("rombank")->set_entry(0);
- /* reset the IRQ state */
- machine.device<pia6821_device>("cvsdpia")->ca1_w(1);
+ // reset the IRQ state
+ m_pia->ca1_w(1);
- /* register for save states */
- state_save_register_global(machine, state->sound_int_state);
- state_save_register_global(machine, state->audio_talkback);
+ // register for save states
+ save_item(NAME(m_talkback));
}
-void williams_narc_init(running_machine &machine)
-{
- williams_audio_state *state = &audio;
- UINT8 *ROM;
- int bank;
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
- /* configure the CPU */
- state->sound_cpu = machine.device("narc1cpu");
- state->soundalt_cpu = machine.device("narc2cpu");
+void williams_cvsd_sound_device::device_reset()
+{
+ // reset interrupt states
+ m_cpu->set_input_line(M6809_FIRQ_LINE, CLEAR_LINE);
+ m_cpu->set_input_line(M6809_IRQ_LINE, CLEAR_LINE);
+ m_cpu->set_input_line(INPUT_LINE_NMI, CLEAR_LINE);
+}
- /* configure master CPU banks */
- ROM = machine.region("narc1cpu")->base();
- for (bank = 0; bank < 16; bank++)
- {
- /*
- D0 -> A15
- D1/D2 -> selects: 0=n/c 1=U3 2=U4 3=U5
- D3 -> A16
- */
- offs_t offset = 0x8000 * (bank & 1) + 0x10000 * ((bank >> 3) & 1) + 0x20000 * ((bank >> 1) & 3);
- memory_configure_bank(machine, "bank5", bank, 1, &ROM[0x10000 + offset], 0);
- }
- memory_set_bankptr(machine, "bank6", &ROM[0x10000 + 0x4000 + 0x8000 + 0x10000 + 0x20000 * 3]);
- /* configure slave CPU banks */
- ROM = machine.region("narc2cpu")->base();
- for (bank = 0; bank < 16; bank++)
- {
- /*
- D0 -> A15
- D1/D2 -> selects: 0=U35 1=U36 2=U37 3=U38
- D3 -> A16
- */
- offs_t offset = 0x8000 * (bank & 1) + 0x10000 * ((bank >> 3) & 1) + 0x20000 * ((bank >> 1) & 3);
- memory_configure_bank(machine, "bank7", bank, 1, &ROM[0x10000 + offset], 0);
- }
- memory_set_bankptr(machine, "bank8", &ROM[0x10000 + 0x4000 + 0x8000 + 0x10000 + 0x20000 * 3]);
+//-------------------------------------------------
+// device_timer - timer callbacks
+//-------------------------------------------------
- /* register for save states */
- state_save_register_global(machine, state->sound_int_state);
- state_save_register_global(machine, state->audio_talkback);
- state_save_register_global(machine, state->audio_sync);
+void williams_cvsd_sound_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
+{
+ // process incoming data write
+ m_pia->portb_w(param & 0xff);
+ m_pia->cb1_w((param >> 8) & 1);
+ m_pia->cb2_w((param >> 9) & 1);
}
-void williams_adpcm_init(running_machine &machine)
-{
- williams_audio_state *state = &audio;
- UINT8 *ROM;
- /* configure the CPU */
- state->sound_cpu = machine.device("adpcm");
- state->soundalt_cpu = NULL;
+//**************************************************************************
+// NARC SOUND BOARD
+//**************************************************************************
+
+//-------------------------------------------------
+// williams_narc_sound_device - constructor
+//-------------------------------------------------
- /* configure banks */
- ROM = machine.region("adpcm")->base();
- memory_configure_bank(machine, "bank5", 0, 8, &ROM[0x10000], 0x8000);
- memory_set_bankptr(machine, "bank6", &ROM[0x10000 + 0x4000 + 7 * 0x8000]);
+williams_narc_sound_device::williams_narc_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, WILLIAMS_NARC_SOUND, "Williams NARC Sound Board", "wmsnarc", tag, owner, clock),
+ device_mixer_interface(mconfig, *this),
+ m_cpu0(*this, "cpu0"),
+ m_cpu1(*this, "cpu1"),
+ m_hc55516(*this, "cvsd"),
+ m_latch(0),
+ m_latch2(0),
+ m_talkback(0),
+ m_audio_sync(0),
+ m_sound_int_state(0)
+{
+}
- /* expand ADPCM data */
- /* it is assumed that U12 is loaded @ 0x00000 and U13 is loaded @ 0x40000 */
- ROM = machine.region("oki")->base();
- memcpy(ROM + 0x1c0000, ROM + 0x080000, 0x20000); /* expand individual banks */
- memcpy(ROM + 0x180000, ROM + 0x0a0000, 0x20000);
- memcpy(ROM + 0x140000, ROM + 0x0c0000, 0x20000);
- memcpy(ROM + 0x100000, ROM + 0x0e0000, 0x20000);
- memcpy(ROM + 0x0c0000, ROM + 0x000000, 0x20000);
- memcpy(ROM + 0x000000, ROM + 0x040000, 0x20000);
- memcpy(ROM + 0x080000, ROM + 0x020000, 0x20000);
- memcpy(ROM + 0x1e0000, ROM + 0x060000, 0x20000); /* copy common bank */
- memcpy(ROM + 0x1a0000, ROM + 0x060000, 0x20000);
- memcpy(ROM + 0x160000, ROM + 0x060000, 0x20000);
- memcpy(ROM + 0x120000, ROM + 0x060000, 0x20000);
- memcpy(ROM + 0x0e0000, ROM + 0x060000, 0x20000);
- memcpy(ROM + 0x0a0000, ROM + 0x060000, 0x20000);
- memcpy(ROM + 0x020000, ROM + 0x060000, 0x20000);
+//-------------------------------------------------
+// read - return the talkback register with the
+// SYNC bits in bits 8 and 9
+//-------------------------------------------------
- /* register for save states */
- state_save_register_global(machine, state->sound_int_state);
- state_save_register_global(machine, state->audio_talkback);
+READ16_MEMBER(williams_narc_sound_device::read)
+{
+ return m_talkback | (m_audio_sync << 8);
}
-static void init_audio_state(running_machine &machine)
+//-------------------------------------------------
+// write - handle an external write to the input
+// latch
+//-------------------------------------------------
+
+WRITE16_MEMBER(williams_narc_sound_device::write)
{
- williams_audio_state *state = &audio;
- device_t *sound_cpu = state->sound_cpu;
- device_t *soundalt_cpu = state->soundalt_cpu;
+ synchronize(TID_MASTER_COMMAND, data);
+}
+
- /* reset the YM2151 state */
- devtag_reset(machine, "ymsnd");
+//-------------------------------------------------
+// reset_write - write to the reset line
+//-------------------------------------------------
- /* clear all the interrupts */
- state->sound_int_state = 0;
- if (sound_cpu != NULL)
+WRITE_LINE_MEMBER(williams_narc_sound_device::reset_write)
+{
+ // going high halts the CPU
+ if (state)
{
- device_set_input_line(sound_cpu, M6809_FIRQ_LINE, CLEAR_LINE);
- device_set_input_line(sound_cpu, M6809_IRQ_LINE, CLEAR_LINE);
- device_set_input_line(sound_cpu, INPUT_LINE_NMI, CLEAR_LINE);
+ master_bank_select_w(*m_cpu0->space(), 0, 0);
+ slave_bank_select_w(*m_cpu1->space(), 0, 0);
+ device_reset();
+ m_cpu0->set_input_line(INPUT_LINE_RESET, ASSERT_LINE);
+ m_cpu1->set_input_line(INPUT_LINE_RESET, ASSERT_LINE);
}
- if (soundalt_cpu != NULL)
+
+ // going low resets and reactivates the CPU
+ else
{
- device_set_input_line(soundalt_cpu, M6809_FIRQ_LINE, CLEAR_LINE);
- device_set_input_line(soundalt_cpu, M6809_IRQ_LINE, CLEAR_LINE);
- device_set_input_line(soundalt_cpu, INPUT_LINE_NMI, CLEAR_LINE);
+ m_cpu0->set_input_line(INPUT_LINE_RESET, CLEAR_LINE);
+ m_cpu1->set_input_line(INPUT_LINE_RESET, CLEAR_LINE);
}
}
+//-------------------------------------------------
+// master_bank_select_w - select the bank for the
+// master CPU
+//-------------------------------------------------
-/***************************************************************************
- CVSD IRQ GENERATION CALLBACKS
-****************************************************************************/
-
-static void cvsd_ym2151_irq(device_t *device, int state)
+WRITE8_MEMBER(williams_narc_sound_device::master_bank_select_w)
{
- device->machine().device<pia6821_device>("cvsdpia")->ca1_w(!state);
+ subbank("masterbank")->set_entry(data & 0x0f);
}
-static WRITE_LINE_DEVICE_HANDLER( cvsd_irqa )
-{
- williams_audio_state *sndstate = &audio;
+//-------------------------------------------------
+// slave_bank_select_w - select the bank for the
+// slave CPU
+//-------------------------------------------------
- device_set_input_line(sndstate->sound_cpu, M6809_FIRQ_LINE, state ? ASSERT_LINE : CLEAR_LINE);
+WRITE8_MEMBER(williams_narc_sound_device::slave_bank_select_w)
+{
+ subbank("slavebank")->set_entry(data & 0x0f);
}
-static WRITE_LINE_DEVICE_HANDLER( cvsd_irqb )
-{
- williams_audio_state *sndstate = &audio;
+//-------------------------------------------------
+// command_r - read command written by external
+// agent
+//-------------------------------------------------
- device_set_input_line(sndstate->sound_cpu, INPUT_LINE_NMI, state ? ASSERT_LINE : CLEAR_LINE);
+READ8_MEMBER(williams_narc_sound_device::command_r)
+{
+ m_cpu0->set_input_line(M6809_IRQ_LINE, CLEAR_LINE);
+ m_sound_int_state = 0;
+ return m_latch;
}
+//-------------------------------------------------
+// command2_w - write command from master CPU to
+// slave CPU
+//-------------------------------------------------
-/***************************************************************************
- ADPCM IRQ GENERATION CALLBACKS
-****************************************************************************/
-
-static void adpcm_ym2151_irq(device_t *device, int state)
+WRITE8_MEMBER(williams_narc_sound_device::command2_w)
{
- williams_audio_state *sndstate = &audio;
-
- device_set_input_line(sndstate->sound_cpu, M6809_FIRQ_LINE, state ? ASSERT_LINE : CLEAR_LINE);
+ synchronize(TID_SLAVE_COMMAND, data);
}
+//-------------------------------------------------
+// command2_r - read command written by master
+// CPU
+//-------------------------------------------------
-/***************************************************************************
- CVSD READ/WRITE HANDLERS
-****************************************************************************/
-
-static WRITE8_HANDLER( cvsd_bank_select_w )
+READ8_MEMBER(williams_narc_sound_device::command2_r)
{
- memory_set_bank(space->machine(), "bank5", data & 0x0f);
+ m_cpu1->set_input_line(M6809_FIRQ_LINE, CLEAR_LINE);
+ return m_latch2;
}
-static WRITE8_DEVICE_HANDLER( cvsd_talkback_w )
-{
- williams_audio_state *state = &audio;
+//-------------------------------------------------
+// master_talkback_w - handle writes to the
+// talkback latch from the master CPU
+//-------------------------------------------------
- state->audio_talkback = data;
- logerror("CVSD Talkback = %02X\n", data);
+WRITE8_MEMBER(williams_narc_sound_device::master_talkback_w)
+{
+ m_talkback = data;
+ logerror("Master Talkback = %02X\n", data);
}
-static WRITE8_DEVICE_HANDLER( cvsd_digit_clock_clear_w )
+//-------------------------------------------------
+// master_sync_w - handle writes to the master
+// SYNC register
+//-------------------------------------------------
+
+WRITE8_MEMBER(williams_narc_sound_device::master_sync_w)
{
- hc55516_digit_w(device, data);
- hc55516_clock_w(device, 0);
+ timer_set(attotime::from_double(TIME_OF_74LS123(180000, 0.000001)), TID_SYNC_CLEAR, 0x01);
+ m_audio_sync |= 0x01;
+ logerror("Master sync = %02X\n", data);
}
-static WRITE8_DEVICE_HANDLER( cvsd_clock_set_w )
+//-------------------------------------------------
+// slave_talkback_w - handle writes to the
+// talkback latch from the slave CPU
+//-------------------------------------------------
+
+WRITE8_MEMBER(williams_narc_sound_device::slave_talkback_w)
{
- hc55516_clock_w(device, 1);
+ logerror("Slave Talkback = %02X\n", data);
}
-/***************************************************************************
- CVSD COMMUNICATIONS
-****************************************************************************/
+//-------------------------------------------------
+// slave_sync_w - handle writes to the slave
+// SYNC register
+//-------------------------------------------------
-static TIMER_CALLBACK( williams_cvsd_delayed_data_w )
+WRITE8_MEMBER(williams_narc_sound_device::slave_sync_w)
{
- pia6821_device *pia = machine.device<pia6821_device>("cvsdpia");
- pia->portb_w(param & 0xff);
- pia->cb1_w((param >> 8) & 1);
- pia->cb2_w((param >> 9) & 1);
+ timer_set(attotime::from_double(TIME_OF_74LS123(180000, 0.000001)), TID_SYNC_CLEAR, 0x02);
+ m_audio_sync |= 0x02;
+ logerror("Slave sync = %02X\n", data);
}
-void williams_cvsd_data_w(running_machine &machine, int data)
+//-------------------------------------------------
+// cvsd_digit_clock_clear_w - clear the clock on
+// the HC55516 and clock the data
+//-------------------------------------------------
+
+WRITE8_MEMBER(williams_narc_sound_device::cvsd_digit_clock_clear_w)
{
- machine.scheduler().synchronize(FUNC(williams_cvsd_delayed_data_w), data);
+ hc55516_digit_w(m_hc55516, data);
+ hc55516_clock_w(m_hc55516, 0);
}
-void williams_cvsd_reset_w(running_machine &machine, int state)
-{
- williams_audio_state *sndstate = &audio;
- address_space *space = sndstate->sound_cpu->memory().space(AS_PROGRAM);
+//-------------------------------------------------
+// cvsd_clock_set_w - set the clock on the HC55516
+//-------------------------------------------------
- /* going high halts the CPU */
- if (state)
- {
- cvsd_bank_select_w(space, 0, 0);
- init_audio_state(space->machine());
- device_set_input_line(&space->device(), INPUT_LINE_RESET, ASSERT_LINE);
- }
- /* going low resets and reactivates the CPU */
- else
- device_set_input_line(&space->device(), INPUT_LINE_RESET, CLEAR_LINE);
+WRITE8_MEMBER(williams_narc_sound_device::cvsd_clock_set_w)
+{
+ hc55516_clock_w(m_hc55516, 1);
}
+//-------------------------------------------------
+// ym2151_irq_w - handle line changes on the
+// YM2151 IRQ line
+//-------------------------------------------------
-/***************************************************************************
- NARC READ/WRITE HANDLERS
-****************************************************************************/
-
-static WRITE8_HANDLER( narc_master_bank_select_w )
+WRITE_LINE_MEMBER(williams_narc_sound_device::ym2151_irq_w)
{
- memory_set_bank(space->machine(), "bank5", data & 0x0f);
+ m_cpu0->set_input_line(M6809_FIRQ_LINE, state ? ASSERT_LINE : CLEAR_LINE);
}
-static WRITE8_HANDLER( narc_slave_bank_select_w )
-{
- memory_set_bank(space->machine(), "bank7", data & 0x0f);
-}
+//-------------------------------------------------
+// master CPU map
+//-------------------------------------------------
+static ADDRESS_MAP_START( williams_narc_master_map, AS_PROGRAM, 8, williams_narc_sound_device )
+ AM_RANGE(0x0000, 0x1fff) AM_RAM
+ AM_RANGE(0x2000, 0x2001) AM_MIRROR(0x03fe) AM_DEVREADWRITE_LEGACY("ym2151", ym2151_r, ym2151_w)
+ AM_RANGE(0x2800, 0x2800) AM_MIRROR(0x03ff) AM_WRITE(master_talkback_w)
+ AM_RANGE(0x2c00, 0x2c00) AM_MIRROR(0x03ff) AM_WRITE(command2_w)
+ AM_RANGE(0x3000, 0x3000) AM_MIRROR(0x03ff) AM_DEVWRITE_LEGACY("dac1", dac_w)
+ AM_RANGE(0x3400, 0x3400) AM_MIRROR(0x03ff) AM_READ(command_r)
+ AM_RANGE(0x3800, 0x3800) AM_MIRROR(0x03ff) AM_WRITE(master_bank_select_w)
+ AM_RANGE(0x3c00, 0x3c00) AM_MIRROR(0x03ff) AM_WRITE(master_sync_w)
+ AM_RANGE(0x4000, 0xbfff) AM_ROMBANK("masterbank")
+ AM_RANGE(0xc000, 0xffff) AM_ROMBANK("masterupper")
+ADDRESS_MAP_END
-static READ8_HANDLER( narc_command_r )
-{
- williams_audio_state *state = &audio;
- driver_device *drvstate = space->machine().driver_data<driver_device>();
- device_set_input_line(state->sound_cpu, M6809_IRQ_LINE, CLEAR_LINE);
- state->sound_int_state = 0;
- return drvstate->soundlatch_byte_r(*space, 0);
-}
+//-------------------------------------------------
+// slave CPU map
+//-------------------------------------------------
-static WRITE8_HANDLER( narc_command2_w )
-{
- williams_audio_state *state = &audio;
- driver_device *drvstate = space->machine().driver_data<driver_device>();
- drvstate->soundlatch2_byte_w(*space, 0, data & 0xff);
- device_set_input_line(state->soundalt_cpu, M6809_FIRQ_LINE, ASSERT_LINE);
-}
+static ADDRESS_MAP_START( williams_narc_slave_map, AS_PROGRAM, 8, williams_narc_sound_device )
+ AM_RANGE(0x0000, 0x1fff) AM_RAM
+ AM_RANGE(0x2000, 0x2000) AM_MIRROR(0x03ff) AM_WRITE(cvsd_clock_set_w)
+ AM_RANGE(0x2400, 0x2400) AM_MIRROR(0x03ff) AM_WRITE(cvsd_digit_clock_clear_w)
+ AM_RANGE(0x2800, 0x2800) AM_MIRROR(0x03ff) AM_WRITE(slave_talkback_w)
+ AM_RANGE(0x3000, 0x3000) AM_MIRROR(0x03ff) AM_DEVWRITE_LEGACY("dac2", dac_w)
+ AM_RANGE(0x3400, 0x3400) AM_MIRROR(0x03ff) AM_READ(command2_r)
+ AM_RANGE(0x3800, 0x3800) AM_MIRROR(0x03ff) AM_WRITE(slave_bank_select_w)
+ AM_RANGE(0x3c00, 0x3c00) AM_MIRROR(0x03ff) AM_WRITE(slave_sync_w)
+ AM_RANGE(0x4000, 0xbfff) AM_ROMBANK("slavebank")
+ AM_RANGE(0xc000, 0xffff) AM_ROMBANK("slaveupper")
+ADDRESS_MAP_END
-static READ8_HANDLER( narc_command2_r )
+//-------------------------------------------------
+// YM2151 configuration
+//-------------------------------------------------
+
+static const ym2151_interface narc_ym2151_interface =
{
- williams_audio_state *state = &audio;
- driver_device *drvstate = space->machine().driver_data<driver_device>();
- device_set_input_line(state->soundalt_cpu, M6809_FIRQ_LINE, CLEAR_LINE);
- return drvstate->soundlatch2_byte_r(*space, 0);
-}
+ DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, williams_narc_sound_device, ym2151_irq_w)
+};
-static WRITE8_HANDLER( narc_master_talkback_w )
-{
- williams_audio_state *state = &audio;
+//-------------------------------------------------
+// machine configuration
+//-------------------------------------------------
- state->audio_talkback = data;
- logerror("Master Talkback = %02X\n", data);
-}
+static MACHINE_CONFIG_FRAGMENT( williams_narc_sound )
+ MCFG_CPU_ADD("cpu0", M6809E, NARC_MASTER_CLOCK)
+ MCFG_CPU_PROGRAM_MAP(williams_narc_master_map)
+ MCFG_CPU_ADD("cpu1", M6809E, NARC_MASTER_CLOCK)
+ MCFG_CPU_PROGRAM_MAP(williams_narc_slave_map)
-static TIMER_CALLBACK( narc_sync_clear )
-{
- williams_audio_state *state = &audio;
+ MCFG_SOUND_ADD("ym2151", YM2151, NARC_FM_CLOCK)
+ MCFG_SOUND_CONFIG(narc_ym2151_interface)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, DEVICE_SELF_OWNER, 0.10)
- state->audio_sync &= ~param;
-}
+ MCFG_SOUND_ADD("dac1", DAC, 0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, DEVICE_SELF_OWNER, 0.50)
-static WRITE8_HANDLER( narc_master_sync_w )
-{
- williams_audio_state *state = &audio;
+ MCFG_SOUND_ADD("dac2", DAC, 0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, DEVICE_SELF_OWNER, 0.50)
+
+ MCFG_SOUND_ADD("cvsd", HC55516, 0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, DEVICE_SELF_OWNER, 0.60)
+MACHINE_CONFIG_END
- space->machine().scheduler().timer_set(attotime::from_double(TIME_OF_74LS123(180000, 0.000001)), FUNC(narc_sync_clear), 0x01);
- state->audio_sync |= 0x01;
- logerror("Master sync = %02X\n", data);
-}
+//-------------------------------------------------
+// device_mconfig_additions - return a pointer to
+// the device's machine fragment
+//-------------------------------------------------
-static WRITE8_HANDLER( narc_slave_talkback_w )
+machine_config_constructor williams_narc_sound_device::device_mconfig_additions() const
{
- logerror("Slave Talkback = %02X\n", data);
+ return MACHINE_CONFIG_NAME( williams_narc_sound );
}
-static WRITE8_HANDLER( narc_slave_sync_w )
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void williams_narc_sound_device::device_start()
{
- williams_audio_state *state = &audio;
+ // configure master CPU banks
+ UINT8 *rom = subregion("cpu0")->base();
+ for (int bank = 0; bank < 16; bank++)
+ {
+ //
+ // D0 -> A15
+ // D1/D2 -> selects: 0=n/c 1=U3 2=U4 3=U5
+ // D3 -> A16
+ //
+ offs_t offset = 0x8000 * (bank & 1) + 0x10000 * ((bank >> 3) & 1) + 0x20000 * ((bank >> 1) & 3);
+ subbank("masterbank")->configure_entry(bank, &rom[0x10000 + offset]);
+ }
+ subbank("masterupper")->set_base(&rom[0x10000 + 0x4000 + 0x8000 + 0x10000 + 0x20000 * 3]);
- space->machine().scheduler().timer_set(attotime::from_double(TIME_OF_74LS123(180000, 0.000001)), FUNC(narc_sync_clear), 0x02);
- state->audio_sync |= 0x02;
- logerror("Slave sync = %02X\n", data);
+ // configure slave CPU banks
+ rom = subregion("cpu1")->base();
+ for (int bank = 0; bank < 16; bank++)
+ {
+ //
+ // D0 -> A15
+ // D1/D2 -> selects: 0=U35 1=U36 2=U37 3=U38
+ // D3 -> A16
+ //
+ offs_t offset = 0x8000 * (bank & 1) + 0x10000 * ((bank >> 3) & 1) + 0x20000 * ((bank >> 1) & 3);
+ subbank("slavebank")->configure_entry(bank, &rom[0x10000 + offset]);
+ }
+ subbank("slaveupper")->set_base(&rom[0x10000 + 0x4000 + 0x8000 + 0x10000 + 0x20000 * 3]);
+
+ // register for save states
+ save_item(NAME(m_latch));
+ save_item(NAME(m_latch2));
+ save_item(NAME(m_talkback));
+ save_item(NAME(m_audio_sync));
+ save_item(NAME(m_sound_int_state));
}
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
-/***************************************************************************
- NARC COMMUNICATIONS
-****************************************************************************/
+void williams_narc_sound_device::device_reset()
+{
+ // reset interrupt states
+ m_sound_int_state = 0;
+ m_cpu0->set_input_line(M6809_FIRQ_LINE, CLEAR_LINE);
+ m_cpu0->set_input_line(M6809_IRQ_LINE, CLEAR_LINE);
+ m_cpu0->set_input_line(INPUT_LINE_NMI, CLEAR_LINE);
+ m_cpu1->set_input_line(M6809_FIRQ_LINE, CLEAR_LINE);
+ m_cpu1->set_input_line(M6809_IRQ_LINE, CLEAR_LINE);
+ m_cpu1->set_input_line(INPUT_LINE_NMI, CLEAR_LINE);
+}
+
+
+//-------------------------------------------------
+// device_timer - timer callbacks
+//-------------------------------------------------
-void williams_narc_data_w(running_machine &machine, int data)
+void williams_narc_sound_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
{
- williams_audio_state *state = &audio;
- device_t *sound_cpu = state->sound_cpu;
- address_space *space = sound_cpu->memory().space(AS_PROGRAM);
- driver_device *drvstate = space->machine().driver_data<driver_device>();
- drvstate->soundlatch_byte_w(*space, 0, data & 0xff);
- device_set_input_line(sound_cpu, INPUT_LINE_NMI, (data & 0x100) ? CLEAR_LINE : ASSERT_LINE);
- if (!(data & 0x200))
+ switch (id)
{
- device_set_input_line(sound_cpu, M6809_IRQ_LINE, ASSERT_LINE);
- state->sound_int_state = 1;
+ case TID_MASTER_COMMAND:
+ m_latch = param & 0xff;
+ m_cpu0->set_input_line(INPUT_LINE_NMI, (param & 0x100) ? CLEAR_LINE : ASSERT_LINE);
+ if ((param & 0x200) == 0)
+ {
+ m_cpu0->set_input_line(M6809_IRQ_LINE, ASSERT_LINE);
+ m_sound_int_state = 1;
+ }
+ break;
+
+ case TID_SLAVE_COMMAND:
+ m_latch2 = param & 0xff;
+ m_cpu1->set_input_line(M6809_FIRQ_LINE, ASSERT_LINE);
+ break;
+
+ case TID_SYNC_CLEAR:
+ m_audio_sync &= ~param;
+ break;
}
}
-void williams_narc_reset_w(running_machine &machine, int state)
+//**************************************************************************
+// ADPCM SOUND BOARD
+//**************************************************************************
+
+//-------------------------------------------------
+// williams_adpcm_sound_device - constructor
+//-------------------------------------------------
+
+williams_adpcm_sound_device::williams_adpcm_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, WILLIAMS_ADPCM_SOUND, "Williams ADPCM Sound Board", "wmsadpcm", tag, owner, clock),
+ device_mixer_interface(mconfig, *this),
+ m_cpu(*this, "cpu"),
+ m_oki6295(*this, "oki"),
+ m_latch(0),
+ m_talkback(0),
+ m_sound_int_state(0)
{
- williams_audio_state *sndstate = &audio;
- device_t *sound_cpu = sndstate->sound_cpu;
- device_t *soundalt_cpu = sndstate->soundalt_cpu;
+}
+
- /* going high halts the CPU */
+//-------------------------------------------------
+// write - handle an external write to the input
+// latch
+//-------------------------------------------------
+
+WRITE16_MEMBER(williams_adpcm_sound_device::write)
+{
+ synchronize(TID_COMMAND, data);
+}
+
+
+//-------------------------------------------------
+// reset_write - write to the reset line
+//-------------------------------------------------
+
+WRITE_LINE_MEMBER(williams_adpcm_sound_device::reset_write)
+{
+ // going high halts the CPU
if (state)
{
- address_space *space = sound_cpu->memory().space(AS_PROGRAM);
- narc_master_bank_select_w(space, 0, 0);
- narc_slave_bank_select_w(space, 0, 0);
- init_audio_state(space->machine());
- device_set_input_line(sound_cpu, INPUT_LINE_RESET, ASSERT_LINE);
- device_set_input_line(soundalt_cpu, INPUT_LINE_RESET, ASSERT_LINE);
+ bank_select_w(*m_cpu->space(), 0, 0);
+ device_reset();
+ m_cpu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE);
}
- /* going low resets and reactivates the CPU */
+
+ // going low resets and reactivates the CPU
else
- {
- device_set_input_line(sound_cpu, INPUT_LINE_RESET, CLEAR_LINE);
- device_set_input_line(soundalt_cpu, INPUT_LINE_RESET, CLEAR_LINE);
- }
+ m_cpu->set_input_line(INPUT_LINE_RESET, CLEAR_LINE);
}
-int williams_narc_talkback_r(running_machine &machine)
-{
- williams_audio_state *state = &audio;
+//-------------------------------------------------
+// irq_read - read the sound IRQ state
+//-------------------------------------------------
- return state->audio_talkback | (state->audio_sync << 8);
+READ_LINE_MEMBER(williams_adpcm_sound_device::irq_read)
+{
+ return m_sound_int_state;
}
+//-------------------------------------------------
+// bank_select_w - select the sound CPU memory
+// bank
+//-------------------------------------------------
-/***************************************************************************
- ADPCM READ/WRITE HANDLERS
-****************************************************************************/
-
-static WRITE8_HANDLER( adpcm_bank_select_w )
+WRITE8_MEMBER(williams_adpcm_sound_device::bank_select_w)
{
- memory_set_bank(space->machine(), "bank5", data & 0x07);
+ subbank("rombank")->set_entry(data & 0x07);
}
-static WRITE8_DEVICE_HANDLER( adpcm_6295_bank_select_w )
+//-------------------------------------------------
+// bank_select_w - select the OKI6295 memory
+// bank
+//-------------------------------------------------
+
+WRITE8_MEMBER(williams_adpcm_sound_device::oki6295_bank_select_w)
{
- downcast<okim6295_device *>(device)->set_bank_base((data & 7) * 0x40000);
+ m_oki6295->set_bank_base((data & 7) * 0x40000);
}
-static TIMER_CALLBACK( clear_irq_state )
+//-------------------------------------------------
+// command_r - read the command from the external
+// latch
+//-------------------------------------------------
+
+READ8_MEMBER(williams_adpcm_sound_device::command_r)
{
- williams_audio_state *state = &audio;
+ m_cpu->set_input_line(M6809_IRQ_LINE, CLEAR_LINE);
- state->sound_int_state = 0;
+ // don't clear the external IRQ state for a short while; this allows the
+ // self-tests to pass
+ timer_set(attotime::from_usec(10), TID_IRQ_CLEAR);
+ return m_latch;
}
-static READ8_HANDLER( adpcm_command_r )
-{
- williams_audio_state *state = &audio;
- device_t *sound_cpu = state->sound_cpu;
- device_set_input_line(sound_cpu, M6809_IRQ_LINE, CLEAR_LINE);
+//-------------------------------------------------
+// talkback_w - write to the talkback latch
+//-------------------------------------------------
- /* don't clear the external IRQ state for a short while; this allows the
- self-tests to pass */
- space->machine().scheduler().timer_set(attotime::from_usec(10), FUNC(clear_irq_state));
- driver_device *drvstate = space->machine().driver_data<driver_device>();
- return drvstate->soundlatch_byte_r(*space, 0);
+WRITE8_MEMBER(williams_adpcm_sound_device::talkback_w)
+{
+ m_talkback = data;
+ logerror("ADPCM Talkback = %02X\n", data);
}
-static WRITE8_HANDLER( adpcm_talkback_w )
+//-------------------------------------------------
+// talkback_w - write to the talkback latch
+//-------------------------------------------------
+
+WRITE_LINE_MEMBER(williams_adpcm_sound_device::ym2151_irq_w)
{
- williams_audio_state *state = &audio;
- state->audio_talkback = data;
- logerror("ADPCM Talkback = %02X\n", data);
+ m_cpu->set_input_line(M6809_FIRQ_LINE, state ? ASSERT_LINE : CLEAR_LINE);
}
+//-------------------------------------------------
+// audio CPU map
+//-------------------------------------------------
-/***************************************************************************
- ADPCM COMMUNICATIONS
-****************************************************************************/
+static ADDRESS_MAP_START( williams_adpcm_map, AS_PROGRAM, 8, williams_adpcm_sound_device )
+ AM_RANGE(0x0000, 0x1fff) AM_RAM
+ AM_RANGE(0x2000, 0x2000) AM_MIRROR(0x03ff) AM_WRITE(bank_select_w)
+ AM_RANGE(0x2400, 0x2401) AM_MIRROR(0x03fe) AM_DEVREADWRITE_LEGACY("ym2151", ym2151_r, ym2151_w)
+ AM_RANGE(0x2800, 0x2800) AM_MIRROR(0x03ff) AM_DEVWRITE_LEGACY("dac", dac_w)
+ AM_RANGE(0x2c00, 0x2c00) AM_MIRROR(0x03ff) AM_DEVREADWRITE("oki", okim6295_device, read, write)
+ AM_RANGE(0x3000, 0x3000) AM_MIRROR(0x03ff) AM_READ(command_r)
+ AM_RANGE(0x3400, 0x3400) AM_MIRROR(0x03ff) AM_WRITE(oki6295_bank_select_w)
+ AM_RANGE(0x3c00, 0x3c00) AM_MIRROR(0x03ff) AM_WRITE(talkback_w)
+ AM_RANGE(0x4000, 0xbfff) AM_ROMBANK("rombank")
+ AM_RANGE(0xc000, 0xffff) AM_ROMBANK("romupper")
+ADDRESS_MAP_END
-void williams_adpcm_data_w(running_machine &machine, int data)
+
+//-------------------------------------------------
+// YM2151 configuration
+//-------------------------------------------------
+
+static const ym2151_interface adpcm_ym2151_interface =
{
- williams_audio_state *state = &audio;
- device_t *sound_cpu = state->sound_cpu;
- address_space *space = sound_cpu->memory().space(AS_PROGRAM);
- driver_device *drvstate = space->machine().driver_data<driver_device>();
- drvstate->soundlatch_byte_w(*space, 0, data & 0xff);
- if (!(data & 0x200))
- {
- device_set_input_line(sound_cpu, M6809_IRQ_LINE, ASSERT_LINE);
- state->sound_int_state = 1;
- space->machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(100));
- }
+ DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, williams_adpcm_sound_device, ym2151_irq_w)
+};
+
+
+//-------------------------------------------------
+// machine configuration
+//-------------------------------------------------
+
+static MACHINE_CONFIG_FRAGMENT( williams_adpcm_sound )
+ MCFG_CPU_ADD("cpu", M6809E, ADPCM_MASTER_CLOCK)
+ MCFG_CPU_PROGRAM_MAP(williams_adpcm_map)
+
+ MCFG_SOUND_ADD("ym2151", YM2151, ADPCM_FM_CLOCK)
+ MCFG_SOUND_CONFIG(adpcm_ym2151_interface)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, DEVICE_SELF_OWNER, 0.10)
+
+ MCFG_SOUND_ADD("dac", DAC, 0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, DEVICE_SELF_OWNER, 0.50)
+
+ MCFG_OKIM6295_ADD("oki", ADPCM_MASTER_CLOCK/8, OKIM6295_PIN7_HIGH) // clock frequency & pin 7 not verified
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, DEVICE_SELF_OWNER, 0.50)
+MACHINE_CONFIG_END
+
+
+//-------------------------------------------------
+// device_mconfig_additions - return a pointer to
+// the device's machine fragment
+//-------------------------------------------------
+
+machine_config_constructor williams_adpcm_sound_device::device_mconfig_additions() const
+{
+ return MACHINE_CONFIG_NAME( williams_adpcm_sound );
}
-void williams_adpcm_reset_w(running_machine &machine, int state)
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void williams_adpcm_sound_device::device_start()
{
- williams_audio_state *sndstate = &audio;
- device_t *sound_cpu = sndstate->sound_cpu;
+ // configure banks
+ UINT8 *rom = subregion("cpu")->base();
+ subbank("rombank")->configure_entries(0, 8, &rom[0x10000], 0x8000);
+ subbank("romupper")->set_base(&rom[0x10000 + 0x4000 + 7 * 0x8000]);
- /* going high halts the CPU */
- if (state)
- {
- address_space *space = sound_cpu->memory().space(AS_PROGRAM);
- adpcm_bank_select_w(space, 0, 0);
- init_audio_state(space->machine());
- device_set_input_line(sound_cpu, INPUT_LINE_RESET, ASSERT_LINE);
- }
- /* going low resets and reactivates the CPU */
- else
- device_set_input_line(sound_cpu, INPUT_LINE_RESET, CLEAR_LINE);
+ // expand ADPCM data
+ // it is assumed that U12 is loaded @ 0x00000 and U13 is loaded @ 0x40000
+ rom = subregion("oki")->base();
+ memcpy(rom + 0x1c0000, rom + 0x080000, 0x20000); // expand individual banks
+ memcpy(rom + 0x180000, rom + 0x0a0000, 0x20000);
+ memcpy(rom + 0x140000, rom + 0x0c0000, 0x20000);
+ memcpy(rom + 0x100000, rom + 0x0e0000, 0x20000);
+ memcpy(rom + 0x0c0000, rom + 0x000000, 0x20000);
+ memcpy(rom + 0x000000, rom + 0x040000, 0x20000);
+ memcpy(rom + 0x080000, rom + 0x020000, 0x20000);
+
+ memcpy(rom + 0x1e0000, rom + 0x060000, 0x20000); // copy common bank
+ memcpy(rom + 0x1a0000, rom + 0x060000, 0x20000);
+ memcpy(rom + 0x160000, rom + 0x060000, 0x20000);
+ memcpy(rom + 0x120000, rom + 0x060000, 0x20000);
+ memcpy(rom + 0x0e0000, rom + 0x060000, 0x20000);
+ memcpy(rom + 0x0a0000, rom + 0x060000, 0x20000);
+ memcpy(rom + 0x020000, rom + 0x060000, 0x20000);
+
+ // register for save states
+ save_item(NAME(m_latch));
+ save_item(NAME(m_talkback));
+ save_item(NAME(m_sound_int_state));
}
-int williams_adpcm_sound_irq_r(running_machine &machine)
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void williams_adpcm_sound_device::device_reset()
+{
+ // reset interrupt states
+ m_sound_int_state = 0;
+ m_cpu->set_input_line(M6809_FIRQ_LINE, CLEAR_LINE);
+ m_cpu->set_input_line(M6809_IRQ_LINE, CLEAR_LINE);
+ m_cpu->set_input_line(INPUT_LINE_NMI, CLEAR_LINE);
+}
+
+
+//-------------------------------------------------
+// device_timer - timer callbacks
+//-------------------------------------------------
+
+void williams_adpcm_sound_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
{
- williams_audio_state *state = &audio;
- return state->sound_int_state;
+ switch (id)
+ {
+ case TID_COMMAND:
+ m_latch = param & 0xff;
+ if (!(param & 0x200))
+ {
+ m_cpu->set_input_line(M6809_IRQ_LINE, ASSERT_LINE);
+ m_sound_int_state = 1;
+ machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(100));
+ }
+ break;
+
+ case TID_IRQ_CLEAR:
+ m_sound_int_state = 0;
+ break;
+ }
}
diff --git a/src/mame/audio/williams.h b/src/mame/audio/williams.h
index 8166fd4927d..03884c09d4d 100644
--- a/src/mame/audio/williams.h
+++ b/src/mame/audio/williams.h
@@ -1,23 +1,223 @@
/***************************************************************************
- Midway/Williams Audio Boards
+ audio/williams.h
+
+ Functions to emulate general the various Williams/Midway sound cards.
+
+****************************************************************************
+
+ Copyright Aaron Giles
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in
+ the documentation and/or other materials provided with the
+ distribution.
+ * Neither the name 'MAME' nor the names of its contributors may be
+ used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
+ IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
+ INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
****************************************************************************/
-MACHINE_CONFIG_EXTERN( williams_cvsd_sound );
-MACHINE_CONFIG_EXTERN( williams_adpcm_sound );
-MACHINE_CONFIG_EXTERN( williams_narc_sound );
+#include "emu.h"
+#include "machine/6821pia.h"
+#include "cpu/m6809/m6809.h"
+#include "sound/2151intf.h"
+#include "sound/okim6295.h"
+#include "sound/hc55516.h"
+#include "sound/dac.h"
+
+
+
+//**************************************************************************
+// GLOBAL VARIABLES
+//**************************************************************************
+
+extern const device_type WILLIAMS_NARC_SOUND;
+extern const device_type WILLIAMS_CVSD_SOUND;
+extern const device_type WILLIAMS_ADPCM_SOUND;
+
+
+
+//**************************************************************************
+// DEVICE CONFIGURATION MACROS
+//**************************************************************************
+
+#define MCFG_WILLIAMS_NARC_SOUND_ADD(_tag) \
+ MCFG_DEVICE_ADD(_tag, WILLIAMS_NARC_SOUND, 0) \
+
+#define MCFG_WILLIAMS_CVSD_SOUND_ADD(_tag) \
+ MCFG_DEVICE_ADD(_tag, WILLIAMS_CVSD_SOUND, 0) \
+
+#define MCFG_WILLIAMS_ADPCM_SOUND_ADD(_tag) \
+ MCFG_DEVICE_ADD(_tag, WILLIAMS_ADPCM_SOUND, 0) \
+
+
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+// ======================> williams_cvsd_sound_device
+
+class williams_cvsd_sound_device : public device_t,
+ public device_mixer_interface
+{
+public:
+ // construction/destruction
+ williams_cvsd_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+ // read/write
+ DECLARE_WRITE16_MEMBER(write);
+ DECLARE_WRITE_LINE_MEMBER(reset_write);
+
+ // internal communications
+ DECLARE_WRITE8_MEMBER(bank_select_w);
+ DECLARE_WRITE8_MEMBER(talkback_w);
+ DECLARE_WRITE8_MEMBER(cvsd_digit_clock_clear_w);
+ DECLARE_WRITE8_MEMBER(cvsd_clock_set_w);
+ DECLARE_WRITE_LINE_MEMBER(ym2151_irq_w);
+ DECLARE_WRITE_LINE_MEMBER(pia_irqa);
+ DECLARE_WRITE_LINE_MEMBER(pia_irqb);
+
+protected:
+ // device-level overrides
+ virtual machine_config_constructor device_mconfig_additions() const;
+ virtual void device_start();
+ virtual void device_reset();
+ virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
+
+private:
+ // devices
+ required_device<m6809e_device> m_cpu;
+ required_device<pia6821_device> m_pia;
+ required_device<hc55516_device> m_hc55516;
+
+ // internal state
+ UINT8 m_talkback;
+};
+
+
+// ======================> williams_narc_sound_device
+
+class williams_narc_sound_device : public device_t,
+ public device_mixer_interface
+{
+public:
+ // construction/destruction
+ williams_narc_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+ // read/write
+ DECLARE_READ16_MEMBER(read);
+ DECLARE_WRITE16_MEMBER(write);
+ DECLARE_WRITE_LINE_MEMBER(reset_write);
+
+ // internal communications
+ DECLARE_WRITE8_MEMBER(master_bank_select_w);
+ DECLARE_WRITE8_MEMBER(slave_bank_select_w);
+ DECLARE_READ8_MEMBER(command_r);
+ DECLARE_WRITE8_MEMBER(command2_w);
+ DECLARE_READ8_MEMBER(command2_r);
+ DECLARE_WRITE8_MEMBER(master_talkback_w);
+ DECLARE_WRITE8_MEMBER(master_sync_w);
+ DECLARE_WRITE8_MEMBER(slave_talkback_w);
+ DECLARE_WRITE8_MEMBER(slave_sync_w);
+ DECLARE_WRITE8_MEMBER(cvsd_digit_clock_clear_w);
+ DECLARE_WRITE8_MEMBER(cvsd_clock_set_w);
+ DECLARE_WRITE_LINE_MEMBER(ym2151_irq_w);
+
+protected:
+ // device-level overrides
+ virtual machine_config_constructor device_mconfig_additions() const;
+ virtual void device_start();
+ virtual void device_reset();
+ virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
+
+private:
+ // timer IDs
+ enum
+ {
+ TID_MASTER_COMMAND,
+ TID_SLAVE_COMMAND,
+ TID_SYNC_CLEAR
+ };
+
+ // devices
+ required_device<m6809e_device> m_cpu0;
+ required_device<m6809e_device> m_cpu1;
+ required_device<hc55516_device> m_hc55516;
+
+ // internal state
+ UINT8 m_latch;
+ UINT8 m_latch2;
+ UINT8 m_talkback;
+ UINT8 m_audio_sync;
+ UINT8 m_sound_int_state;
+};
+
+
+// ======================> williams_adpcm_sound_device
+
+class williams_adpcm_sound_device : public device_t,
+ public device_mixer_interface
+{
+public:
+ // construction/destruction
+ williams_adpcm_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+ // read/write
+ DECLARE_WRITE16_MEMBER(write);
+ DECLARE_WRITE_LINE_MEMBER(reset_write);
+ DECLARE_READ_LINE_MEMBER(irq_read);
+
+ // internal communications
+ DECLARE_WRITE8_MEMBER(bank_select_w);
+ DECLARE_WRITE8_MEMBER(oki6295_bank_select_w);
+ DECLARE_READ8_MEMBER(command_r);
+ DECLARE_WRITE8_MEMBER(talkback_w);
+ DECLARE_WRITE_LINE_MEMBER(ym2151_irq_w);
+
+protected:
+ // timer IDs
+ enum
+ {
+ TID_COMMAND,
+ TID_IRQ_CLEAR
+ };
+
+ // device-level overrides
+ virtual machine_config_constructor device_mconfig_additions() const;
+ virtual void device_start();
+ virtual void device_reset();
+ virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
-void williams_cvsd_init(running_machine &machine);
-void williams_cvsd_data_w(running_machine &machine, int data);
-void williams_cvsd_reset_w(running_machine &machine, int state);
+private:
+ // devices
+ required_device<m6809e_device> m_cpu;
+ required_device<okim6295_device> m_oki6295;
-void williams_adpcm_init(running_machine &machine);
-void williams_adpcm_data_w(running_machine &machine, int data);
-void williams_adpcm_reset_w(running_machine &machine, int state);
-int williams_adpcm_sound_irq_r(running_machine &machine);
+ // internal state
+ UINT8 m_latch;
+ UINT8 m_talkback;
+ UINT8 m_sound_int_state;
+};
+
-void williams_narc_init(running_machine &machine);
-void williams_narc_data_w(running_machine &machine, int data);
-void williams_narc_reset_w(running_machine &machine, int state);
-int williams_narc_talkback_r(running_machine &machine);
diff --git a/src/mame/drivers/aliens.c b/src/mame/drivers/aliens.c
index 4bf0fd63f39..5c6330c4948 100644
--- a/src/mame/drivers/aliens.c
+++ b/src/mame/drivers/aliens.c
@@ -206,8 +206,8 @@ static const k007232_interface k007232_config =
static const ym2151_interface ym2151_config =
{
- 0,
- aliens_snd_bankswitch_w
+ DEVCB_NULL,
+ DEVCB_HANDLER(aliens_snd_bankswitch_w)
};
diff --git a/src/mame/drivers/amspdwy.c b/src/mame/drivers/amspdwy.c
index 2fbbeea4d8c..7ab97610c45 100644
--- a/src/mame/drivers/amspdwy.c
+++ b/src/mame/drivers/amspdwy.c
@@ -246,7 +246,7 @@ static void irq_handler( device_t *device, int irq )
static const ym2151_interface amspdwy_ym2151_interface =
{
- irq_handler
+ DEVCB_LINE(irq_handler)
};
static MACHINE_START( amspdwy )
diff --git a/src/mame/drivers/aquarium.c b/src/mame/drivers/aquarium.c
index 102eb81ff98..b0bee1dd73a 100644
--- a/src/mame/drivers/aquarium.c
+++ b/src/mame/drivers/aquarium.c
@@ -296,7 +296,7 @@ static void irq_handler( device_t *device, int irq )
static const ym2151_interface ym2151_config =
{
- irq_handler
+ DEVCB_LINE(irq_handler)
};
diff --git a/src/mame/drivers/asuka.c b/src/mame/drivers/asuka.c
index 4f598c9914c..4d4d690849b 100644
--- a/src/mame/drivers/asuka.c
+++ b/src/mame/drivers/asuka.c
@@ -781,8 +781,8 @@ static const ym2610_interface ym2610_config =
static const ym2151_interface ym2151_config =
{
- irq_handler,
- sound_bankswitch_2151_w
+ DEVCB_LINE(irq_handler),
+ DEVCB_HANDLER(sound_bankswitch_2151_w)
};
static const msm5205_interface msm5205_config =
diff --git a/src/mame/drivers/atarisy1.c b/src/mame/drivers/atarisy1.c
index ffcfa367159..4ddf818b602 100644
--- a/src/mame/drivers/atarisy1.c
+++ b/src/mame/drivers/atarisy1.c
@@ -744,7 +744,7 @@ GFXDECODE_END
static const ym2151_interface ym2151_config =
{
- atarigen_ym2151_irq_gen
+ DEVCB_LINE(atarigen_ym2151_irq_gen)
};
diff --git a/src/mame/drivers/blockout.c b/src/mame/drivers/blockout.c
index 637b369daf0..94021911455 100644
--- a/src/mame/drivers/blockout.c
+++ b/src/mame/drivers/blockout.c
@@ -268,7 +268,7 @@ static void blockout_irq_handler(device_t *device, int irq)
static const ym2151_interface ym2151_config =
{
- blockout_irq_handler
+ DEVCB_LINE(blockout_irq_handler)
};
diff --git a/src/mame/drivers/boogwing.c b/src/mame/drivers/boogwing.c
index c2cd7e785c1..2f77d6a6d3c 100644
--- a/src/mame/drivers/boogwing.c
+++ b/src/mame/drivers/boogwing.c
@@ -290,8 +290,8 @@ static WRITE8_DEVICE_HANDLER( sound_bankswitch_w )
static const ym2151_interface ym2151_config =
{
- sound_irq,
- sound_bankswitch_w
+ DEVCB_LINE(sound_irq),
+ DEVCB_HANDLER(sound_bankswitch_w)
};
diff --git a/src/mame/drivers/cabal.c b/src/mame/drivers/cabal.c
index f266a7ef35a..9da0b2ff0db 100644
--- a/src/mame/drivers/cabal.c
+++ b/src/mame/drivers/cabal.c
@@ -464,7 +464,7 @@ static void irqhandler(device_t *device, int irq)
static const ym2151_interface cabalbl_ym2151_interface =
{
- irqhandler
+ DEVCB_LINE(irqhandler)
};
static const msm5205_interface msm5205_interface_1 =
diff --git a/src/mame/drivers/cave.c b/src/mame/drivers/cave.c
index 2732e246498..452848c10ba 100644
--- a/src/mame/drivers/cave.c
+++ b/src/mame/drivers/cave.c
@@ -1828,7 +1828,7 @@ static void irqhandler(device_t *device, int irq)
static const ym2151_interface ym2151_config =
{
- irqhandler
+ DEVCB_LINE(irqhandler)
};
static const ym2203_interface ym2203_config =
diff --git a/src/mame/drivers/cbuster.c b/src/mame/drivers/cbuster.c
index 237ca02cbf5..739d4b0914e 100644
--- a/src/mame/drivers/cbuster.c
+++ b/src/mame/drivers/cbuster.c
@@ -270,7 +270,7 @@ static void sound_irq(device_t *device, int state)
static const ym2151_interface ym2151_config =
{
- sound_irq
+ DEVCB_LINE(sound_irq)
};
static int twocrude_bank_callback( const int bank )
diff --git a/src/mame/drivers/chinagat.c b/src/mame/drivers/chinagat.c
index 8715bbc8fa9..cc8ca29118b 100644
--- a/src/mame/drivers/chinagat.c
+++ b/src/mame/drivers/chinagat.c
@@ -500,7 +500,7 @@ static void chinagat_irq_handler( device_t *device, int irq )
static const ym2151_interface ym2151_config =
{
- chinagat_irq_handler
+ DEVCB_LINE(chinagat_irq_handler)
};
/* This on the bootleg board, instead of the m6295 */
diff --git a/src/mame/drivers/chqflag.c b/src/mame/drivers/chqflag.c
index 2d7bfc82028..3a64597bab8 100644
--- a/src/mame/drivers/chqflag.c
+++ b/src/mame/drivers/chqflag.c
@@ -266,7 +266,7 @@ static void chqflag_ym2151_irq_w( device_t *device, int data )
static const ym2151_interface ym2151_config =
{
- chqflag_ym2151_irq_w
+ DEVCB_LINE(chqflag_ym2151_irq_w)
};
static void volume_callback0( device_t *device, int v )
diff --git a/src/mame/drivers/cninja.c b/src/mame/drivers/cninja.c
index 58f7d52d5e3..96aed1789ce 100644
--- a/src/mame/drivers/cninja.c
+++ b/src/mame/drivers/cninja.c
@@ -731,13 +731,13 @@ static WRITE8_DEVICE_HANDLER( sound_bankswitch_w )
static const ym2151_interface ym2151_config =
{
- sound_irq,
- sound_bankswitch_w
+ DEVCB_LINE(sound_irq),
+ DEVCB_HANDLER(sound_bankswitch_w)
};
static const ym2151_interface ym2151_interface2 =
{
- sound_irq2
+ DEVCB_LINE(sound_irq2)
};
/**********************************************************************************/
diff --git a/src/mame/drivers/cps1.c b/src/mame/drivers/cps1.c
index e945420cbe8..50cb9018ad9 100644
--- a/src/mame/drivers/cps1.c
+++ b/src/mame/drivers/cps1.c
@@ -3015,7 +3015,7 @@ static void cps1_irq_handler_mus(device_t *device, int irq)
static const ym2151_interface ym2151_config =
{
- cps1_irq_handler_mus
+ DEVCB_LINE(cps1_irq_handler_mus)
};
diff --git a/src/mame/drivers/crimfght.c b/src/mame/drivers/crimfght.c
index e56750d6c3f..48153b918a1 100644
--- a/src/mame/drivers/crimfght.c
+++ b/src/mame/drivers/crimfght.c
@@ -220,8 +220,8 @@ INPUT_PORTS_END
static const ym2151_interface ym2151_config =
{
- 0,
- crimfght_snd_bankswitch_w
+ DEVCB_NULL,
+ DEVCB_HANDLER(crimfght_snd_bankswitch_w)
};
static void volume_callback( device_t *device, int v )
diff --git a/src/mame/drivers/cyberbal.c b/src/mame/drivers/cyberbal.c
index 63c70cb066d..a2a48df0787 100644
--- a/src/mame/drivers/cyberbal.c
+++ b/src/mame/drivers/cyberbal.c
@@ -416,7 +416,7 @@ GFXDECODE_END
static const ym2151_interface ym2151_config =
{
- atarigen_ym2151_irq_gen
+ DEVCB_LINE(atarigen_ym2151_irq_gen)
};
diff --git a/src/mame/drivers/darkseal.c b/src/mame/drivers/darkseal.c
index 04ec8b34763..aba25d92bf7 100644
--- a/src/mame/drivers/darkseal.c
+++ b/src/mame/drivers/darkseal.c
@@ -229,7 +229,7 @@ static void sound_irq(device_t *device, int state)
static const ym2151_interface ym2151_config =
{
- sound_irq
+ DEVCB_LINE(sound_irq)
};
static const deco16ic_interface darkseal_deco16ic_tilegen1_intf =
diff --git a/src/mame/drivers/dassault.c b/src/mame/drivers/dassault.c
index 0aa9e479f23..f8936ac4480 100644
--- a/src/mame/drivers/dassault.c
+++ b/src/mame/drivers/dassault.c
@@ -518,8 +518,8 @@ static WRITE8_DEVICE_HANDLER( sound_bankswitch_w )
static const ym2151_interface ym2151_config =
{
- sound_irq,
- sound_bankswitch_w
+ DEVCB_LINE(sound_irq),
+ DEVCB_HANDLER(sound_bankswitch_w)
};
/**********************************************************************************/
diff --git a/src/mame/drivers/dblewing.c b/src/mame/drivers/dblewing.c
index 9f963f8c5ea..46cbd895aa5 100644
--- a/src/mame/drivers/dblewing.c
+++ b/src/mame/drivers/dblewing.c
@@ -540,7 +540,7 @@ static void sound_irq( device_t *device, int state )
static const ym2151_interface ym2151_config =
{
- sound_irq
+ DEVCB_LINE(sound_irq)
};
static int dblewing_bank_callback( const int bank )
diff --git a/src/mame/drivers/dbz.c b/src/mame/drivers/dbz.c
index f2f20959a42..42033b48ee6 100644
--- a/src/mame/drivers/dbz.c
+++ b/src/mame/drivers/dbz.c
@@ -274,7 +274,7 @@ INPUT_PORTS_END
static const ym2151_interface ym2151_config =
{
- dbz_sound_irq
+ DEVCB_LINE(dbz_sound_irq)
};
/**********************************************************************************/
diff --git a/src/mame/drivers/ddragon.c b/src/mame/drivers/ddragon.c
index 7a29aa33fc7..eb1fc9e02c1 100644
--- a/src/mame/drivers/ddragon.c
+++ b/src/mame/drivers/ddragon.c
@@ -263,7 +263,7 @@ WRITE8_MEMBER(ddragon_state::darktowr_mcu_bank_w)
WRITE8_MEMBER(ddragon_state::darktowr_bankswitch_w)
{
- int oldbank = machine().memory().bank("bank1");
+ int oldbank = machine().memory().bank("bank1")->entry();
int newbank = (data & 0xe0) >> 5;
m_scrollx_hi = (data & 0x01);
@@ -946,7 +946,7 @@ GFXDECODE_END
static const ym2151_interface ym2151_config =
{
- irq_handler
+ DEVCB_LINE(irq_handler)
};
static const msm5205_interface msm5205_config =
diff --git a/src/mame/drivers/ddragon3.c b/src/mame/drivers/ddragon3.c
index 7ddac787e65..50366dfc566 100644
--- a/src/mame/drivers/ddragon3.c
+++ b/src/mame/drivers/ddragon3.c
@@ -521,7 +521,7 @@ static void dd3_ymirq_handler(device_t *device, int irq)
static const ym2151_interface ym2151_config =
{
- dd3_ymirq_handler
+ DEVCB_LINE(dd3_ymirq_handler)
};
/*************************************
diff --git a/src/mame/drivers/deco32.c b/src/mame/drivers/deco32.c
index ea331a7328d..390e0f2ae7c 100644
--- a/src/mame/drivers/deco32.c
+++ b/src/mame/drivers/deco32.c
@@ -1636,14 +1636,14 @@ static WRITE8_DEVICE_HANDLER( sound_bankswitch_w )
static const ym2151_interface ym2151_config =
{
- sound_irq,
- sound_bankswitch_w
+ DEVCB_LINE(sound_irq),
+ DEVCB_HANDLER(sound_bankswitch_w)
};
static const ym2151_interface ym2151_interface_nslasher =
{
- sound_irq_nslasher,
- sound_bankswitch_w
+ DEVCB_LINE(sound_irq_nslasher),
+ DEVCB_HANDLER(sound_bankswitch_w)
};
static const eeprom_interface eeprom_interface_tattass =
diff --git a/src/mame/drivers/dietgo.c b/src/mame/drivers/dietgo.c
index a95960cf70e..f2565929dc3 100644
--- a/src/mame/drivers/dietgo.c
+++ b/src/mame/drivers/dietgo.c
@@ -168,7 +168,7 @@ static void sound_irq(device_t *device, int state)
static const ym2151_interface ym2151_config =
{
- sound_irq
+ DEVCB_LINE(sound_irq)
};
diff --git a/src/mame/drivers/dooyong.c b/src/mame/drivers/dooyong.c
index 27ccbd47a3b..cc3836c0336 100644
--- a/src/mame/drivers/dooyong.c
+++ b/src/mame/drivers/dooyong.c
@@ -815,7 +815,7 @@ static const ym2203_interface ym2203_interface_2 =
static const ym2151_interface ym2151_config =
{
- irqhandler
+ DEVCB_LINE(irqhandler)
};
/***************************************************************************
diff --git a/src/mame/drivers/exzisus.c b/src/mame/drivers/exzisus.c
index c627b4c2fe0..8095c894e22 100644
--- a/src/mame/drivers/exzisus.c
+++ b/src/mame/drivers/exzisus.c
@@ -259,7 +259,7 @@ static void irqhandler(device_t *device, int irq)
static const ym2151_interface ym2151_config =
{
- irqhandler
+ DEVCB_LINE(irqhandler)
};
diff --git a/src/mame/drivers/fantland.c b/src/mame/drivers/fantland.c
index 12c80097ab1..ca678469067 100644
--- a/src/mame/drivers/fantland.c
+++ b/src/mame/drivers/fantland.c
@@ -893,7 +893,7 @@ static void galaxygn_sound_irq( device_t *device, int line )
static const ym2151_interface galaxygn_ym2151_interface =
{
- galaxygn_sound_irq
+ DEVCB_LINE(galaxygn_sound_irq)
};
static MACHINE_CONFIG_START( galaxygn, fantland_state )
diff --git a/src/mame/drivers/funkyjet.c b/src/mame/drivers/funkyjet.c
index e828ee0e16a..72384402487 100644
--- a/src/mame/drivers/funkyjet.c
+++ b/src/mame/drivers/funkyjet.c
@@ -283,7 +283,7 @@ static void sound_irq( device_t *device, int state )
static const ym2151_interface ym2151_config =
{
- sound_irq
+ DEVCB_LINE(sound_irq)
};
static const deco16ic_interface funkyjet_deco16ic_tilegen1_intf =
diff --git a/src/mame/drivers/gotcha.c b/src/mame/drivers/gotcha.c
index c8afe27eb7e..2f49345e1e2 100644
--- a/src/mame/drivers/gotcha.c
+++ b/src/mame/drivers/gotcha.c
@@ -247,7 +247,7 @@ static void irqhandler( device_t *device, int linestate )
static const ym2151_interface ym2151_config =
{
- irqhandler
+ DEVCB_LINE(irqhandler)
};
diff --git a/src/mame/drivers/hyprduel.c b/src/mame/drivers/hyprduel.c
index 5c21a0a6fd7..0558644587f 100644
--- a/src/mame/drivers/hyprduel.c
+++ b/src/mame/drivers/hyprduel.c
@@ -628,7 +628,7 @@ static void sound_irq( device_t *device, int state )
static const ym2151_interface ym2151_config =
{
- sound_irq
+ DEVCB_LINE(sound_irq)
};
/***************************************************************************
diff --git a/src/mame/drivers/lemmings.c b/src/mame/drivers/lemmings.c
index a7bd3681aef..17f828bc376 100644
--- a/src/mame/drivers/lemmings.c
+++ b/src/mame/drivers/lemmings.c
@@ -249,7 +249,7 @@ static void sound_irq( device_t *device, int state )
static const ym2151_interface ym2151_config =
{
- sound_irq
+ DEVCB_LINE(sound_irq)
};
static MACHINE_START( lemmings )
diff --git a/src/mame/drivers/m107.c b/src/mame/drivers/m107.c
index 0466985fe6e..7950afefc43 100644
--- a/src/mame/drivers/m107.c
+++ b/src/mame/drivers/m107.c
@@ -761,7 +761,7 @@ static void sound_irq(device_t *device, int state)
static const ym2151_interface ym2151_config =
{
- sound_irq
+ DEVCB_LINE(sound_irq)
};
/***************************************************************************/
diff --git a/src/mame/drivers/m72.c b/src/mame/drivers/m72.c
index 1e16f34d7e9..dbc66a1fc53 100644
--- a/src/mame/drivers/m72.c
+++ b/src/mame/drivers/m72.c
@@ -1825,7 +1825,7 @@ GFXDECODE_END
static const ym2151_interface ym2151_config =
{
- m72_ym2151_irq_handler
+ DEVCB_LINE(m72_ym2151_irq_handler)
};
diff --git a/src/mame/drivers/m90.c b/src/mame/drivers/m90.c
index 7c447d34149..6d3a9a69928 100644
--- a/src/mame/drivers/m90.c
+++ b/src/mame/drivers/m90.c
@@ -669,13 +669,13 @@ GFXDECODE_END
static const ym2151_interface ym2151_config =
{
- m72_ym2151_irq_handler
+ DEVCB_LINE(m72_ym2151_irq_handler)
};
/* this bootleg polls the YM2151 instead of taking interrupts from it */
static const ym2151_interface dynablsb_ym2151_config =
{
- NULL
+ DEVCB_NULL
};
static INTERRUPT_GEN( fake_nmi )
diff --git a/src/mame/drivers/m92.c b/src/mame/drivers/m92.c
index 70f43dbff8e..0d071682eea 100644
--- a/src/mame/drivers/m92.c
+++ b/src/mame/drivers/m92.c
@@ -881,7 +881,7 @@ static void sound_irq(device_t *device, int state)
static const ym2151_interface ym2151_config =
{
- sound_irq
+ DEVCB_LINE(sound_irq)
};
/***************************************************************************/
diff --git a/src/mame/drivers/madmotor.c b/src/mame/drivers/madmotor.c
index 1aea2d2e49a..00dd08bd381 100644
--- a/src/mame/drivers/madmotor.c
+++ b/src/mame/drivers/madmotor.c
@@ -227,7 +227,7 @@ static void sound_irq(device_t *device, int state)
static const ym2151_interface ym2151_config =
{
- sound_irq
+ DEVCB_LINE(sound_irq)
};
static MACHINE_START( madmotor )
diff --git a/src/mame/drivers/mcr.c b/src/mame/drivers/mcr.c
index 6e6b96e635e..9f94a29ca4f 100644
--- a/src/mame/drivers/mcr.c
+++ b/src/mame/drivers/mcr.c
@@ -2617,7 +2617,6 @@ static void mcr_init(running_machine &machine, int cpuboard, int vidboard, int s
static DRIVER_INIT( solarfox )
{
mcr_init(machine, 90009, 91399, 90908);
- mcr_sound_init(machine, MCR_SSIO);
mcr_state *state = machine.driver_data<mcr_state>();
machine.device<midway_ssio_device>("ssio")->set_custom_input(0, 0x1c, read8_delegate(FUNC(mcr_state::solarfox_ip0_r),state));
@@ -2630,7 +2629,6 @@ static DRIVER_INIT( solarfox )
static DRIVER_INIT( kick )
{
mcr_init(machine, 90009, 91399, 90908);
- mcr_sound_init(machine, MCR_SSIO);
mcr_state *state = machine.driver_data<mcr_state>();
machine.device<midway_ssio_device>("ssio")->set_custom_input(1, 0xf0, read8_delegate(FUNC(mcr_state::kick_ip1_r),state));
@@ -2642,14 +2640,12 @@ static DRIVER_INIT( kick )
static DRIVER_INIT( mcr_90010 )
{
mcr_init(machine, 90010, 91399, 90913);
- mcr_sound_init(machine, MCR_SSIO);
}
static DRIVER_INIT( wacko )
{
mcr_init(machine, 90010, 91399, 90913);
- mcr_sound_init(machine, MCR_SSIO);
mcr_state *state = machine.driver_data<mcr_state>();
machine.device<midway_ssio_device>("ssio")->set_custom_input(1, 0xff, read8_delegate(FUNC(mcr_state::wacko_ip1_r),state));
@@ -2661,7 +2657,6 @@ static DRIVER_INIT( wacko )
static DRIVER_INIT( twotiger )
{
mcr_init(machine, 90010, 91399, 90913);
- mcr_sound_init(machine, MCR_SSIO);
mcr_state *state = machine.driver_data<mcr_state>();
machine.device<midway_ssio_device>("ssio")->set_custom_output(4, 0xff, write8_delegate(FUNC(mcr_state::twotiger_op4_w),state));
@@ -2672,7 +2667,6 @@ static DRIVER_INIT( twotiger )
static DRIVER_INIT( kroozr )
{
mcr_init(machine, 90010, 91399, 91483);
- mcr_sound_init(machine, MCR_SSIO);
mcr_state *state = machine.driver_data<mcr_state>();
machine.device<midway_ssio_device>("ssio")->set_custom_input(1, 0x47, read8_delegate(FUNC(mcr_state::kroozr_ip1_r),state));
@@ -2683,7 +2677,6 @@ static DRIVER_INIT( kroozr )
static DRIVER_INIT( journey )
{
mcr_init(machine, 91475, 91464, 90913);
- mcr_sound_init(machine, MCR_SSIO);
mcr_state *state = machine.driver_data<mcr_state>();
machine.device<midway_ssio_device>("ssio")->set_custom_output(4, 0x01, write8_delegate(FUNC(mcr_state::journey_op4_w),state));
@@ -2693,14 +2686,12 @@ static DRIVER_INIT( journey )
static DRIVER_INIT( mcr_91490 )
{
mcr_init(machine, 91490, 91464, 90913);
- mcr_sound_init(machine, MCR_SSIO);
}
static DRIVER_INIT( dotrone )
{
mcr_init(machine, 91490, 91464, 91657);
- mcr_sound_init(machine, MCR_SSIO | MCR_SQUAWK_N_TALK);
mcr_state *state = machine.driver_data<mcr_state>();
machine.device<midway_ssio_device>("ssio")->set_custom_output(4, 0xff, write8_delegate(FUNC(mcr_state::dotron_op4_w),state));
@@ -2710,7 +2701,6 @@ static DRIVER_INIT( dotrone )
static DRIVER_INIT( nflfoot )
{
mcr_init(machine, 91490, 91464, 91657);
- mcr_sound_init(machine, MCR_SSIO | MCR_SQUAWK_N_TALK);
mcr_state *state = machine.driver_data<mcr_state>();
machine.device<midway_ssio_device>("ssio")->set_custom_input(2, 0x80, read8_delegate(FUNC(mcr_state::nflfoot_ip2_r),state));
@@ -2731,7 +2721,6 @@ static DRIVER_INIT( nflfoot )
static DRIVER_INIT( demoderb )
{
mcr_init(machine, 91490, 91464, 90913);
- mcr_sound_init(machine, MCR_SSIO | MCR_TURBO_CHIP_SQUEAK);
mcr_state *state = machine.driver_data<mcr_state>();
machine.device<midway_ssio_device>("ssio")->set_custom_input(1, 0xfc, read8_delegate(FUNC(mcr_state::demoderb_ip1_r),state));
diff --git a/src/mame/drivers/mcr3.c b/src/mame/drivers/mcr3.c
index a9ab15de489..4a0a9f7187d 100644
--- a/src/mame/drivers/mcr3.c
+++ b/src/mame/drivers/mcr3.c
@@ -1524,10 +1524,9 @@ ROM_END
*
*************************************/
-static void mcr_common_init(running_machine &machine, int sound_board)
+static void mcr_common_init(running_machine &machine)
{
mcr3_state *state = machine.driver_data<mcr3_state>();
- mcr_sound_init(machine, sound_board);
state_save_register_global(machine, state->m_input_mux);
state_save_register_global(machine, state->m_latched_input);
@@ -1537,7 +1536,7 @@ static void mcr_common_init(running_machine &machine, int sound_board)
static DRIVER_INIT( demoderm )
{
- mcr_common_init(machine, MCR_TURBO_CHIP_SQUEAK);
+ mcr_common_init(machine);
mcr3_state *state = machine.driver_data<mcr3_state>();
machine.device("maincpu")->memory().space(AS_IO)->install_read_handler(0x01, 0x01, read8_delegate(FUNC(mcr3_state::demoderm_ip1_r),state));
machine.device("maincpu")->memory().space(AS_IO)->install_read_handler(0x02, 0x02, read8_delegate(FUNC(mcr3_state::demoderm_ip2_r),state));
@@ -1548,7 +1547,7 @@ static DRIVER_INIT( demoderm )
static DRIVER_INIT( sarge )
{
mcr3_state *state = machine.driver_data<mcr3_state>();
- mcr_common_init(machine, MCR_TURBO_CHIP_SQUEAK);
+ mcr_common_init(machine);
machine.device("maincpu")->memory().space(AS_IO)->install_write_handler(0x06, 0x06, write8_delegate(FUNC(midway_turbo_chip_squeak_device::write),state->m_turbo_chip_squeak.target()));
}
@@ -1556,7 +1555,7 @@ static DRIVER_INIT( sarge )
static DRIVER_INIT( maxrpm )
{
mcr3_state *state = machine.driver_data<mcr3_state>();
- mcr_common_init(machine, MCR_TURBO_CHIP_SQUEAK);
+ mcr_common_init(machine);
machine.device("maincpu")->memory().space(AS_IO)->install_read_handler(0x01, 0x01, read8_delegate(FUNC(mcr3_state::maxrpm_ip1_r),state));
machine.device("maincpu")->memory().space(AS_IO)->install_read_handler(0x02, 0x02, read8_delegate(FUNC(mcr3_state::maxrpm_ip2_r),state));
machine.device("maincpu")->memory().space(AS_IO)->install_write_handler(0x05, 0x05, write8_delegate(FUNC(mcr3_state::maxrpm_op5_w),state));
@@ -1573,7 +1572,7 @@ static DRIVER_INIT( maxrpm )
static DRIVER_INIT( rampage )
{
mcr3_state *state = machine.driver_data<mcr3_state>();
- mcr_common_init(machine, MCR_SOUNDS_GOOD);
+ mcr_common_init(machine);
machine.device("maincpu")->memory().space(AS_IO)->install_read_handler(0x04, 0x04, read8_delegate(FUNC(mcr3_state::rampage_ip4_r),state));
machine.device("maincpu")->memory().space(AS_IO)->install_write_handler(0x06, 0x06, write8_delegate(FUNC(mcr3_state::rampage_op6_w),state));
}
@@ -1582,7 +1581,7 @@ static DRIVER_INIT( rampage )
static DRIVER_INIT( powerdrv )
{
mcr3_state *state = machine.driver_data<mcr3_state>();
- mcr_common_init(machine, MCR_SOUNDS_GOOD);
+ mcr_common_init(machine);
machine.device("maincpu")->memory().space(AS_IO)->install_read_handler(0x02, 0x02, read8_delegate(FUNC(mcr3_state::powerdrv_ip2_r),state));
machine.device("maincpu")->memory().space(AS_IO)->install_write_handler(0x05, 0x05, write8_delegate(FUNC(mcr3_state::powerdrv_op5_w),state));
machine.device("maincpu")->memory().space(AS_IO)->install_write_handler(0x06, 0x06, write8_delegate(FUNC(mcr3_state::powerdrv_op6_w),state));
@@ -1592,7 +1591,7 @@ static DRIVER_INIT( powerdrv )
static DRIVER_INIT( stargrds )
{
mcr3_state *state = machine.driver_data<mcr3_state>();
- mcr_common_init(machine, MCR_SOUNDS_GOOD);
+ mcr_common_init(machine);
machine.device("maincpu")->memory().space(AS_IO)->install_read_handler(0x00, 0x00, read8_delegate(FUNC(mcr3_state::stargrds_ip0_r),state));
machine.device("maincpu")->memory().space(AS_IO)->install_write_handler(0x05, 0x05, write8_delegate(FUNC(mcr3_state::stargrds_op5_w),state));
machine.device("maincpu")->memory().space(AS_IO)->install_write_handler(0x06, 0x06, write8_delegate(FUNC(mcr3_state::stargrds_op6_w),state));
@@ -1602,7 +1601,7 @@ static DRIVER_INIT( stargrds )
static DRIVER_INIT( spyhunt )
{
mcr3_state *state = machine.driver_data<mcr3_state>();
- mcr_common_init(machine, MCR_SSIO | MCR_CHIP_SQUEAK_DELUXE);
+ mcr_common_init(machine);
machine.device<midway_ssio_device>("ssio")->set_custom_input(1, 0x60, read8_delegate(FUNC(mcr3_state::spyhunt_ip1_r),state));
machine.device<midway_ssio_device>("ssio")->set_custom_input(2, 0xff, read8_delegate(FUNC(mcr3_state::spyhunt_ip2_r),state));
machine.device<midway_ssio_device>("ssio")->set_custom_output(4, 0xff, write8_delegate(FUNC(mcr3_state::spyhunt_op4_w),state));
@@ -1615,7 +1614,7 @@ static DRIVER_INIT( spyhunt )
static DRIVER_INIT( crater )
{
mcr3_state *state = machine.driver_data<mcr3_state>();
- mcr_common_init(machine, MCR_SSIO);
+ mcr_common_init(machine);
state->m_spyhunt_sprite_color_mask = 0x03;
state->m_spyhunt_scroll_offset = 96;
@@ -1625,7 +1624,7 @@ static DRIVER_INIT( crater )
static DRIVER_INIT( turbotag )
{
mcr3_state *state = machine.driver_data<mcr3_state>();
- mcr_common_init(machine, MCR_SSIO | MCR_CHIP_SQUEAK_DELUXE);
+ mcr_common_init(machine);
machine.device<midway_ssio_device>("ssio")->set_custom_input(1, 0x60, read8_delegate(FUNC(mcr3_state::spyhunt_ip1_r),state));
machine.device<midway_ssio_device>("ssio")->set_custom_input(2, 0xff, read8_delegate(FUNC(mcr3_state::turbotag_ip2_r),state));
machine.device<midway_ssio_device>("ssio")->set_custom_output(4, 0xff, write8_delegate(FUNC(mcr3_state::spyhunt_op4_w),state));
diff --git a/src/mame/drivers/mcr68.c b/src/mame/drivers/mcr68.c
index f03275fec1b..a92c17d4017 100644
--- a/src/mame/drivers/mcr68.c
+++ b/src/mame/drivers/mcr68.c
@@ -55,8 +55,6 @@
#include "emu.h"
#include "cpu/m68000/m68000.h"
-#include "audio/midway.h"
-#include "audio/williams.h"
#include "machine/nvram.h"
#include "includes/mcr.h"
#include "includes/mcr68.h"
@@ -206,8 +204,8 @@ READ16_MEMBER(mcr68_state::archrivl_port_1_r)
WRITE16_MEMBER(mcr68_state::archrivl_control_w)
{
COMBINE_DATA(&m_control_word);
- williams_cvsd_reset_w(machine(), ~m_control_word & 0x0400);
- williams_cvsd_data_w(machine(), m_control_word & 0x3ff);
+ m_cvsd_sound->reset_write(~m_control_word & 0x0400);
+ m_cvsd_sound->write(space, 0, m_control_word & 0x3ff);
}
@@ -1056,16 +1054,16 @@ MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( archrivl, mcr68 )
/* basic machine hardware */
- MCFG_DEVICE_REMOVE("mono")
- MCFG_FRAGMENT_ADD(williams_cvsd_sound)
+ MCFG_WILLIAMS_CVSD_SOUND_ADD("cvsd")
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( pigskin, mcr68 )
/* basic machine hardware */
- MCFG_DEVICE_REMOVE("mono")
- MCFG_FRAGMENT_ADD(williams_cvsd_sound)
+ MCFG_WILLIAMS_CVSD_SOUND_ADD("cvsd")
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_PROGRAM_MAP(pigskin_map)
@@ -1075,8 +1073,8 @@ MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( trisport, mcr68 )
/* basic machine hardware */
- MCFG_DEVICE_REMOVE("mono")
- MCFG_FRAGMENT_ADD(williams_cvsd_sound)
+ MCFG_WILLIAMS_CVSD_SOUND_ADD("cvsd")
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_PROGRAM_MAP(trisport_map)
@@ -1354,7 +1352,7 @@ ROM_START( archrivl )
ROM_LOAD16_BYTE( "2c-rev2", 0x20000, 0x10000, CRC(cc2893f7) SHA1(44931299cb98e27ac2f11b3922da76895fbfe0a7) )
ROM_LOAD16_BYTE( "2b-rev2", 0x20001, 0x10000, CRC(fa977050) SHA1(67c66995da755401162f7e668b97eb42ac769ec0) )
- ROM_REGION( 0x90000, "cvsdcpu", 0 ) /* Audio System board */
+ ROM_REGION( 0x90000, "cvsd:cpu", 0 ) /* Audio System board */
ROM_LOAD( "u4.snd", 0x10000, 0x08000, CRC(96b3c652) SHA1(1bb576d0bf6b6b8df24e7b9352a33e97dd8ebdcb) )
ROM_RELOAD( 0x18000, 0x08000 )
ROM_RELOAD( 0x20000, 0x08000 )
@@ -1401,7 +1399,7 @@ ROM_START( archrivl2 )
ROM_LOAD16_BYTE( "archrivl.3", 0x20000, 0x10000, CRC(d6d08ff7) SHA1(bbbd4b5c3218c9bb461b17e536191d40ab39f67c) )
ROM_LOAD16_BYTE( "archrivl.1", 0x20001, 0x10000, CRC(92f3a43d) SHA1(45fdcbacd65f5898d54cc2ac95639b7ee2c097e6) )
- ROM_REGION( 0x90000, "cvsdcpu", 0 ) /* Audio System board */
+ ROM_REGION( 0x90000, "cvsd:cpu", 0 ) /* Audio System board */
ROM_LOAD( "u4.snd", 0x10000, 0x08000, CRC(96b3c652) SHA1(1bb576d0bf6b6b8df24e7b9352a33e97dd8ebdcb) )
ROM_RELOAD( 0x18000, 0x08000 )
ROM_RELOAD( 0x20000, 0x08000 )
@@ -1448,7 +1446,7 @@ ROM_START( pigskin ) /* Initial boot screen reports KIT CODE REV 1.1K 8/01/90 */
ROM_LOAD16_BYTE( "pigskin-k_la1.a6", 0x20000, 0x10000, CRC(4d8b7e50) SHA1(9e5d0edf1603e11f22d3129a2b8865ebcb5e27f9) )
ROM_LOAD16_BYTE( "pigskin-k_la1.b6", 0x20001, 0x10000, CRC(1194f187) SHA1(e7cebe5322a5c8e382b6773939be5bc88492f289) )
- ROM_REGION( 0x90000, "cvsdcpu", 0 ) /* Audio System board */
+ ROM_REGION( 0x90000, "cvsd:cpu", 0 ) /* Audio System board */
ROM_LOAD( "pigskin_sl1.u4", 0x10000, 0x10000, CRC(6daf2d37) SHA1(4c8098520fe44e36b01389bcfcfe3ad1d027cbde) )
ROM_RELOAD( 0x20000, 0x10000 )
ROM_LOAD( "pigskin_sl1.u19", 0x30000, 0x10000, CRC(56fd16a3) SHA1(b91aabdbd3185355f2b7177fc4d3a86fa110f51d) )
@@ -1475,7 +1473,7 @@ ROM_START( pigskina ) /* Initial boot screen reports REV 2.0 7/06/90 */
ROM_LOAD16_BYTE( "pigskin_la2.a6", 0x20000, 0x10000, CRC(2fc91002) SHA1(64d270b78c69d3f4fb36d1233a1632d6ba3d87a5) )
ROM_LOAD16_BYTE( "pigskin_la2.b6", 0x20001, 0x10000, CRC(0b93dc66) SHA1(f3b516a1d1e4abd7b0d56243949e9cd7ac79178b) )
- ROM_REGION( 0x90000, "cvsdcpu", 0 ) /* Audio System board */
+ ROM_REGION( 0x90000, "cvsd:cpu", 0 ) /* Audio System board */
ROM_LOAD( "pigskin_sl1.u4", 0x10000, 0x10000, CRC(6daf2d37) SHA1(4c8098520fe44e36b01389bcfcfe3ad1d027cbde) )
ROM_RELOAD( 0x20000, 0x10000 )
ROM_LOAD( "pigskin_sl1.u19", 0x30000, 0x10000, CRC(56fd16a3) SHA1(b91aabdbd3185355f2b7177fc4d3a86fa110f51d) )
@@ -1502,7 +1500,7 @@ ROM_START( trisport )
ROM_LOAD16_BYTE( "la3.a6", 0x20000, 0x10000, CRC(9c6a1398) SHA1(ee115d9207f3a9034b7c9eccd2ff151d9c923c9a) )
ROM_LOAD16_BYTE( "la3.b6", 0x20001, 0x10000, CRC(597b564c) SHA1(090da3ec0c86035cc41a9caea182b8a5419c3be9) )
- ROM_REGION( 0x90000, "cvsdcpu", 0 ) /* Audio System board */
+ ROM_REGION( 0x90000, "cvsd:cpu", 0 ) /* Audio System board */
ROM_LOAD( "sl1-snd.u4", 0x10000, 0x10000, CRC(0ed8c904) SHA1(21292a001c4c44f87b8782c706e5c346b767cd6b) )
ROM_RELOAD( 0x20000, 0x10000 )
ROM_LOAD( "sl1-snd.u19", 0x30000, 0x10000, CRC(b57d7d7e) SHA1(483f718f1cc4549baf5696935532d30803254a19) )
@@ -1545,10 +1543,9 @@ ROM_END
*
*************************************/
-static void mcr68_common_init(running_machine &machine, int sound_board, int clip, int xoffset)
+static void mcr68_common_init(running_machine &machine, int clip, int xoffset)
{
mcr68_state *state = machine.driver_data<mcr68_state>();
- mcr_sound_init(machine, sound_board);
state->m_sprite_clip = clip;
state->m_sprite_xoffset = xoffset;
@@ -1560,7 +1557,7 @@ static void mcr68_common_init(running_machine &machine, int sound_board, int cli
static DRIVER_INIT( zwackery )
{
mcr68_state *state = machine.driver_data<mcr68_state>();
- mcr68_common_init(machine, MCR_CHIP_SQUEAK_DELUXE, 0, 0);
+ mcr68_common_init(machine, 0, 0);
/* Zwackery doesn't care too much about this value; currently taken from Blasted */
state->m_timing_factor = attotime::from_hz(machine.device("maincpu")->unscaled_clock() / 10) * (256 + 16);
@@ -1570,7 +1567,7 @@ static DRIVER_INIT( zwackery )
static DRIVER_INIT( xenophob )
{
mcr68_state *state = machine.driver_data<mcr68_state>();
- mcr68_common_init(machine, MCR_SOUNDS_GOOD, 0, -4);
+ mcr68_common_init(machine, 0, -4);
/* Xenophobe doesn't care too much about this value; currently taken from Blasted */
state->m_timing_factor = attotime::from_hz(machine.device("maincpu")->unscaled_clock() / 10) * (256 + 16);
@@ -1583,7 +1580,7 @@ static DRIVER_INIT( xenophob )
static DRIVER_INIT( spyhunt2 )
{
mcr68_state *state = machine.driver_data<mcr68_state>();
- mcr68_common_init(machine, MCR_TURBO_CHIP_SQUEAK | MCR_SOUNDS_GOOD, 0, -6);
+ mcr68_common_init(machine, 0, -6);
/* Spy Hunter 2 doesn't care too much about this value; currently taken from Blasted */
state->m_timing_factor = attotime::from_hz(machine.device("maincpu")->unscaled_clock() / 10) * (256 + 16);
@@ -1598,7 +1595,7 @@ static DRIVER_INIT( spyhunt2 )
static DRIVER_INIT( blasted )
{
mcr68_state *state = machine.driver_data<mcr68_state>();
- mcr68_common_init(machine, MCR_SOUNDS_GOOD, 0, 0);
+ mcr68_common_init(machine, 0, 0);
/* Blasted checks the timing of VBLANK relative to the 493 interrupt */
/* VBLANK is required to come within 220-256 E clocks (i.e., 2200-2560 CPU clocks) */
@@ -1615,7 +1612,7 @@ static DRIVER_INIT( blasted )
static DRIVER_INIT( intlaser )
{
mcr68_state *state = machine.driver_data<mcr68_state>();
- mcr68_common_init(machine, MCR_SOUNDS_GOOD, 0, 0);
+ mcr68_common_init(machine, 0, 0);
/* Copied from Blasted */
state->m_timing_factor = attotime::from_hz(machine.device("maincpu")->unscaled_clock() / 10) * (256 + 16);
@@ -1630,7 +1627,7 @@ static DRIVER_INIT( intlaser )
static DRIVER_INIT( archrivl )
{
mcr68_state *state = machine.driver_data<mcr68_state>();
- mcr68_common_init(machine, MCR_WILLIAMS_SOUND, 16, 0);
+ mcr68_common_init(machine, 16, 0);
/* Arch Rivals doesn't care too much about this value; currently taken from Blasted */
state->m_timing_factor = attotime::from_hz(machine.device("maincpu")->unscaled_clock() / 10) * (256 + 16);
@@ -1649,7 +1646,7 @@ static DRIVER_INIT( archrivl )
static DRIVER_INIT( pigskin )
{
mcr68_state *state = machine.driver_data<mcr68_state>();
- mcr68_common_init(machine, MCR_WILLIAMS_SOUND, 16, 0);
+ mcr68_common_init(machine, 16, 0);
/* Pigskin doesn't care too much about this value; currently taken from Tri-Sports */
state->m_timing_factor = attotime::from_hz(machine.device("maincpu")->unscaled_clock() / 10) * 115;
@@ -1661,7 +1658,7 @@ static DRIVER_INIT( pigskin )
static DRIVER_INIT( trisport )
{
mcr68_state *state = machine.driver_data<mcr68_state>();
- mcr68_common_init(machine, MCR_WILLIAMS_SOUND, 0, 0);
+ mcr68_common_init(machine, 0, 0);
/* Tri-Sports checks the timing of VBLANK relative to the 493 interrupt */
/* VBLANK is required to come within 87-119 E clocks (i.e., 870-1190 CPU clocks) */
diff --git a/src/mame/drivers/megasys1.c b/src/mame/drivers/megasys1.c
index 5fa42ac9b3d..dc30899430d 100644
--- a/src/mame/drivers/megasys1.c
+++ b/src/mame/drivers/megasys1.c
@@ -1452,7 +1452,7 @@ GFXDECODE_END
static const ym2151_interface ym2151_config =
{
- megasys1_sound_irq
+ DEVCB_LINE(megasys1_sound_irq)
};
static MACHINE_CONFIG_START( system_A, megasys1_state )
diff --git a/src/mame/drivers/metro.c b/src/mame/drivers/metro.c
index ac9900a9d0c..e7cc917f35d 100644
--- a/src/mame/drivers/metro.c
+++ b/src/mame/drivers/metro.c
@@ -532,7 +532,7 @@ static void metro_sound_irq_handler( device_t *device, int state )
static const ym2151_interface ym2151_config =
{
- metro_sound_irq_handler /* irq handler */
+ DEVCB_LINE(metro_sound_irq_handler) /* irq handler */
};
diff --git a/src/mame/drivers/midtunit.c b/src/mame/drivers/midtunit.c
index 0bf1586fee0..76ac68cacca 100644
--- a/src/mame/drivers/midtunit.c
+++ b/src/mame/drivers/midtunit.c
@@ -22,8 +22,6 @@
#include "emu.h"
#include "cpu/tms34010/tms34010.h"
#include "cpu/adsp2100/adsp2100.h"
-#include "audio/williams.h"
-#include "audio/dcs.h"
#include "machine/nvram.h"
#include "includes/midtunit.h"
@@ -626,7 +624,9 @@ MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( tunit_adpcm, tunit_core )
/* basic machine hardware */
- MCFG_FRAGMENT_ADD(williams_adpcm_sound)
+ MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_WILLIAMS_ADPCM_SOUND_ADD("adpcm")
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
@@ -645,10 +645,10 @@ MACHINE_CONFIG_END
*************************************/
ROM_START( mk )
- ROM_REGION( 0x50000, "adpcm", 0 ) /* sound CPU */
+ ROM_REGION( 0x50000, "adpcm:cpu", 0 ) /* sound CPU */
ROM_LOAD( "mks-u3.rom", 0x10000, 0x40000, CRC(c615844c) SHA1(5732f9053a5f73b0cc3b0166d7dc4430829d5bc7) )
- ROM_REGION( 0x200000, "oki", 0 ) /* ADPCM */
+ ROM_REGION( 0x200000, "adpcm:oki", 0 ) /* ADPCM */
ROM_LOAD( "mks-u12.rom", 0x00000, 0x40000, CRC(258bd7f9) SHA1(463890b23f17350fb9b8a85897b0777c45bc2d54) )
ROM_RELOAD( 0x40000, 0x40000 )
ROM_LOAD( "mks-u13.rom", 0x80000, 0x40000, CRC(7b7ec3b6) SHA1(6eec1b90d4a4855f34a7ebfbf93f3358d5627db4) )
@@ -678,10 +678,10 @@ ROM_END
ROM_START( mkr4 )
- ROM_REGION( 0x50000, "adpcm", 0 ) /* sound CPU */
+ ROM_REGION( 0x50000, "adpcm:cpu", 0 ) /* sound CPU */
ROM_LOAD( "mks-u3.rom", 0x10000, 0x40000, CRC(c615844c) SHA1(5732f9053a5f73b0cc3b0166d7dc4430829d5bc7) )
- ROM_REGION( 0x200000, "oki", 0 ) /* ADPCM */
+ ROM_REGION( 0x200000, "adpcm:oki", 0 ) /* ADPCM */
ROM_LOAD( "mks-u12.rom", 0x00000, 0x40000, CRC(258bd7f9) SHA1(463890b23f17350fb9b8a85897b0777c45bc2d54) )
ROM_RELOAD( 0x40000, 0x40000 )
ROM_LOAD( "mks-u13.rom", 0x80000, 0x40000, CRC(7b7ec3b6) SHA1(6eec1b90d4a4855f34a7ebfbf93f3358d5627db4) )
@@ -711,10 +711,10 @@ ROM_END
ROM_START( mktturbo )
- ROM_REGION( 0x50000, "adpcm", 0 ) /* sound CPU */
+ ROM_REGION( 0x50000, "adpcm:cpu", 0 ) /* sound CPU */
ROM_LOAD( "mks-u3.rom", 0x10000, 0x40000, CRC(c615844c) SHA1(5732f9053a5f73b0cc3b0166d7dc4430829d5bc7) )
- ROM_REGION( 0x200000, "oki", 0 ) /* ADPCM */
+ ROM_REGION( 0x200000, "adpcm:oki", 0 ) /* ADPCM */
ROM_LOAD( "mks-u12.rom", 0x00000, 0x40000, CRC(258bd7f9) SHA1(463890b23f17350fb9b8a85897b0777c45bc2d54) )
ROM_RELOAD( 0x40000, 0x40000 )
ROM_LOAD( "mks-u13.rom", 0x80000, 0x40000, CRC(7b7ec3b6) SHA1(6eec1b90d4a4855f34a7ebfbf93f3358d5627db4) )
@@ -1166,11 +1166,11 @@ ROM_END
ROM_START( nbajam )
- ROM_REGION( 0x50000, "adpcm", 0 ) /* sound CPU */
+ ROM_REGION( 0x50000, "adpcm:cpu", 0 ) /* sound CPU */
ROM_LOAD( "nbau3.bin", 0x010000, 0x20000, CRC(3a3ea480) SHA1(d12a45cba5c35f046b176661d7877fa4fd0e6c13) )
ROM_RELOAD( 0x030000, 0x20000 )
- ROM_REGION( 0x200000, "oki", 0 ) /* ADPCM */
+ ROM_REGION( 0x200000, "adpcm:oki", 0 ) /* ADPCM */
ROM_LOAD( "nbau12.bin", 0x000000, 0x80000, CRC(b94847f1) SHA1(e7efa0a379bfa91fe4ffb75f07a5dfbfde9a96b4) )
ROM_LOAD( "nbau13.bin", 0x080000, 0x80000, CRC(b6fe24bd) SHA1(f70f75b5570a2b368ebc74d2a7d264c618940430) )
@@ -1202,11 +1202,11 @@ ROM_END
ROM_START( nbajamr2 )
- ROM_REGION( 0x50000, "adpcm", 0 ) /* sound CPU */
+ ROM_REGION( 0x50000, "adpcm:cpu", 0 ) /* sound CPU */
ROM_LOAD( "nbau3.bin", 0x010000, 0x20000, CRC(3a3ea480) SHA1(d12a45cba5c35f046b176661d7877fa4fd0e6c13) )
ROM_RELOAD( 0x030000, 0x20000 )
- ROM_REGION( 0x200000, "oki", 0 ) /* ADPCM */
+ ROM_REGION( 0x200000, "adpcm:oki", 0 ) /* ADPCM */
ROM_LOAD( "nbau12.bin", 0x000000, 0x80000, CRC(b94847f1) SHA1(e7efa0a379bfa91fe4ffb75f07a5dfbfde9a96b4) )
ROM_LOAD( "nbau13.bin", 0x080000, 0x80000, CRC(b6fe24bd) SHA1(f70f75b5570a2b368ebc74d2a7d264c618940430) )
@@ -1238,11 +1238,11 @@ ROM_END
ROM_START( nbajamte )
- ROM_REGION( 0x50000, "adpcm", 0 ) /* sound CPU */
+ ROM_REGION( 0x50000, "adpcm:cpu", 0 ) /* sound CPU */
ROM_LOAD( "te-u3.bin", 0x010000, 0x20000, CRC(d4551195) SHA1(e8908fbe4339fb8c93f7e74113dfd25dda1667ea) )
ROM_RELOAD( 0x030000, 0x20000 )
- ROM_REGION( 0x200000, "oki", 0 ) /* ADPCM */
+ ROM_REGION( 0x200000, "adpcm:oki", 0 ) /* ADPCM */
ROM_LOAD( "te-u12.bin", 0x000000, 0x80000, CRC(4fac97bc) SHA1(bd88d8c3edab0e35ad9f9350bcbaa17cda61d87a) )
ROM_LOAD( "te-u13.bin", 0x080000, 0x80000, CRC(6f27b202) SHA1(c1f0db15624d1e7102ce9fd1db49ccf86e8611d6) )
@@ -1274,11 +1274,11 @@ ROM_END
ROM_START( nbajamt1 )
- ROM_REGION( 0x50000, "adpcm", 0 ) /* sound CPU */
+ ROM_REGION( 0x50000, "adpcm:cpu", 0 ) /* sound CPU */
ROM_LOAD( "te-u3.bin", 0x010000, 0x20000, CRC(d4551195) SHA1(e8908fbe4339fb8c93f7e74113dfd25dda1667ea) )
ROM_RELOAD( 0x030000, 0x20000 )
- ROM_REGION( 0x200000, "oki", 0 ) /* ADPCM */
+ ROM_REGION( 0x200000, "adpcm:oki", 0 ) /* ADPCM */
ROM_LOAD( "te-u12.bin", 0x000000, 0x80000, CRC(4fac97bc) SHA1(bd88d8c3edab0e35ad9f9350bcbaa17cda61d87a) )
ROM_LOAD( "te-u13.bin", 0x080000, 0x80000, CRC(6f27b202) SHA1(c1f0db15624d1e7102ce9fd1db49ccf86e8611d6) )
@@ -1310,11 +1310,11 @@ ROM_END
ROM_START( nbajamt2 )
- ROM_REGION( 0x50000, "adpcm", 0 ) /* sound CPU */
+ ROM_REGION( 0x50000, "adpcm:cpu", 0 ) /* sound CPU */
ROM_LOAD( "te-u3.bin", 0x010000, 0x20000, CRC(d4551195) SHA1(e8908fbe4339fb8c93f7e74113dfd25dda1667ea) )
ROM_RELOAD( 0x030000, 0x20000 )
- ROM_REGION( 0x200000, "oki", 0 ) /* ADPCM */
+ ROM_REGION( 0x200000, "adpcm:oki", 0 ) /* ADPCM */
ROM_LOAD( "te-u12.bin", 0x000000, 0x80000, CRC(4fac97bc) SHA1(bd88d8c3edab0e35ad9f9350bcbaa17cda61d87a) )
ROM_LOAD( "te-u13.bin", 0x080000, 0x80000, CRC(6f27b202) SHA1(c1f0db15624d1e7102ce9fd1db49ccf86e8611d6) )
@@ -1346,11 +1346,11 @@ ROM_END
ROM_START( nbajamt3 )
- ROM_REGION( 0x50000, "adpcm", 0 ) /* sound CPU */
+ ROM_REGION( 0x50000, "adpcm:cpu", 0 ) /* sound CPU */
ROM_LOAD( "te-u3.bin", 0x010000, 0x20000, CRC(d4551195) SHA1(e8908fbe4339fb8c93f7e74113dfd25dda1667ea) )
ROM_RELOAD( 0x030000, 0x20000 )
- ROM_REGION( 0x200000, "oki", 0 ) /* ADPCM */
+ ROM_REGION( 0x200000, "adpcm:oki", 0 ) /* ADPCM */
ROM_LOAD( "te-u12.bin", 0x000000, 0x80000, CRC(4fac97bc) SHA1(bd88d8c3edab0e35ad9f9350bcbaa17cda61d87a) )
ROM_LOAD( "te-u13.bin", 0x080000, 0x80000, CRC(6f27b202) SHA1(c1f0db15624d1e7102ce9fd1db49ccf86e8611d6) )
@@ -1382,11 +1382,11 @@ ROM_END
ROM_START( nbajamtn )
- ROM_REGION( 0x50000, "adpcm", 0 ) /* sound CPU */
+ ROM_REGION( 0x50000, "adpcm:cpu", 0 ) /* sound CPU */
ROM_LOAD( "te-u3.bin", 0x010000, 0x20000, CRC(d4551195) SHA1(e8908fbe4339fb8c93f7e74113dfd25dda1667ea) )
ROM_RELOAD( 0x030000, 0x20000 )
- ROM_REGION( 0x200000, "oki", 0 ) /* ADPCM */
+ ROM_REGION( 0x200000, "adpcm:oki", 0 ) /* ADPCM */
ROM_LOAD( "te-u12.bin", 0x000000, 0x80000, CRC(4fac97bc) SHA1(bd88d8c3edab0e35ad9f9350bcbaa17cda61d87a) )
ROM_LOAD( "te-u13.bin", 0x080000, 0x80000, CRC(6f27b202) SHA1(c1f0db15624d1e7102ce9fd1db49ccf86e8611d6) )
@@ -1418,11 +1418,11 @@ ROM_END
ROM_START( jdreddp )
- ROM_REGION( 0x50000, "adpcm", 0 ) /* sound CPU */
+ ROM_REGION( 0x50000, "adpcm:cpu", 0 ) /* sound CPU */
ROM_LOAD( "jd_u3.rom", 0x010000, 0x20000, CRC(6154d108) SHA1(54328455ec22ba815de85aa3bfe6405353c64f5c) )
ROM_RELOAD( 0x030000, 0x20000 )
- ROM_REGION( 0x200000, "oki", 0 ) /* ADPCM */
+ ROM_REGION( 0x200000, "adpcm:oki", 0 ) /* ADPCM */
ROM_LOAD( "jd_u12.rom", 0x000000, 0x80000, CRC(ef32f202) SHA1(16aea085e63496dec259291de1a64fbeab52f039) )
ROM_LOAD( "jd_u13.rom", 0x080000, 0x80000, CRC(3dc70473) SHA1(a3d7210301ff0579889009a075092115d9bf0600) )
diff --git a/src/mame/drivers/midyunit.c b/src/mame/drivers/midyunit.c
index 29b7f813e42..1e1798b7a93 100644
--- a/src/mame/drivers/midyunit.c
+++ b/src/mame/drivers/midyunit.c
@@ -114,7 +114,6 @@ Notes:
#include "emu.h"
#include "cpu/z80/z80.h"
#include "cpu/tms34010/tms34010.h"
-#include "audio/williams.h"
#include "sound/okim6295.h"
#include "includes/midyunit.h"
@@ -152,19 +151,19 @@ static WRITE8_DEVICE_HANDLER( yawdim_oki_bank_w )
CUSTOM_INPUT_MEMBER(midyunit_state::narc_talkback_strobe_r)
{
- return (williams_narc_talkback_r(machine()) >> 8) & 1;
+ return (m_narc_sound->read(*machine().memory().first_space(), 0) >> 8) & 1;
}
CUSTOM_INPUT_MEMBER(midyunit_state::narc_talkback_data_r)
{
- return williams_narc_talkback_r(machine()) & 0xff;
+ return m_narc_sound->read(*machine().memory().first_space(), 0) & 0xff;
}
CUSTOM_INPUT_MEMBER(midyunit_state::adpcm_irq_state_r)
{
- return williams_adpcm_sound_irq_r(machine()) & 1;
+ return m_adpcm_sound->irq_read() & 1;
}
@@ -1018,7 +1017,10 @@ static MACHINE_CONFIG_START( zunit, midyunit_state )
MCFG_VIDEO_START(midzunit)
/* sound hardware */
- MCFG_FRAGMENT_ADD(williams_narc_sound)
+ MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
+ MCFG_WILLIAMS_NARC_SOUND_ADD("narcsnd")
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
MACHINE_CONFIG_END
@@ -1046,13 +1048,17 @@ static MACHINE_CONFIG_START( yunit_core, midyunit_state )
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_RAW_PARAMS(STDRES_PIXEL_CLOCK*2, 505, 0, 399, 289, 0, 253)
MCFG_SCREEN_UPDATE_STATIC(tms340x0_ind16)
+
+ /* sound hardware */
+ MCFG_SPEAKER_STANDARD_MONO("mono")
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( yunit_cvsd_4bit_slow, yunit_core )
/* basic machine hardware */
- MCFG_FRAGMENT_ADD(williams_cvsd_sound)
+ MCFG_WILLIAMS_CVSD_SOUND_ADD("cvsd")
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
/* video hardware */
MCFG_PALETTE_LENGTH(256)
@@ -1065,7 +1071,9 @@ static MACHINE_CONFIG_DERIVED( yunit_cvsd_4bit_fast, yunit_core )
/* basic machine hardware */
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_CLOCK(FAST_MASTER_CLOCK)
- MCFG_FRAGMENT_ADD(williams_cvsd_sound)
+
+ MCFG_WILLIAMS_CVSD_SOUND_ADD("cvsd")
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
/* video hardware */
MCFG_PALETTE_LENGTH(256)
@@ -1076,7 +1084,8 @@ MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( yunit_cvsd_6bit_slow, yunit_core )
/* basic machine hardware */
- MCFG_FRAGMENT_ADD(williams_cvsd_sound)
+ MCFG_WILLIAMS_CVSD_SOUND_ADD("cvsd")
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
/* video hardware */
MCFG_PALETTE_LENGTH(4096)
@@ -1089,7 +1098,9 @@ static MACHINE_CONFIG_DERIVED( yunit_adpcm_6bit_fast, yunit_core )
/* basic machine hardware */
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_CLOCK(FAST_MASTER_CLOCK)
- MCFG_FRAGMENT_ADD(williams_adpcm_sound)
+
+ MCFG_WILLIAMS_ADPCM_SOUND_ADD("adpcm")
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
/* video hardware */
MCFG_PALETTE_LENGTH(4096)
@@ -1102,7 +1113,9 @@ static MACHINE_CONFIG_DERIVED( yunit_adpcm_6bit_faster, yunit_core )
/* basic machine hardware */
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_CLOCK(FASTER_MASTER_CLOCK)
- MCFG_FRAGMENT_ADD(williams_adpcm_sound)
+
+ MCFG_WILLIAMS_ADPCM_SOUND_ADD("adpcm")
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
/* video hardware */
MCFG_PALETTE_LENGTH(4096)
@@ -1122,8 +1135,6 @@ static MACHINE_CONFIG_DERIVED( mkyawdim, yunit_core )
MCFG_VIDEO_START(mkyawdim)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("mono")
-
MCFG_OKIM6295_ADD("oki", 1056000, OKIM6295_PIN7_HIGH) // clock frequency & pin 7 not verified
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
@@ -1137,13 +1148,13 @@ MACHINE_CONFIG_END
*************************************/
ROM_START( narc )
- ROM_REGION( 0x90000, "narc1cpu", 0 ) /* sound CPU */
+ ROM_REGION( 0x90000, "narcsnd:cpu0", 0 ) /* sound CPU */
ROM_LOAD( "narcrev2.u4", 0x50000, 0x10000, CRC(450a591a) SHA1(bbda8061262738e5866f2707f69483a0a51d2910) )
ROM_RELOAD( 0x60000, 0x10000 )
ROM_LOAD( "narcrev2.u5", 0x70000, 0x10000, CRC(e551e5e3) SHA1(c8b4f53dbd4c534abb77d4dc07c4d12653b79894) )
ROM_RELOAD( 0x80000, 0x10000 )
- ROM_REGION( 0x90000, "narc2cpu", 0 ) /* slave sound CPU */
+ ROM_REGION( 0x90000, "narcsnd:cpu1", 0 ) /* slave sound CPU */
ROM_LOAD( "narcrev2.u35", 0x10000, 0x10000, CRC(81295892) SHA1(159664e5ee03c88d6e940e70e87e2150dc5b8b25) )
ROM_RELOAD( 0x20000, 0x10000 )
ROM_LOAD( "narcrev2.u36", 0x30000, 0x10000, CRC(16cdbb13) SHA1(2dfd961a5d909c1804f4fda34de33ee2664c4bc6) )
@@ -1227,13 +1238,13 @@ ROM_END
ROM_START( narc3 )
- ROM_REGION( 0x90000, "narc1cpu", 0 ) /* sound CPU */
+ ROM_REGION( 0x90000, "narcsnd:cpu0", 0 ) /* sound CPU */
ROM_LOAD( "narcrev2.u4", 0x50000, 0x10000, CRC(450a591a) SHA1(bbda8061262738e5866f2707f69483a0a51d2910) )
ROM_RELOAD( 0x60000, 0x10000 )
ROM_LOAD( "narcrev2.u5", 0x70000, 0x10000, CRC(e551e5e3) SHA1(c8b4f53dbd4c534abb77d4dc07c4d12653b79894) )
ROM_RELOAD( 0x80000, 0x10000 )
- ROM_REGION( 0x90000, "narc2cpu", 0 ) /* slave sound CPU */
+ ROM_REGION( 0x90000, "narcsnd:cpu1", 0 ) /* slave sound CPU */
ROM_LOAD( "narcrev2.u35", 0x10000, 0x10000, CRC(81295892) SHA1(159664e5ee03c88d6e940e70e87e2150dc5b8b25) )
ROM_RELOAD( 0x20000, 0x10000 )
ROM_LOAD( "narcrev2.u36", 0x30000, 0x10000, CRC(16cdbb13) SHA1(2dfd961a5d909c1804f4fda34de33ee2664c4bc6) )
@@ -1328,13 +1339,13 @@ ROM_START( narc3 )
ROM_END
ROM_START( narc2 )
- ROM_REGION( 0x90000, "narc1cpu", 0 ) /* sound CPU */
+ ROM_REGION( 0x90000, "narcsnd:cpu0", 0 ) /* sound CPU */
ROM_LOAD( "narcrev2.u4", 0x50000, 0x10000, CRC(450a591a) SHA1(bbda8061262738e5866f2707f69483a0a51d2910) )
ROM_RELOAD( 0x60000, 0x10000 )
ROM_LOAD( "narcrev2.u5", 0x70000, 0x10000, CRC(e551e5e3) SHA1(c8b4f53dbd4c534abb77d4dc07c4d12653b79894) )
ROM_RELOAD( 0x80000, 0x10000 )
- ROM_REGION( 0x90000, "narc2cpu", 0 ) /* slave sound CPU */
+ ROM_REGION( 0x90000, "narcsnd:cpu1", 0 ) /* slave sound CPU */
ROM_LOAD( "narcrev2.u35", 0x10000, 0x10000, CRC(81295892) SHA1(159664e5ee03c88d6e940e70e87e2150dc5b8b25) )
ROM_RELOAD( 0x20000, 0x10000 )
ROM_LOAD( "narcrev2.u36", 0x30000, 0x10000, CRC(16cdbb13) SHA1(2dfd961a5d909c1804f4fda34de33ee2664c4bc6) )
@@ -1430,7 +1441,7 @@ ROM_END
ROM_START( trog )
- ROM_REGION( 0x90000, "cvsdcpu", 0 ) /* sound CPU */
+ ROM_REGION( 0x90000, "cvsd:cpu", 0 ) /* sound CPU */
ROM_LOAD ( "trogu4.bin", 0x10000, 0x10000, CRC(759d0bf4) SHA1(c4c3fa51c43cf7fd241ac1f33d7d220aa9f9edb3) )
ROM_RELOAD( 0x20000, 0x10000 )
ROM_LOAD ( "trogu19.bin", 0x30000, 0x10000, CRC(960c333d) SHA1(da8ce8dfffffe7a2d60b3f75cc5aa88e5e2be659) )
@@ -1460,7 +1471,7 @@ ROM_END
ROM_START( trog4 )
- ROM_REGION( 0x90000, "cvsdcpu", 0 ) /* sound CPU */
+ ROM_REGION( 0x90000, "cvsd:cpu", 0 ) /* sound CPU */
ROM_LOAD ( "trogu4.bin", 0x10000, 0x10000, CRC(759d0bf4) SHA1(c4c3fa51c43cf7fd241ac1f33d7d220aa9f9edb3) )
ROM_RELOAD( 0x20000, 0x10000 )
ROM_LOAD ( "trogu19.bin", 0x30000, 0x10000, CRC(960c333d) SHA1(da8ce8dfffffe7a2d60b3f75cc5aa88e5e2be659) )
@@ -1490,7 +1501,7 @@ ROM_END
ROM_START( trog3 )
- ROM_REGION( 0x90000, "cvsdcpu", 0 ) /* sound CPU */
+ ROM_REGION( 0x90000, "cvsd:cpu", 0 ) /* sound CPU */
ROM_LOAD ( "trogu4.bin", 0x10000, 0x10000, CRC(759d0bf4) SHA1(c4c3fa51c43cf7fd241ac1f33d7d220aa9f9edb3) )
ROM_RELOAD( 0x20000, 0x10000 )
ROM_LOAD ( "trogu19.bin", 0x30000, 0x10000, CRC(960c333d) SHA1(da8ce8dfffffe7a2d60b3f75cc5aa88e5e2be659) )
@@ -1520,7 +1531,7 @@ ROM_END
ROM_START( trogpa6 )
- ROM_REGION( 0x90000, "cvsdcpu", 0 ) /* sound CPU */
+ ROM_REGION( 0x90000, "cvsd:cpu", 0 ) /* sound CPU */
ROM_LOAD ( "trogu4.bin", 0x10000, 0x10000, CRC(759d0bf4) SHA1(c4c3fa51c43cf7fd241ac1f33d7d220aa9f9edb3) )
ROM_RELOAD( 0x20000, 0x10000 )
ROM_LOAD ( "trogu19.bin", 0x30000, 0x10000, CRC(960c333d) SHA1(da8ce8dfffffe7a2d60b3f75cc5aa88e5e2be659) )
@@ -1550,7 +1561,7 @@ ROM_END
ROM_START( trogpa4 )
- ROM_REGION( 0x90000, "cvsdcpu", 0 ) /* sound CPU */
+ ROM_REGION( 0x90000, "cvsd:cpu", 0 ) /* sound CPU */
ROM_LOAD ( "trogu4.bin", 0x10000, 0x10000, CRC(759d0bf4) SHA1(c4c3fa51c43cf7fd241ac1f33d7d220aa9f9edb3) )
ROM_RELOAD( 0x20000, 0x10000 )
ROM_LOAD ( "trogu19.bin", 0x30000, 0x10000, CRC(960c333d) SHA1(da8ce8dfffffe7a2d60b3f75cc5aa88e5e2be659) )
@@ -1580,7 +1591,7 @@ ROM_END
ROM_START( smashtv )
- ROM_REGION( 0x90000, "cvsdcpu", 0 ) /* sound CPU */
+ ROM_REGION( 0x90000, "cvsd:cpu", 0 ) /* sound CPU */
ROM_LOAD ( "sl2.u4", 0x10000, 0x10000, CRC(29d3f6c8) SHA1(8a90cdff54f59ddb7dba521504d880515a59df08) )
ROM_RELOAD( 0x20000, 0x10000 )
ROM_LOAD ( "sl2.u19", 0x30000, 0x10000, CRC(ac5a402a) SHA1(c476018062126dc3936caa2c328de490737165ec) )
@@ -1608,7 +1619,7 @@ ROM_END
ROM_START( smashtv6 )
- ROM_REGION( 0x90000, "cvsdcpu", 0 ) /* sound CPU */
+ ROM_REGION( 0x90000, "cvsd:cpu", 0 ) /* sound CPU */
ROM_LOAD ( "sl2.u4", 0x10000, 0x10000, CRC(29d3f6c8) SHA1(8a90cdff54f59ddb7dba521504d880515a59df08) )
ROM_RELOAD( 0x20000, 0x10000 )
ROM_LOAD ( "sl2.u19", 0x30000, 0x10000, CRC(ac5a402a) SHA1(c476018062126dc3936caa2c328de490737165ec) )
@@ -1636,7 +1647,7 @@ ROM_END
ROM_START( smashtv5 )
- ROM_REGION( 0x90000, "cvsdcpu", 0 ) /* sound CPU */
+ ROM_REGION( 0x90000, "cvsd:cpu", 0 ) /* sound CPU */
ROM_LOAD ( "sl2.u4", 0x10000, 0x10000, CRC(29d3f6c8) SHA1(8a90cdff54f59ddb7dba521504d880515a59df08) )
ROM_RELOAD( 0x20000, 0x10000 )
ROM_LOAD ( "sl2.u19", 0x30000, 0x10000, CRC(ac5a402a) SHA1(c476018062126dc3936caa2c328de490737165ec) )
@@ -1664,7 +1675,7 @@ ROM_END
ROM_START( smashtv4 )
- ROM_REGION( 0x90000, "cvsdcpu", 0 ) /* sound CPU */
+ ROM_REGION( 0x90000, "cvsd:cpu", 0 ) /* sound CPU */
ROM_LOAD ( "sl2.u4", 0x10000, 0x10000, CRC(29d3f6c8) SHA1(8a90cdff54f59ddb7dba521504d880515a59df08) )
ROM_RELOAD( 0x20000, 0x10000 )
ROM_LOAD ( "sl2.u19", 0x30000, 0x10000, CRC(ac5a402a) SHA1(c476018062126dc3936caa2c328de490737165ec) )
@@ -1692,7 +1703,7 @@ ROM_END
ROM_START( smashtv3 )
- ROM_REGION( 0x90000, "cvsdcpu", 0 ) /* sound CPU */
+ ROM_REGION( 0x90000, "cvsd:cpu", 0 ) /* sound CPU */
ROM_LOAD ( "sl2.u4", 0x10000, 0x10000, CRC(29d3f6c8) SHA1(8a90cdff54f59ddb7dba521504d880515a59df08) )
ROM_RELOAD( 0x20000, 0x10000 )
ROM_LOAD ( "sl2.u19", 0x30000, 0x10000, CRC(ac5a402a) SHA1(c476018062126dc3936caa2c328de490737165ec) )
@@ -1720,7 +1731,7 @@ ROM_END
ROM_START( hiimpact )
- ROM_REGION( 0x90000, "cvsdcpu", 0 ) /* sound CPU */
+ ROM_REGION( 0x90000, "cvsd:cpu", 0 ) /* sound CPU */
ROM_LOAD ( "sl1u4.bin", 0x10000, 0x20000, CRC(28effd6a) SHA1(4a839f15e1b453a22fdef7b1801b8cc5cfdf3c29) )
ROM_LOAD ( "sl1u19.bin", 0x30000, 0x20000, CRC(0ea22c89) SHA1(6d4579f6b10cac685be01348451b3537a0626034) )
ROM_LOAD ( "sl1u20.bin", 0x50000, 0x20000, CRC(4e747ab5) SHA1(82040f40aac7dae577376a742eadaaa9644500c1) )
@@ -1755,7 +1766,7 @@ ROM_END
ROM_START( hiimpact4 )
- ROM_REGION( 0x90000, "cvsdcpu", 0 ) /* sound CPU */
+ ROM_REGION( 0x90000, "cvsd:cpu", 0 ) /* sound CPU */
ROM_LOAD ( "sl1u4.bin", 0x10000, 0x20000, CRC(28effd6a) SHA1(4a839f15e1b453a22fdef7b1801b8cc5cfdf3c29) )
ROM_LOAD ( "sl1u19.bin", 0x30000, 0x20000, CRC(0ea22c89) SHA1(6d4579f6b10cac685be01348451b3537a0626034) )
ROM_LOAD ( "sl1u20.bin", 0x50000, 0x20000, CRC(4e747ab5) SHA1(82040f40aac7dae577376a742eadaaa9644500c1) )
@@ -1790,7 +1801,7 @@ ROM_END
ROM_START( hiimpact3 )
- ROM_REGION( 0x90000, "cvsdcpu", 0 ) /* sound CPU */
+ ROM_REGION( 0x90000, "cvsd:cpu", 0 ) /* sound CPU */
ROM_LOAD ( "sl1u4.bin", 0x10000, 0x20000, CRC(28effd6a) SHA1(4a839f15e1b453a22fdef7b1801b8cc5cfdf3c29) )
ROM_LOAD ( "sl1u19.bin", 0x30000, 0x20000, CRC(0ea22c89) SHA1(6d4579f6b10cac685be01348451b3537a0626034) )
ROM_LOAD ( "sl1u20.bin", 0x50000, 0x20000, CRC(4e747ab5) SHA1(82040f40aac7dae577376a742eadaaa9644500c1) )
@@ -1825,7 +1836,7 @@ ROM_END
ROM_START( hiimpact2 )
- ROM_REGION( 0x90000, "cvsdcpu", 0 ) /* sound CPU */
+ ROM_REGION( 0x90000, "cvsd:cpu", 0 ) /* sound CPU */
ROM_LOAD ( "sl1u4.bin", 0x10000, 0x20000, CRC(28effd6a) SHA1(4a839f15e1b453a22fdef7b1801b8cc5cfdf3c29) )
ROM_LOAD ( "sl1u19.bin", 0x30000, 0x20000, CRC(0ea22c89) SHA1(6d4579f6b10cac685be01348451b3537a0626034) )
ROM_LOAD ( "sl1u20.bin", 0x50000, 0x20000, CRC(4e747ab5) SHA1(82040f40aac7dae577376a742eadaaa9644500c1) )
@@ -1860,7 +1871,7 @@ ROM_END
ROM_START( hiimpact1 )
- ROM_REGION( 0x90000, "cvsdcpu", 0 ) /* sound CPU */
+ ROM_REGION( 0x90000, "cvsd:cpu", 0 ) /* sound CPU */
ROM_LOAD ( "sl1u4.bin", 0x10000, 0x20000, CRC(28effd6a) SHA1(4a839f15e1b453a22fdef7b1801b8cc5cfdf3c29) )
ROM_LOAD ( "sl1u19.bin", 0x30000, 0x20000, CRC(0ea22c89) SHA1(6d4579f6b10cac685be01348451b3537a0626034) )
ROM_LOAD ( "sl1u20.bin", 0x50000, 0x20000, CRC(4e747ab5) SHA1(82040f40aac7dae577376a742eadaaa9644500c1) )
@@ -1895,7 +1906,7 @@ ROM_END
ROM_START( hiimpactp )
- ROM_REGION( 0x90000, "cvsdcpu", 0 ) /* sound CPU */
+ ROM_REGION( 0x90000, "cvsd:cpu", 0 ) /* sound CPU */
ROM_LOAD ( "sl1u4.bin", 0x10000, 0x20000, CRC(28effd6a) SHA1(4a839f15e1b453a22fdef7b1801b8cc5cfdf3c29) )
ROM_LOAD ( "sl1u19.bin", 0x30000, 0x20000, CRC(0ea22c89) SHA1(6d4579f6b10cac685be01348451b3537a0626034) )
ROM_LOAD ( "sl1u20.bin", 0x50000, 0x20000, CRC(4e747ab5) SHA1(82040f40aac7dae577376a742eadaaa9644500c1) )
@@ -1930,7 +1941,7 @@ ROM_END
ROM_START( shimpact )
- ROM_REGION( 0x90000, "cvsdcpu", 0 ) /* sound CPU */
+ ROM_REGION( 0x90000, "cvsd:cpu", 0 ) /* sound CPU */
ROM_LOAD ( "shiu4.bin", 0x10000, 0x20000, CRC(1e5a012c) SHA1(4077fc266799a01738b7f88e867535f1fbacd557) )
ROM_LOAD ( "shiu19.bin", 0x30000, 0x20000, CRC(10f9684e) SHA1(1fdc5364f87fb65f4f2a438841e0fe847f765aaf) )
ROM_LOAD ( "shiu20.bin", 0x50000, 0x20000, CRC(1b4a71c1) SHA1(74b7b4ae76ebe65f1f46b2117970bfefefbb5344) )
@@ -1958,7 +1969,7 @@ ROM_END
ROM_START( shimpactp6 )
- ROM_REGION( 0x90000, "cvsdcpu", 0 ) /* sound CPU */
+ ROM_REGION( 0x90000, "cvsd:cpu", 0 ) /* sound CPU */
ROM_LOAD ( "shiu4.bin", 0x10000, 0x20000, CRC(1e5a012c) SHA1(4077fc266799a01738b7f88e867535f1fbacd557) )
ROM_LOAD ( "shiu19.bin", 0x30000, 0x20000, CRC(10f9684e) SHA1(1fdc5364f87fb65f4f2a438841e0fe847f765aaf) )
ROM_LOAD ( "shiu20.bin", 0x50000, 0x20000, CRC(1b4a71c1) SHA1(74b7b4ae76ebe65f1f46b2117970bfefefbb5344) )
@@ -1986,7 +1997,7 @@ ROM_END
ROM_START( shimpactp5 )
- ROM_REGION( 0x90000, "cvsdcpu", 0 ) /* sound CPU */
+ ROM_REGION( 0x90000, "cvsd:cpu", 0 ) /* sound CPU */
ROM_LOAD ( "shiu4.bin", 0x10000, 0x20000, CRC(1e5a012c) SHA1(4077fc266799a01738b7f88e867535f1fbacd557) )
ROM_LOAD ( "shiu19.bin", 0x30000, 0x20000, CRC(10f9684e) SHA1(1fdc5364f87fb65f4f2a438841e0fe847f765aaf) )
ROM_LOAD ( "shiu20.bin", 0x50000, 0x20000, CRC(1b4a71c1) SHA1(74b7b4ae76ebe65f1f46b2117970bfefefbb5344) )
@@ -2014,7 +2025,7 @@ ROM_END
ROM_START( shimpactp4 ) /* You must manualy reset the high score table or game will hang after initial demo screen, it's best to do a "Full Factory Restore" */
- ROM_REGION( 0x90000, "cvsdcpu", 0 ) /* sound CPU */
+ ROM_REGION( 0x90000, "cvsd:cpu", 0 ) /* sound CPU */
ROM_LOAD ( "shiu4.bin", 0x10000, 0x20000, CRC(1e5a012c) SHA1(4077fc266799a01738b7f88e867535f1fbacd557) )
ROM_LOAD ( "shiu19.bin", 0x30000, 0x20000, CRC(10f9684e) SHA1(1fdc5364f87fb65f4f2a438841e0fe847f765aaf) )
ROM_LOAD ( "shiu20.bin", 0x50000, 0x20000, CRC(1b4a71c1) SHA1(74b7b4ae76ebe65f1f46b2117970bfefefbb5344) )
@@ -2042,7 +2053,7 @@ ROM_END
ROM_START( strkforc )
- ROM_REGION( 0x90000, "cvsdcpu", 0 ) /* sound CPU */
+ ROM_REGION( 0x90000, "cvsd:cpu", 0 ) /* sound CPU */
ROM_LOAD ( "sfu4.bin", 0x10000, 0x10000, CRC(8f747312) SHA1(729929c209741e72eb83b407cf95d7709ec1b5ae) )
ROM_RELOAD( 0x20000, 0x10000 )
ROM_LOAD ( "sfu19.bin", 0x30000, 0x10000, CRC(afb29926) SHA1(ad904c0968a90b8187cc87d6c171fbc021d2f66f) )
@@ -2074,10 +2085,10 @@ ROM_END
ROM_START( mkla4 )
- ROM_REGION( 0x50000, "adpcm", 0 ) /* sound CPU */
+ ROM_REGION( 0x50000, "adpcm:cpu", 0 ) /* sound CPU */
ROM_LOAD ( "mks-u3.rom", 0x10000, 0x40000, CRC(c615844c) SHA1(5732f9053a5f73b0cc3b0166d7dc4430829d5bc7) )
- ROM_REGION( 0x200000, "oki", 0 ) /* ADPCM */
+ ROM_REGION( 0x200000, "adpcm:oki", 0 ) /* ADPCM */
ROM_LOAD ( "mks-u12.rom", 0x00000, 0x40000, CRC(258bd7f9) SHA1(463890b23f17350fb9b8a85897b0777c45bc2d54) )
ROM_RELOAD( 0x40000, 0x40000 )
ROM_LOAD ( "mks-u13.rom", 0x80000, 0x40000, CRC(7b7ec3b6) SHA1(6eec1b90d4a4855f34a7ebfbf93f3358d5627db4) )
@@ -2106,10 +2117,10 @@ ROM_END
ROM_START( mkla3 )
- ROM_REGION( 0x50000, "adpcm", 0 ) /* sound CPU */
+ ROM_REGION( 0x50000, "adpcm:cpu", 0 ) /* sound CPU */
ROM_LOAD ( "mks-u3.rom", 0x10000, 0x40000, CRC(c615844c) SHA1(5732f9053a5f73b0cc3b0166d7dc4430829d5bc7) )
- ROM_REGION( 0x200000, "oki", 0 ) /* ADPCM */
+ ROM_REGION( 0x200000, "adpcm:oki", 0 ) /* ADPCM */
ROM_LOAD ( "mks-u12.rom", 0x00000, 0x40000, CRC(258bd7f9) SHA1(463890b23f17350fb9b8a85897b0777c45bc2d54) )
ROM_RELOAD( 0x40000, 0x40000 )
ROM_LOAD ( "mks-u13.rom", 0x80000, 0x40000, CRC(7b7ec3b6) SHA1(6eec1b90d4a4855f34a7ebfbf93f3358d5627db4) )
@@ -2138,10 +2149,10 @@ ROM_END
ROM_START( mkla2 )
- ROM_REGION( 0x50000, "adpcm", 0 ) /* sound CPU */
+ ROM_REGION( 0x50000, "adpcm:cpu", 0 ) /* sound CPU */
ROM_LOAD ( "mks-u3.rom", 0x10000, 0x40000, CRC(c615844c) SHA1(5732f9053a5f73b0cc3b0166d7dc4430829d5bc7) )
- ROM_REGION( 0x200000, "oki", 0 ) /* ADPCM */
+ ROM_REGION( 0x200000, "adpcm:oki", 0 ) /* ADPCM */
ROM_LOAD ( "mks-u12.rom", 0x00000, 0x40000, CRC(258bd7f9) SHA1(463890b23f17350fb9b8a85897b0777c45bc2d54) )
ROM_RELOAD( 0x40000, 0x40000 )
ROM_LOAD ( "mks-u13.rom", 0x80000, 0x40000, CRC(7b7ec3b6) SHA1(6eec1b90d4a4855f34a7ebfbf93f3358d5627db4) )
@@ -2170,10 +2181,10 @@ ROM_END
ROM_START( mkla1 )
- ROM_REGION( 0x50000, "adpcm", 0 ) /* sound CPU */
+ ROM_REGION( 0x50000, "adpcm:cpu", 0 ) /* sound CPU */
ROM_LOAD ( "mks-u3.rom", 0x10000, 0x40000, CRC(c615844c) SHA1(5732f9053a5f73b0cc3b0166d7dc4430829d5bc7) )
- ROM_REGION( 0x200000, "oki", 0 ) /* ADPCM */
+ ROM_REGION( 0x200000, "adpcm:oki", 0 ) /* ADPCM */
ROM_LOAD ( "mks-u12.rom", 0x00000, 0x40000, CRC(258bd7f9) SHA1(463890b23f17350fb9b8a85897b0777c45bc2d54) )
ROM_RELOAD( 0x40000, 0x40000 )
ROM_LOAD ( "mks-u13.rom", 0x80000, 0x40000, CRC(7b7ec3b6) SHA1(6eec1b90d4a4855f34a7ebfbf93f3358d5627db4) )
@@ -2202,10 +2213,10 @@ ROM_END
ROM_START( mkprot9 )
- ROM_REGION( 0x50000, "adpcm", 0 ) /* sound CPU */
+ ROM_REGION( 0x50000, "adpcm:cpu", 0 ) /* sound CPU */
ROM_LOAD ( "mks-u3.rom", 0x10000, 0x40000, CRC(c615844c) SHA1(5732f9053a5f73b0cc3b0166d7dc4430829d5bc7) )
- ROM_REGION( 0x200000, "oki", 0 ) /* ADPCM */
+ ROM_REGION( 0x200000, "adpcm:oki", 0 ) /* ADPCM */
ROM_LOAD ( "mks-u12.rom", 0x00000, 0x40000, CRC(258bd7f9) SHA1(463890b23f17350fb9b8a85897b0777c45bc2d54) )
ROM_RELOAD( 0x40000, 0x40000 )
ROM_LOAD ( "mks-u13.rom", 0x80000, 0x40000, CRC(7b7ec3b6) SHA1(6eec1b90d4a4855f34a7ebfbf93f3358d5627db4) )
@@ -2234,10 +2245,10 @@ ROM_END
ROM_START( mkprot8 )
- ROM_REGION( 0x50000, "adpcm", 0 ) /* sound CPU */
+ ROM_REGION( 0x50000, "adpcm:cpu", 0 ) /* sound CPU */
ROM_LOAD ( "mks-u3.rom", 0x10000, 0x40000, CRC(c615844c) SHA1(5732f9053a5f73b0cc3b0166d7dc4430829d5bc7) )
- ROM_REGION( 0x200000, "oki", 0 ) /* ADPCM */
+ ROM_REGION( 0x200000, "adpcm:oki", 0 ) /* ADPCM */
ROM_LOAD ( "mks-u12.rom", 0x00000, 0x40000, CRC(258bd7f9) SHA1(463890b23f17350fb9b8a85897b0777c45bc2d54) )
ROM_RELOAD( 0x40000, 0x40000 )
ROM_LOAD ( "mks-u13.rom", 0x80000, 0x40000, CRC(7b7ec3b6) SHA1(6eec1b90d4a4855f34a7ebfbf93f3358d5627db4) )
@@ -2265,10 +2276,10 @@ ROM_START( mkprot8 )
ROM_END
ROM_START( mkprot4 )
- ROM_REGION( 0x50000, "adpcm", 0 ) /* sound CPU */
+ ROM_REGION( 0x50000, "adpcm:cpu", 0 ) /* sound CPU */
ROM_LOAD ( "mks-u3.rom", 0x10000, 0x40000, CRC(c615844c) SHA1(5732f9053a5f73b0cc3b0166d7dc4430829d5bc7) )
- ROM_REGION( 0x200000, "oki", 0 ) /* ADPCM */
+ ROM_REGION( 0x200000, "adpcm:oki", 0 ) /* ADPCM */
ROM_LOAD ( "mks-u12.rom", 0x00000, 0x40000, CRC(258bd7f9) SHA1(463890b23f17350fb9b8a85897b0777c45bc2d54) )
ROM_RELOAD( 0x40000, 0x40000 )
ROM_LOAD ( "mks-u13.rom", 0x80000, 0x40000, CRC(7b7ec3b6) SHA1(6eec1b90d4a4855f34a7ebfbf93f3358d5627db4) )
@@ -2296,10 +2307,10 @@ ROM_START( mkprot4 )
ROM_END
ROM_START( mkyturbo )
- ROM_REGION( 0x50000, "adpcm", 0 ) /* sound CPU */
+ ROM_REGION( 0x50000, "adpcm:cpu", 0 ) /* sound CPU */
ROM_LOAD ( "mks-u3.rom", 0x10000, 0x40000, CRC(c615844c) SHA1(5732f9053a5f73b0cc3b0166d7dc4430829d5bc7) )
- ROM_REGION( 0x200000, "oki", 0 ) /* ADPCM */
+ ROM_REGION( 0x200000, "adpcm:oki", 0 ) /* ADPCM */
ROM_LOAD ( "mks-u12.rom", 0x00000, 0x40000, CRC(258bd7f9) SHA1(463890b23f17350fb9b8a85897b0777c45bc2d54) )
ROM_RELOAD( 0x40000, 0x40000 )
ROM_LOAD ( "mks-u13.rom", 0x80000, 0x40000, CRC(7b7ec3b6) SHA1(6eec1b90d4a4855f34a7ebfbf93f3358d5627db4) )
@@ -2328,10 +2339,10 @@ ROM_START( mkyturbo )
ROM_END
ROM_START( mkyturboe )
- ROM_REGION( 0x50000, "adpcm", 0 ) /* sound CPU */
+ ROM_REGION( 0x50000, "adpcm:cpu", 0 ) /* sound CPU */
ROM_LOAD ( "mks-u3.rom", 0x10000, 0x40000, CRC(c615844c) SHA1(5732f9053a5f73b0cc3b0166d7dc4430829d5bc7) )
- ROM_REGION( 0x200000, "oki", 0 ) /* ADPCM */
+ ROM_REGION( 0x200000, "adpcm:oki", 0 ) /* ADPCM */
ROM_LOAD ( "mks-u12.rom", 0x00000, 0x40000, CRC(258bd7f9) SHA1(463890b23f17350fb9b8a85897b0777c45bc2d54) )
ROM_RELOAD( 0x40000, 0x40000 )
ROM_LOAD ( "mks-u13.rom", 0x80000, 0x40000, CRC(7b7ec3b6) SHA1(6eec1b90d4a4855f34a7ebfbf93f3358d5627db4) )
@@ -2359,10 +2370,10 @@ ROM_START( mkyturboe )
ROM_END
ROM_START( mknifty )
- ROM_REGION( 0x50000, "adpcm", 0 ) /* sound CPU */
+ ROM_REGION( 0x50000, "adpcm:cpu", 0 ) /* sound CPU */
ROM_LOAD ( "mks-u3.rom", 0x10000, 0x40000, CRC(c615844c) SHA1(5732f9053a5f73b0cc3b0166d7dc4430829d5bc7) )
- ROM_REGION( 0x200000, "oki", 0 ) /* ADPCM */
+ ROM_REGION( 0x200000, "adpcm:oki", 0 ) /* ADPCM */
ROM_LOAD ( "mks-u12.rom", 0x00000, 0x40000, CRC(258bd7f9) SHA1(463890b23f17350fb9b8a85897b0777c45bc2d54) )
ROM_RELOAD( 0x40000, 0x40000 )
ROM_LOAD ( "mks-u13.rom", 0x80000, 0x40000, CRC(7b7ec3b6) SHA1(6eec1b90d4a4855f34a7ebfbf93f3358d5627db4) )
@@ -2390,10 +2401,10 @@ ROM_START( mknifty )
ROM_END
ROM_START( mknifty666 )
- ROM_REGION( 0x50000, "adpcm", 0 ) /* sound CPU */
+ ROM_REGION( 0x50000, "adpcm:cpu", 0 ) /* sound CPU */
ROM_LOAD ( "mks-u3.rom", 0x10000, 0x40000, CRC(c615844c) SHA1(5732f9053a5f73b0cc3b0166d7dc4430829d5bc7) )
- ROM_REGION( 0x200000, "oki", 0 ) /* ADPCM */
+ ROM_REGION( 0x200000, "adpcm:oki", 0 ) /* ADPCM */
ROM_LOAD ( "mks-u12.rom", 0x00000, 0x40000, CRC(258bd7f9) SHA1(463890b23f17350fb9b8a85897b0777c45bc2d54) )
ROM_RELOAD( 0x40000, 0x40000 )
ROM_LOAD ( "mks-u13.rom", 0x80000, 0x40000, CRC(7b7ec3b6) SHA1(6eec1b90d4a4855f34a7ebfbf93f3358d5627db4) )
@@ -2486,11 +2497,11 @@ ROM_END
ROM_START( term2 )
- ROM_REGION( 0x50000, "adpcm", 0 ) /* sound CPU */
+ ROM_REGION( 0x50000, "adpcm:cpu", 0 ) /* sound CPU */
ROM_LOAD ( "t2_snd.3", 0x10000, 0x20000, CRC(73c3f5c4) SHA1(978dd974590e77294dbe9a647aebd3d24af6397f) )
ROM_RELOAD ( 0x30000, 0x20000 )
- ROM_REGION( 0x200000, "oki", 0 ) /* ADPCM */
+ ROM_REGION( 0x200000, "adpcm:oki", 0 ) /* ADPCM */
ROM_LOAD ( "t2_snd.12", 0x00000, 0x40000, CRC(e192a40d) SHA1(1f7a0e282c0c8eb66cbe514128bd104433e53b7a) )
ROM_RELOAD( 0x40000, 0x40000 )
ROM_LOAD ( "t2_snd.13", 0x80000, 0x40000, CRC(956fa80b) SHA1(02ab504627f4b25a394fa4192bb134138cbf6a4f) )
@@ -2519,11 +2530,11 @@ ROM_END
ROM_START( term2la3 )
- ROM_REGION( 0x50000, "adpcm", 0 ) /* sound CPU */
+ ROM_REGION( 0x50000, "adpcm:cpu", 0 ) /* sound CPU */
ROM_LOAD ( "t2_snd.3", 0x10000, 0x20000, CRC(73c3f5c4) SHA1(978dd974590e77294dbe9a647aebd3d24af6397f) )
ROM_RELOAD ( 0x30000, 0x20000 )
- ROM_REGION( 0x200000, "oki", 0 ) /* ADPCM */
+ ROM_REGION( 0x200000, "adpcm:oki", 0 ) /* ADPCM */
ROM_LOAD ( "t2_snd.12", 0x00000, 0x40000, CRC(e192a40d) SHA1(1f7a0e282c0c8eb66cbe514128bd104433e53b7a) )
ROM_RELOAD( 0x40000, 0x40000 )
ROM_LOAD ( "t2_snd.13", 0x80000, 0x40000, CRC(956fa80b) SHA1(02ab504627f4b25a394fa4192bb134138cbf6a4f) )
@@ -2552,11 +2563,11 @@ ROM_END
ROM_START( term2la2 )
- ROM_REGION( 0x50000, "adpcm", 0 ) /* sound CPU */
+ ROM_REGION( 0x50000, "adpcm:cpu", 0 ) /* sound CPU */
ROM_LOAD ( "t2_snd.3", 0x10000, 0x20000, CRC(73c3f5c4) SHA1(978dd974590e77294dbe9a647aebd3d24af6397f) )
ROM_RELOAD ( 0x30000, 0x20000 )
- ROM_REGION( 0x200000, "oki", 0 ) /* ADPCM */
+ ROM_REGION( 0x200000, "adpcm:oki", 0 ) /* ADPCM */
ROM_LOAD ( "t2_snd.12", 0x00000, 0x40000, CRC(e192a40d) SHA1(1f7a0e282c0c8eb66cbe514128bd104433e53b7a) )
ROM_RELOAD( 0x40000, 0x40000 )
ROM_LOAD ( "t2_snd.13", 0x80000, 0x40000, CRC(956fa80b) SHA1(02ab504627f4b25a394fa4192bb134138cbf6a4f) )
@@ -2585,11 +2596,11 @@ ROM_END
ROM_START( term2la1 )
- ROM_REGION( 0x50000, "adpcm", 0 ) /* sound CPU */
+ ROM_REGION( 0x50000, "adpcm:cpu", 0 ) /* sound CPU */
ROM_LOAD ( "t2_snd.3", 0x10000, 0x20000, CRC(73c3f5c4) SHA1(978dd974590e77294dbe9a647aebd3d24af6397f) )
ROM_RELOAD ( 0x30000, 0x20000 )
- ROM_REGION( 0x200000, "oki", 0 ) /* ADPCM */
+ ROM_REGION( 0x200000, "adpcm:oki", 0 ) /* ADPCM */
ROM_LOAD ( "t2_snd.12", 0x00000, 0x40000, CRC(e192a40d) SHA1(1f7a0e282c0c8eb66cbe514128bd104433e53b7a) )
ROM_RELOAD( 0x40000, 0x40000 )
ROM_LOAD ( "t2_snd.13", 0x80000, 0x40000, CRC(956fa80b) SHA1(02ab504627f4b25a394fa4192bb134138cbf6a4f) )
@@ -2618,11 +2629,11 @@ ROM_END
ROM_START( totcarn )
- ROM_REGION( 0x50000, "adpcm", 0 ) /* sound CPU */
+ ROM_REGION( 0x50000, "adpcm:cpu", 0 ) /* sound CPU */
ROM_LOAD ( "tcu3.bin", 0x10000, 0x20000, CRC(5bdb4665) SHA1(c6b90b914785b8703790957cc4bb4983a332fba6) )
ROM_RELOAD ( 0x30000, 0x20000 )
- ROM_REGION( 0x200000, "oki", 0 ) /* ADPCM */
+ ROM_REGION( 0x200000, "adpcm:oki", 0 ) /* ADPCM */
ROM_LOAD ( "tcu12.bin", 0x00000, 0x40000, CRC(d0000ac7) SHA1(2d476c7727462623feb2f1a23fb797eaeed5ce30) )
ROM_RELOAD( 0x40000, 0x40000 )
ROM_LOAD ( "tcu13.bin", 0x80000, 0x40000, CRC(e48e6f0c) SHA1(bf7d548b6b1901966f99c815129ea160ef36f024) )
@@ -2651,11 +2662,11 @@ ROM_END
ROM_START( totcarnp )
- ROM_REGION( 0x50000, "adpcm", 0 ) /* sound CPU */
+ ROM_REGION( 0x50000, "adpcm:cpu", 0 ) /* sound CPU */
ROM_LOAD ( "tcu3.bin", 0x10000, 0x20000, CRC(5bdb4665) SHA1(c6b90b914785b8703790957cc4bb4983a332fba6) )
ROM_RELOAD ( 0x30000, 0x20000 )
- ROM_REGION( 0x200000, "oki", 0 ) /* ADPCM */
+ ROM_REGION( 0x200000, "adpcm:oki", 0 ) /* ADPCM */
ROM_LOAD ( "tcu12.bin", 0x00000, 0x40000, CRC(d0000ac7) SHA1(2d476c7727462623feb2f1a23fb797eaeed5ce30) )
ROM_RELOAD( 0x40000, 0x40000 )
ROM_LOAD ( "tcu13.bin", 0x80000, 0x40000, CRC(e48e6f0c) SHA1(bf7d548b6b1901966f99c815129ea160ef36f024) )
diff --git a/src/mame/drivers/mlanding.c b/src/mame/drivers/mlanding.c
index ef6e6a23547..c8cac766a3d 100644
--- a/src/mame/drivers/mlanding.c
+++ b/src/mame/drivers/mlanding.c
@@ -738,8 +738,8 @@ static const msm5205_interface msm5205_config =
static const ym2151_interface ym2151_config =
{
- irq_handler,
- sound_bankswitch_w
+ DEVCB_LINE(irq_handler),
+ DEVCB_HANDLER(sound_bankswitch_w)
};
static const tc0140syt_interface mlanding_tc0140syt_intf =
diff --git a/src/mame/drivers/mpu4.c b/src/mame/drivers/mpu4.c
index 1da7d967e14..dbc7fce1fb9 100644
--- a/src/mame/drivers/mpu4.c
+++ b/src/mame/drivers/mpu4.c
@@ -528,7 +528,7 @@ WRITE8_MEMBER(mpu4_state::bankswitch_w)
READ8_MEMBER(mpu4_state::bankswitch_r)
{
- return machine().memory().bank("bank1");
+ return machine().memory().bank("bank1")->entry();
}
diff --git a/src/mame/drivers/mugsmash.c b/src/mame/drivers/mugsmash.c
index 8f503818b47..8274c6e1835 100644
--- a/src/mame/drivers/mugsmash.c
+++ b/src/mame/drivers/mugsmash.c
@@ -396,7 +396,7 @@ static void irq_handler(device_t *device, int irq)
static const ym2151_interface ym2151_config =
{
- irq_handler
+ DEVCB_LINE(irq_handler)
};
static MACHINE_START( mugsmash )
diff --git a/src/mame/drivers/namcos1.c b/src/mame/drivers/namcos1.c
index e530e84bcfb..969dd5a4fb2 100644
--- a/src/mame/drivers/namcos1.c
+++ b/src/mame/drivers/namcos1.c
@@ -1063,7 +1063,7 @@ static void namcos1_sound_interrupt( device_t *device, int irq )
static const ym2151_interface ym2151_config =
{
- namcos1_sound_interrupt
+ DEVCB_LINE(namcos1_sound_interrupt)
};
static const namco_interface namco_config =
diff --git a/src/mame/drivers/nemesis.c b/src/mame/drivers/nemesis.c
index efb2e9edf6e..93444a321a5 100644
--- a/src/mame/drivers/nemesis.c
+++ b/src/mame/drivers/nemesis.c
@@ -1521,7 +1521,7 @@ static void sound_irq(device_t *device, int state)
static const ym2151_interface ym2151_config =
{
- sound_irq
+ DEVCB_LINE(sound_irq)
};
static const ym3812_interface ym3812_config =
diff --git a/src/mame/drivers/nmk16.c b/src/mame/drivers/nmk16.c
index cce970e29a0..cb12661c99e 100644
--- a/src/mame/drivers/nmk16.c
+++ b/src/mame/drivers/nmk16.c
@@ -4805,7 +4805,7 @@ static void irq_handler(device_t *device, int irq)
static const ym2151_interface afega_ym2151_intf =
{
- irq_handler
+ DEVCB_LINE(irq_handler)
};
diff --git a/src/mame/drivers/opwolf.c b/src/mame/drivers/opwolf.c
index ff671ed4e50..ee9da646674 100644
--- a/src/mame/drivers/opwolf.c
+++ b/src/mame/drivers/opwolf.c
@@ -699,8 +699,8 @@ static void irq_handler( device_t *device, int irq )
static const ym2151_interface ym2151_config =
{
- irq_handler,
- sound_bankswitch_w
+ DEVCB_LINE(irq_handler),
+ DEVCB_HANDLER(sound_bankswitch_w)
};
diff --git a/src/mame/drivers/rainbow.c b/src/mame/drivers/rainbow.c
index e4d4d8be686..14b41f69bc9 100644
--- a/src/mame/drivers/rainbow.c
+++ b/src/mame/drivers/rainbow.c
@@ -631,8 +631,8 @@ static void irqhandler( device_t *device, int irq )
static const ym2151_interface ym2151_config =
{
- irqhandler,
- bankswitch_w
+ DEVCB_LINE(irqhandler),
+ DEVCB_HANDLER(bankswitch_w)
};
diff --git a/src/mame/drivers/rastan.c b/src/mame/drivers/rastan.c
index 7265cb9f8f3..674a621bf78 100644
--- a/src/mame/drivers/rastan.c
+++ b/src/mame/drivers/rastan.c
@@ -346,8 +346,8 @@ static void irqhandler( device_t *device, int irq )
static const ym2151_interface ym2151_config =
{
- irqhandler,
- rastan_bankswitch_w
+ DEVCB_LINE(irqhandler),
+ DEVCB_HANDLER(rastan_bankswitch_w)
};
static const msm5205_interface msm5205_config =
diff --git a/src/mame/drivers/rohga.c b/src/mame/drivers/rohga.c
index 6fe6a17fb6d..3e62bafa40f 100644
--- a/src/mame/drivers/rohga.c
+++ b/src/mame/drivers/rohga.c
@@ -732,8 +732,8 @@ static WRITE8_DEVICE_HANDLER( sound_bankswitch_w )
static const ym2151_interface ym2151_config =
{
- sound_irq,
- sound_bankswitch_w
+ DEVCB_LINE(sound_irq),
+ DEVCB_HANDLER(sound_bankswitch_w)
};
/**********************************************************************************/
diff --git a/src/mame/drivers/rpunch.c b/src/mame/drivers/rpunch.c
index 06fc916c98e..f1cb0e2335e 100644
--- a/src/mame/drivers/rpunch.c
+++ b/src/mame/drivers/rpunch.c
@@ -449,7 +449,7 @@ GFXDECODE_END
static const ym2151_interface ym2151_config =
{
- ym2151_irq_gen
+ DEVCB_LINE(ym2151_irq_gen)
};
diff --git a/src/mame/drivers/segahang.c b/src/mame/drivers/segahang.c
index 98f5207cb24..9a4e57e066c 100644
--- a/src/mame/drivers/segahang.c
+++ b/src/mame/drivers/segahang.c
@@ -778,7 +778,7 @@ static const ym2203_interface ym2203_config =
static const ym2151_interface ym2151_config =
{
- sound_irq
+ DEVCB_LINE(sound_irq)
};
diff --git a/src/mame/drivers/segas16a.c b/src/mame/drivers/segas16a.c
index e6d61467187..eca68a68fe9 100644
--- a/src/mame/drivers/segas16a.c
+++ b/src/mame/drivers/segas16a.c
@@ -1936,8 +1936,8 @@ INPUT_PORTS_END
static const ym2151_interface ym2151_config =
{
- NULL,
- n7751_control_w
+ DEVCB_NULL,
+ DEVCB_HANDLER(n7751_control_w)
};
diff --git a/src/mame/drivers/segas24.c b/src/mame/drivers/segas24.c
index ba071ad542d..fb391f8549c 100644
--- a/src/mame/drivers/segas24.c
+++ b/src/mame/drivers/segas24.c
@@ -1933,7 +1933,7 @@ INPUT_PORTS_END
static const ym2151_interface ym2151_config =
{
- irq_ym
+ DEVCB_LINE(irq_ym)
};
diff --git a/src/mame/drivers/segaxbd.c b/src/mame/drivers/segaxbd.c
index 0cf4e1e522a..f2cdfb9e04b 100644
--- a/src/mame/drivers/segaxbd.c
+++ b/src/mame/drivers/segaxbd.c
@@ -1236,7 +1236,7 @@ INPUT_PORTS_END
static const ym2151_interface ym2151_config =
{
- sound_cpu_irq
+ DEVCB_LINE(sound_cpu_irq)
};
diff --git a/src/mame/drivers/segaybd.c b/src/mame/drivers/segaybd.c
index 47fcb0f8542..dbc182ad20a 100644
--- a/src/mame/drivers/segaybd.c
+++ b/src/mame/drivers/segaybd.c
@@ -917,7 +917,7 @@ INPUT_PORTS_END
static const ym2151_interface ym2151_config =
{
- sound_cpu_irq
+ DEVCB_LINE(sound_cpu_irq)
};
diff --git a/src/mame/drivers/sf.c b/src/mame/drivers/sf.c
index 45408cf49b7..feb9ff4428e 100644
--- a/src/mame/drivers/sf.c
+++ b/src/mame/drivers/sf.c
@@ -794,7 +794,7 @@ static void irq_handler( device_t *device, int irq )
static const ym2151_interface ym2151_config =
{
- irq_handler
+ DEVCB_LINE(irq_handler)
};
static const msm5205_interface msm5205_config =
diff --git a/src/mame/drivers/shadfrce.c b/src/mame/drivers/shadfrce.c
index 9bac216d535..69f95a7e779 100644
--- a/src/mame/drivers/shadfrce.c
+++ b/src/mame/drivers/shadfrce.c
@@ -550,7 +550,7 @@ static void irq_handler(device_t *device, int irq)
static const ym2151_interface ym2151_config =
{
- irq_handler
+ DEVCB_LINE(irq_handler)
};
static MACHINE_CONFIG_START( shadfrce, shadfrce_state )
diff --git a/src/mame/drivers/shisen.c b/src/mame/drivers/shisen.c
index b1ad0221e43..43db2cae734 100644
--- a/src/mame/drivers/shisen.c
+++ b/src/mame/drivers/shisen.c
@@ -204,7 +204,7 @@ GFXDECODE_END
static const ym2151_interface ym2151_config =
{
- m72_ym2151_irq_handler
+ DEVCB_LINE(m72_ym2151_irq_handler)
};
diff --git a/src/mame/drivers/sidearms.c b/src/mame/drivers/sidearms.c
index f4fdd3157b7..a325eb98fa9 100644
--- a/src/mame/drivers/sidearms.c
+++ b/src/mame/drivers/sidearms.c
@@ -649,7 +649,7 @@ static const ym2203_interface ym2203_config =
static const ym2151_interface whizz_ym2151_interface =
{
- irqhandler
+ DEVCB_LINE(irqhandler)
};
static MACHINE_CONFIG_START( sidearms, sidearms_state )
diff --git a/src/mame/drivers/silvmil.c b/src/mame/drivers/silvmil.c
index d4951002caf..f947d85c0b1 100644
--- a/src/mame/drivers/silvmil.c
+++ b/src/mame/drivers/silvmil.c
@@ -307,7 +307,7 @@ static void silvmil_irqhandler( device_t *device, int irq )
static const ym2151_interface silvmil_ym2151_interface =
{
- silvmil_irqhandler
+ DEVCB_LINE(silvmil_irqhandler)
};
diff --git a/src/mame/drivers/snowbros.c b/src/mame/drivers/snowbros.c
index 7cf4637cb5f..f7fa1ec161f 100644
--- a/src/mame/drivers/snowbros.c
+++ b/src/mame/drivers/snowbros.c
@@ -1509,7 +1509,7 @@ static const ym3812_interface ym3812_config =
static const ym2151_interface ym2151_config =
{
- irqhandler
+ DEVCB_LINE(irqhandler)
};
diff --git a/src/mame/drivers/supbtime.c b/src/mame/drivers/supbtime.c
index 7f06944b694..c6ec233eb12 100644
--- a/src/mame/drivers/supbtime.c
+++ b/src/mame/drivers/supbtime.c
@@ -316,7 +316,7 @@ static void sound_irq(device_t *device, int state)
static const ym2151_interface ym2151_config =
{
- sound_irq
+ DEVCB_LINE(sound_irq)
};
static const deco16ic_interface supbtime_deco16ic_tilegen1_intf =
diff --git a/src/mame/drivers/surpratk.c b/src/mame/drivers/surpratk.c
index 64092447f7a..82c688f97df 100644
--- a/src/mame/drivers/surpratk.c
+++ b/src/mame/drivers/surpratk.c
@@ -166,7 +166,7 @@ static void irqhandler( device_t *device, int linestate )
static const ym2151_interface ym2151_config =
{
- irqhandler
+ DEVCB_LINE(irqhandler)
};
diff --git a/src/mame/drivers/taito_x.c b/src/mame/drivers/taito_x.c
index ba3b1b74acf..a03a9b1653d 100644
--- a/src/mame/drivers/taito_x.c
+++ b/src/mame/drivers/taito_x.c
@@ -794,7 +794,7 @@ static const ym2610_interface ym2610_config =
static const ym2151_interface ym2151_config =
{
- irqhandler
+ DEVCB_LINE(irqhandler)
};
static MACHINE_START( taitox )
diff --git a/src/mame/drivers/tatsumi.c b/src/mame/drivers/tatsumi.c
index 2ff8289ba2f..177b7644677 100644
--- a/src/mame/drivers/tatsumi.c
+++ b/src/mame/drivers/tatsumi.c
@@ -846,7 +846,7 @@ static void sound_irq(device_t *device, int state)
static const ym2151_interface ym2151_config =
{
- sound_irq
+ DEVCB_LINE(sound_irq)
};
static INTERRUPT_GEN( roundup5_interrupt )
diff --git a/src/mame/drivers/tecmo16.c b/src/mame/drivers/tecmo16.c
index eaf9a9faf38..2a93f8ddda3 100644
--- a/src/mame/drivers/tecmo16.c
+++ b/src/mame/drivers/tecmo16.c
@@ -368,7 +368,7 @@ static void irqhandler(device_t *device, int irq)
static const ym2151_interface ym2151_config =
{
- irqhandler
+ DEVCB_LINE(irqhandler)
};
/******************************************************************************/
diff --git a/src/mame/drivers/tmnt.c b/src/mame/drivers/tmnt.c
index 212bfef6569..9207690ea9f 100644
--- a/src/mame/drivers/tmnt.c
+++ b/src/mame/drivers/tmnt.c
@@ -2038,7 +2038,7 @@ static void cuebrick_irq_handler( device_t *device, int state )
static const ym2151_interface ym2151_interface_cbj =
{
- cuebrick_irq_handler
+ DEVCB_LINE(cuebrick_irq_handler)
};
static void volume_callback(device_t *device, int v)
diff --git a/src/mame/drivers/topspeed.c b/src/mame/drivers/topspeed.c
index 95784c70203..9c43404c465 100644
--- a/src/mame/drivers/topspeed.c
+++ b/src/mame/drivers/topspeed.c
@@ -621,8 +621,8 @@ static void irq_handler( device_t *device, int irq ) /* assumes Z80 sandwiched b
static const ym2151_interface ym2151_config =
{
- irq_handler,
- sound_bankswitch_w
+ DEVCB_LINE(irq_handler),
+ DEVCB_HANDLER(sound_bankswitch_w)
};
static const msm5205_interface msm5205_config =
diff --git a/src/mame/drivers/tumbleb.c b/src/mame/drivers/tumbleb.c
index 665995f840f..95e9070b2a8 100644
--- a/src/mame/drivers/tumbleb.c
+++ b/src/mame/drivers/tumbleb.c
@@ -2219,7 +2219,7 @@ static void semicom_irqhandler( device_t *device, int irq )
static const ym2151_interface semicom_ym2151_interface =
{
- semicom_irqhandler
+ DEVCB_LINE(semicom_irqhandler)
};
static MACHINE_RESET (htchctch)
diff --git a/src/mame/drivers/tumblep.c b/src/mame/drivers/tumblep.c
index ca595e5bc76..ec9ed274f33 100644
--- a/src/mame/drivers/tumblep.c
+++ b/src/mame/drivers/tumblep.c
@@ -280,7 +280,7 @@ static void sound_irq(device_t *device, int state)
static const ym2151_interface ym2151_config =
{
- sound_irq
+ DEVCB_LINE(sound_irq)
};
static const deco16ic_interface tumblep_deco16ic_tilegen1_intf =
diff --git a/src/mame/drivers/vaportra.c b/src/mame/drivers/vaportra.c
index 039f05d4b3f..6af2312ec41 100644
--- a/src/mame/drivers/vaportra.c
+++ b/src/mame/drivers/vaportra.c
@@ -207,7 +207,7 @@ static void sound_irq( device_t *device, int state )
static const ym2151_interface ym2151_config =
{
- sound_irq
+ DEVCB_LINE(sound_irq)
};
diff --git a/src/mame/drivers/vball.c b/src/mame/drivers/vball.c
index 3f3e154d1e4..c42949876ed 100644
--- a/src/mame/drivers/vball.c
+++ b/src/mame/drivers/vball.c
@@ -401,7 +401,7 @@ static void vball_irq_handler(device_t *device, int irq)
static const ym2151_interface ym2151_config =
{
- vball_irq_handler
+ DEVCB_LINE(vball_irq_handler)
};
diff --git a/src/mame/drivers/vigilant.c b/src/mame/drivers/vigilant.c
index 893663c1ca7..5b9d7b92dc9 100644
--- a/src/mame/drivers/vigilant.c
+++ b/src/mame/drivers/vigilant.c
@@ -463,7 +463,7 @@ GFXDECODE_END
static const ym2151_interface ym2151_config =
{
- m72_ym2151_irq_handler
+ DEVCB_LINE(m72_ym2151_irq_handler)
};
static const ym2203_interface ym2203_config =
diff --git a/src/mame/drivers/williams.c b/src/mame/drivers/williams.c
index abb60f7101d..39b1045d97e 100644
--- a/src/mame/drivers/williams.c
+++ b/src/mame/drivers/williams.c
@@ -493,7 +493,6 @@
#include "sound/hc55516.h"
#include "machine/6821pia.h"
#include "machine/ticket.h"
-#include "audio/williams.h"
#include "includes/williams.h"
#include "machine/nvram.h"
@@ -1694,8 +1693,8 @@ MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( joust2, williams2 )
/* basic machine hardware */
- MCFG_DEVICE_REMOVE("mono")
- MCFG_FRAGMENT_ADD(williams_cvsd_sound)
+ MCFG_WILLIAMS_CVSD_SOUND_ADD("cvsd")
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MCFG_MACHINE_START(joust2)
MCFG_MACHINE_RESET(joust2)
@@ -2678,7 +2677,7 @@ ROM_START( joust2 )
ROM_LOAD( "ic08_r1.cpu", 0x0E000, 0x2000, CRC(84517c3c) SHA1(de0b6473953783c091ddcc7aaa89fc1ec3b9d378) ) /* IC08 ROM08 */
/* sound board */
- ROM_REGION( 0x90000, "cvsdcpu", 0 )
+ ROM_REGION( 0x90000, "cvsd:cpu", 0 )
ROM_LOAD( "u04_r1.snd", 0x10000, 0x8000, CRC(3af6b47d) SHA1(aff19d65a4d9c249dec6a9e04a4066fada0f8fa1) ) /* IC04 ROM23 */
ROM_RELOAD( 0x18000, 0x8000 )
ROM_RELOAD( 0x20000, 0x8000 )
diff --git a/src/mame/drivers/wwfsstar.c b/src/mame/drivers/wwfsstar.c
index 7f37aec88e4..a11c6f72c1d 100644
--- a/src/mame/drivers/wwfsstar.c
+++ b/src/mame/drivers/wwfsstar.c
@@ -414,7 +414,7 @@ static void wwfsstar_ymirq_handler(device_t *device, int irq)
static const ym2151_interface ym2151_config =
{
- wwfsstar_ymirq_handler
+ DEVCB_LINE(wwfsstar_ymirq_handler)
};
/*******************************************************************************
diff --git a/src/mame/drivers/wwfwfest.c b/src/mame/drivers/wwfwfest.c
index 0eae2099caa..ac6083a777a 100644
--- a/src/mame/drivers/wwfwfest.c
+++ b/src/mame/drivers/wwfwfest.c
@@ -374,7 +374,7 @@ static void dd3_ymirq_handler(device_t *device, int irq)
static const ym2151_interface ym2151_config =
{
- dd3_ymirq_handler
+ DEVCB_LINE(dd3_ymirq_handler)
};
/*******************************************************************************
diff --git a/src/mame/includes/mcr68.h b/src/mame/includes/mcr68.h
index fac9a5ba89e..5146b096654 100644
--- a/src/mame/includes/mcr68.h
+++ b/src/mame/includes/mcr68.h
@@ -1,4 +1,6 @@
#include "machine/6821pia.h"
+#include "audio/midway.h"
+#include "audio/williams.h"
struct counter_state
{
@@ -18,12 +20,14 @@ public:
m_chip_squeak_deluxe(*this, "csd"),
m_sounds_good(*this, "sg"),
m_turbo_chip_squeak(*this, "tcs"),
+ m_cvsd_sound(*this, "cvsd"),
m_videoram(*this, "videoram"),
m_spriteram(*this, "spriteram") { }
optional_device<midway_chip_squeak_deluxe_device> m_chip_squeak_deluxe;
optional_device<midway_sounds_good_device> m_sounds_good;
optional_device<midway_turbo_chip_squeak_device> m_turbo_chip_squeak;
+ optional_device<williams_cvsd_sound_device> m_cvsd_sound;
required_shared_ptr<UINT16> m_videoram;
required_shared_ptr<UINT16> m_spriteram;
diff --git a/src/mame/includes/midtunit.h b/src/mame/includes/midtunit.h
index 1c5c06d4535..967598c7515 100644
--- a/src/mame/includes/midtunit.h
+++ b/src/mame/includes/midtunit.h
@@ -4,14 +4,22 @@
**************************************************************************/
+#include "audio/williams.h"
+#include "audio/dcs.h"
+
class midtunit_state : public driver_device
{
public:
midtunit_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
- m_nvram(*this, "nvram") { }
+ m_nvram(*this, "nvram"),
+ m_cvsd_sound(*this, "cvsd"),
+ m_adpcm_sound(*this, "adpcm") { }
required_shared_ptr<UINT16> m_nvram;
+ optional_device<williams_cvsd_sound_device> m_cvsd_sound;
+ optional_device<williams_adpcm_sound_device> m_adpcm_sound;
+
DECLARE_WRITE16_MEMBER(midtunit_cmos_enable_w);
DECLARE_WRITE16_MEMBER(midtunit_cmos_w);
DECLARE_READ16_MEMBER(midtunit_cmos_r);
diff --git a/src/mame/includes/midyunit.h b/src/mame/includes/midyunit.h
index 962f582c61d..35d00a68b7a 100644
--- a/src/mame/includes/midyunit.h
+++ b/src/mame/includes/midyunit.h
@@ -5,6 +5,7 @@
**************************************************************************/
#include "cpu/tms34010/tms34010.h"
+#include "audio/williams.h"
#include "machine/nvram.h"
/* protection data types */
@@ -32,8 +33,15 @@ class midyunit_state : public driver_device
public:
midyunit_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
+ m_narc_sound(*this, "narcsnd"),
+ m_cvsd_sound(*this, "cvsd"),
+ m_adpcm_sound(*this, "adpcm"),
m_gfx_rom(*this, "gfx_rom", 16) { }
+ optional_device<williams_narc_sound_device> m_narc_sound;
+ optional_device<williams_cvsd_sound_device> m_cvsd_sound;
+ optional_device<williams_adpcm_sound_device> m_adpcm_sound;
+
UINT16 *m_cmos_ram;
UINT32 m_cmos_page;
optional_shared_ptr<UINT8> m_gfx_rom;
diff --git a/src/mame/includes/williams.h b/src/mame/includes/williams.h
index 8f20356a029..3e8dbe8db6e 100644
--- a/src/mame/includes/williams.h
+++ b/src/mame/includes/williams.h
@@ -6,18 +6,22 @@
#include "machine/6821pia.h"
+#include "audio/williams.h"
class williams_state : public driver_device
{
public:
williams_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
+ m_cvsd_sound(*this, "cvsd"),
m_nvram(*this, "nvram") ,
m_videoram(*this, "videoram"),
m_blaster_palette_0(*this, "blaster_pal0"),
m_blaster_scanline_control(*this, "blaster_scan"),
m_williams2_tileram(*this, "williams2_tile"){ }
+ optional_device<williams_cvsd_sound_device> m_cvsd_sound;
+
required_shared_ptr<UINT8> m_nvram;
UINT8 *m_mayday_protection;
required_shared_ptr<UINT8> m_videoram;
diff --git a/src/mame/machine/mcr.c b/src/mame/machine/mcr.c
index 414ceae814e..a3c93da7628 100644
--- a/src/mame/machine/mcr.c
+++ b/src/mame/machine/mcr.c
@@ -174,9 +174,6 @@ MACHINE_RESET( mcr )
{
/* reset cocktail flip */
mcr_cocktail_flip = 0;
-
- /* initialize the sound */
- mcr_sound_reset(machine);
}
diff --git a/src/mame/machine/mcr68.c b/src/mame/machine/mcr68.c
index 7b64a0c12cf..81f22c400b0 100644
--- a/src/mame/machine/mcr68.c
+++ b/src/mame/machine/mcr68.c
@@ -171,9 +171,6 @@ static void mcr68_common_init(running_machine &machine)
/* initialize the clock */
state->m_m6840_internal_counter_period = attotime::from_hz(machine.device("maincpu")->unscaled_clock() / 10);
-
- /* initialize the sound */
- mcr_sound_reset(machine);
}
diff --git a/src/mame/machine/midtunit.c b/src/mame/machine/midtunit.c
index 87c1918a8be..78e4e27fd99 100644
--- a/src/mame/machine/midtunit.c
+++ b/src/mame/machine/midtunit.c
@@ -7,8 +7,6 @@
#include "emu.h"
#include "cpu/tms34010/tms34010.h"
#include "cpu/m6809/m6809.h"
-#include "audio/williams.h"
-#include "audio/dcs.h"
#include "includes/midtunit.h"
@@ -434,7 +432,6 @@ static void init_tunit_generic(running_machine &machine, int sound)
{
case SOUND_ADPCM:
case SOUND_ADPCM_LARGE:
- williams_adpcm_init(machine);
break;
case SOUND_DCS:
@@ -466,7 +463,7 @@ DRIVER_INIT( mktunit )
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0x1b00000, 0x1b6ffff, read16_delegate(FUNC(midtunit_state::mk_prot_r),state), write16_delegate(FUNC(midtunit_state::mk_prot_w),state));
/* sound chip protection (hidden RAM) */
- machine.device("adpcm")->memory().space(AS_PROGRAM)->install_ram(0xfb9c, 0xfbc6);
+ machine.device("adpcm:cpu")->memory().space(AS_PROGRAM)->install_ram(0xfb9c, 0xfbc6);
}
DRIVER_INIT( mkturbo )
@@ -499,9 +496,9 @@ static void init_nbajam_common(running_machine &machine, int te_protection)
/* sound chip protection (hidden RAM) */
if (!te_protection)
- machine.device("adpcm")->memory().space(AS_PROGRAM)->install_ram(0xfbaa, 0xfbd4);
+ machine.device("adpcm:cpu")->memory().space(AS_PROGRAM)->install_ram(0xfbaa, 0xfbd4);
else
- machine.device("adpcm")->memory().space(AS_PROGRAM)->install_ram(0xfbec, 0xfc16);
+ machine.device("adpcm:cpu")->memory().space(AS_PROGRAM)->install_ram(0xfbec, 0xfc16);
}
DRIVER_INIT( nbajam )
@@ -527,8 +524,8 @@ DRIVER_INIT( jdreddp )
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0x1b00000, 0x1bfffff, read16_delegate(FUNC(midtunit_state::jdredd_prot_r),state), write16_delegate(FUNC(midtunit_state::jdredd_prot_w),state));
/* sound chip protection (hidden RAM) */
- machine.device("adpcm")->memory().space(AS_PROGRAM)->install_read_bank(0xfbcf, 0xfbf9, "bank7");
- machine.device("adpcm")->memory().space(AS_PROGRAM)->install_write_bank(0xfbcf, 0xfbf9, "bank9");
+ machine.device("adpcm:cpu")->memory().space(AS_PROGRAM)->install_read_bank(0xfbcf, 0xfbf9, "bank7");
+ machine.device("adpcm:cpu")->memory().space(AS_PROGRAM)->install_write_bank(0xfbcf, 0xfbf9, "bank9");
memory_set_bankptr(machine, "bank9", auto_alloc_array(machine, UINT8, 0x80));
#if ENABLE_ALL_JDREDD_LEVELS
@@ -574,13 +571,14 @@ DRIVER_INIT( mk2 )
MACHINE_RESET( midtunit )
{
+ midtunit_state *state = machine.driver_data<midtunit_state>();
/* reset sound */
switch (chip_type)
{
case SOUND_ADPCM:
case SOUND_ADPCM_LARGE:
- williams_adpcm_reset_w(machine, 1);
- williams_adpcm_reset_w(machine, 0);
+ state->m_adpcm_sound->reset_write(1);
+ state->m_adpcm_sound->reset_write(0);
break;
case SOUND_DCS:
@@ -633,13 +631,14 @@ WRITE16_MEMBER(midtunit_state::midtunit_sound_w)
}
/* call through based on the sound type */
+ midtunit_state *state = space.machine().driver_data<midtunit_state>();
if (ACCESSING_BITS_0_7 && ACCESSING_BITS_8_15)
switch (chip_type)
{
case SOUND_ADPCM:
case SOUND_ADPCM_LARGE:
- williams_adpcm_reset_w(machine(), ~data & 0x100);
- williams_adpcm_data_w(machine(), data & 0xff);
+ state->m_adpcm_sound->reset_write(~data & 0x100);
+ state->m_adpcm_sound->write(space, offset, data & 0xff);
/* the games seem to check for $82 loops, so this should be just barely enough */
fake_sound_state = 128;
diff --git a/src/mame/machine/midyunit.c b/src/mame/machine/midyunit.c
index cb9c965c462..0c56cd56ace 100644
--- a/src/mame/machine/midyunit.c
+++ b/src/mame/machine/midyunit.c
@@ -7,7 +7,6 @@
#include "emu.h"
#include "cpu/tms34010/tms34010.h"
#include "cpu/m6809/m6809.h"
-#include "audio/williams.h"
#include "includes/midyunit.h"
@@ -172,8 +171,8 @@ WRITE16_MEMBER(midyunit_state::term2_sound_w)
if (offset == 0)
m_term2_analog_select = (data >> 12) & 3;
- williams_adpcm_reset_w(machine(), (~data & 0x100) >> 1);
- williams_adpcm_data_w(machine(), data);
+ m_adpcm_sound->reset_write((~data & 0x100) >> 1);
+ m_adpcm_sound->write(space, offset, data);
}
@@ -298,24 +297,20 @@ static void init_generic(running_machine &machine, int bpp, int sound, int prot_
switch (sound)
{
case SOUND_CVSD_SMALL:
- williams_cvsd_init(machine);
- machine.device("cvsdcpu")->memory().space(AS_PROGRAM)->install_write_handler(prot_start, prot_end, write8_delegate(FUNC(midyunit_state::cvsd_protection_w),state));
+ machine.device("cvsd:cpu")->memory().space(AS_PROGRAM)->install_write_handler(prot_start, prot_end, write8_delegate(FUNC(midyunit_state::cvsd_protection_w),state));
state->m_cvsd_protection_base = machine.region("cvsdcpu")->base() + 0x10000 + (prot_start - 0x8000);
break;
case SOUND_CVSD:
- williams_cvsd_init(machine);
- machine.device("cvsdcpu")->memory().space(AS_PROGRAM)->install_ram(prot_start, prot_end);
+ machine.device("cvsd:cpu")->memory().space(AS_PROGRAM)->install_ram(prot_start, prot_end);
break;
case SOUND_ADPCM:
- williams_adpcm_init(machine);
- machine.device("adpcm")->memory().space(AS_PROGRAM)->install_ram(prot_start, prot_end);
+ machine.device("adpcm:cpu")->memory().space(AS_PROGRAM)->install_ram(prot_start, prot_end);
break;
case SOUND_NARC:
- williams_narc_init(machine);
- machine.device("narc1cpu")->memory().space(AS_PROGRAM)->install_ram(prot_start, prot_end);
+ machine.device("narcsnd:cpu0")->memory().space(AS_PROGRAM)->install_ram(prot_start, prot_end);
break;
case SOUND_YAWDIM:
@@ -559,19 +554,19 @@ MACHINE_RESET( midyunit )
switch (state->m_chip_type)
{
case SOUND_NARC:
- williams_narc_reset_w(machine, 1);
- williams_narc_reset_w(machine, 0);
+ state->m_narc_sound->reset_write(1);
+ state->m_narc_sound->reset_write(0);
break;
case SOUND_CVSD:
case SOUND_CVSD_SMALL:
- williams_cvsd_reset_w(machine, 1);
- williams_cvsd_reset_w(machine, 0);
+ state->m_cvsd_sound->reset_write(1);
+ state->m_cvsd_sound->reset_write(0);
break;
case SOUND_ADPCM:
- williams_adpcm_reset_w(machine, 1);
- williams_adpcm_reset_w(machine, 0);
+ state->m_adpcm_sound->reset_write(1);
+ state->m_adpcm_sound->reset_write(0);
break;
case SOUND_YAWDIM:
@@ -601,18 +596,18 @@ WRITE16_MEMBER(midyunit_state::midyunit_sound_w)
switch (m_chip_type)
{
case SOUND_NARC:
- williams_narc_data_w(machine(), data);
+ m_narc_sound->write(space, offset, data);
break;
case SOUND_CVSD_SMALL:
case SOUND_CVSD:
- williams_cvsd_reset_w(machine(), (~data & 0x100) >> 8);
- williams_cvsd_data_w(machine(), (data & 0xff) | ((data & 0x200) >> 1));
+ m_cvsd_sound->reset_write((~data & 0x100) >> 8);
+ m_cvsd_sound->write(space, offset, (data & 0xff) | ((data & 0x200) >> 1));
break;
case SOUND_ADPCM:
- williams_adpcm_reset_w(machine(), (~data & 0x100) >> 8);
- williams_adpcm_data_w(machine(), data);
+ m_adpcm_sound->reset_write((~data & 0x100) >> 8);
+ m_adpcm_sound->write(space, offset, data);
break;
case SOUND_YAWDIM:
diff --git a/src/mame/machine/williams.c b/src/mame/machine/williams.c
index 8edd711077e..fe8ecf3b40a 100644
--- a/src/mame/machine/williams.c
+++ b/src/mame/machine/williams.c
@@ -5,7 +5,6 @@
***************************************************************************/
#include "emu.h"
-#include "audio/williams.h"
#include "cpu/m6800/m6800.h"
#include "cpu/m6809/m6809.h"
#include "machine/6821pia.h"
@@ -988,18 +987,13 @@ MACHINE_START( joust2 )
{
williams_state *state = machine.driver_data<williams_state>();
MACHINE_START_CALL(williams2);
- williams_cvsd_init(machine);
state_save_register_global(machine, state->m_joust2_current_sound_data);
}
MACHINE_RESET( joust2 )
{
- pia6821_device *pia_3 = machine.device<pia6821_device>("cvsdpia");
-
- /* standard init */
MACHINE_RESET_CALL(williams2);
- pia_3->ca1_w(1);
}
@@ -1013,10 +1007,8 @@ static TIMER_CALLBACK( joust2_deferred_snd_cmd_w )
static WRITE8_DEVICE_HANDLER( joust2_pia_3_cb1_w )
{
williams_state *state = device->machine().driver_data<williams_state>();
- pia6821_device *pia_3 = device->machine().device<pia6821_device>("cvsdpia");
-
state->m_joust2_current_sound_data = (state->m_joust2_current_sound_data & ~0x100) | ((data << 8) & 0x100);
- pia_3->cb1_w(data);
+ state->m_cvsd_sound->write(*device->machine().memory().first_space(), 0, state->m_joust2_current_sound_data);
}
@@ -1024,6 +1016,6 @@ static WRITE8_DEVICE_HANDLER( joust2_snd_cmd_w )
{
williams_state *state = device->machine().driver_data<williams_state>();
state->m_joust2_current_sound_data = (state->m_joust2_current_sound_data & ~0xff) | (data & 0xff);
- williams_cvsd_data_w(device->machine(), state->m_joust2_current_sound_data);
+ state->m_cvsd_sound->write(*device->machine().memory().first_space(), 0, state->m_joust2_current_sound_data);
device->machine().scheduler().synchronize(FUNC(joust2_deferred_snd_cmd_w), state->m_joust2_current_sound_data);
}