diff options
Diffstat (limited to 'src/devices/sound/segapcm.cpp')
-rw-r--r-- | src/devices/sound/segapcm.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/devices/sound/segapcm.cpp b/src/devices/sound/segapcm.cpp index e93bbaec7ee..9b4d7a9c803 100644 --- a/src/devices/sound/segapcm.cpp +++ b/src/devices/sound/segapcm.cpp @@ -39,7 +39,7 @@ void segapcm_device::device_start() std::fill(&m_ram[0], &m_ram[0x800], 0xff); - m_stream = stream_alloc_legacy(0, 2, clock() / 128); + m_stream = stream_alloc(0, 2, clock() / 128); save_item(NAME(m_low)); save_pointer(NAME(m_ram), 0x800); @@ -68,14 +68,14 @@ void segapcm_device::rom_bank_updated() //------------------------------------------------- -// sound_stream_update_legacy - handle a stream update +// sound_stream_update - handle a stream update //------------------------------------------------- -void segapcm_device::sound_stream_update_legacy(sound_stream &stream, stream_sample_t const * const *inputs, stream_sample_t * const *outputs, int samples) +void segapcm_device::sound_stream_update(sound_stream &stream, std::vector<read_stream_view> const &inputs, std::vector<write_stream_view> &outputs) { /* clear the buffers */ - memset(outputs[0], 0, samples*sizeof(*outputs[0])); - memset(outputs[1], 0, samples*sizeof(*outputs[1])); + outputs[0].fill(0); + outputs[1].fill(0); // reg function // ------------------------------------------------ @@ -113,7 +113,7 @@ void segapcm_device::sound_stream_update_legacy(sound_stream &stream, stream_sam int i; /* loop over samples on this channel */ - for (i = 0; i < samples; i++) + for (i = 0; i < outputs[0].samples(); i++) { int8_t v; @@ -132,8 +132,8 @@ void segapcm_device::sound_stream_update_legacy(sound_stream &stream, stream_sam v = read_byte(offset + (addr >> 8)) - 0x80; /* apply panning and advance */ - outputs[0][i] += v * (regs[2] & 0x7f); - outputs[1][i] += v * (regs[3] & 0x7f); + outputs[0].add_int(i, v * (regs[2] & 0x7f), 32768); + outputs[1].add_int(i, v * (regs[3] & 0x7f), 32768); addr = (addr + regs[7]) & 0xffffff; } |