summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/sound/beep.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/beep.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/beep.c')
-rw-r--r--src/emu/sound/beep.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/emu/sound/beep.c b/src/emu/sound/beep.c
index e57f3b49cfe..29a0b1c3f4e 100644
--- a/src/emu/sound/beep.c
+++ b/src/emu/sound/beep.c
@@ -83,17 +83,14 @@ static STREAM_UPDATE( beep_sound_update )
static SND_START( beep )
{
- struct beep_sound *pBeep;
-
- pBeep = auto_malloc(sizeof(*pBeep));
- memset(pBeep, 0, sizeof(*pBeep));
+ struct beep_sound *pBeep = device->token;
pBeep->stream = stream_create(device, 0, 1, BEEP_RATE, pBeep, beep_sound_update );
pBeep->enable = 0;
pBeep->frequency = 3250;
pBeep->incr = 0;
pBeep->signal = 0x07fff;
- return pBeep;
+ return DEVICE_START_OK;
}
@@ -180,6 +177,7 @@ SND_GET_INFO( beep )
switch (state)
{
/* --- the following bits of info are returned as 64-bit signed integers --- */
+ case SNDINFO_INT_TOKEN_BYTES: info->i = sizeof(struct beep_sound); 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( beep ); break;