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/sound/ym2154.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/sound/ym2154.cpp')
-rw-r--r-- | src/devices/sound/ym2154.cpp | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/src/devices/sound/ym2154.cpp b/src/devices/sound/ym2154.cpp index b52c4e49532..7d7c8bdd420 100644 --- a/src/devices/sound/ym2154.cpp +++ b/src/devices/sound/ym2154.cpp @@ -245,16 +245,10 @@ TIMER_CALLBACK_MEMBER(ym2154_device::delayed_irq) // sound_stream_update - generate sound data //------------------------------------------------- -void ym2154_device::sound_stream_update(sound_stream &stream, std::vector<read_stream_view> const &inputs, std::vector<write_stream_view> &outputs) +void ym2154_device::sound_stream_update(sound_stream &stream) { static const uint16_t voltable[8] = { 0x7fa,0x751,0x6b5,0x627,0x5a4,0x52c,0x4be,0x45a }; - auto &outl = outputs[0]; - auto &outr = outputs[1]; - - outl.fill(0); - outr.fill(0); - for (int chan = 0; chan < 12; chan++) { auto &channel = m_channel[chan]; @@ -279,7 +273,7 @@ void ym2154_device::sound_stream_update(sound_stream &stream, std::vector<read_s rvol = voltable[rvol & 7] >> (rvol >> 3); auto &source = space(chan / 6); - for (int sampindex = 0; sampindex < outl.samples() && (channel.m_pos >> ADDR_SHIFT) <= channel.m_end; sampindex++) + for (int sampindex = 0; sampindex < stream.samples() && (channel.m_pos >> ADDR_SHIFT) <= channel.m_end; sampindex++) { uint8_t raw = source.read_byte(channel.m_pos++); @@ -291,8 +285,8 @@ void ym2154_device::sound_stream_update(sound_stream &stream, std::vector<read_s if (BIT(raw, 7)) sample = -sample; - outl.add_int(sampindex, sample * lvol, 0x2000 * 0x800); - outr.add_int(sampindex, sample * rvol, 0x2000 * 0x800); + stream.add_int(0, sampindex, sample * lvol, 0x2000 * 0x800); + stream.add_int(1, sampindex, sample * rvol, 0x2000 * 0x800); } } } |