mirror of
https://github.com/holub/mame
synced 2025-05-24 14:56:21 +03:00
Actually use the speaker interface if provided.
This commit is contained in:
parent
a2e82426fe
commit
abb8ad1fb6
@ -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);
|
||||
|
||||
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;
|
||||
|
Loading…
Reference in New Issue
Block a user