summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/bzone.c
diff options
context:
space:
mode:
author Aaron Giles <aaron@aarongiles.com>2010-10-14 05:09:21 +0000
committer Aaron Giles <aaron@aarongiles.com>2010-10-14 05:09:21 +0000
commit4355bf0017e3848b992b95af25adddad21e22cbd (patch)
tree8cf413ff395fe26f8b07f0db324bc35fbefc3e49 /src/mame/drivers/bzone.c
parentaef77af2cf9e737c6f9eb7d99f6d923c444c543b (diff)
Update driver-specific sound devices to use tokens and store
their state like other devices. [Atari Ace] -- From: Atari Ace <atari_ace@frontier.com> Date: Mon, Oct 11, 2010 at 12:32 AM Subject: [patch] Audio device conversions To: submit@mamedev.org Cc: atariace@hotmail.com Hi mamedev, I've been working on auto-converting the majority of the remaining drivers to use driver_data (by finding global and static state and moving it to a state class programmatically), but a number of issues make it tricky to do. One problem is the various audio device drivers that are in src\mame\audio that don't encapsulate their state and thus get pulled accidentally into the driver_device by my scripts. Here's a patch that fixes most of them. The first patch makes sure the interface is always a device (mostly changing space handler to device handlers) and does some minor cleanup. The second patch then places the state into an appropriate token. ~aa
Diffstat (limited to 'src/mame/drivers/bzone.c')
-rw-r--r--src/mame/drivers/bzone.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/mame/drivers/bzone.c b/src/mame/drivers/bzone.c
index 1f3ca592ccd..f320f928a72 100644
--- a/src/mame/drivers/bzone.c
+++ b/src/mame/drivers/bzone.c
@@ -216,7 +216,7 @@
static UINT8 analog_data;
-UINT8 rb_input_select;
+static UINT8 rb_input_select;
@@ -284,6 +284,12 @@ static READ8_DEVICE_HANDLER( redbaron_joy_r )
return input_port_read(device->machine, rb_input_select ? "FAKE1" : "FAKE2");
}
+static WRITE8_DEVICE_HANDLER( redbaron_joysound_w )
+{
+ rb_input_select = data & 1;
+ redbaron_sounds_w(device, offset, data);
+}
+
/*************************************
@@ -326,7 +332,7 @@ static ADDRESS_MAP_START( redbaron_map, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x1802, 0x1802) AM_READ_PORT("IN4")
AM_RANGE(0x1804, 0x1804) AM_DEVREAD("mathbox", mathbox_lo_r)
AM_RANGE(0x1806, 0x1806) AM_DEVREAD("mathbox", mathbox_hi_r)
- AM_RANGE(0x1808, 0x1808) AM_WRITE(redbaron_sounds_w) /* and select joystick pot also */
+ AM_RANGE(0x1808, 0x1808) AM_DEVWRITE("custom", redbaron_joysound_w) /* and select joystick pot also */
AM_RANGE(0x180a, 0x180a) AM_WRITENOP /* sound reset, yet todo */
AM_RANGE(0x180c, 0x180c) AM_DEVWRITE("earom", atari_vg_earom_ctrl_w)
AM_RANGE(0x1810, 0x181f) AM_DEVREADWRITE("pokey", pokey_r, pokey_w)