diff --git a/src/core/save_state_version.h b/src/core/save_state_version.h index ccff222be..0c30b6be4 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 = 12; +static constexpr u32 SAVE_STATE_VERSION = 13; diff --git a/src/core/spu.cpp b/src/core/spu.cpp index c16feb6f7..d8ba9104e 100644 --- a/src/core/spu.cpp +++ b/src/core/spu.cpp @@ -40,6 +40,8 @@ void SPU::Reset() m_main_volume_right = {}; m_cd_audio_volume_left = 0; m_cd_audio_volume_right = 0; + m_external_volume_left = 0; + m_external_volume_right = 0; m_key_on_register = 0; m_key_off_register = 0; m_endx_register = 0; @@ -93,6 +95,8 @@ bool SPU::DoState(StateWrapper& sw) sw.DoPOD(&m_main_volume_right); sw.Do(&m_cd_audio_volume_left); sw.Do(&m_cd_audio_volume_right); + sw.Do(&m_external_volume_left); + sw.Do(&m_external_volume_right); sw.Do(&m_key_on_register); sw.Do(&m_key_off_register); sw.Do(&m_endx_register); @@ -219,6 +223,12 @@ u16 SPU::ReadRegister(u32 offset) case 0x1F801DB2 - SPU_BASE: return m_cd_audio_volume_right; + case 0x1F801DB4 - SPU_BASE: + return m_external_volume_left; + + case 0x1F801DB6 - SPU_BASE: + return m_external_volume_right; + case 0x1F801DB8 - SPU_BASE: m_tick_event->InvokeEarly(); return m_main_volume_left.current_level; @@ -441,6 +451,22 @@ void SPU::WriteRegister(u32 offset, u16 value) m_tick_event->InvokeEarly(); m_cd_audio_volume_right = value; } + break; + + case 0x1F801DB4 - SPU_BASE: + { + // External volumes aren't used, so don't bother syncing. + Log_DebugPrintf("SPU left external volume register <- 0x%04X", ZeroExtend32(value)); + m_external_volume_left = value; + } + break; + + case 0x1F801DB6 - SPU_BASE: + { + // External volumes aren't used, so don't bother syncing. + Log_DebugPrintf("SPU right external volume register <- 0x%04X", ZeroExtend32(value)); + m_external_volume_right = value; + } break; // read-only registers diff --git a/src/core/spu.h b/src/core/spu.h index e107c83c0..b947d59ce 100644 --- a/src/core/spu.h +++ b/src/core/spu.h @@ -399,6 +399,9 @@ private: s16 m_cd_audio_volume_left = 0; s16 m_cd_audio_volume_right = 0; + s16 m_external_volume_left = 0; + s16 m_external_volume_right = 0; + u32 m_key_on_register = 0; u32 m_key_off_register = 0; u32 m_endx_register = 0;