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/c140.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/c140.c')
-rw-r--r-- | src/emu/sound/c140.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/emu/sound/c140.c b/src/emu/sound/c140.c index d1d615025a0..fcc3a8bb836 100644 --- a/src/emu/sound/c140.c +++ b/src/emu/sound/c140.c @@ -457,10 +457,7 @@ static STREAM_UPDATE( update_stereo ) static SND_START( c140 ) { const c140_interface *intf = device->static_config; - struct c140_info *info; - - info = auto_malloc(sizeof(*info)); - memset(info, 0, sizeof(*info)); + struct c140_info *info = device->token; info->sample_rate=info->baserate=clock; @@ -490,7 +487,7 @@ static SND_START( c140 ) /* allocate a pair of buffers to mix into - 1 second's worth should be more than enough */ info->mixer_buffer_left = auto_malloc(2 * sizeof(INT16)*info->sample_rate ); info->mixer_buffer_right = info->mixer_buffer_left + info->sample_rate; - return info; + return DEVICE_START_OK; } @@ -514,6 +511,7 @@ SND_GET_INFO( c140 ) switch (state) { /* --- the following bits of info are returned as 64-bit signed integers --- */ + case SNDINFO_INT_TOKEN_BYTES: info->i = sizeof(struct c140_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( c140 ); break; |