diff options
author | 2011-01-27 08:06:43 +0000 | |
---|---|---|
committer | 2011-01-27 08:06:43 +0000 | |
commit | c94b8c94901066b9f44a1b13d7448502fa147974 (patch) | |
tree | 9787f6d7088152dab9c1a509700d1afa75074062 /src/emu/sound/k051649.c | |
parent | e214465d3578e0c713f4a686916e40c2e9461050 (diff) |
C++-ified the sound and streams interfaces. Combined sound.c and streams.c
into one file, and separated the speaker device into its own file.
Generalized the concept of dynamically assigned inputs and re-wired the
speaker to work this way, so it is now treated just like any other
sound device. Added methods to the device_sound_interface for controlling
output gain and mapping device inputs/outputs to stream inputs/outputs.
Also made the sound_stream_update() method pure virtual, so all modern
sound devices must use the new mechanism for stream updates.
Primary changes outside of the core are:
stream_update(stream) == stream->update()
stream_create(device,...) == machine->sound().stream_alloc(*device,...)
sound_global_enable(machine,enable) == machine->sound().system_enable(enable)
Beyond this, the patterns are relatively obvious for the remaining calls.
Diffstat (limited to 'src/emu/sound/k051649.c')
-rw-r--r-- | src/emu/sound/k051649.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/emu/sound/k051649.c b/src/emu/sound/k051649.c index 9c2e85c8a6f..9a9d60cd71c 100644 --- a/src/emu/sound/k051649.c +++ b/src/emu/sound/k051649.c @@ -23,7 +23,6 @@ ***************************************************************************/ #include "emu.h" -#include "streams.h" #include "k051649.h" #define FREQBASEBITS 16 @@ -139,7 +138,7 @@ static DEVICE_START( k051649 ) /* get stream channels */ info->rate = device->clock()/16; - info->stream = stream_create(device, 0, 1, info->rate, info, k051649_update); + info->stream = device->machine->sound().stream_alloc(*device, 0, 1, info->rate, info, k051649_update); info->mclock = device->clock(); /* allocate a buffer to mix into - 1 second's worth should be more than enough */ @@ -168,7 +167,7 @@ static DEVICE_RESET( k051649 ) WRITE8_DEVICE_HANDLER( k051649_waveform_w ) { k051649_state *info = get_safe_token(device); - stream_update(info->stream); + info->stream->update(); info->channel_list[offset>>5].waveform[offset&0x1f]=data; /* SY 20001114: Channel 5 shares the waveform with channel 4 */ if (offset >= 0x60) @@ -185,14 +184,14 @@ READ8_DEVICE_HANDLER ( k051649_waveform_r ) WRITE8_DEVICE_HANDLER( k052539_waveform_w ) { k051649_state *info = get_safe_token(device); - stream_update(info->stream); + info->stream->update(); info->channel_list[offset>>5].waveform[offset&0x1f]=data; } WRITE8_DEVICE_HANDLER( k051649_volume_w ) { k051649_state *info = get_safe_token(device); - stream_update(info->stream); + info->stream->update(); info->channel_list[offset&0x7].volume=data&0xf; } @@ -201,14 +200,14 @@ WRITE8_DEVICE_HANDLER( k051649_frequency_w ) k051649_state *info = get_safe_token(device); info->f[offset]=data; - stream_update(info->stream); + info->stream->update(); info->channel_list[offset>>1].frequency=(info->f[offset&0xe] + (info->f[offset|1]<<8))&0xfff; } WRITE8_DEVICE_HANDLER( k051649_keyonoff_w ) { k051649_state *info = get_safe_token(device); - stream_update(info->stream); + info->stream->update(); info->channel_list[0].key=data&1; info->channel_list[1].key=data&2; info->channel_list[2].key=data&4; |