mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2024-11-22 22:05:38 +00:00
SPU: Implement internal volume sweep register reads
Fixes muted audio in Michelin Rally Masters.
This commit is contained in:
parent
452c6e16d1
commit
7317c83a3c
|
@ -219,6 +219,14 @@ u16 SPU::ReadRegister(u32 offset)
|
|||
case 0x1F801DB2 - SPU_BASE:
|
||||
return m_cd_audio_volume_right;
|
||||
|
||||
case 0x1F801DB8 - SPU_BASE:
|
||||
m_tick_event->InvokeEarly();
|
||||
return m_main_volume_left.current_level;
|
||||
|
||||
case 0x1F801DBA - SPU_BASE:
|
||||
m_tick_event->InvokeEarly();
|
||||
return m_main_volume_right.current_level;
|
||||
|
||||
default:
|
||||
{
|
||||
if (offset < (0x1F801D80 - SPU_BASE))
|
||||
|
@ -227,6 +235,16 @@ u16 SPU::ReadRegister(u32 offset)
|
|||
if (offset >= (0x1F801DC0 - SPU_BASE) && offset <= (0x1F801DFE - SPU_BASE))
|
||||
return m_reverb_registers.rev[(offset - (0x1F801DC0 - SPU_BASE)) / 2];
|
||||
|
||||
if (offset >= (0x1F801E00 - SPU_BASE) && offset <= (0x1F801E60 - SPU_BASE))
|
||||
{
|
||||
const u32 voice_index = offset - (0x1F801E00 - SPU_BASE);
|
||||
m_tick_event->InvokeEarly();
|
||||
if (offset & 0x02)
|
||||
return m_voices[voice_index].left_volume.current_level;
|
||||
else
|
||||
return m_voices[voice_index].right_volume.current_level;
|
||||
}
|
||||
|
||||
Log_ErrorPrintf("Unknown SPU register read: offset 0x%X (address 0x%08X)", offset, offset | SPU_BASE);
|
||||
return UINT16_C(0xFFFF);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue