mirror of https://github.com/PCSX2/pcsx2.git
SPU: VolumeSlide: disregard phase when exp + decr
This commit is contained in:
parent
e3ca5833d0
commit
01849565aa
|
@ -144,11 +144,20 @@ void V_VolumeSlide::Update()
|
|||
}
|
||||
}
|
||||
|
||||
counter_inc = std::max<u32>(1, counter_inc);
|
||||
// Allow counter_inc to be zero only in when all bits
|
||||
// of the rate field are set
|
||||
if (Step != 3 && Shift != 0x1f)
|
||||
{
|
||||
counter_inc = std::max<u32>(1, counter_inc);
|
||||
}
|
||||
Counter += counter_inc;
|
||||
|
||||
// If negative phase "increase" to -0x8000 or "decrease" towards 0
|
||||
level_inc = Phase ? -level_inc : level_inc;
|
||||
// Unless in Exp + Decr modes
|
||||
if (!(Exp && Decr))
|
||||
{
|
||||
level_inc = Phase ? -level_inc : level_inc;
|
||||
}
|
||||
|
||||
if (Counter >= 0x8000)
|
||||
{
|
||||
|
@ -162,6 +171,11 @@ void V_VolumeSlide::Update()
|
|||
{
|
||||
s32 low = Phase ? INT16_MIN : 0;
|
||||
s32 high = Phase ? 0 : INT16_MAX;
|
||||
if (Exp)
|
||||
{
|
||||
low = 0;
|
||||
high = INT16_MAX;
|
||||
}
|
||||
Value = std::clamp<s32>(Value + level_inc, low, high);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue