diff --git a/extern/vgsound_emu-modified/vgsound_emu/src/scc/README.md b/extern/vgsound_emu-modified/vgsound_emu/src/scc/README.md index 2a66bd8cb..6ce9914d5 100644 --- a/extern/vgsound_emu-modified/vgsound_emu/src/scc/README.md +++ b/extern/vgsound_emu-modified/vgsound_emu/src/scc/README.md @@ -1,5 +1,9 @@ # Konami SCC +## modified + +the emulation core has been modified for optimization. + ## Summary - 5 voice wavetable diff --git a/extern/vgsound_emu-modified/vgsound_emu/src/scc/scc.cpp b/extern/vgsound_emu-modified/vgsound_emu/src/scc/scc.cpp index 07cbb60e8..7b0246a10 100644 --- a/extern/vgsound_emu-modified/vgsound_emu/src/scc/scc.cpp +++ b/extern/vgsound_emu-modified/vgsound_emu/src/scc/scc.cpp @@ -10,17 +10,17 @@ #include "scc.hpp" // shared SCC features -void scc_core::tick() +void scc_core::tick(const int cycles) { m_out = 0; for (auto &elem : m_voice) { - elem.tick(); + elem.tick(cycles); m_out += elem.out(); } } -void scc_core::voice_t::tick() +void scc_core::voice_t::tick(const int cycles) { if (m_pitch >= 9) // or voice is halted { @@ -28,23 +28,23 @@ void scc_core::voice_t::tick() const u16 temp = m_counter; if (m_host.m_test.freq_4bit()) // 4 bit frequency mode { - m_counter = (m_counter & ~0x0ff) | (bitfield(bitfield(m_counter, 0, 8) - 1, 0, 8) << 0); - m_counter = (m_counter & ~0xf00) | (bitfield(bitfield(m_counter, 8, 4) - 1, 0, 4) << 8); + m_counter = (m_counter & ~0x0ff) | (bitfield(bitfield(m_counter, 0, 8) - cycles, 0, 8) << 0); + m_counter = (m_counter & ~0xf00) | (bitfield(bitfield(m_counter, 8, 4) - cycles, 0, 4) << 8); } else { - m_counter = bitfield(m_counter - 1, 0, 12); + m_counter = bitfield(m_counter - cycles, 0, 12); } // handle counter carry - const bool carry = m_host.m_test.freq_8bit() + const bool carry = (temptick(); - } + scc->tick(16); short out=(short)scc->out()<<5; buf[0][h]=out;