#include "gfx.h"
#include "tile.h"
-#ifdef USE_GLIDE
-#include "3d.h"
-#endif
+#define TILE_PREAMBLE \
+ uint8 *pCache; \
+\
+ uint32 TileAddr = BG.TileAddress + ((Tile & 0x3ff) << BG.TileShift); \
+ if ((Tile & 0x1ff) >= 256) \
+ TileAddr += BG.NameSelect; \
+\
+ TileAddr &= 0xffff; \
+\
+ uint32 TileNumber; \
+ pCache = &BG.Buffer[(TileNumber = (TileAddr >> BG.TileShift)) << 6]; \
+\
+ if (!BG.Buffered [TileNumber]) \
+ BG.Buffered[TileNumber] = ConvertTile (pCache, TileAddr); \
+\
+ if (BG.Buffered [TileNumber] == BLANK_TILE) \
+ return; \
+\
+ register uint32 l; \
+ if (BG.DirectColourMode) \
+ { \
+ if (IPPU.DirectColourMapsNeedRebuild) \
+ S9xBuildDirectColourMaps (); \
+ GFX.ScreenColors = DirectColourMaps [(Tile >> 10) & BG.PaletteMask]; \
+ } \
+ else \
+ GFX.ScreenColors = &IPPU.ScreenColors [(((Tile >> 10) & BG.PaletteMask) << BG.PaletteShift) + BG.StartPalette];
+
+#define RENDER_TILE(NORMAL, FLIPPED, N) \
+ if (!(Tile & (V_FLIP | H_FLIP))) \
+ { \
+ bp = pCache + StartLine; \
+ for (l = LineCount; l != 0; l--, bp += 8, Offset += GFX.PPL) \
+ { \
+ if (*(uint32 *) bp) \
+ NORMAL (Offset, bp); \
+ if (*(uint32 *) (bp + 4)) \
+ NORMAL (Offset + N, bp + 4); \
+ } \
+ } \
+ else \
+ if (!(Tile & V_FLIP)) \
+ { \
+ bp = pCache + StartLine; \
+ for (l = LineCount; l != 0; l--, bp += 8, Offset += GFX.PPL) \
+ { \
+ if (*(uint32 *) (bp + 4)) \
+ FLIPPED (Offset, bp + 4); \
+ if (*(uint32 *) bp) \
+ FLIPPED (Offset + N, bp); \
+ } \
+ } \
+ else \
+ if (Tile & H_FLIP) \
+ { \
+ bp = pCache + 56 - StartLine; \
+ for (l = LineCount; l != 0; l--, bp -= 8, Offset += GFX.PPL) \
+ { \
+ if (*(uint32 *) (bp + 4)) \
+ FLIPPED (Offset, bp + 4); \
+ if (*(uint32 *) bp) \
+ FLIPPED (Offset + N, bp); \
+ } \
+ } \
+ else \
+ { \
+ bp = pCache + 56 - StartLine; \
+ for (l = LineCount; l != 0; l--, bp -= 8, Offset += GFX.PPL) \
+ { \
+ if (*(uint32 *) bp) \
+ NORMAL (Offset, bp); \
+ if (*(uint32 *) (bp + 4)) \
+ NORMAL (Offset + N, bp + 4); \
+ } \
+ }
+
+#define TILE_CLIP_PREAMBLE \
+ uint32 dd; \
+ uint32 d1; \
+ uint32 d2; \
+\
+ if (StartPixel < 4) \
+ { \
+ d1 = HeadMask [StartPixel]; \
+ if (StartPixel + Width < 4) \
+ d1 &= TailMask [StartPixel + Width]; \
+ } \
+ else \
+ d1 = 0; \
+\
+ if (StartPixel + Width > 4) \
+ { \
+ if (StartPixel > 4) \
+ d2 = HeadMask [StartPixel - 4]; \
+ else \
+ d2 = 0xffffffff; \
+\
+ d2 &= TailMask [(StartPixel + Width - 4)]; \
+ } \
+ else \
+ d2 = 0;
+
+
+#define RENDER_CLIPPED_TILE(NORMAL, FLIPPED, N) \
+ if (!(Tile & (V_FLIP | H_FLIP))) \
+ { \
+ bp = pCache + StartLine; \
+ for (l = LineCount; l != 0; l--, bp += 8, Offset += GFX.PPL) \
+ { \
+ if ((dd = (*(uint32 *) bp) & d1)) \
+ NORMAL (Offset, (uint8 *) &dd); \
+ if ((dd = (*(uint32 *) (bp + 4)) & d2)) \
+ NORMAL (Offset + N, (uint8 *) &dd); \
+ } \
+ } \
+ else \
+ if (!(Tile & V_FLIP)) \
+ { \
+ bp = pCache + StartLine; \
+ SWAP_DWORD (d1); \
+ SWAP_DWORD (d2); \
+ for (l = LineCount; l != 0; l--, bp += 8, Offset += GFX.PPL) \
+ { \
+ if ((dd = *(uint32 *) (bp + 4) & d1)) \
+ FLIPPED (Offset, (uint8 *) &dd); \
+ if ((dd = *(uint32 *) bp & d2)) \
+ FLIPPED (Offset + N, (uint8 *) &dd); \
+ } \
+ } \
+ else \
+ if (Tile & H_FLIP) \
+ { \
+ bp = pCache + 56 - StartLine; \
+ SWAP_DWORD (d1); \
+ SWAP_DWORD (d2); \
+ for (l = LineCount; l != 0; l--, bp -= 8, Offset += GFX.PPL) \
+ { \
+ if ((dd = *(uint32 *) (bp + 4) & d1)) \
+ FLIPPED (Offset, (uint8 *) &dd); \
+ if ((dd = *(uint32 *) bp & d2)) \
+ FLIPPED (Offset + N, (uint8 *) &dd); \
+ } \
+ } \
+ else \
+ { \
+ bp = pCache + 56 - StartLine; \
+ for (l = LineCount; l != 0; l--, bp -= 8, Offset += GFX.PPL) \
+ { \
+ if ((dd = (*(uint32 *) bp) & d1)) \
+ NORMAL (Offset, (uint8 *) &dd); \
+ if ((dd = (*(uint32 *) (bp + 4)) & d2)) \
+ NORMAL (Offset + N, (uint8 *) &dd); \
+ } \
+ }
+
+#define RENDER_TILE_LARGE(PIXEL, FUNCTION) \
+ if (!(Tile & (V_FLIP | H_FLIP))) \
+ { \
+ if ((pixel = *(pCache + StartLine + StartPixel))) \
+ { \
+ pixel = PIXEL; \
+ for (l = LineCount; l != 0; l--, sp += GFX.PPL, Depth += GFX.PPL) \
+ { \
+ for (int z = Pixels - 1; z >= 0; z--) \
+ if (GFX.Z1 > Depth [z]) \
+ { \
+ sp [z] = FUNCTION(sp + z, pixel); \
+ Depth [z] = GFX.Z2; \
+ }\
+ } \
+ } \
+ } \
+ else \
+ if (!(Tile & V_FLIP)) \
+ { \
+ StartPixel = 7 - StartPixel; \
+ if ((pixel = *(pCache + StartLine + StartPixel))) \
+ { \
+ pixel = PIXEL; \
+ for (l = LineCount; l != 0; l--, sp += GFX.PPL, Depth += GFX.PPL) \
+ { \
+ for (int z = Pixels - 1; z >= 0; z--) \
+ if (GFX.Z1 > Depth [z]) \
+ { \
+ sp [z] = FUNCTION(sp + z, pixel); \
+ Depth [z] = GFX.Z2; \
+ }\
+ } \
+ } \
+ } \
+ else \
+ if (Tile & H_FLIP) \
+ { \
+ StartPixel = 7 - StartPixel; \
+ if ((pixel = *(pCache + 56 - StartLine + StartPixel))) \
+ { \
+ pixel = PIXEL; \
+ for (l = LineCount; l != 0; l--, sp += GFX.PPL, Depth += GFX.PPL) \
+ { \
+ for (int z = Pixels - 1; z >= 0; z--) \
+ if (GFX.Z1 > Depth [z]) \
+ { \
+ sp [z] = FUNCTION(sp + z, pixel); \
+ Depth [z] = GFX.Z2; \
+ }\
+ } \
+ } \
+ } \
+ else \
+ { \
+ if ((pixel = *(pCache + 56 - StartLine + StartPixel))) \
+ { \
+ pixel = PIXEL; \
+ for (l = LineCount; l != 0; l--, sp += GFX.PPL, Depth += GFX.PPL) \
+ { \
+ for (int z = Pixels - 1; z >= 0; z--) \
+ if (GFX.Z1 > Depth [z]) \
+ { \
+ sp [z] = FUNCTION(sp + z, pixel); \
+ Depth [z] = GFX.Z2; \
+ }\
+ } \
+ } \
+ }
+
+#define RENDER_TILEHI(NORMAL, FLIPPED, N) \
+ if (!(Tile & (V_FLIP | H_FLIP))) \
+ { \
+ bp = pCache + StartLine; \
+ for (l = LineCount; l != 0; l--, bp += 8, Offset += GFX.PPL) \
+ { \
+ /*if (*(uint32 *) bp)*/if (((uint32)bp[0])|((uint32)bp[2])|((uint32)bp[4])|((uint32)bp[6])) \
+ NORMAL (Offset, bp); \
+ } \
+ } \
+ else \
+ if (!(Tile & V_FLIP)) \
+ { \
+ bp = pCache + StartLine; \
+ for (l = LineCount; l != 0; l--, bp += 8, Offset += GFX.PPL) \
+ { \
+ /*if (*(uint32 *) (bp + 4))*/if (((uint32)bp[0])|((uint32)bp[2])|((uint32)bp[4])|((uint32)bp[6])) \
+ FLIPPED (Offset, bp); \
+ } \
+ } \
+ else \
+ if (Tile & H_FLIP) \
+ { \
+ bp = pCache + 56 - StartLine; \
+ for (l = LineCount; l != 0; l--, bp -= 8, Offset += GFX.PPL) \
+ { \
+ /*if (*(uint32 *) (bp + 4))*/if (((uint32)bp[0])|((uint32)bp[2])|((uint32)bp[4])|((uint32)bp[6])) \
+ FLIPPED (Offset, bp); \
+ } \
+ } \
+ else \
+ { \
+ bp = pCache + 56 - StartLine; \
+ for (l = LineCount; l != 0; l--, bp -= 8, Offset += GFX.PPL) \
+ { \
+ /*if (*(uint32 *) bp)*/if (((uint32)bp[0])|((uint32)bp[2])|((uint32)bp[4])|((uint32)bp[6])) \
+ NORMAL (Offset, bp); \
+ } \
+ }
+
+
+
+#define RENDER_CLIPPED_TILEHI(NORMAL, FLIPPED, N) \
+ d1=(d1&0xFF)|((d1&0xFF0000)>>8)|((d2&0xFF)<<16)|((d2&0xFF0000)<<8);\
+ if (!(Tile & (V_FLIP | H_FLIP))) \
+ { \
+ bp = pCache + StartLine; \
+ for (l = LineCount; l != 0; l--, bp += 8, Offset += GFX.PPL) \
+ { \
+ /*if ((dd = (*(uint32 *) bp) & d1))*/if ((dd = (((((uint32)bp[6])<<24)|(((uint32)bp[4])<<16)|(((uint32)bp[2])<<8)|((uint32)bp[0]))&d1))) \
+ NORMAL (Offset, (uint8 *) &dd); \
+ } \
+ } \
+ else \
+ if (!(Tile & V_FLIP)) \
+ { \
+ bp = pCache + StartLine; \
+ SWAP_DWORD (d1); \
+ /*SWAP_DWORD (d2);*/ \
+ for (l = LineCount; l != 0; l--, bp += 8, Offset += GFX.PPL) \
+ { \
+ /*if ((dd = *(uint32 *) (bp + 4) & d1))*/if ((dd = (((((uint32)bp[6])<<24)|(((uint32)bp[4])<<16)|(((uint32)bp[2])<<8)|((uint32)bp[0]))&d1))) \
+ FLIPPED (Offset, (uint8 *) &dd); \
+ } \
+ } \
+ else \
+ if (Tile & H_FLIP) \
+ { \
+ bp = pCache + 56 - StartLine; \
+ SWAP_DWORD (d1); \
+ /*SWAP_DWORD (d2);*/ \
+ for (l = LineCount; l != 0; l--, bp -= 8, Offset += GFX.PPL) \
+ { \
+ /*if ((dd = *(uint32 *) (bp + 4) & d1))*/if ((dd = (((((uint32)bp[6])<<24)|(((uint32)bp[4])<<16)|(((uint32)bp[2])<<8)|((uint32)bp[0]))&d1))) \
+ FLIPPED (Offset, (uint8 *) &dd); \
+ } \
+ } \
+ else \
+ { \
+ bp = pCache + 56 - StartLine; \
+ for (l = LineCount; l != 0; l--, bp -= 8, Offset += GFX.PPL) \
+ { \
+ /*if ((dd = (*(uint32 *) bp) & d1))*/ if ((dd = (((((uint32)bp[6])<<24)|(((uint32)bp[4])<<16)|(((uint32)bp[2])<<8)|((uint32)bp[0]))&d1))) \
+ NORMAL (Offset, (uint8 *) &dd); \
+ } \
+ }
extern uint32 HeadMask [4];
extern uint32 TailMask [5];
return (non_zero ? TRUE : BLANK_TILE);
}
-INLINE void WRITE_4PIXELS (uint32 Offset, uint8 *Pixels, struct SGFX * gfx)
+INLINE void WRITE_4PIXELS (uint32 Offset, uint8 *Pixels)
{
register uint8 Pixel;
- uint8 *Screen = gfx->S + Offset;
- uint8 *Depth = gfx->DB + Offset;
+ uint8 *Screen = GFX.S + Offset;
+ uint8 *Depth = GFX.DB + Offset;
#define FN(N) \
- if (gfx->Z1 > Depth [N] && (Pixel = Pixels[N])) \
+ if (GFX.Z1 > Depth [N] && (Pixel = Pixels[N])) \
{ \
- Screen [N] = (uint8) gfx->ScreenColors [Pixel]; \
- Depth [N] = gfx->Z2; \
+ Screen [N] = (uint8) GFX.ScreenColors [Pixel]; \
+ Depth [N] = GFX.Z2; \
}
FN(0)
#undef FN
}
-INLINE void WRITE_4PIXELS_FLIPPED (uint32 Offset, uint8 *Pixels, struct SGFX * gfx)
+INLINE void WRITE_4PIXELS_FLIPPED (uint32 Offset, uint8 *Pixels)
{
register uint8 Pixel;
- uint8 *Screen = gfx->S + Offset;
- uint8 *Depth = gfx->DB + Offset;
+ uint8 *Screen = GFX.S + Offset;
+ uint8 *Depth = GFX.DB + Offset;
#define FN(N) \
- if (gfx->Z1 > Depth [N] && (Pixel = Pixels[3 - N])) \
+ if (GFX.Z1 > Depth [N] && (Pixel = Pixels[3 - N])) \
{ \
- Screen [N] = (uint8) gfx->ScreenColors [Pixel]; \
- Depth [N] = gfx->Z2; \
+ Screen [N] = (uint8) GFX.ScreenColors [Pixel]; \
+ Depth [N] = GFX.Z2; \
}
FN(0)
#undef FN
}
-INLINE void WRITE_4PIXELSx2 (uint32 Offset, uint8 *Pixels, struct SGFX * gfx)
+INLINE void WRITE_4PIXELSx2 (uint32 Offset, uint8 *Pixels)
{
register uint8 Pixel;
- uint8 *Screen = gfx->S + Offset;
- uint8 *Depth = gfx->DB + Offset;
+ uint8 *Screen = GFX.S + Offset;
+ uint8 *Depth = GFX.DB + Offset;
#define FN(N) \
- if (gfx->Z1 > Depth [0] && (Pixel = Pixels[N])) \
+ if (GFX.Z1 > Depth [0] && (Pixel = Pixels[N])) \
{ \
- Screen [N * 2] = Screen [N * 2 + 1] = (uint8) gfx->ScreenColors [Pixel]; \
- Depth [N * 2] = Depth [N * 2 + 1] = gfx->Z2; \
+ Screen [N * 2] = Screen [N * 2 + 1] = (uint8) GFX.ScreenColors [Pixel]; \
+ Depth [N * 2] = Depth [N * 2 + 1] = GFX.Z2; \
}
FN(0)
#undef FN
}
-INLINE void WRITE_4PIXELS_FLIPPEDx2 (uint32 Offset, uint8 *Pixels, struct SGFX * gfx)
+INLINE void WRITE_4PIXELS_FLIPPEDx2 (uint32 Offset, uint8 *Pixels)
{
register uint8 Pixel;
- uint8 *Screen = gfx->S + Offset;
- uint8 *Depth = gfx->DB + Offset;
+ uint8 *Screen = GFX.S + Offset;
+ uint8 *Depth = GFX.DB + Offset;
#define FN(N) \
- if (gfx->Z1 > Depth [N * 2] && (Pixel = Pixels[3 - N])) \
+ if (GFX.Z1 > Depth [N * 2] && (Pixel = Pixels[3 - N])) \
{ \
- Screen [N * 2] = Screen [N * 2 + 1] = (uint8) gfx->ScreenColors [Pixel]; \
- Depth [N * 2] = Depth [N * 2 + 1] = gfx->Z2; \
+ Screen [N * 2] = Screen [N * 2 + 1] = (uint8) GFX.ScreenColors [Pixel]; \
+ Depth [N * 2] = Depth [N * 2 + 1] = GFX.Z2; \
}
FN(0)
#undef FN
}
-INLINE void WRITE_4PIXELSx2x2 (uint32 Offset, uint8 *Pixels, struct SGFX * gfx)
+INLINE void WRITE_4PIXELSx2x2 (uint32 Offset, uint8 *Pixels)
{
register uint8 Pixel;
- uint8 *Screen = gfx->S + Offset;
- uint8 *Depth = gfx->DB + Offset;
+ uint8 *Screen = GFX.S + Offset;
+ uint8 *Depth = GFX.DB + Offset;
#define FN(N) \
- if (gfx->Z1 > Depth [N * 2] && (Pixel = Pixels[N])) \
+ if (GFX.Z1 > Depth [N * 2] && (Pixel = Pixels[N])) \
{ \
- Screen [N * 2] = Screen [N * 2 + 1] = Screen [gfx->RealPitch + N * 2] = \
- Screen [gfx->RealPitch + N * 2 + 1] = (uint8) gfx->ScreenColors [Pixel]; \
- Depth [N * 2] = Depth [N * 2 + 1] = Depth [gfx->RealPitch + N * 2] = \
- Depth [gfx->RealPitch + N * 2 + 1] = gfx->Z2; \
+ Screen [N * 2] = Screen [N * 2 + 1] = Screen [GFX.Pitch + N * 2] = \
+ Screen [GFX.Pitch + N * 2 + 1] = (uint8) GFX.ScreenColors [Pixel]; \
+ Depth [N * 2] = Depth [N * 2 + 1] = Depth [GFX.Pitch + N * 2] = \
+ Depth [GFX.Pitch + N * 2 + 1] = GFX.Z2; \
}
FN(0)
#undef FN
}
-INLINE void WRITE_4PIXELS_FLIPPEDx2x2 (uint32 Offset, uint8 *Pixels, struct SGFX * gfx)
+INLINE void WRITE_4PIXELS_FLIPPEDx2x2 (uint32 Offset, uint8 *Pixels)
{
register uint8 Pixel;
- uint8 *Screen = gfx->S + Offset;
- uint8 *Depth = gfx->DB + Offset;
+ uint8 *Screen = GFX.S + Offset;
+ uint8 *Depth = GFX.DB + Offset;
#define FN(N) \
- if (gfx->Z1 > Depth [N * 2] && (Pixel = Pixels[3 - N])) \
+ if (GFX.Z1 > Depth [N * 2] && (Pixel = Pixels[3 - N])) \
{ \
- Screen [N * 2] = Screen [N * 2 + 1] = Screen [gfx->RealPitch + N * 2] = \
- Screen [gfx->RealPitch + N * 2 + 1] = (uint8) gfx->ScreenColors [Pixel]; \
- Depth [N * 2] = Depth [N * 2 + 1] = Depth [gfx->RealPitch + N * 2] = \
- Depth [gfx->RealPitch + N * 2 + 1] = gfx->Z2; \
+ Screen [N * 2] = Screen [N * 2 + 1] = Screen [GFX.Pitch + N * 2] = \
+ Screen [GFX.Pitch + N * 2 + 1] = (uint8) GFX.ScreenColors [Pixel]; \
+ Depth [N * 2] = Depth [N * 2 + 1] = Depth [GFX.Pitch + N * 2] = \
+ Depth [GFX.Pitch + N * 2 + 1] = GFX.Z2; \
}
FN(0)
#undef FN
}
-void DrawTile (uint32 Tile, uint32 Offset, uint32 StartLine,
- uint32 LineCount, struct SGFX * gfx)
+void DrawTile(uint32 Tile, uint32 Offset, uint32 StartLine, uint32 LineCount)
{
TILE_PREAMBLE
RENDER_TILE(WRITE_4PIXELS, WRITE_4PIXELS_FLIPPED, 4)
}
-void DrawClippedTile (uint32 Tile, uint32 Offset,
+void DrawClippedTile(uint32 Tile, uint32 Offset,
uint32 StartPixel, uint32 Width,
- uint32 StartLine, uint32 LineCount, struct SGFX * gfx)
+ uint32 StartLine, uint32 LineCount)
{
TILE_PREAMBLE
register uint8 *bp;
RENDER_CLIPPED_TILE(WRITE_4PIXELS, WRITE_4PIXELS_FLIPPED, 4)
}
-void DrawTilex2 (uint32 Tile, uint32 Offset, uint32 StartLine,
- uint32 LineCount, struct SGFX * gfx)
+void DrawTilex2 (uint32 Tile, uint32 Offset, uint32 StartLine, uint32 LineCount)
{
TILE_PREAMBLE
void DrawClippedTilex2 (uint32 Tile, uint32 Offset,
uint32 StartPixel, uint32 Width,
- uint32 StartLine, uint32 LineCount, struct SGFX * gfx)
+ uint32 StartLine, uint32 LineCount)
{
TILE_PREAMBLE
register uint8 *bp;
}
void DrawTilex2x2 (uint32 Tile, uint32 Offset, uint32 StartLine,
- uint32 LineCount, struct SGFX * gfx)
+ uint32 LineCount)
{
TILE_PREAMBLE
void DrawClippedTilex2x2 (uint32 Tile, uint32 Offset,
uint32 StartPixel, uint32 Width,
- uint32 StartLine, uint32 LineCount, struct SGFX * gfx)
+ uint32 StartLine, uint32 LineCount)
{
TILE_PREAMBLE
register uint8 *bp;
void DrawLargePixel (uint32 Tile, uint32 Offset,
uint32 StartPixel, uint32 Pixels,
- uint32 StartLine, uint32 LineCount, struct SGFX * gfx)
+ uint32 StartLine, uint32 LineCount)
{
TILE_PREAMBLE
- register uint8 *sp = gfx->S + Offset;
- uint8 *Depth = gfx->DB + Offset;
+ register uint8 *sp = GFX.S + Offset;
+ uint8 *Depth = GFX.DB + Offset;
uint8 pixel;
#define PLOT_PIXEL(screen, pixel) (pixel)
- RENDER_TILE_LARGE (((uint8) gfx->ScreenColors [pixel]), PLOT_PIXEL)
+ RENDER_TILE_LARGE (((uint8) GFX.ScreenColors [pixel]), PLOT_PIXEL)
}
-INLINE void WRITE_4PIXELS16 (uint32 Offset, uint8 *Pixels, struct SGFX * gfx)
+INLINE void WRITE_4PIXELS16 (uint32 Offset, uint8 *Pixels)
{
register uint32 Pixel;
- uint16 *Screen = (uint16 *) gfx->S + Offset;
- uint8 *Depth = gfx->DB + Offset;
+ uint16 *Screen = (uint16 *) GFX.S + Offset;
+ uint8 *Depth = GFX.DB + Offset;
#define FN(N) \
- if (gfx->Z1 > Depth [N] && (Pixel = Pixels[N])) \
+ if (GFX.Z1 > Depth [N] && (Pixel = Pixels[N])) \
{ \
- Screen [N] = gfx->ScreenColors [Pixel]; \
- Depth [N] = gfx->Z2; \
+ Screen [N] = GFX.ScreenColors [Pixel]; \
+ Depth [N] = GFX.Z2; \
}
FN(0)
#undef FN
}
-INLINE void WRITE_4PIXELS16_FLIPPED (uint32 Offset, uint8 *Pixels, struct SGFX * gfx)
+INLINE void WRITE_4PIXELS16_FLIPPED (uint32 Offset, uint8 *Pixels)
{
register uint32 Pixel;
- uint16 *Screen = (uint16 *) gfx->S + Offset;
- uint8 *Depth = gfx->DB + Offset;
+ uint16 *Screen = (uint16 *) GFX.S + Offset;
+ uint8 *Depth = GFX.DB + Offset;
#define FN(N) \
- if (gfx->Z1 > Depth [N] && (Pixel = Pixels[3 - N])) \
+ if (GFX.Z1 > Depth [N] && (Pixel = Pixels[3 - N])) \
{ \
- Screen [N] = gfx->ScreenColors [Pixel]; \
- Depth [N] = gfx->Z2; \
+ Screen [N] = GFX.ScreenColors [Pixel]; \
+ Depth [N] = GFX.Z2; \
}
FN(0)
#undef FN
}
-INLINE void WRITE_4PIXELS16x2 (uint32 Offset, uint8 *Pixels, struct SGFX * gfx)
+INLINE void WRITE_4PIXELS16x2 (uint32 Offset, uint8 *Pixels)
{
register uint32 Pixel;
- uint16 *Screen = (uint16 *) gfx->S + Offset;
- uint8 *Depth = gfx->DB + Offset;
+ uint16 *Screen = (uint16 *) GFX.S + Offset;
+ uint8 *Depth = GFX.DB + Offset;
#define FN(N) \
- if (gfx->Z1 > Depth [N * 2] && (Pixel = Pixels[N])) \
+ if (GFX.Z1 > Depth [N * 2] && (Pixel = Pixels[N])) \
{ \
- Screen [N * 2] = Screen [N * 2 + 1] = gfx->ScreenColors [Pixel]; \
- Depth [N * 2] = Depth [N * 2 + 1] = gfx->Z2; \
+ Screen [N * 2] = Screen [N * 2 + 1] = GFX.ScreenColors [Pixel]; \
+ Depth [N * 2] = Depth [N * 2 + 1] = GFX.Z2; \
}
FN(0)
#undef FN
}
-INLINE void WRITE_4PIXELS16_FLIPPEDx2 (uint32 Offset, uint8 *Pixels, struct SGFX * gfx)
+INLINE void WRITE_4PIXELS16_FLIPPEDx2 (uint32 Offset, uint8 *Pixels)
{
register uint32 Pixel;
- uint16 *Screen = (uint16 *) gfx->S + Offset;
- uint8 *Depth = gfx->DB + Offset;
+ uint16 *Screen = (uint16 *) GFX.S + Offset;
+ uint8 *Depth = GFX.DB + Offset;
#define FN(N) \
- if (gfx->Z1 > Depth [N * 2] && (Pixel = Pixels[3 - N])) \
+ if (GFX.Z1 > Depth [N * 2] && (Pixel = Pixels[3 - N])) \
{ \
- Screen [N * 2] = Screen [N * 2 + 1] = gfx->ScreenColors [Pixel]; \
- Depth [N * 2] = Depth [N * 2 + 1] = gfx->Z2; \
+ Screen [N * 2] = Screen [N * 2 + 1] = GFX.ScreenColors [Pixel]; \
+ Depth [N * 2] = Depth [N * 2 + 1] = GFX.Z2; \
}
FN(0)
#undef FN
}
-INLINE void WRITE_4PIXELS16x2x2 (uint32 Offset, uint8 *Pixels, struct SGFX * gfx)
+INLINE void WRITE_4PIXELS16x2x2 (uint32 Offset, uint8 *Pixels)
{
register uint32 Pixel;
- uint16 *Screen = (uint16 *) gfx->S + Offset;
- uint8 *Depth = gfx->DB + Offset;
+ uint16 *Screen = (uint16 *) GFX.S + Offset;
+ uint8 *Depth = GFX.DB + Offset;
#define FN(N) \
- if (gfx->Z1 > Depth [N * 2] && (Pixel = Pixels[N])) \
+ if (GFX.Z1 > Depth [N * 2] && (Pixel = Pixels[N])) \
{ \
- Screen [N * 2] = Screen [N * 2 + 1] = Screen [(gfx->RealPitch >> 1) + N * 2] = \
- Screen [(gfx->RealPitch >> 1) + N * 2 + 1] = gfx->ScreenColors [Pixel]; \
- Depth [N * 2] = Depth [N * 2 + 1] = Depth [(gfx->RealPitch >> 1) + N * 2] = \
- Depth [(gfx->RealPitch >> 1) + N * 2 + 1] = gfx->Z2; \
+ Screen [N * 2] = Screen [N * 2 + 1] = Screen [(GFX.Pitch >> 1) + N * 2] = \
+ Screen [(GFX.Pitch >> 1) + N * 2 + 1] = GFX.ScreenColors [Pixel]; \
+ Depth [N * 2] = Depth [N * 2 + 1] = Depth [(GFX.Pitch >> 1) + N * 2] = \
+ Depth [(GFX.Pitch >> 1) + N * 2 + 1] = GFX.Z2; \
}
FN(0)
#undef FN
}
-INLINE void WRITE_4PIXELS16_FLIPPEDx2x2 (uint32 Offset, uint8 *Pixels, struct SGFX * gfx)
+INLINE void WRITE_4PIXELS16_FLIPPEDx2x2 (uint32 Offset, uint8 *Pixels)
{
register uint32 Pixel;
- uint16 *Screen = (uint16 *) gfx->S + Offset;
- uint8 *Depth = gfx->DB + Offset;
+ uint16 *Screen = (uint16 *) GFX.S + Offset;
+ uint8 *Depth = GFX.DB + Offset;
#define FN(N) \
- if (gfx->Z1 > Depth [N * 2] && (Pixel = Pixels[3 - N])) \
+ if (GFX.Z1 > Depth [N * 2] && (Pixel = Pixels[3 - N])) \
{ \
- Screen [N * 2] = Screen [N * 2 + 1] = Screen [(gfx->RealPitch >> 1) + N * 2] = \
- Screen [(gfx->RealPitch >> 1) + N * 2 + 1] = gfx->ScreenColors [Pixel]; \
- Depth [N * 2] = Depth [N * 2 + 1] = Depth [(gfx->RealPitch >> 1) + N * 2] = \
- Depth [(gfx->RealPitch >> 1) + N * 2 + 1] = gfx->Z2; \
+ Screen [N * 2] = Screen [N * 2 + 1] = Screen [(GFX.Pitch >> 1) + N * 2] = \
+ Screen [(GFX.Pitch >> 1) + N * 2 + 1] = GFX.ScreenColors [Pixel]; \
+ Depth [N * 2] = Depth [N * 2 + 1] = Depth [(GFX.Pitch >> 1) + N * 2] = \
+ Depth [(GFX.Pitch >> 1) + N * 2 + 1] = GFX.Z2; \
}
FN(0)
}
void DrawTile16 (uint32 Tile, uint32 Offset, uint32 StartLine,
- uint32 LineCount, struct SGFX * gfx)
+ uint32 LineCount)
{
TILE_PREAMBLE
register uint8 *bp;
void DrawClippedTile16 (uint32 Tile, uint32 Offset,
uint32 StartPixel, uint32 Width,
- uint32 StartLine, uint32 LineCount, struct SGFX * gfx)
+ uint32 StartLine, uint32 LineCount)
{
TILE_PREAMBLE
register uint8 *bp;
}
void DrawTile16x2 (uint32 Tile, uint32 Offset, uint32 StartLine,
- uint32 LineCount, struct SGFX * gfx)
+ uint32 LineCount)
{
TILE_PREAMBLE
register uint8 *bp;
void DrawClippedTile16x2 (uint32 Tile, uint32 Offset,
uint32 StartPixel, uint32 Width,
- uint32 StartLine, uint32 LineCount, struct SGFX * gfx)
+ uint32 StartLine, uint32 LineCount)
{
TILE_PREAMBLE
register uint8 *bp;
}
void DrawTile16x2x2 (uint32 Tile, uint32 Offset, uint32 StartLine,
- uint32 LineCount, struct SGFX * gfx)
+ uint32 LineCount)
{
TILE_PREAMBLE
register uint8 *bp;
void DrawClippedTile16x2x2 (uint32 Tile, uint32 Offset,
uint32 StartPixel, uint32 Width,
- uint32 StartLine, uint32 LineCount, struct SGFX * gfx)
+ uint32 StartLine, uint32 LineCount)
{
TILE_PREAMBLE
register uint8 *bp;
void DrawLargePixel16 (uint32 Tile, uint32 Offset,
uint32 StartPixel, uint32 Pixels,
- uint32 StartLine, uint32 LineCount, struct SGFX * gfx)
+ uint32 StartLine, uint32 LineCount)
{
TILE_PREAMBLE
- register uint16 *sp = (uint16 *) gfx->S + Offset;
- uint8 *Depth = gfx->DB + Offset;
+ register uint16 *sp = (uint16 *) GFX.S + Offset;
+ uint8 *Depth = GFX.DB + Offset;
uint16 pixel;
- RENDER_TILE_LARGE (gfx->ScreenColors [pixel], PLOT_PIXEL)
+ RENDER_TILE_LARGE (GFX.ScreenColors [pixel], PLOT_PIXEL)
}
-INLINE void WRITE_4PIXELS16_ADD (uint32 Offset, uint8 *Pixels, struct SGFX * gfx)
+INLINE void WRITE_4PIXELS16_ADD (uint32 Offset, uint8 *Pixels)
{
register uint32 Pixel;
- uint16 *Screen = (uint16 *) gfx->S + Offset;
- uint8 *Depth = gfx->ZBuffer + Offset;
- uint8 *SubDepth = gfx->SubZBuffer + Offset;
+ uint16 *Screen = (uint16 *) GFX.S + Offset;
+ uint8 *Depth = GFX.ZBuffer + Offset;
+ uint8 *SubDepth = GFX.SubZBuffer + Offset;
#define FN(N) \
- if (gfx->Z1 > Depth [N] && (Pixel = Pixels[N])) \
+ if (GFX.Z1 > Depth [N] && (Pixel = Pixels[N])) \
{ \
if (SubDepth [N]) \
{ \
if (SubDepth [N] != 1) \
- Screen [N] = COLOR_ADD (gfx->ScreenColors [Pixel], \
- Screen [gfx->Delta + N]); \
+ Screen [N] = COLOR_ADD (GFX.ScreenColors [Pixel], \
+ Screen [GFX.Delta + N]); \
else \
- Screen [N] = COLOR_ADD (gfx->ScreenColors [Pixel], \
- gfx->FixedColour); \
+ Screen [N] = COLOR_ADD (GFX.ScreenColors [Pixel], \
+ GFX.FixedColour); \
} \
else \
- Screen [N] = gfx->ScreenColors [Pixel]; \
- Depth [N] = gfx->Z2; \
+ Screen [N] = GFX.ScreenColors [Pixel]; \
+ Depth [N] = GFX.Z2; \
}
FN(0)
#undef FN
}
-INLINE void WRITE_4PIXELS16_FLIPPED_ADD (uint32 Offset, uint8 *Pixels, struct SGFX * gfx)
+INLINE void WRITE_4PIXELS16_FLIPPED_ADD (uint32 Offset, uint8 *Pixels)
{
register uint32 Pixel;
- uint16 *Screen = (uint16 *) gfx->S + Offset;
- uint8 *Depth = gfx->ZBuffer + Offset;
- uint8 *SubDepth = gfx->SubZBuffer + Offset;
+ uint16 *Screen = (uint16 *) GFX.S + Offset;
+ uint8 *Depth = GFX.ZBuffer + Offset;
+ uint8 *SubDepth = GFX.SubZBuffer + Offset;
#define FN(N) \
- if (gfx->Z1 > Depth [N] && (Pixel = Pixels[3 - N])) \
+ if (GFX.Z1 > Depth [N] && (Pixel = Pixels[3 - N])) \
{ \
if (SubDepth [N]) \
{ \
if (SubDepth [N] != 1) \
- Screen [N] = COLOR_ADD (gfx->ScreenColors [Pixel], \
- Screen [gfx->Delta + N]); \
+ Screen [N] = COLOR_ADD (GFX.ScreenColors [Pixel], \
+ Screen [GFX.Delta + N]); \
else \
- Screen [N] = COLOR_ADD (gfx->ScreenColors [Pixel], \
- gfx->FixedColour); \
+ Screen [N] = COLOR_ADD (GFX.ScreenColors [Pixel], \
+ GFX.FixedColour); \
} \
else \
- Screen [N] = gfx->ScreenColors [Pixel]; \
- Depth [N] = gfx->Z2; \
+ Screen [N] = GFX.ScreenColors [Pixel]; \
+ Depth [N] = GFX.Z2; \
}
FN(0)
#undef FN
}
-INLINE void WRITE_4PIXELS16_ADD1_2 (uint32 Offset, uint8 *Pixels, struct SGFX * gfx)
+INLINE void WRITE_4PIXELS16_ADD1_2 (uint32 Offset, uint8 *Pixels)
{
register uint32 Pixel;
- uint16 *Screen = (uint16 *) gfx->S + Offset;
- uint8 *Depth = gfx->ZBuffer + Offset;
- uint8 *SubDepth = gfx->SubZBuffer + Offset;
+ uint16 *Screen = (uint16 *) GFX.S + Offset;
+ uint8 *Depth = GFX.ZBuffer + Offset;
+ uint8 *SubDepth = GFX.SubZBuffer + Offset;
#define FN(N) \
- if (gfx->Z1 > Depth [N] && (Pixel = Pixels[N])) \
+ if (GFX.Z1 > Depth [N] && (Pixel = Pixels[N])) \
{ \
if (SubDepth [N]) \
{ \
if (SubDepth [N] != 1) \
- Screen [N] = (uint16) (COLOR_ADD1_2 (gfx->ScreenColors [Pixel], \
- Screen [gfx->Delta + N])); \
+ Screen [N] = (uint16) (COLOR_ADD1_2 (GFX.ScreenColors [Pixel], \
+ Screen [GFX.Delta + N])); \
else \
- Screen [N] = COLOR_ADD (gfx->ScreenColors [Pixel], \
- gfx->FixedColour); \
+ Screen [N] = COLOR_ADD (GFX.ScreenColors [Pixel], \
+ GFX.FixedColour); \
} \
else \
- Screen [N] = gfx->ScreenColors [Pixel]; \
- Depth [N] = gfx->Z2; \
+ Screen [N] = GFX.ScreenColors [Pixel]; \
+ Depth [N] = GFX.Z2; \
}
FN(0)
#undef FN
}
-INLINE void WRITE_4PIXELS16_FLIPPED_ADD1_2 (uint32 Offset, uint8 *Pixels, struct SGFX * gfx)
+INLINE void WRITE_4PIXELS16_FLIPPED_ADD1_2 (uint32 Offset, uint8 *Pixels)
{
register uint32 Pixel;
- uint16 *Screen = (uint16 *) gfx->S + Offset;
- uint8 *Depth = gfx->ZBuffer + Offset;
- uint8 *SubDepth = gfx->SubZBuffer + Offset;
+ uint16 *Screen = (uint16 *) GFX.S + Offset;
+ uint8 *Depth = GFX.ZBuffer + Offset;
+ uint8 *SubDepth = GFX.SubZBuffer + Offset;
#define FN(N) \
- if (gfx->Z1 > Depth [N] && (Pixel = Pixels[3 - N])) \
+ if (GFX.Z1 > Depth [N] && (Pixel = Pixels[3 - N])) \
{ \
if (SubDepth [N]) \
{ \
if (SubDepth [N] != 1) \
- Screen [N] = (uint16) (COLOR_ADD1_2 (gfx->ScreenColors [Pixel], \
- Screen [gfx->Delta + N])); \
+ Screen [N] = (uint16) (COLOR_ADD1_2 (GFX.ScreenColors [Pixel], \
+ Screen [GFX.Delta + N])); \
else \
- Screen [N] = COLOR_ADD (gfx->ScreenColors [Pixel], \
- gfx->FixedColour); \
+ Screen [N] = COLOR_ADD (GFX.ScreenColors [Pixel], \
+ GFX.FixedColour); \
} \
else \
- Screen [N] = gfx->ScreenColors [Pixel]; \
- Depth [N] = gfx->Z2; \
+ Screen [N] = GFX.ScreenColors [Pixel]; \
+ Depth [N] = GFX.Z2; \
}
FN(0)
#undef FN
}
-INLINE void WRITE_4PIXELS16_SUB (uint32 Offset, uint8 *Pixels, struct SGFX * gfx)
+INLINE void WRITE_4PIXELS16_SUB (uint32 Offset, uint8 *Pixels)
{
register uint32 Pixel;
- uint16 *Screen = (uint16 *) gfx->S + Offset;
- uint8 *Depth = gfx->ZBuffer + Offset;
- uint8 *SubDepth = gfx->SubZBuffer + Offset;
+ uint16 *Screen = (uint16 *) GFX.S + Offset;
+ uint8 *Depth = GFX.ZBuffer + Offset;
+ uint8 *SubDepth = GFX.SubZBuffer + Offset;
#define FN(N) \
- if (gfx->Z1 > Depth [N] && (Pixel = Pixels[N])) \
+ if (GFX.Z1 > Depth [N] && (Pixel = Pixels[N])) \
{ \
if (SubDepth [N]) \
{ \
if (SubDepth [N] != 1) \
- Screen [N] = (uint16) COLOR_SUB (gfx->ScreenColors [Pixel], \
- Screen [gfx->Delta + N]); \
+ Screen [N] = (uint16) COLOR_SUB (GFX.ScreenColors [Pixel], \
+ Screen [GFX.Delta + N]); \
else \
- Screen [N] = (uint16) COLOR_SUB (gfx->ScreenColors [Pixel], \
- gfx->FixedColour); \
+ Screen [N] = (uint16) COLOR_SUB (GFX.ScreenColors [Pixel], \
+ GFX.FixedColour); \
} \
else \
- Screen [N] = gfx->ScreenColors [Pixel]; \
- Depth [N] = gfx->Z2; \
+ Screen [N] = GFX.ScreenColors [Pixel]; \
+ Depth [N] = GFX.Z2; \
}
FN(0)
#undef FN
}
-INLINE void WRITE_4PIXELS16_FLIPPED_SUB (uint32 Offset, uint8 *Pixels, struct SGFX * gfx)
+INLINE void WRITE_4PIXELS16_FLIPPED_SUB (uint32 Offset, uint8 *Pixels)
{
register uint32 Pixel;
- uint16 *Screen = (uint16 *) gfx->S + Offset;
- uint8 *Depth = gfx->ZBuffer + Offset;
- uint8 *SubDepth = gfx->SubZBuffer + Offset;
+ uint16 *Screen = (uint16 *) GFX.S + Offset;
+ uint8 *Depth = GFX.ZBuffer + Offset;
+ uint8 *SubDepth = GFX.SubZBuffer + Offset;
#define FN(N) \
- if (gfx->Z1 > Depth [N] && (Pixel = Pixels[3 - N])) \
+ if (GFX.Z1 > Depth [N] && (Pixel = Pixels[3 - N])) \
{ \
if (SubDepth [N]) \
{ \
if (SubDepth [N] != 1) \
- Screen [N] = (uint16) COLOR_SUB (gfx->ScreenColors [Pixel], \
- Screen [gfx->Delta + N]); \
+ Screen [N] = (uint16) COLOR_SUB (GFX.ScreenColors [Pixel], \
+ Screen [GFX.Delta + N]); \
else \
- Screen [N] = (uint16) COLOR_SUB (gfx->ScreenColors [Pixel], \
- gfx->FixedColour); \
+ Screen [N] = (uint16) COLOR_SUB (GFX.ScreenColors [Pixel], \
+ GFX.FixedColour); \
} \
else \
- Screen [N] = gfx->ScreenColors [Pixel]; \
- Depth [N] = gfx->Z2; \
+ Screen [N] = GFX.ScreenColors [Pixel]; \
+ Depth [N] = GFX.Z2; \
}
FN(0)
#undef FN
}
-INLINE void WRITE_4PIXELS16_SUB1_2 (uint32 Offset, uint8 *Pixels, struct SGFX * gfx)
+INLINE void WRITE_4PIXELS16_SUB1_2 (uint32 Offset, uint8 *Pixels)
{
register uint32 Pixel;
- uint16 *Screen = (uint16 *) gfx->S + Offset;
- uint8 *Depth = gfx->ZBuffer + Offset;
- uint8 *SubDepth = gfx->SubZBuffer + Offset;
+ uint16 *Screen = (uint16 *) GFX.S + Offset;
+ uint8 *Depth = GFX.ZBuffer + Offset;
+ uint8 *SubDepth = GFX.SubZBuffer + Offset;
#define FN(N) \
- if (gfx->Z1 > Depth [N] && (Pixel = Pixels[N])) \
+ if (GFX.Z1 > Depth [N] && (Pixel = Pixels[N])) \
{ \
if (SubDepth [N]) \
{ \
if (SubDepth [N] != 1) \
- Screen [N] = (uint16) COLOR_SUB1_2 (gfx->ScreenColors [Pixel], \
- Screen [gfx->Delta + N]); \
+ Screen [N] = (uint16) COLOR_SUB1_2 (GFX.ScreenColors [Pixel], \
+ Screen [GFX.Delta + N]); \
else \
- Screen [N] = (uint16) COLOR_SUB (gfx->ScreenColors [Pixel], \
- gfx->FixedColour); \
+ Screen [N] = (uint16) COLOR_SUB (GFX.ScreenColors [Pixel], \
+ GFX.FixedColour); \
} \
else \
- Screen [N] = gfx->ScreenColors [Pixel]; \
- Depth [N] = gfx->Z2; \
+ Screen [N] = GFX.ScreenColors [Pixel]; \
+ Depth [N] = GFX.Z2; \
}
FN(0)
#undef FN
}
-INLINE void WRITE_4PIXELS16_FLIPPED_SUB1_2 (uint32 Offset, uint8 *Pixels, struct SGFX * gfx)
+INLINE void WRITE_4PIXELS16_FLIPPED_SUB1_2 (uint32 Offset, uint8 *Pixels)
{
register uint32 Pixel;
- uint16 *Screen = (uint16 *) gfx->S + Offset;
- uint8 *Depth = gfx->ZBuffer + Offset;
- uint8 *SubDepth = gfx->SubZBuffer + Offset;
+ uint16 *Screen = (uint16 *) GFX.S + Offset;
+ uint8 *Depth = GFX.ZBuffer + Offset;
+ uint8 *SubDepth = GFX.SubZBuffer + Offset;
#define FN(N) \
- if (gfx->Z1 > Depth [N] && (Pixel = Pixels[3 - N])) \
+ if (GFX.Z1 > Depth [N] && (Pixel = Pixels[3 - N])) \
{ \
if (SubDepth [N]) \
{ \
if (SubDepth [N] != 1) \
- Screen [N] = (uint16) COLOR_SUB1_2 (gfx->ScreenColors [Pixel], \
- Screen [gfx->Delta + N]); \
+ Screen [N] = (uint16) COLOR_SUB1_2 (GFX.ScreenColors [Pixel], \
+ Screen [GFX.Delta + N]); \
else \
- Screen [N] = (uint16) COLOR_SUB (gfx->ScreenColors [Pixel], \
- gfx->FixedColour); \
+ Screen [N] = (uint16) COLOR_SUB (GFX.ScreenColors [Pixel], \
+ GFX.FixedColour); \
} \
else \
- Screen [N] = gfx->ScreenColors [Pixel]; \
- Depth [N] = gfx->Z2; \
+ Screen [N] = GFX.ScreenColors [Pixel]; \
+ Depth [N] = GFX.Z2; \
}
FN(0)
void DrawTile16Add (uint32 Tile, uint32 Offset, uint32 StartLine,
- uint32 LineCount, struct SGFX * gfx)
+ uint32 LineCount)
{
TILE_PREAMBLE
register uint8 *bp;
void DrawClippedTile16Add (uint32 Tile, uint32 Offset,
uint32 StartPixel, uint32 Width,
- uint32 StartLine, uint32 LineCount, struct SGFX * gfx)
+ uint32 StartLine, uint32 LineCount)
{
TILE_PREAMBLE
register uint8 *bp;
}
void DrawTile16Add1_2 (uint32 Tile, uint32 Offset, uint32 StartLine,
- uint32 LineCount, struct SGFX * gfx)
+ uint32 LineCount)
{
TILE_PREAMBLE
register uint8 *bp;
void DrawClippedTile16Add1_2 (uint32 Tile, uint32 Offset,
uint32 StartPixel, uint32 Width,
- uint32 StartLine, uint32 LineCount, struct SGFX * gfx)
+ uint32 StartLine, uint32 LineCount)
{
TILE_PREAMBLE
register uint8 *bp;
}
void DrawTile16Sub (uint32 Tile, uint32 Offset, uint32 StartLine,
- uint32 LineCount, struct SGFX * gfx)
+ uint32 LineCount)
{
TILE_PREAMBLE
register uint8 *bp;
void DrawClippedTile16Sub (uint32 Tile, uint32 Offset,
uint32 StartPixel, uint32 Width,
- uint32 StartLine, uint32 LineCount, struct SGFX * gfx)
+ uint32 StartLine, uint32 LineCount)
{
TILE_PREAMBLE
register uint8 *bp;
}
void DrawTile16Sub1_2 (uint32 Tile, uint32 Offset, uint32 StartLine,
- uint32 LineCount, struct SGFX * gfx)
+ uint32 LineCount)
{
TILE_PREAMBLE
register uint8 *bp;
void DrawClippedTile16Sub1_2 (uint32 Tile, uint32 Offset,
uint32 StartPixel, uint32 Width,
- uint32 StartLine, uint32 LineCount, struct SGFX * gfx)
+ uint32 StartLine, uint32 LineCount)
{
TILE_PREAMBLE
register uint8 *bp;
RENDER_CLIPPED_TILE(WRITE_4PIXELS16_SUB1_2, WRITE_4PIXELS16_FLIPPED_SUB1_2, 4)
}
-INLINE void WRITE_4PIXELS16_ADDF1_2 (uint32 Offset, uint8 *Pixels, struct SGFX * gfx)
+INLINE void WRITE_4PIXELS16_ADDF1_2 (uint32 Offset, uint8 *Pixels)
{
register uint32 Pixel;
- uint16 *Screen = (uint16 *) gfx->S + Offset;
- uint8 *Depth = gfx->ZBuffer + Offset;
- uint8 *SubDepth = gfx->SubZBuffer + Offset;
+ uint16 *Screen = (uint16 *) GFX.S + Offset;
+ uint8 *Depth = GFX.ZBuffer + Offset;
+ uint8 *SubDepth = GFX.SubZBuffer + Offset;
#define FN(N) \
- if (gfx->Z1 > Depth [N] && (Pixel = Pixels[N])) \
+ if (GFX.Z1 > Depth [N] && (Pixel = Pixels[N])) \
{ \
if (SubDepth [N] == 1) \
- Screen [N] = (uint16) (COLOR_ADD1_2 (gfx->ScreenColors [Pixel], \
- gfx->FixedColour)); \
+ Screen [N] = (uint16) (COLOR_ADD1_2 (GFX.ScreenColors [Pixel], \
+ GFX.FixedColour)); \
else \
- Screen [N] = gfx->ScreenColors [Pixel];\
- Depth [N] = gfx->Z2; \
+ Screen [N] = GFX.ScreenColors [Pixel];\
+ Depth [N] = GFX.Z2; \
}
FN(0)
#undef FN
}
-INLINE void WRITE_4PIXELS16_FLIPPED_ADDF1_2 (uint32 Offset, uint8 *Pixels, struct SGFX * gfx)
+INLINE void WRITE_4PIXELS16_FLIPPED_ADDF1_2 (uint32 Offset, uint8 *Pixels)
{
register uint32 Pixel;
- uint16 *Screen = (uint16 *) gfx->S + Offset;
- uint8 *Depth = gfx->ZBuffer + Offset;
- uint8 *SubDepth = gfx->SubZBuffer + Offset;
+ uint16 *Screen = (uint16 *) GFX.S + Offset;
+ uint8 *Depth = GFX.ZBuffer + Offset;
+ uint8 *SubDepth = GFX.SubZBuffer + Offset;
#define FN(N) \
- if (gfx->Z1 > Depth [N] && (Pixel = Pixels[3 - N])) \
+ if (GFX.Z1 > Depth [N] && (Pixel = Pixels[3 - N])) \
{ \
if (SubDepth [N] == 1) \
- Screen [N] = (uint16) (COLOR_ADD1_2 (gfx->ScreenColors [Pixel], \
- gfx->FixedColour)); \
+ Screen [N] = (uint16) (COLOR_ADD1_2 (GFX.ScreenColors [Pixel], \
+ GFX.FixedColour)); \
else \
- Screen [N] = gfx->ScreenColors [Pixel];\
- Depth [N] = gfx->Z2; \
+ Screen [N] = GFX.ScreenColors [Pixel];\
+ Depth [N] = GFX.Z2; \
}
FN(0)
#undef FN
}
-INLINE void WRITE_4PIXELS16_SUBF1_2 (uint32 Offset, uint8 *Pixels, struct SGFX * gfx)
+INLINE void WRITE_4PIXELS16_SUBF1_2 (uint32 Offset, uint8 *Pixels)
{
register uint32 Pixel;
- uint16 *Screen = (uint16 *) gfx->S + Offset;
- uint8 *Depth = gfx->ZBuffer + Offset;
- uint8 *SubDepth = gfx->SubZBuffer + Offset;
+ uint16 *Screen = (uint16 *) GFX.S + Offset;
+ uint8 *Depth = GFX.ZBuffer + Offset;
+ uint8 *SubDepth = GFX.SubZBuffer + Offset;
#define FN(N) \
- if (gfx->Z1 > Depth [N] && (Pixel = Pixels[N])) \
+ if (GFX.Z1 > Depth [N] && (Pixel = Pixels[N])) \
{ \
if (SubDepth [N] == 1) \
- Screen [N] = (uint16) COLOR_SUB1_2 (gfx->ScreenColors [Pixel], \
- gfx->FixedColour); \
+ Screen [N] = (uint16) COLOR_SUB1_2 (GFX.ScreenColors [Pixel], \
+ GFX.FixedColour); \
else \
- Screen [N] = gfx->ScreenColors [Pixel]; \
- Depth [N] = gfx->Z2; \
+ Screen [N] = GFX.ScreenColors [Pixel]; \
+ Depth [N] = GFX.Z2; \
}
FN(0)
#undef FN
}
-INLINE void WRITE_4PIXELS16_FLIPPED_SUBF1_2 (uint32 Offset, uint8 *Pixels, struct SGFX * gfx)
+INLINE void WRITE_4PIXELS16_FLIPPED_SUBF1_2 (uint32 Offset, uint8 *Pixels)
{
register uint32 Pixel;
- uint16 *Screen = (uint16 *) gfx->S + Offset;
- uint8 *Depth = gfx->ZBuffer + Offset;
- uint8 *SubDepth = gfx->SubZBuffer + Offset;
+ uint16 *Screen = (uint16 *) GFX.S + Offset;
+ uint8 *Depth = GFX.ZBuffer + Offset;
+ uint8 *SubDepth = GFX.SubZBuffer + Offset;
#define FN(N) \
- if (gfx->Z1 > Depth [N] && (Pixel = Pixels[3 - N])) \
+ if (GFX.Z1 > Depth [N] && (Pixel = Pixels[3 - N])) \
{ \
if (SubDepth [N] == 1) \
- Screen [N] = (uint16) COLOR_SUB1_2 (gfx->ScreenColors [Pixel], \
- gfx->FixedColour); \
+ Screen [N] = (uint16) COLOR_SUB1_2 (GFX.ScreenColors [Pixel], \
+ GFX.FixedColour); \
else \
- Screen [N] = gfx->ScreenColors [Pixel]; \
- Depth [N] = gfx->Z2; \
+ Screen [N] = GFX.ScreenColors [Pixel]; \
+ Depth [N] = GFX.Z2; \
}
FN(0)
}
void DrawTile16FixedAdd1_2 (uint32 Tile, uint32 Offset, uint32 StartLine,
- uint32 LineCount, struct SGFX * gfx)
+ uint32 LineCount)
{
TILE_PREAMBLE
register uint8 *bp;
void DrawClippedTile16FixedAdd1_2 (uint32 Tile, uint32 Offset,
uint32 StartPixel, uint32 Width,
- uint32 StartLine, uint32 LineCount, struct SGFX * gfx)
+ uint32 StartLine, uint32 LineCount)
{
TILE_PREAMBLE
register uint8 *bp;
}
void DrawTile16FixedSub1_2 (uint32 Tile, uint32 Offset, uint32 StartLine,
- uint32 LineCount, struct SGFX * gfx)
+ uint32 LineCount)
{
TILE_PREAMBLE
register uint8 *bp;
void DrawClippedTile16FixedSub1_2 (uint32 Tile, uint32 Offset,
uint32 StartPixel, uint32 Width,
- uint32 StartLine, uint32 LineCount, struct SGFX * gfx)
+ uint32 StartLine, uint32 LineCount)
{
TILE_PREAMBLE
register uint8 *bp;
void DrawLargePixel16Add (uint32 Tile, uint32 Offset,
uint32 StartPixel, uint32 Pixels,
- uint32 StartLine, uint32 LineCount, struct SGFX * gfx)
+ uint32 StartLine, uint32 LineCount)
{
TILE_PREAMBLE
- register uint16 *sp = (uint16 *) gfx->S + Offset;
- uint8 *Depth = gfx->ZBuffer + Offset;
+ register uint16 *sp = (uint16 *) GFX.S + Offset;
+ uint8 *Depth = GFX.ZBuffer + Offset;
register uint16 pixel;
#define LARGE_ADD_PIXEL(s, p) \
-(Depth [z + gfx->DepthDelta] ? (Depth [z + gfx->DepthDelta] != 1 ? \
- COLOR_ADD (p, *(s + gfx->Delta)) : \
- COLOR_ADD (p, gfx->FixedColour)) \
+(Depth [z + GFX.DepthDelta] ? (Depth [z + GFX.DepthDelta] != 1 ? \
+ COLOR_ADD (p, *(s + GFX.Delta)) : \
+ COLOR_ADD (p, GFX.FixedColour)) \
: p)
- RENDER_TILE_LARGE (gfx->ScreenColors [pixel], LARGE_ADD_PIXEL)
+ RENDER_TILE_LARGE (GFX.ScreenColors [pixel], LARGE_ADD_PIXEL)
}
void DrawLargePixel16Add1_2 (uint32 Tile, uint32 Offset,
uint32 StartPixel, uint32 Pixels,
- uint32 StartLine, uint32 LineCount, struct SGFX * gfx)
+ uint32 StartLine, uint32 LineCount)
{
TILE_PREAMBLE
- register uint16 *sp = (uint16 *) gfx->S + Offset;
- uint8 *Depth = gfx->ZBuffer + Offset;
+ register uint16 *sp = (uint16 *) GFX.S + Offset;
+ uint8 *Depth = GFX.ZBuffer + Offset;
register uint16 pixel;
#define LARGE_ADD_PIXEL1_2(s, p) \
-((uint16) (Depth [z + gfx->DepthDelta] ? (Depth [z + gfx->DepthDelta] != 1 ? \
- COLOR_ADD1_2 (p, *(s + gfx->Delta)) : \
- COLOR_ADD (p, gfx->FixedColour)) \
+((uint16) (Depth [z + GFX.DepthDelta] ? (Depth [z + GFX.DepthDelta] != 1 ? \
+ COLOR_ADD1_2 (p, *(s + GFX.Delta)) : \
+ COLOR_ADD (p, GFX.FixedColour)) \
: p))
- RENDER_TILE_LARGE (gfx->ScreenColors [pixel], LARGE_ADD_PIXEL1_2)
+ RENDER_TILE_LARGE (GFX.ScreenColors [pixel], LARGE_ADD_PIXEL1_2)
}
void DrawLargePixel16Sub (uint32 Tile, uint32 Offset,
uint32 StartPixel, uint32 Pixels,
- uint32 StartLine, uint32 LineCount, struct SGFX * gfx)
+ uint32 StartLine, uint32 LineCount)
{
TILE_PREAMBLE
- register uint16 *sp = (uint16 *) gfx->S + Offset;
- uint8 *Depth = gfx->ZBuffer + Offset;
+ register uint16 *sp = (uint16 *) GFX.S + Offset;
+ uint8 *Depth = GFX.ZBuffer + Offset;
register uint16 pixel;
#define LARGE_SUB_PIXEL(s, p) \
-(Depth [z + gfx->DepthDelta] ? (Depth [z + gfx->DepthDelta] != 1 ? \
- COLOR_SUB (p, *(s + gfx->Delta)) : \
- COLOR_SUB (p, gfx->FixedColour)) \
+(Depth [z + GFX.DepthDelta] ? (Depth [z + GFX.DepthDelta] != 1 ? \
+ COLOR_SUB (p, *(s + GFX.Delta)) : \
+ COLOR_SUB (p, GFX.FixedColour)) \
: p)
- RENDER_TILE_LARGE (gfx->ScreenColors [pixel], LARGE_SUB_PIXEL)
+ RENDER_TILE_LARGE (GFX.ScreenColors [pixel], LARGE_SUB_PIXEL)
}
void DrawLargePixel16Sub1_2 (uint32 Tile, uint32 Offset,
uint32 StartPixel, uint32 Pixels,
- uint32 StartLine, uint32 LineCount, struct SGFX * gfx)
+ uint32 StartLine, uint32 LineCount)
{
TILE_PREAMBLE
- register uint16 *sp = (uint16 *) gfx->S + Offset;
- uint8 *Depth = gfx->ZBuffer + Offset;
+ register uint16 *sp = (uint16 *) GFX.S + Offset;
+ uint8 *Depth = GFX.ZBuffer + Offset;
uint16 pixel;
#define LARGE_SUB_PIXEL1_2(s, p) \
-(Depth [z + gfx->DepthDelta] ? (Depth [z + gfx->DepthDelta] != 1 ? \
- COLOR_SUB1_2 (p, *(s + gfx->Delta)) : \
- COLOR_SUB (p, gfx->FixedColour)) \
+(Depth [z + GFX.DepthDelta] ? (Depth [z + GFX.DepthDelta] != 1 ? \
+ COLOR_SUB1_2 (p, *(s + GFX.Delta)) : \
+ COLOR_SUB (p, GFX.FixedColour)) \
: p)
- RENDER_TILE_LARGE (gfx->ScreenColors [pixel], LARGE_SUB_PIXEL1_2)
+ RENDER_TILE_LARGE (GFX.ScreenColors [pixel], LARGE_SUB_PIXEL1_2)
}
void DrawHiResTile16 (uint32 Tile, uint32 Offset, uint32 StartLine,
- uint32 LineCount, struct SGFX * gfx)
+ uint32 LineCount)
{
TILE_PREAMBLE
register uint8 *bp;
void DrawHiResClippedTile16 (uint32 Tile, uint32 Offset,
uint32 StartPixel, uint32 Width,
- uint32 StartLine, uint32 LineCount, struct SGFX * gfx)
+ uint32 StartLine, uint32 LineCount)
{
TILE_PREAMBLE
register uint8 *bp;
TILE_CLIP_PREAMBLE
RENDER_CLIPPED_TILEHI(WRITE_4PIXELSHI16, WRITE_4PIXELSHI16_FLIPPED, 4)
}
+