diff options
author | 2009-01-18 20:24:42 +0000 | |
---|---|---|
committer | 2009-01-18 20:24:42 +0000 | |
commit | 170b4c27522f3ed0c3af90e0e24e45659f0ea763 (patch) | |
tree | ebf0563c6f0a9f8b48040beec2543e5b5fd086fa /src/emu/sound/cdda.c | |
parent | 6278021cf6a3a3e6af895ff4ea3623175fd4ef71 (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/cdda.c')
-rw-r--r-- | src/emu/sound/cdda.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/emu/sound/cdda.c b/src/emu/sound/cdda.c index 0bab6475fcb..f9b94b1e99b 100644 --- a/src/emu/sound/cdda.c +++ b/src/emu/sound/cdda.c @@ -46,10 +46,7 @@ static STREAM_UPDATE( cdda_update ) static SND_START( cdda ) { const struct CDDAinterface *intf; - cdda_info *info; - - info = auto_malloc(sizeof(*info)); - memset(info, 0, sizeof(*info)); + cdda_info *info = device->token; /* allocate an audio cache */ info->audio_cache = auto_malloc( CD_MAX_SECTOR_DATA * MAX_SECTORS ); @@ -67,7 +64,7 @@ static SND_START( cdda ) state_save_register_device_item( device, 0, info->audio_samples ); state_save_register_device_item( device, 0, info->audio_bptr ); - return info; + return DEVICE_START_OK; } @@ -315,6 +312,7 @@ SND_GET_INFO( cdda ) switch (state) { /* --- the following bits of info are returned as 64-bit signed integers --- */ + case SNDINFO_INT_TOKEN_BYTES: info->i = sizeof(cdda_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( cdda ); break; |