summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/sound/hc55516.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/hc55516.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/hc55516.c')
-rw-r--r--src/emu/sound/hc55516.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/emu/sound/hc55516.c b/src/emu/sound/hc55516.c
index c687f56e598..8b414fa018e 100644
--- a/src/emu/sound/hc55516.c
+++ b/src/emu/sound/hc55516.c
@@ -52,14 +52,10 @@ static STREAM_UPDATE( hc55516_update );
-static void *start_common(const device_config *device, int clock,
+static device_start_err start_common(const device_config *device, int clock,
UINT8 _shiftreg_mask, int _active_clock_hi)
{
- struct hc55516_data *chip;
-
- /* allocate the chip */
- chip = auto_malloc(sizeof(*chip));
- memset(chip, 0, sizeof(*chip));
+ struct hc55516_data *chip = device->token;
/* compute the fixed charge, decay, and leak time constants */
charge = pow(exp(-1), 1.0 / (FILTER_CHARGE_TC * 16000.0));
@@ -85,7 +81,7 @@ static void *start_common(const device_config *device, int clock,
state_save_register_device_item(device, 0, chip->integrator);
/* success */
- return chip;
+ return DEVICE_START_OK;
}
@@ -339,6 +335,7 @@ SND_GET_INFO( hc55516 )
switch (state)
{
/* --- the following bits of info are returned as 64-bit signed integers --- */
+ case SNDINFO_INT_TOKEN_BYTES: info->i = sizeof(struct hc55516_data); break;
case SNDINFO_FCT_ALIAS: info->type = SOUND_HC55516; break;
/* --- the following bits of info are returned as pointers to data or functions --- */