diff --git a/extern/vgsound_emu-modified/vgsound_emu/src/es550x/es5506.cpp b/extern/vgsound_emu-modified/vgsound_emu/src/es550x/es5506.cpp index 4860c0bde..548202a29 100644 --- a/extern/vgsound_emu-modified/vgsound_emu/src/es550x/es5506.cpp +++ b/extern/vgsound_emu-modified/vgsound_emu/src/es550x/es5506.cpp @@ -99,7 +99,7 @@ void es5506_core::voice_t::tick(u8 voice) if (m_alu.busy()) { - fetch(0); + if ((m_alu.m_last_accum&(~m_alu.m_fraction))!=(m_alu.m_accum&(~m_alu.m_fraction))) fetch(0); m_filter.tick(m_alu.interpolation()); // Send to output m_output[0] = m_mute ? 0 : volume_calc(m_lvol, (short)m_filter.o4_1()); 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 0a9780fcf..2137cb246 100644 --- a/extern/vgsound_emu-modified/vgsound_emu/src/es550x/es550x.hpp +++ b/extern/vgsound_emu-modified/vgsound_emu/src/es550x/es550x.hpp @@ -169,6 +169,7 @@ class es550x_shared_core : public vgsound_emu_core , m_start(0) , m_end(0) , m_accum(0) + , m_last_accum(0) , m_sample{0,0} { } @@ -268,7 +269,7 @@ class es550x_shared_core : public vgsound_emu_core inline s32 sample(u8 slot) { return m_sample[slot & 1]; } - private: + public: class es550x_alu_cr_t : public vgsound_emu_core { public: @@ -370,6 +371,7 @@ class es550x_shared_core : public vgsound_emu_core // 20 integer, 9 fraction for ES5504/ES5505 // 21 integer, 11 fraction for ES5506 u32 m_accum = 0; + u32 m_last_accum = 0; // Samples s32 m_sample[2]; }; 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 b0621ef77..f5849d0dd 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 @@ -16,6 +16,7 @@ void es550x_shared_core::es550x_voice_t::es550x_alu_t::reset() m_start = 0; m_end = 0; m_accum = 0; + m_last_accum=0; m_sample[0] = m_sample[1] = 0; } @@ -23,6 +24,7 @@ bool es550x_shared_core::es550x_voice_t::es550x_alu_t::busy() { return !(m_cr.m_ bool es550x_shared_core::es550x_voice_t::es550x_alu_t::tick() { + m_last_accum = m_accum; if (m_cr.dir()) { m_accum -= m_fc; diff --git a/src/engine/platform/es5506.cpp b/src/engine/platform/es5506.cpp index cf9be44e7..556c54926 100644 --- a/src/engine/platform/es5506.cpp +++ b/src/engine/platform/es5506.cpp @@ -1153,14 +1153,15 @@ void DivPlatformES5506::notifyInsDeletion(void* ins) { void DivPlatformES5506::setFlags(const DivConfig& flags) { chipClock=16000000; CHECK_CUSTOM_CLOCK; - rate=chipClock/512; // 2 E clock tick (16 CLKIN tick) per voice / 4 - for (int i=0; i<32; i++) { - oscBuf[i]->rate=rate; - } initChanMax=MAX(4,flags.getInt("channels",0x1f)&0x1f); chanMax=initChanMax; pageWriteMask(0x00,0x60,0x0b,chanMax); + + rate=chipClock/(16*(initChanMax+1)); // 2 E clock tick (16 CLKIN tick) per voice / 4 + for (int i=0; i<32; i++) { + oscBuf[i]->rate=rate; + } } void DivPlatformES5506::poke(unsigned int addr, unsigned short val) { diff --git a/src/engine/platform/sound/c64_fp/siddefs-fp.h b/src/engine/platform/sound/c64_fp/siddefs-fp.h index 439008621..3719925fc 100644 --- a/src/engine/platform/sound/c64_fp/siddefs-fp.h +++ b/src/engine/platform/sound/c64_fp/siddefs-fp.h @@ -21,10 +21,14 @@ #define SIDDEFS_FP_H // Compilation configuration. -#define RESID_BRANCH_HINTS 0 +#define RESID_BRANCH_HINTS 1 // Compiler specifics. +#if defined(__GNUC__) && (__GNUC__ >= 4) +#define HAVE_BUILTIN_EXPECT 1 +#else #define HAVE_BUILTIN_EXPECT 0 +#endif #ifndef M_PI # define M_PI 3.14159265358979323846