#include "port.h"
-struct SGFX{
- // Initialize these variables
- uint8 *Screen;
- uint8 *SubScreen;
- uint8 *ZBuffer;
- uint8 *SubZBuffer;
- uint32 Pitch;
+struct SGFX {
+ // Initialize these variables
+ uint8 *Screen;
+ uint8 *SubScreen;
+ uint8 *ZBuffer;
+ uint8 *SubZBuffer;
+ uint32 Pitch; /// Width of surface in bytes
+ uint32 ZPitch; /// Pitch of ZBuffer
+ uint32 Delta; /// Set to (GFX.SubScreen - GFX.Screen) >> 1
+ uint32 DepthDelta; /// Set to GFX.SubZBuffer - GFX.ZBuffer
+ uint32 PPL; /// Number of pixels per line (= pitch in pixels)
// Setup in call to S9xGraphicsInit()
- int Delta;
uint16 *X2;
uint16 *ZERO_OR_X2;
uint16 *ZERO;
- uint32 RealPitch; // True pitch of Screen buffer.
- uint32 Pitch2; // Same as RealPitch except while using speed up hack for Glide.
- uint32 ZPitch; // Pitch of ZBuffer
- uint32 PPL; // Number of pixels on each of Screen buffer
- uint32 PPLx2;
- uint32 PixSize;
+
uint8 *S;
uint8 *DB;
uint16 *ScreenColors;
- uint32 DepthDelta;
uint8 Z1;
uint8 Z2;
uint32 FixedColour;
- const char *InfoString;
+
+ char *InfoString;
uint32 InfoStringTimeout;
uint32 StartY;
uint32 EndY;
#endif
#define COLOR_ADD1_2(C1, C2) \
-(((((C1) & RGB_REMOVE_LOW_BITS_MASK) + \
- ((C2) & RGB_REMOVE_LOW_BITS_MASK)) >> 1) + \
- ((C1) & (C2) & RGB_LOW_BITS_MASK) | ALPHA_BITS_MASK)
+ ((((((C1) & RGB_REMOVE_LOW_BITS_MASK) + \
+ ((C2) & RGB_REMOVE_LOW_BITS_MASK)) >> 1) + \
+ ((C1) & (C2) & RGB_LOW_BITS_MASK)) | ALPHA_BITS_MASK)
#if defined(OLD_COLOUR_BLENDING)
#define COLOR_SUB(C1, C2) \
-GFX.ZERO_OR_X2 [(((C1) | RGB_HI_BITS_MASKx2) - \
+ GFX.ZERO_OR_X2 [(((C1) | RGB_HI_BITS_MASKx2) - \
((C2) & RGB_REMOVE_LOW_BITS_MASK)) >> 1]
#else
#define COLOR_SUB(C1, C2) \
-(GFX.ZERO_OR_X2 [(((C1) | RGB_HI_BITS_MASKx2) - \
+ (GFX.ZERO_OR_X2 [(((C1) | RGB_HI_BITS_MASKx2) - \
((C2) & RGB_REMOVE_LOW_BITS_MASK)) >> 1] + \
-((C1) & RGB_LOW_BITS_MASK) - ((C2) & RGB_LOW_BITS_MASK))
+ ((C1) & RGB_LOW_BITS_MASK) - ((C2) & RGB_LOW_BITS_MASK))
#endif
#define COLOR_SUB1_2(C1, C2) \
-GFX.ZERO [(((C1) | RGB_HI_BITS_MASKx2) - \
+ GFX.ZERO [(((C1) | RGB_HI_BITS_MASKx2) - \
((C2) & RGB_REMOVE_LOW_BITS_MASK)) >> 1]
typedef void (*NormalTileRenderer) (uint32 Tile, uint32 Offset,