mirror of
https://github.com/holub/mame
synced 2025-04-18 22:49:58 +03:00
sound/gt155.cpp: Increased range of filter output to avoid overflow. (#13454)
This commit is contained in:
parent
06183fc297
commit
515a8c31e8
@ -129,10 +129,9 @@ void gt155_device::mix_sample(voice_t &voice, s64 &left, s64 &right)
|
||||
|
||||
// interpolate, apply envelope + channel gain and lowpass, and mix into output
|
||||
s64 sample = voice.m_sample_last + (s64(voice.m_sample - voice.m_sample_last) * voice.m_addr_frac >> 15);
|
||||
|
||||
// TODO: does this produce accurate filter output?
|
||||
sample = sample * voice.m_filter_gain;
|
||||
sample += s32(voice.m_filter_out) * (voice.m_filter ^ 0xffff);
|
||||
sample += s64(voice.m_filter_out) * (voice.m_filter ^ 0xffff);
|
||||
sample >>= 16;
|
||||
voice.m_filter_out = sample;
|
||||
|
||||
|
@ -60,7 +60,7 @@ private:
|
||||
|
||||
u32 m_filter_gain = 0;
|
||||
u16 m_filter = 0;
|
||||
s16 m_filter_out = 0;
|
||||
s32 m_filter_out = 0;
|
||||
u16 m_filter_unk = 0;
|
||||
|
||||
s16 m_sample_last = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user