SPU2: Fix Address masks for voices + Effect area

Fixes reverb in The Suffering
This commit is contained in:
refractionpcsx2 2020-12-30 01:13:52 +00:00
parent 2859123c47
commit 3d3c039596
1 changed files with 8 additions and 5 deletions

View File

@ -1102,7 +1102,7 @@ static void __fastcall RegWrite_VoiceAddr(u16 value)
switch (address) switch (address)
{ {
case 0: // SSA (Waveform Start Addr) (hiword, 4 bits only) case 0: // SSA (Waveform Start Addr) (hiword, 4 bits only)
thisvoice.StartA = ((value & 0x0F) << 16) | (thisvoice.StartA & 0xFFF8); thisvoice.StartA = ((u32)(value & 0x0F) << 16) | (thisvoice.StartA & 0xFFF8);
if (IsDevBuild) if (IsDevBuild)
DebugCores[core].Voices[voice].lastSetStartA = thisvoice.StartA; DebugCores[core].Voices[voice].lastSetStartA = thisvoice.StartA;
break; break;
@ -1114,7 +1114,7 @@ static void __fastcall RegWrite_VoiceAddr(u16 value)
break; break;
case 2: case 2:
thisvoice.LoopStartA = ((value & 0x0F) << 16) | (thisvoice.LoopStartA & 0xFFF8); thisvoice.LoopStartA = ((u32)(value & 0x0F) << 16) | (thisvoice.LoopStartA & 0xFFF8);
thisvoice.LoopMode = 1; thisvoice.LoopMode = 1;
break; break;
@ -1133,7 +1133,7 @@ static void __fastcall RegWrite_VoiceAddr(u16 value)
// without it some sound effects get cut off so we need the two NextA cases enabled. // without it some sound effects get cut off so we need the two NextA cases enabled.
case 4: case 4:
thisvoice.NextA = ((value & 0x0F) << 16) | (thisvoice.NextA & 0xFFF8) | 1; thisvoice.NextA = ((u32)(value & 0x0F) << 16) | (thisvoice.NextA & 0xFFF8) | 1;
thisvoice.SCurrent = 28; thisvoice.SCurrent = 28;
break; break;
@ -1229,6 +1229,9 @@ static void __fastcall RegWrite_Core(u16 value)
if (!thiscore.IRQEnable) if (!thiscore.IRQEnable)
Spdif.Info &= ~(4 << thiscore.Index); Spdif.Info &= ~(4 << thiscore.Index);
else
if ((thiscore.IRQA & 0xFFF00000) != 0)
DevCon.Warning("SPU2: Core %d IRQA Outside of SPU2 memory, Addr %x", thiscore.Index, thiscore.IRQA);
} }
} }
break; break;
@ -1370,7 +1373,7 @@ static void __fastcall RegWrite_Core(u16 value)
// change the end address anyway. // change the end address anyway.
// //
case REG_A_ESA: case REG_A_ESA:
SetHiWord(thiscore.ExtEffectsStartA, value); SetHiWord(thiscore.ExtEffectsStartA, value & 0xF);
if (!thiscore.FxEnable) if (!thiscore.FxEnable)
{ {
thiscore.EffectsStartA = thiscore.ExtEffectsStartA; thiscore.EffectsStartA = thiscore.ExtEffectsStartA;
@ -1390,7 +1393,7 @@ static void __fastcall RegWrite_Core(u16 value)
break; break;
case REG_A_EEA: case REG_A_EEA:
thiscore.ExtEffectsEndA = ((u32)value << 16) | 0xFFFF; thiscore.ExtEffectsEndA = ((u32)(value & 0xF) << 16) | 0xFFFF;
if (!thiscore.FxEnable) if (!thiscore.FxEnable)
{ {
thiscore.EffectsEndA = thiscore.ExtEffectsEndA; thiscore.EffectsEndA = thiscore.ExtEffectsEndA;