summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/sound/2612intf.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/2612intf.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/2612intf.c')
-rw-r--r--src/emu/sound/2612intf.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/emu/sound/2612intf.c b/src/emu/sound/2612intf.c
index cf0608852c3..fbaf4af4361 100644
--- a/src/emu/sound/2612intf.c
+++ b/src/emu/sound/2612intf.c
@@ -90,12 +90,9 @@ static STATE_POSTLOAD( ym2612_intf_postload )
static SND_START( ym2612 )
{
static const ym2612_interface dummy = { 0 };
- struct ym2612_info *info;
+ struct ym2612_info *info = device->token;
int rate = clock/72;
- info = auto_malloc(sizeof(*info));
- memset(info, 0, sizeof(*info));
-
info->intf = device->static_config ? device->static_config : &dummy;
info->device = device;
@@ -109,13 +106,11 @@ static SND_START( ym2612 )
/**** initialize YM2612 ****/
info->chip = ym2612_init(info,device,clock,rate,timer_handler,IRQHandler);
+ assert_always(info->chip != NULL, "Error creating YM2612 chip");
state_save_register_postload(device->machine, ym2612_intf_postload, info);
-
- if (info->chip)
- return info;
- /* error */
- return NULL;
+
+ return DEVICE_START_OK;
}
@@ -362,6 +357,7 @@ SND_GET_INFO( ym2612 )
switch (state)
{
/* --- the following bits of info are returned as 64-bit signed integers --- */
+ case SNDINFO_INT_TOKEN_BYTES: info->i = sizeof(struct ym2612_info); 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( ym2612 ); break;
@@ -398,6 +394,7 @@ SND_GET_INFO( ym3438 )
switch (state)
{
/* --- the following bits of info are returned as 64-bit signed integers --- */
+ case SNDINFO_INT_TOKEN_BYTES: info->i = sizeof(struct ym2612_info); 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( ym3438 ); break;