summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/sound/sid6581.c
diff options
context:
space:
mode:
author Aaron Giles <aaron@aarongiles.com>2009-01-18 20:24:42 +0000
committer Aaron Giles <aaron@aarongiles.com>2009-01-18 20:24:42 +0000
commit170b4c27522f3ed0c3af90e0e24e45659f0ea763 (patch)
treeebf0563c6f0a9f8b48040beec2543e5b5fd086fa /src/emu/sound/sid6581.c
parent6278021cf6a3a3e6af895ff4ea3623175fd4ef71 (diff)
Sound cores no longer allocate their own tokens. Instead they return a new
integer value indicating the size of token they want, and the core allocates it for them. This mirrors the standard device behavior.
Diffstat (limited to 'src/emu/sound/sid6581.c')
-rw-r--r--src/emu/sound/sid6581.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/emu/sound/sid6581.c b/src/emu/sound/sid6581.c
index ec5d534bd27..a09e9b741d7 100644
--- a/src/emu/sound/sid6581.c
+++ b/src/emu/sound/sid6581.c
@@ -29,14 +29,11 @@ static STREAM_UPDATE( sid_update )
-static void *sid_start(const device_config *device, int clock, SIDTYPE sidtype)
+static device_start_err sid_start(const device_config *device, int clock, SIDTYPE sidtype)
{
- SID6581 *sid;
+ SID6581 *sid = device->token;
const sid6581_interface *iface = (const sid6581_interface*) device->static_config;
- sid = (SID6581 *) auto_malloc(sizeof(*sid));
- memset(sid, 0, sizeof(*sid));
-
sid->device = device;
sid->mixer_channel = stream_create (device, 0, 1, device->machine->sample_rate, (void *) sid, sid_update);
sid->PCMfreq = device->machine->sample_rate;
@@ -46,7 +43,7 @@ static void *sid_start(const device_config *device, int clock, SIDTYPE sidtype)
sid6581_init(sid);
sidInitWaveformTables(sidtype);
- return sid;
+ return DEVICE_START_OK;
}
@@ -113,6 +110,7 @@ SND_GET_INFO( sid6581 )
switch (state)
{
/* --- the following bits of info are returned as 64-bit signed integers --- */
+ case SNDINFO_INT_TOKEN_BYTES: info->i = sizeof(SID6581); break;
/* --- the following bits of info are returned as pointers to data or functions --- */
case SNDINFO_PTR_SET_INFO: info->set_info = SND_SET_INFO_NAME( sid6581 ); break;