diff options
author | Curt Coder <curtcoder@mail.com> | 2009-11-27 13:11:19 +0000 |
---|---|---|
committer | Curt Coder <curtcoder@mail.com> | 2009-11-27 13:11:19 +0000 |
commit | abb8ad1fb6f4267244e1236d559c47b0ef6af10e (patch) | |
tree | 3c537a2b0c5ccd6fa2da572ffca6f465ec184ec8 | |
parent | a2e82426fe48397b522acb270c97eb4f6ea44046 (diff) |
Actually use the speaker interface if provided.
-rw-r--r-- | src/emu/sound/speaker.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/emu/sound/speaker.c b/src/emu/sound/speaker.c index 6043f298422..aba2258dd7f 100644 --- a/src/emu/sound/speaker.c +++ b/src/emu/sound/speaker.c @@ -139,12 +139,25 @@ INLINE speaker_state *get_safe_token(const device_config *device) static DEVICE_START( speaker ) { speaker_state *sp = get_safe_token(device); + const speaker_interface *intf = (const speaker_interface *) device->static_config; int i; double x; sp->channel = stream_create(device, 0, 1, device->machine->sample_rate, sp, speaker_sound_update); - sp->num_levels = 2; - sp->levels = default_levels; + + if (intf != NULL) + { + assert(intf->num_level > 1); + assert(intf->levels != NULL); + sp->num_levels = intf->num_level; + sp->levels = intf->levels; + } + else + { + sp->num_levels = 2; + sp->levels = default_levels; + } + sp->level = 0; for (i = 0; i < FILTER_LENGTH; i++) sp->composed_volume[i] = 0; |