diff options
Diffstat (limited to 'src/emu/sound/ay8910.c')
-rw-r--r-- | src/emu/sound/ay8910.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/src/emu/sound/ay8910.c b/src/emu/sound/ay8910.c index 267f9463d16..b6c485e7551 100644 --- a/src/emu/sound/ay8910.c +++ b/src/emu/sound/ay8910.c @@ -659,12 +659,15 @@ static void ay8910_statesave(ay8910_context *psg, const device_config *device) * *************************************/ -void *ay8910_start_ym(sound_type chip_type, const device_config *device, int clock, const ay8910_interface *intf) +void *ay8910_start_ym(void *infoptr, sound_type chip_type, const device_config *device, int clock, const ay8910_interface *intf) { - ay8910_context *info; + ay8910_context *info = infoptr; - info = auto_malloc(sizeof(*info)); - memset(info, 0, sizeof(*info)); + if (info == NULL) + { + info = auto_malloc(sizeof(*info)); + memset(info, 0, sizeof(*info)); + } info->device = device; info->intf = intf; if ((info->intf->flags & AY8910_SINGLE_OUTPUT) != 0) @@ -819,7 +822,8 @@ static SND_START( ay8910 ) NULL, NULL, NULL, NULL }; const ay8910_interface *intf = (device->static_config ? device->static_config : &generic_ay8910); - return ay8910_start_ym(SOUND_AY8910, device, clock, intf); + ay8910_start_ym(device->token, SOUND_AY8910, device, clock, intf); + return DEVICE_START_OK; } static SND_START( ym2149 ) @@ -831,7 +835,8 @@ static SND_START( ym2149 ) NULL, NULL, NULL, NULL }; const ay8910_interface *intf = (device->static_config ? device->static_config : &generic_ay8910); - return ay8910_start_ym(SOUND_YM2149, device, clock, intf); + ay8910_start_ym(device->token, SOUND_YM2149, device, clock, intf); + return DEVICE_START_OK; } static SND_STOP( ay8910 ) @@ -857,7 +862,8 @@ SND_GET_INFO( ay8910 ) switch (state) { /* --- the following bits of info are returned as 64-bit signed integers --- */ - case SNDINFO_FCT_ALIAS: info->type = SOUND_AY8910; break; + case SNDINFO_INT_TOKEN_BYTES: info->i = sizeof(ay8910_context); break; + case SNDINFO_FCT_ALIAS: info->type = SOUND_AY8910; 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( ay8910 ); break; |