diff options
author | angelosa <lordkale4@gmail.com> | 2022-04-11 18:46:01 +0200 |
---|---|---|
committer | angelosa <lordkale4@gmail.com> | 2022-04-11 18:46:05 +0200 |
commit | 492b0e0df23dd663c9c1ff844377f717eb23c894 (patch) | |
tree | 379317834195af33f2aa63409b00d696024b9a79 /src/devices/sound/huc6230.cpp | |
parent | 926e59db2b56a1e9ae72406d9af58c5a8f362418 (diff) |
huc6272.cpp: don't return -1 when running out of nybbles in adpcm_update fn, fixes extremely overdriven PC-FX aliasing
huc6230.cpp: code review some dubious paths;
Diffstat (limited to 'src/devices/sound/huc6230.cpp')
-rw-r--r-- | src/devices/sound/huc6230.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/devices/sound/huc6230.cpp b/src/devices/sound/huc6230.cpp index 50a28a37cbb..ed297c36cf8 100644 --- a/src/devices/sound/huc6230.cpp +++ b/src/devices/sound/huc6230.cpp @@ -23,6 +23,10 @@ void huc6230_device::sound_stream_update(sound_stream &stream, std::vector<read_ { for (int i = 0; i < outputs[0].samples(); i++) { + // TODO: this implies to read from the PSG inputs + // doesn't seem right at all, eventually causes extreme DC offset on BIOS main menu, + // possibly because adpcm_timer runs from a different thread, + // needs to be rechecked once we have better examples ... s32 samp0 = inputs[0].get(i) * 32768.0; s32 samp1 = inputs[1].get(i) * 32768.0; @@ -33,8 +37,9 @@ void huc6230_device::sound_stream_update(sound_stream &stream, std::vector<read_ if (!channel->m_playing) continue; - samp0 = std::clamp(samp0 + ((channel->m_output * channel->m_lvol) >> 3), -32768, 32767); - samp1 = std::clamp(samp1 + ((channel->m_output * channel->m_rvol) >> 3), -32768, 32767); + // TODO: wrong volume scales + samp0 = std::clamp(samp0 + ((channel->m_output * channel->m_lvol) >> 4), -32768, 32767); + samp1 = std::clamp(samp1 + ((channel->m_output * channel->m_rvol) >> 4), -32768, 32767); } outputs[0].put_int(i, samp0, 32768); @@ -124,6 +129,8 @@ TIMER_CALLBACK_MEMBER(huc6230_device::adpcm_timer) } int32_t new_output; + // TODO: BIOS doesn't use interpolation + // which actually is linear interpolation off/on ... if (!channel->m_interpolate) new_output = channel->m_curr_sample; else |