mirror of
https://github.com/WinampDesktop/winamp.git
synced 2025-06-18 12:45:45 -04:00
SPU: Add a tick counter and delay between key on/off writes
Not yet tested on hardware. We believe that writing to a specific voice's key on/off register within 2 samples/ticks of the first write will result in the second write being ignored. This still needs to be tested on hardware for confirmation. Thanks to @PSI-Rockin for the idea. Fixes sound effects in Monkey Hero.
This commit is contained in:
@ -56,6 +56,7 @@ private:
|
||||
static constexpr s16 ADSR_MAX_VOLUME = 0x7FFF;
|
||||
static constexpr u32 CD_AUDIO_SAMPLE_BUFFER_SIZE = 44100 * 2;
|
||||
static constexpr u32 CAPTURE_BUFFER_SIZE_PER_CHANNEL = 0x400;
|
||||
static constexpr u32 MINIMUM_TICKS_BETWEEN_KEY_ON_OFF = 2;
|
||||
|
||||
enum class RAMTransferMode : u8
|
||||
{
|
||||
@ -283,6 +284,7 @@ private:
|
||||
DMA* m_dma = nullptr;
|
||||
InterruptController* m_interrupt_controller = nullptr;
|
||||
std::unique_ptr<TimingEvent> m_tick_event;
|
||||
u32 m_tick_counter = 0;
|
||||
|
||||
SPUCNT m_SPUCNT = {};
|
||||
SPUSTAT m_SPUSTAT = {};
|
||||
@ -310,6 +312,7 @@ private:
|
||||
TickCount m_ticks_carry = 0;
|
||||
|
||||
std::array<Voice, NUM_VOICES> m_voices{};
|
||||
std::array<u8, NUM_VOICES> m_voice_key_on_off_delay{};
|
||||
std::array<u8, RAM_SIZE> m_ram{};
|
||||
|
||||
InlineFIFOQueue<s16, CD_AUDIO_SAMPLE_BUFFER_SIZE> m_cd_audio_buffer;
|
||||
|
Reference in New Issue
Block a user