diff --git a/extern/vgsound_emu-modified/vgsound_emu/src/es550x/es5506.hpp b/extern/vgsound_emu-modified/vgsound_emu/src/es550x/es5506.hpp index ea8b5a8fb..e2b793cd5 100644 --- a/extern/vgsound_emu-modified/vgsound_emu/src/es550x/es5506.hpp +++ b/extern/vgsound_emu-modified/vgsound_emu/src/es550x/es5506.hpp @@ -314,9 +314,9 @@ class es5506_core : public es550x_shared_core inline bool bclk_falling_edge() { return m_bclk.falling_edge(); } // 6 stereo output channels - inline s32 lout(u8 ch) { return m_output[std::min(5, ch & 0x7)].left(); } + inline s32 lout(u8 ch) { return m_output[ch&7].left(); } - inline s32 rout(u8 ch) { return m_output[std::min(5, ch & 0x7)].right(); } + inline s32 rout(u8 ch) { return m_output[ch&7].right(); } //----------------------------------------------------------------- // @@ -374,7 +374,7 @@ class es5506_core : public es550x_shared_core bool m_wclk_lr = false; // WCLK, L/R output select s8 m_output_bit = 0; // Bit position in output output_t m_ch[6]; // 6 stereo output channels - output_t m_output[6]; // Serial outputs + output_t m_output[8]; // Serial outputs output_t m_output_temp[6]; // temporary signal for serial output output_t m_output_latch[6]; // output latch }; diff --git a/extern/vgsound_emu-modified/vgsound_emu/src/es550x/es550x.hpp b/extern/vgsound_emu-modified/vgsound_emu/src/es550x/es550x.hpp index 9967acf11..02ddcd9a5 100644 --- a/extern/vgsound_emu-modified/vgsound_emu/src/es550x/es550x.hpp +++ b/extern/vgsound_emu-modified/vgsound_emu/src/es550x/es550x.hpp @@ -160,6 +160,7 @@ class es550x_shared_core : public vgsound_emu_core : vgsound_emu_core("es550x_voice_alu") , m_integer(integer) , m_fraction(fraction) + , m_fraction_m9(std::max(0, m_fraction - 9)) , m_total_bits(integer + fraction) , m_accum_mask( u32(std::min(~0, u64(u64(1) << u64(integer + fraction)) - 1))) @@ -175,6 +176,7 @@ class es550x_shared_core : public vgsound_emu_core // configurations const u8 m_integer = 21; const u8 m_fraction = 11; + const u8 m_fraction_m9 = 2; const u8 m_total_bits = 32; const u32 m_accum_mask = 0xffffffff; const bool m_transwave = true; diff --git a/extern/vgsound_emu-modified/vgsound_emu/src/es550x/es550x_alu.cpp b/extern/vgsound_emu-modified/vgsound_emu/src/es550x/es550x_alu.cpp index f058f0546..2118266f3 100644 --- a/extern/vgsound_emu-modified/vgsound_emu/src/es550x/es550x_alu.cpp +++ b/extern/vgsound_emu-modified/vgsound_emu/src/es550x/es550x_alu.cpp @@ -101,7 +101,7 @@ void es550x_shared_core::es550x_voice_t::es550x_alu_t::loop_exec() s32 es550x_shared_core::es550x_voice_t::es550x_alu_t::interpolation() { // SF = S1 + ACCfr * (S2 - S1) - return m_sample[0] + ((bitfield(m_accum, std::max(0, m_fraction - 9), 9) * + return m_sample[0] + ((bitfield(m_accum, m_fraction_m9, 9) * (m_sample[1] - m_sample[0])) >> 9); } diff --git a/src/engine/platform/es5506.cpp b/src/engine/platform/es5506.cpp index 8939c1d85..e532eff27 100644 --- a/src/engine/platform/es5506.cpp +++ b/src/engine/platform/es5506.cpp @@ -170,14 +170,6 @@ void DivPlatformES5506::acquire(short** buf, size_t len) { } void DivPlatformES5506::e_pin(bool state) { - /* - if (es5506.e_falling_edge()) { // get channel outputs - if (es5506.voice_update()) { - const signed int lOut=es5506.voice_lout(prevChanCycle); - const signed int rOut=es5506.voice_rout(prevChanCycle); - chan[prevChanCycle].oscOut=CLAMP((lOut+rOut)>>5,-32768,32767); - } - }*/ if (state) { // host interface if (cycle) { // wait until delay cycle--;