diff options
author | 2025-04-14 11:31:53 +0200 | |
---|---|---|
committer | 2025-04-27 22:23:20 +0200 | |
commit | d0f1c15a0f6df2dd51a754cb46e6175b7079c8f2 (patch) | |
tree | be35c94340442af08c316a8679089ee68e119fac /src/devices/cpu/tms57002/tms57002.cpp | |
parent | ec636faeba5c5841c5a4a35b7c9dc2f06a00f538 (diff) |
New sound infrastructure.
Should be added soon:
- mute
- speaker/microphone resampling
To be added a little later:
- compression
- reverb
Needs to be added by someone else:
- coreaudio
- direct
- portaudio
- xaudio2
- js
Diffstat (limited to 'src/devices/cpu/tms57002/tms57002.cpp')
-rw-r--r-- | src/devices/cpu/tms57002/tms57002.cpp | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/src/devices/cpu/tms57002/tms57002.cpp b/src/devices/cpu/tms57002/tms57002.cpp index 593a74e3263..3485ba25695 100644 --- a/src/devices/cpu/tms57002/tms57002.cpp +++ b/src/devices/cpu/tms57002/tms57002.cpp @@ -920,21 +920,20 @@ void tms57002_device::execute_run() icount = 0; } -void tms57002_device::sound_stream_update(sound_stream &stream, std::vector<read_stream_view> const &inputs, std::vector<write_stream_view> &outputs) +void tms57002_device::sound_stream_update(sound_stream &stream) { - assert(inputs[0].samples() == 1); - assert(outputs[0].samples() == 1); - - stream_buffer::sample_t in_scale = 32767.0 * ((st0 & ST0_SIM) ? 256.0 : 1.0); - si[0] = s32(inputs[0].get(0) * in_scale) & 0xffffff; - si[1] = s32(inputs[1].get(0) * in_scale) & 0xffffff; - si[2] = s32(inputs[2].get(0) * in_scale) & 0xffffff; - si[3] = s32(inputs[3].get(0) * in_scale) & 0xffffff; - - outputs[0].put_int(0, s32(so[0] << 8) >> 1, 32768 * 32768); - outputs[1].put_int(0, s32(so[1] << 8) >> 1, 32768 * 32768); - outputs[2].put_int(0, s32(so[2] << 8) >> 1, 32768 * 32768); - outputs[3].put_int(0, s32(so[3] << 8) >> 1, 32768 * 32768); + assert(stream.samples() == 1); + + sound_stream::sample_t in_scale = 32768.0 * ((st0 & ST0_SIM) ? 256.0 : 1.0); + si[0] = s32(stream.get(0, 0) * in_scale) & 0xffffff; + si[1] = s32(stream.get(1, 0) * in_scale) & 0xffffff; + si[2] = s32(stream.get(2, 0) * in_scale) & 0xffffff; + si[3] = s32(stream.get(3, 0) * in_scale) & 0xffffff; + + stream.put(0, 0, s32(so[0] << 8) / 2147483648.0); + stream.put(1, 0, s32(so[1] << 8) / 2147483648.0); + stream.put(2, 0, s32(so[2] << 8) / 2147483648.0); + stream.put(3, 0, s32(so[3] << 8) / 2147483648.0); sync_w(1); } |