SMS: Don't process collision on sprites above screen height, fixes ecco the dolphin #1611

This commit is contained in:
alyosha-tas 2021-11-19 17:06:10 -05:00
parent c74b47315f
commit 1333813bb1
1 changed files with 8 additions and 4 deletions

View File

@ -126,6 +126,7 @@ namespace BizHawk.Emulation.Cores.Sega.MasterSystem
{
renderHappens = false;
overflowHappens = false;
collisionHappens = false;
}
int SpriteBase = SpriteAttributeTableBase;
@ -174,14 +175,15 @@ namespace BizHawk.Emulation.Cores.Sega.MasterSystem
{
if (SpriteCollisionBuffer[x + xs] != 0)
{
if (collisionHappens)
StatusByte |= 0x20; // Set Collision bit
if (collisionHappens)
StatusByte |= 0x20; // Set Collision bit
}
else if (renderHappens && ScanlinePriorityBuffer[x + xs] == 0)
{
FrameBuffer[(ys + y) * 256 + x + xs] = Palette[(color + 16)];
}
SpriteCollisionBuffer[x + xs] = 1;
if (collisionHappens)
SpriteCollisionBuffer[x + xs] = (byte)i;
}
}
SpritesDrawnThisScanline++;
@ -203,6 +205,7 @@ namespace BizHawk.Emulation.Cores.Sega.MasterSystem
{
renderHappens = false;
overflowHappens = false;
collisionHappens = false;
}
int SpriteBase = SpriteAttributeTableBase;
@ -258,7 +261,8 @@ namespace BizHawk.Emulation.Cores.Sega.MasterSystem
{
FrameBuffer[(ys + y) * 256 + x + xs] = Palette[(color + 16)];
}
SpriteCollisionBuffer[x + xs] = 1;
if (collisionHappens)
SpriteCollisionBuffer[x + xs] = 1;
}
}
SpritesDrawnThisScanline++;