unsigned reserved : 4;
unsigned ofs : 28;
}ni;
- uint32_t ui;
+ u_int32_t ui;
} savageRegZPixelOffset;
/* This reg exists only on Savage4. */
unsigned passZpassOp : 3;
unsigned reserved : 3;
}ni;
- uint32_t ui;
+ u_int32_t ui;
} savageRegStencilCtrl;
/**************************
unsigned palSize : 2;
unsigned newPal : 1;
}ni;
- uint32_t ui;
+ u_int32_t ui;
} savageRegTexDescr_s4;
typedef union
{
unsigned reserved3 : 10;
unsigned newPal : 1;
}ni;
- uint32_t ui;
+ u_int32_t ui;
} savageRegTexDescr_s3d;
/* The layout of this reg is the same on Savage4 and Savage3D,
unsigned reserved : 1;
unsigned addr : 29;
}ni;
- uint32_t ui;
+ u_int32_t ui;
} savageRegTexAddr;
/* The layout of this reg is the same on Savage4 and Savage3D. */
unsigned reserved : 3;
unsigned addr : 29;
}ni;
- uint32_t ui;
+ u_int32_t ui;
} savageRegTexPalAddr;
/* The layout of this reg on Savage4 and Savage3D are very similar. */
unsigned xprClr0 : 16;
unsigned xprClr1 : 16; /* this is reserved on Savage3D */
}ni;
- uint32_t ui;
+ u_int32_t ui;
} savageRegTexXprClr; /* transparency color in RGB565 format*/
/* The layout of this reg differs between Savage4 and Savage3D.
unsigned alphaArg1Invert : 1;
unsigned alphaArg2Invert : 1;
}ni;
- uint32_t ui;
+ u_int32_t ui;
} savageRegTexCtrl_s4;
typedef union
{
unsigned texXprEn : 1;
unsigned reserved2 : 11;
}ni;
- uint32_t ui;
+ u_int32_t ui;
} savageRegTexCtrl_s3d;
/* This reg exists only on Savage4. */
unsigned colorDoDiffMul : 1;
unsigned LeftShiftVal : 2;
}ni;
- uint32_t ui;
+ u_int32_t ui;
} savageRegTexBlendCtrl;
/* This reg exists only on Savage4. */
unsigned red : 8;
unsigned alpha : 8;
}ni;
- uint32_t ui;
+ u_int32_t ui;
} savageRegTexBlendColor;
/********************************
unsigned widthInTile : 6;
unsigned bitPerPixel : 1;
}ni;
- uint32_t ui;
+ u_int32_t ui;
} savageRegTiledSurface;
/********************************
unsigned scissorYStart : 12;
unsigned alphaRefVal : 8;
}ni;
- uint32_t ui;
+ u_int32_t ui;
} savageRegDrawCtrl0;
/* This reg exists only on Savage4. */
unsigned alphaTestCmpFunc : 3;
unsigned alphaTestEn : 1;
}ni;
- uint32_t ui;
+ u_int32_t ui;
} savageRegDrawCtrl1;
/* This reg exists only on Savage4. */
struct
{
unsigned dstAlphaMode : 3;
+
+ /**
+ * This bit enables \c GL_FUNC_SUBTRACT. Like most DirectX oriented
+ * hardware, there's no way to do \c GL_FUNC_REVERSE_SUBTRACT.
+ *
+ * \todo
+ * Add support for \c GL_FUNC_SUBTRACT!
+ */
unsigned dstMinusSrc : 1;
unsigned srcAlphaMode : 3;
unsigned binaryFinalAlpha : 1;
unsigned flushPdDestWrites : 1;
unsigned flushPdZbufWrites : 1;
}ni;
- uint32_t ui;
+ u_int32_t ui;
} savageRegDrawLocalCtrl;
/* This reg exists only on Savage3D. */
unsigned texBlendCtrl : 3;
unsigned flushPdDestWrites : 1;
unsigned flushPdZbufWrites : 1;
- /* havn't found an equivalent for Savage4. Utah-driver sets it to 0. */
+
+ /**
+ * Disable perspective correct interpolation for vertex color, vertex
+ * fog, and vertex alpha. For OpenGL, this should \b always be zero.
+ */
unsigned interpMode : 1;
}ni;
- uint32_t ui;
+ u_int32_t ui;
} savageRegDrawCtrl;
#define SAVAGETBC_DECAL_S3D 0
unsigned scissorYStart : 11;
unsigned reserved2 : 5;
} ni;
- uint32_t ui;
+ u_int32_t ui;
} savageRegScissorsStart;
/* This reg exists only on Savage3D. */
unsigned scissorYEnd : 11;
unsigned reserved2 : 5;
} ni;
- uint32_t ui;
+ u_int32_t ui;
} savageRegScissorsEnd;
/********************************
unsigned reserved : 1;
unsigned addr : 29; /*quad word aligned*/
}ni;
- uint32_t ui;
+ u_int32_t ui;
} savageRegVertBufAddr;
/* I havn't found a Savage3D equivalent of this reg in the Utah-driver.
unsigned reserved : 1;
unsigned addr : 29; /*4-quad word aligned*/
}ni;
- uint32_t ui;
+ u_int32_t ui;
} savageRegDMABufAddr;
/********************************
unsigned reserved : 17;
unsigned kickOff : 1;
}ni;
- uint32_t ui;
+ u_int32_t ui;
} savageRegFlag;
/********************************
unsigned floatZEn : 1;
unsigned wToZEn : 1;
}ni;
- uint32_t ui;
+ u_int32_t ui;
} savageRegZBufCtrl_s4;
typedef union
{
unsigned drawUpdateEn : 1;
unsigned zUpdateEn : 1;
unsigned zBufEn : 1;
+
+ /**
+ * We suspect that, in conjunction with
+ * \c savageRegZBufOffset::zDepthSelect, these 2 bits are actually
+ * \c stencilUpdateEn and \c stencilBufEn. If not, then some of
+ * the bits in \c reserved2 may fulfill that purpose.
+ */
unsigned reserved1 : 2;
+
unsigned zExpOffset : 8;
unsigned wrZafterAlphaTst : 1;
unsigned reserved2 : 15;
}ni;
- uint32_t ui;
+ u_int32_t ui;
} savageRegZBufCtrl_s3d;
/* The layout of this reg on Savage4 and Savage3D is very similar. */
unsigned offset : 14;
unsigned reserved : 11; /* 12-bits in Utah-driver */
unsigned zBufWidthInTiles : 6;
+
+ /**
+ * 0 selects 16-bit depth buffer. On Savage4 hardware, 1 selects
+ * 24-bit depth buffer (with 8-bits for stencil). Though it has never
+ * been tried, we suspect that on Savage3D hardware, 1 selects 15-bit
+ * depth buffer (with 1-bit for stencil).
+ */
unsigned zDepthSelect : 1;
}ni;
- uint32_t ui;
+ u_int32_t ui;
} savageRegZBufOffset;
/* The layout of this reg is the same on Savage4 and Savage3D. */
unsigned wHigh : 6;
unsigned reserved4 : 2;
}ni;
- uint32_t ui;
+ u_int32_t ui;
} savageRegZWatermarks;
/********************************
unsigned fogMode : 1;
unsigned fogEndShift : 2;
}ni;
- uint32_t ui;
+ u_int32_t ui;
} savageRegFogCtrl;
/*not in spec, but tempo for pp and driver*/
unsigned fogDensity : 16;
unsigned fogStart : 16;
}ni;
- uint32_t ui;
+ u_int32_t ui;
} savageRegFogParam;
/**************************************
unsigned antiAliasMode : 2;
unsigned dstPixFmt : 1;
}ni;
- uint32_t ui;
+ u_int32_t ui;
} savageRegDestCtrl;
/* The layout of this reg on Savage4 and Savage3D are very similar. */
* However, it is not used in either driver. */
unsigned destFlush : 2;
}ni;
- uint32_t ui;
+ u_int32_t ui;
} savageRegDestTexWatermarks;
/* Savage4/Twister/ProSavage register BCI addresses */
#define SAVAGE_FIRST_REG 0x18
#define SAVAGE_NR_REGS 34
typedef struct savage_registers_s4_t {
- uint32_t unused1[6]; /* 0x18-0x1d */
+ u_int32_t unused1[6]; /* 0x18-0x1d */
savageRegDrawLocalCtrl drawLocalCtrl; /* 0x1e */
savageRegTexPalAddr texPalAddr; /* 0x1f */
savageRegTexCtrl_s4 texCtrl[2]; /* 0x20, 0x21 */
savageRegTexBlendCtrl texBlendCtrl[2]; /* 0x24, 0x25 */
savageRegTexXprClr texXprClr; /* 0x26 */
savageRegTexDescr_s4 texDescr; /* 0x27 */
- uint8_t fogTable[32]; /* 0x28-0x2f (8dwords) */
+ u_int8_t fogTable[32]; /* 0x28-0x2f (8dwords) */
savageRegFogCtrl fogCtrl; /* 0x30 */
savageRegStencilCtrl stencilCtrl; /* 0x31 */
savageRegZBufCtrl_s4 zBufCtrl; /* 0x32 */
savageRegTexAddr texAddr; /* 0x1a */
savageRegTexDescr_s3d texDescr; /* 0x1b */
savageRegTexCtrl_s3d texCtrl; /* 0x1c */
- uint32_t unused1[3]; /* 0x1d-0x1f */
- uint8_t fogTable[64]; /* 0x20-0x2f (16dwords) */
+ u_int32_t unused1[3]; /* 0x1d-0x1f */
+ u_int8_t fogTable[64]; /* 0x20-0x2f (16dwords) */
savageRegFogCtrl fogCtrl; /* 0x30 */
savageRegDrawCtrl drawCtrl; /* 0x31 */
savageRegZBufCtrl_s3d zBufCtrl; /* 0x32 */
savageRegScissorsEnd scissorsEnd; /* 0x36 */
savageRegZWatermarks zWatermarks; /* 0x37 */
savageRegDestTexWatermarks destTexWatermarks; /* 0x38 */
- uint32_t unused2; /* 0x39 */
+ u_int32_t unused2; /* 0x39 */
} savageRegistersS3D;
typedef union savage_registers_t {
savageRegistersS4 s4;
savageRegistersS3D s3d;
- uint32_t ui[SAVAGE_NR_REGS];
+ u_int32_t ui[SAVAGE_NR_REGS];
} savageRegisters;