summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/sound/2608intf.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/emu/sound/2608intf.c')
-rw-r--r--src/emu/sound/2608intf.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/src/emu/sound/2608intf.c b/src/emu/sound/2608intf.c
index fbe3c64ec3f..94ad83f5ea6 100644
--- a/src/emu/sound/2608intf.c
+++ b/src/emu/sound/2608intf.c
@@ -134,17 +134,14 @@ static SND_START( ym2608 )
void *pcmbufa;
int pcmsizea;
- struct ym2608_info *info;
-
- info = auto_malloc(sizeof(*info));
- memset(info, 0, sizeof(*info));
+ struct ym2608_info *info = device->token;
info->intf = intf;
info->device = device;
/* FIXME: Force to use simgle output */
- info->psg = ay8910_start_ym(SOUND_YM2608, device, clock, &intf->ay8910_intf);
- if (!info->psg) return NULL;
+ info->psg = ay8910_start_ym(NULL, SOUND_YM2608, device, clock, &intf->ay8910_intf);
+ assert_always(info->psg != NULL, "Error creating YM2608/AY8910 chip");
/* Timer Handler set */
info->timer[0] = timer_alloc(device->machine, timer_callback_2608_0, info);
@@ -160,14 +157,10 @@ static SND_START( ym2608 )
info->chip = ym2608_init(info,device,clock,rate,
pcmbufa,pcmsizea,
timer_handler,IRQHandler,&psgintf);
+ assert_always(info->chip != NULL, "Error creating YM2608 chip");
state_save_register_postload(device->machine, ym2608_intf_postload, info);
-
- if (info->chip)
- return info;
-
- /* error */
- return NULL;
+ return DEVICE_START_OK;
}
static SND_STOP( ym2608 )
@@ -309,6 +302,7 @@ SND_GET_INFO( ym2608 )
switch (state)
{
/* --- the following bits of info are returned as 64-bit signed integers --- */
+ case SNDINFO_INT_TOKEN_BYTES: info->i = sizeof(struct ym2608_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( ym2608 ); break;