fixed sprite hit before 255 and for non transparent hits only, thanks to dwedit for providing the fix
This commit is contained in:
parent
b8a4067542
commit
fe70d1bc32
|
@ -1074,7 +1074,8 @@ static void CheckSpriteHit(int p)
|
||||||
|
|
||||||
for(x=sphitx;x<(sphitx+8) && x<l;x++)
|
for(x=sphitx;x<(sphitx+8) && x<l;x++)
|
||||||
{
|
{
|
||||||
if((sphitdata&(0x80>>(x-sphitx))) && !(Plinef[x]&64))
|
|
||||||
|
if((sphitdata&(0x80>>(x-sphitx))) && !(Plinef[x]&64) && x < 255)
|
||||||
{
|
{
|
||||||
PPU_status|=0x40;
|
PPU_status|=0x40;
|
||||||
//printf("Ha: %d, %d, Hita: %d, %d, %d, %d, %d\n",p,p&~7,scanline,GETLASTPIXEL-16,&Plinef[x],Pline,Pline-Plinef);
|
//printf("Ha: %d, %d, Hita: %d, %d, %d, %d, %d\n",p,p&~7,scanline,GETLASTPIXEL-16,&Plinef[x],Pline,Pline-Plinef);
|
||||||
|
@ -2284,9 +2285,10 @@ int FCEUX_PPU_Loop(int skip) {
|
||||||
//1. is it sprite#0?
|
//1. is it sprite#0?
|
||||||
//2. is the bg pixel nonzero?
|
//2. is the bg pixel nonzero?
|
||||||
//then, it is spritehit.
|
//then, it is spritehit.
|
||||||
if(oam[6] == 0 && pixel != 0)
|
if(oam[6] == 0 && (pixel & 3) != 0 &&
|
||||||
|
rasterpos < 255)
|
||||||
{
|
{
|
||||||
PPU_status |= 0x40;
|
PPU_status |= 0x40;
|
||||||
}
|
}
|
||||||
havepixel = true;
|
havepixel = true;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue