mirror of https://github.com/snes9xgit/snes9x.git
add unlimited sprites (range)
This commit is contained in:
parent
20f6dab047
commit
c064706aad
14
gfx.cpp
14
gfx.cpp
|
@ -604,6 +604,7 @@ static void SetupOBJ (void)
|
|||
|
||||
int Height;
|
||||
uint8 S;
|
||||
int sprite_limit = (Settings.MaxSpriteTilesPerLine == 128) ? 128 : 32;
|
||||
|
||||
if (!PPU.OAMPriorityRotation || !(PPU.OAMFlip & PPU.OAMAddr & 1)) // normal case
|
||||
{
|
||||
|
@ -614,7 +615,7 @@ static void SetupOBJ (void)
|
|||
{
|
||||
GFX.OBJLines[i].RTOFlags = 0;
|
||||
GFX.OBJLines[i].Tiles = Settings.MaxSpriteTilesPerLine;
|
||||
for (int j = 0; j < 32; j++)
|
||||
for (int j = 0; j < sprite_limit; j++)
|
||||
GFX.OBJLines[i].OBJ[j].Sprite = -1;
|
||||
}
|
||||
|
||||
|
@ -653,7 +654,7 @@ static void SetupOBJ (void)
|
|||
if (Y >= SNES_HEIGHT_EXTENDED)
|
||||
continue;
|
||||
|
||||
if (LineOBJ[Y] >= 32)
|
||||
if (LineOBJ[Y] >= sprite_limit)
|
||||
{
|
||||
GFX.OBJLines[Y].RTOFlags |= 0x40;
|
||||
continue;
|
||||
|
@ -757,7 +758,7 @@ static void SetupOBJ (void)
|
|||
{
|
||||
if (OBJOnLine[Y][S])
|
||||
{
|
||||
if (j >= 32)
|
||||
if (j >= sprite_limit)
|
||||
{
|
||||
GFX.OBJLines[Y].RTOFlags |= 0x40;
|
||||
break;
|
||||
|
@ -774,7 +775,7 @@ static void SetupOBJ (void)
|
|||
} while (S != FirstSprite);
|
||||
}
|
||||
|
||||
if (j < 32)
|
||||
if (j < sprite_limit)
|
||||
GFX.OBJLines[Y].OBJ[j].Sprite = -1;
|
||||
}
|
||||
}
|
||||
|
@ -794,13 +795,14 @@ static void DrawOBJS (int D)
|
|||
int PixWidth = IPPU.DoubleWidthPixels ? 2 : 1;
|
||||
BG.InterlaceLine = GFX.InterlaceFrame ? 8 : 0;
|
||||
GFX.Z1 = 2;
|
||||
|
||||
int sprite_limit = (Settings.MaxSpriteTilesPerLine == 128) ? 128 : 32;
|
||||
|
||||
for (uint32 Y = GFX.StartY, Offset = Y * GFX.PPL; Y <= GFX.EndY; Y++, Offset += GFX.PPL)
|
||||
{
|
||||
int I = 0;
|
||||
int tiles = GFX.OBJLines[Y].Tiles;
|
||||
|
||||
for (int S = GFX.OBJLines[Y].OBJ[I].Sprite; S >= 0 && I < 32; S = GFX.OBJLines[Y].OBJ[++I].Sprite)
|
||||
for (int S = GFX.OBJLines[Y].OBJ[I].Sprite; S >= 0 && I < sprite_limit; S = GFX.OBJLines[Y].OBJ[++I].Sprite)
|
||||
{
|
||||
tiles += GFX.OBJVisibleTiles[S];
|
||||
if (tiles <= 0)
|
||||
|
|
Loading…
Reference in New Issue