Merge pull request #10108 from phire/always-disable-bb

BPStructs: ensure side effects are same
This commit is contained in:
JMC47 2021-09-18 08:05:21 -04:00 committed by GitHub
commit b0144d88d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 1 deletions

View File

@ -226,6 +226,8 @@ static void BPWritten(const BPCmd& bp)
srcRect.right = bpmem.copyTexSrcXY.x + bpmem.copyTexSrcWH.x + 1;
srcRect.bottom = bpmem.copyTexSrcXY.y + bpmem.copyTexSrcWH.y + 1;
const UPE_Copy PE_copy = bpmem.triggerEFBCopy;
// Since the copy X and Y coordinates/sizes are 10-bit, the game can configure a copy region up
// to 1024x1024. Hardware tests have found that the number of bytes written does not depend on
// the configured stride, instead it is based on the size registers, writing beyond the length
@ -250,6 +252,12 @@ static void BPWritten(const BPCmd& bp)
// Just ignore it
// Apparently Mario Kart Wii in wifi mode can generate a deformed EFB copy of size 4x4
// at offset (328,1020)
if (PE_copy.copy_to_xfb == 1)
{
// Make sure we disable Bounding box to match the side effects of the non-failure path
BoundingBox::Disable();
}
return;
}
@ -262,7 +270,6 @@ static void BPWritten(const BPCmd& bp)
const u32 copy_height = srcRect.GetHeight();
// Check if we are to copy from the EFB or draw to the XFB
const UPE_Copy PE_copy = bpmem.triggerEFBCopy;
if (PE_copy.copy_to_xfb == 0)
{
// bpmem.zcontrol.pixel_format to PixelFormat::Z24 is when the game wants to copy from ZBuffer