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;
@ -181,7 +182,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] = (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++;