From 00060527288c0a9cef50972f03e2a9580c266dc2 Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Wed, 8 Apr 2020 20:33:39 +1000 Subject: [PATCH] SPU: Fix some registers not being saved to state --- src/core/save_state_version.h | 2 +- src/core/spu.cpp | 4 ++++ src/core/spu.h | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/core/save_state_version.h b/src/core/save_state_version.h index 54ea1f225..9b110ae52 100644 --- a/src/core/save_state_version.h +++ b/src/core/save_state_version.h @@ -2,4 +2,4 @@ #include "types.h" static constexpr u32 SAVE_STATE_MAGIC = 0x43435544; -static constexpr u32 SAVE_STATE_VERSION = 19; +static constexpr u32 SAVE_STATE_VERSION = 20; diff --git a/src/core/spu.cpp b/src/core/spu.cpp index 6f764fb7f..2b90ee2de 100644 --- a/src/core/spu.cpp +++ b/src/core/spu.cpp @@ -105,6 +105,7 @@ bool SPU::DoState(StateWrapper& sw) sw.Do(&m_key_on_register); sw.Do(&m_key_off_register); sw.Do(&m_endx_register); + sw.Do(&m_pitch_modulation_enable_register); sw.Do(&m_noise_mode_register); sw.Do(&m_noise_count); sw.Do(&m_noise_level); @@ -149,6 +150,9 @@ bool SPU::DoState(StateWrapper& sw) UpdateTransferEvent(); } + //for (u32 i = 0; i < NUM_REVERB_REGS; i++) + //Log_WarningPrintf("Reverb[%u] = 0x%04X", i, m_reverb_registers.rev[i]); + return !sw.HasError(); } diff --git a/src/core/spu.h b/src/core/spu.h index af4b1d65a..5e1c05d25 100644 --- a/src/core/spu.h +++ b/src/core/spu.h @@ -70,7 +70,7 @@ private: 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; - static constexpr u32 NUM_REVERB_REGS = 16; + static constexpr u32 NUM_REVERB_REGS = 32; static constexpr u32 FIFO_SIZE_IN_HALFWORDS = 32; static constexpr TickCount TRANSFER_TICKS_PER_HALFWORD = 32;