summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/bionicc.c
diff options
context:
space:
mode:
author Aaron Giles <aaron@aarongiles.com>2012-10-14 06:28:35 +0000
committer Aaron Giles <aaron@aarongiles.com>2012-10-14 06:28:35 +0000
commitecfbeb7fd0e5d13dfb99b9abd3c4d17b539dc655 (patch)
treef34beae335fab79d570e7b4e8c1abb25334d644e /src/mame/drivers/bionicc.c
parent85f1df0adcf8eb926e46fb7867651198f48fc968 (diff)
Created a base class delegate_common_base for all delegate
types. Created a binding_type_exception which is thrown when a bind attempt fails due to mismatched types. Added helper templates to driver_device to wrap legacy device read/write handlers into driver_device member functions. This should help move some things forward until more common code is converted into proper devices. Introduce new module devcb2 which contains modernized versions of devcb. Compared to previous implementation this one is simpler overall, trampolining calls through a single internal set of adapter functions. The new versions are also designed to be specified in the machine_config rather than in structures, so they are no longer simple POD types. Additional new/changed features: * reads and writes can map to delegates for line or 8/16/32/64-bit * reads and writes can map to an I/O port * reads can be mapped to a constant value, with or without logging * writes can be mapped to a device's input line * all reads/writes can have a shift, mask, and/or xor applied * devices can opt to make the functions safe-if-NULL when resolving * only member function types are supported Rewrote the YM2151 interface to be fully modernized, and removed the ym2151_interface struct in favor of inline configs using the new devcb2 mechanism. In many cases, removed no longer needed trampolines, instead taking advantage of direct support for input line writes.
Diffstat (limited to 'src/mame/drivers/bionicc.c')
-rw-r--r--src/mame/drivers/bionicc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mame/drivers/bionicc.c b/src/mame/drivers/bionicc.c
index e4e069d3160..7ff9a21c70e 100644
--- a/src/mame/drivers/bionicc.c
+++ b/src/mame/drivers/bionicc.c
@@ -163,7 +163,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, bionicc_state )
AM_RANGE(0x0000, 0x7fff) AM_ROM
- AM_RANGE(0x8000, 0x8001) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w)
+ AM_RANGE(0x8000, 0x8001) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_byte_r)
AM_RANGE(0xc000, 0xc7ff) AM_RAM
ADDRESS_MAP_END
@@ -382,7 +382,7 @@ static MACHINE_CONFIG_START( bionicc, bionicc_state )
MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_SOUND_ADD("ymsnd", YM2151, 3579545)
+ MCFG_YM2151_ADD("ymsnd", 3579545)
MCFG_SOUND_ROUTE(0, "mono", 0.60)
MCFG_SOUND_ROUTE(1, "mono", 0.60)
MACHINE_CONFIG_END