summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/sound/sn76496.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/sn76496.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/sn76496.c')
-rw-r--r--src/emu/sound/sn76496.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/emu/sound/sn76496.c b/src/emu/sound/sn76496.c
index 3a1ed9077bf..bcc71ef2dc6 100644
--- a/src/emu/sound/sn76496.c
+++ b/src/emu/sound/sn76496.c
@@ -314,15 +314,12 @@ static int SN76496_init(const device_config *device, int clock, struct SN76496 *
}
-static void *generic_start(const device_config *device, int clock, int feedbackmask, int noisetaps, int noiseinvert)
+static device_start_err generic_start(const device_config *device, int clock, int feedbackmask, int noisetaps, int noiseinvert)
{
- struct SN76496 *chip;
-
- chip = auto_malloc(sizeof(*chip));
- memset(chip, 0, sizeof(*chip));
+ struct SN76496 *chip = device->token;
if (SN76496_init(device,clock,chip) != 0)
- return NULL;
+ fatalerror("Error creating SN76496 chip");
SN76496_set_gain(chip, 0);
chip->FeedbackMask = feedbackmask;
@@ -338,8 +335,7 @@ static void *generic_start(const device_config *device, int clock, int feedbackm
state_save_register_device_item_array(device, 0, chip->Count);
state_save_register_device_item_array(device, 0, chip->Output);
- return chip;
-
+ return DEVICE_START_OK;
}
@@ -392,6 +388,7 @@ SND_GET_INFO( sn76496 )
switch (state)
{
/* --- the following bits of info are returned as 64-bit signed integers --- */
+ case SNDINFO_INT_TOKEN_BYTES: info->i = sizeof(struct SN76496); break;
case SNDINFO_FCT_ALIAS: info->type = SOUND_SN76496; break;
/* --- the following bits of info are returned as pointers to data or functions --- */