mirror of https://github.com/PCSX2/pcsx2.git
Fixed effects area wrapping calculation, which was always buggy but this
wasn't evident until additional addresses were precalculated. Not expected to improve compatibility.
This commit is contained in:
parent
d1ae298211
commit
233f66db5e
|
@ -229,17 +229,13 @@ s32 V_Core::EffectsBufferIndexer(s32 offset) const
|
||||||
// already x4'd. It doesn't really make sense that we should x4 them again, and this
|
// already x4'd. It doesn't really make sense that we should x4 them again, and this
|
||||||
// seems to work. (feedback-free in bios and DDS) --air
|
// seems to work. (feedback-free in bios and DDS) --air
|
||||||
|
|
||||||
u32 pos = EffectsStartA + offset;
|
|
||||||
|
|
||||||
// Need to use modulus here, because games can and will drop the buffer size
|
// Need to use modulus here, because games can and will drop the buffer size
|
||||||
// without notice, and it leads to offsets several times past the end of the buffer.
|
// without notice, and it leads to offsets several times past the end of the buffer.
|
||||||
|
|
||||||
if (pos > EffectsEndA) {
|
if ((u32)offset >= (u32)EffectsBufferSize)
|
||||||
pos = EffectsStartA + (offset % EffectsBufferSize);
|
return EffectsStartA + (offset % EffectsBufferSize) + (offset < 0 ? EffectsBufferSize : 0);
|
||||||
} else if (pos < EffectsStartA) {
|
else
|
||||||
pos = EffectsEndA + 1 - (offset % EffectsBufferSize);
|
return EffectsStartA + offset;
|
||||||
}
|
|
||||||
return pos;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void V_Core::UpdateEffectsBufferSize()
|
void V_Core::UpdateEffectsBufferSize()
|
||||||
|
|
Loading…
Reference in New Issue