diff options
Diffstat (limited to 'src/devices/sound/digitalk.cpp')
-rw-r--r-- | src/devices/sound/digitalk.cpp | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/src/devices/sound/digitalk.cpp b/src/devices/sound/digitalk.cpp index d69f9098cc3..ebe7fbb14da 100644 --- a/src/devices/sound/digitalk.cpp +++ b/src/devices/sound/digitalk.cpp @@ -156,7 +156,7 @@ quantization is done, but the whole 128 samples are adpcm-encoded. Finally, silent zones are compressed specifically by storing their -lenghts. +lengths. Decoding is simpler. The 128-samples waveform is decoded using the @@ -544,29 +544,27 @@ void digitalker_device::digitalker_step() // sound_stream_update - handle a stream update //------------------------------------------------- -void digitalker_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) +void digitalker_device::sound_stream_update(sound_stream &stream) { - stream_sample_t *sout = outputs[0]; int cpos = 0; - while(cpos != samples) { + while(cpos != stream.samples()) { if(m_zero_count == 0 && m_dac_index == 128) digitalker_step(); if(m_zero_count) { - int n = samples - cpos; - int i; + int n = stream.samples() - cpos; if(n > m_zero_count) n = m_zero_count; - for(i=0; i != n; i++) - sout[cpos++] = 0; + stream.fill(0, 0, cpos, n); + cpos += n; m_zero_count -= n; } else if(m_dac_index != 128) { - while(cpos != samples && m_dac_index != 128) { - short v = m_dac[m_dac_index]; + while(cpos != stream.samples() && m_dac_index != 128) { + s32 v = m_dac[m_dac_index]; int pp = m_pitch_pos; - while(cpos != samples && pp != m_pitch) { - sout[cpos++] = v; + while(cpos != stream.samples() && pp != m_pitch) { + stream.put_int(0, cpos++, v, 32768); pp++; } if(pp == m_pitch) { @@ -576,9 +574,6 @@ void digitalker_device::sound_stream_update(sound_stream &stream, stream_sample_ m_pitch_pos = pp; } - } else { - while(cpos != samples) - sout[cpos++] = 0; } } } @@ -685,7 +680,7 @@ int digitalker_device::digitalker_0_intr_r() return digitalker_intr_r(); } -WRITE8_MEMBER( digitalker_device::digitalker_data_w ) +void digitalker_device::digitalker_data_w(uint8_t data) { m_data = data; } |