SPU: Stub out external volume registers

If nothing else, it'll avoid spamming the log.
This commit is contained in:
Connor McLaughlin 2020-03-24 00:22:02 +10:00
parent 7317c83a3c
commit 18cc3d5932
3 changed files with 30 additions and 1 deletions

View file

@ -2,4 +2,4 @@
#include "types.h" #include "types.h"
static constexpr u32 SAVE_STATE_MAGIC = 0x43435544; static constexpr u32 SAVE_STATE_MAGIC = 0x43435544;
static constexpr u32 SAVE_STATE_VERSION = 12; static constexpr u32 SAVE_STATE_VERSION = 13;

View file

@ -40,6 +40,8 @@ void SPU::Reset()
m_main_volume_right = {}; m_main_volume_right = {};
m_cd_audio_volume_left = 0; m_cd_audio_volume_left = 0;
m_cd_audio_volume_right = 0; m_cd_audio_volume_right = 0;
m_external_volume_left = 0;
m_external_volume_right = 0;
m_key_on_register = 0; m_key_on_register = 0;
m_key_off_register = 0; m_key_off_register = 0;
m_endx_register = 0; m_endx_register = 0;
@ -93,6 +95,8 @@ bool SPU::DoState(StateWrapper& sw)
sw.DoPOD(&m_main_volume_right); sw.DoPOD(&m_main_volume_right);
sw.Do(&m_cd_audio_volume_left); sw.Do(&m_cd_audio_volume_left);
sw.Do(&m_cd_audio_volume_right); 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_on_register);
sw.Do(&m_key_off_register); sw.Do(&m_key_off_register);
sw.Do(&m_endx_register); sw.Do(&m_endx_register);
@ -219,6 +223,12 @@ u16 SPU::ReadRegister(u32 offset)
case 0x1F801DB2 - SPU_BASE: case 0x1F801DB2 - SPU_BASE:
return m_cd_audio_volume_right; 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: case 0x1F801DB8 - SPU_BASE:
m_tick_event->InvokeEarly(); m_tick_event->InvokeEarly();
return m_main_volume_left.current_level; return m_main_volume_left.current_level;
@ -441,6 +451,22 @@ void SPU::WriteRegister(u32 offset, u16 value)
m_tick_event->InvokeEarly(); m_tick_event->InvokeEarly();
m_cd_audio_volume_right = value; 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; break;
// read-only registers // read-only registers

View file

@ -399,6 +399,9 @@ private:
s16 m_cd_audio_volume_left = 0; s16 m_cd_audio_volume_left = 0;
s16 m_cd_audio_volume_right = 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_on_register = 0;
u32 m_key_off_register = 0; u32 m_key_off_register = 0;
u32 m_endx_register = 0; u32 m_endx_register = 0;