definitions for used nVidia acceleration engine commands.
Written by Rudolf Cornelissen 12/2004-12/2005
*/
#ifndef NV_ACC_H
#define NV_ACC_H
typedef struct {
uint32 reserved00[0x0004];
uint16 FifoFree;
uint16 Nop;
uint32 reserved01[0x000b];
uint32 DMAPut;
uint32 DMAGet;
uint32 reserved02[0x00ae];
uint32 SetRop5;
} cmd_nv_rop5_solid;
typedef struct {
uint32 reserved00[0x0004];
uint16 FifoFree;
uint16 Nop;
uint32 reserved01[0x000b];
uint32 DMAPut;
uint32 DMAGet;
uint32 reserved02[0x00ae];
uint32 TopLeft;
uint32 HeightWidth;
} cmd_nv_image_black_rectangle;
typedef struct {
uint32 reserved00[0x0004];
uint16 FifoFree;
uint16 Nop;
uint32 reserved01[0x000b];
uint32 DMAPut;
uint32 DMAGet;
uint32 reserved02[0x00ae];
uint32 SetColorFormat;
uint32 reserved03[0x0001];
uint32 SetShape;
uint32 reserved04[0x0001];
uint32 SetColor0;
uint32 SetColor1;
uint32 SetPattern[0x0002];
} cmd_nv_image_pattern;
typedef struct {
uint32 reserved00[0x0004];
uint16 FifoFree;
uint16 Nop;
uint32 reserved01[0x000b];
uint32 DMAPut;
uint32 DMAGet;
uint32 reserved02[0x00ae];
uint32 SourceOrg;
uint32 DestOrg;
uint32 HeightWidth;
} cmd_nv_image_blit;
typedef struct {
uint32 reserved00[0x0004];
uint16 FifoFree;
uint16 Nop;
uint32 reserved01[0x000b];
uint32 DMAPut;
uint32 DMAGet;
uint32 reserved02[0x00ae];
uint32 SetColorFormat;
uint32 reserved03[0x003e];
uint32 Color1A;
struct {
uint32 LeftTop;
uint32 WidthHeight;
} UnclippedRectangle[0x40];
* (used for the 2D 'ScanlineCPUToScreenColorExpandFill' and 'ColorExpandScanline'
* functions.)
* We don't use this currently. */
U032 reserved04[(0x080)-3];
struct
{
U032 TopLeft;
U032 BottomRight;
} ClipB;
U032 Color1B;
struct
{
U032 TopLeft;
U032 BottomRight;
} ClippedRectangle[64];
U032 reserved05[(0x080)-5];
struct
{
U032 TopLeft;
U032 BottomRight;
} ClipC;
U032 Color1C;
U032 WidthHeightC;
U032 PointC;
U032 MonochromeData1C;
U032 reserved06[(0x080)+121];
struct
{
U032 TopLeft;
U032 BottomRight;
} ClipD;
U032 Color1D;
U032 WidthHeightInD;
U032 WidthHeightOutD;
U032 PointD;
U032 MonochromeData1D;
U032 reserved07[(0x080)+120];
struct
{
U032 TopLeft;
U032 BottomRight;
} ClipE;
U032 Color0E;
U032 Color1E;
U032 WidthHeightInE;
U032 WidthHeightOutE;
U032 PointE;
U032 MonochromeData01E;
*/
} cmd_nv3_gdi_rectangle_text;
typedef struct {
uint32 reserved00[0x0004];
uint16 FifoFree;
uint16 Nop;
uint32 reserved01[0x000b];
uint32 DMAPut;
uint32 DMAGet;
uint32 reserved02[0x00af];
uint32 Color;
uint32 reserved03[0x003e];
struct {
uint32 Point0;
uint32 Point1;
} Line[0x10];
struct {
uint32 Point0X;
uint32 Point0Y;
uint32 Point1X;
uint32 Point1Y;
} Line32[0x08];
struct {
uint32 Point;
} Polyline[0x20];
struct {
uint32 PointX;
uint32 PointY;
} Polyline32[0x10];
struct {
uint32 Color;
uint32 Point;
} ColorPolyline[0x10];
* colored sections */
} cmd_nv1_render_solid_lin;
* a handle should also be defined in the engine's init code, which was never done AFAIK.
* The command could be very interesting for us, as it could potentially speed-up our
* rectangle_fills :-) */
typedef struct {
uint32 reserved00[0x0004];
uint16 FifoFree;
uint16 Nop;
uint32 reserved01[0x000b];
uint32 DMAPut;
uint32 DMAGet;
uint32 reserved02[0x00af];
uint32 Color;
uint32 reserved03[0x003e];
struct {
uint32 TopLeft;
uint32 HeightWidth;
} Rectangle[0x10];
} cmd_nv_render_solid_rectangle;
typedef struct {
} cmd_nv1_image_from_cpu;
* (Used for the 2D 'ImageWriteScanline' and
* 'ScanlineImageWriteRect' functions.)
* Is this command actually usefull? */
typedef struct {
uint32 reserved00[0x0004];
uint16 FifoFree;
uint16 Nop;
uint32 reserved01[0x000b];
uint32 DMAPut;
uint32 DMAGet;
uint32 reserved02[0x00ae];
uint32 Format;
uint32 Pitch;
uint32 OffsetSource;
uint32 OffsetDest;
} cmd_nv4_surface;
* 3D specific commands *
************************/
typedef struct {
uint32 reserved00[0x0004];
uint16 FifoFree;
uint16 Nop;
uint32 reserved01[0x000b];
uint32 DMAPut;
uint32 DMAGet;
uint32 reserved02[0x00ae];
uint32 Colorkey;
uint32 Offset;
uint32 Format;
uint32 Filter;
uint32 Blend;
uint32 Control;
uint32 FogColor;
uint32 reserved03[0x0039];
struct {
float ScreenX;
float ScreenY;
float ScreenZ;
float RWH;
uint32 Color;
uint32 Specular;
float TU;
float TV;
} TLVertex[0x10];
uint32 TLVDrawPrim[0x40];
* b8-11 is I2, 4-7 is I1, b0-3 is I0:
* Ix is a TLVertex[Ix].
* So: define your (single) texture, define your
* vertexes, and then program TLVDrawPrim with the
* order to draw them.
* You can draw primitives consisting of sets of upto
* 6 out of 16 defined vertexes this way; and you can
* draw 64 sets maximum. */
} cmd_nv4_dx5_texture_triangle;
typedef struct {
uint32 reserved00[0x0004];
uint16 FifoFree;
uint16 Nop;
uint32 reserved01[0x000b];
uint32 DMAPut;
uint32 DMAGet;
uint32 reserved02[0x00b0];
uint32 Pitch;
uint32 SetOffsetColor;
uint32 SetOffsetZeta;
} cmd_nv4_context_surfaces_argb_zs;
typedef struct {
} cmd_nv4_dx6_multi_texture_triangle;
#define NV_GENERAL_FIFO_CH0 0x0000
#define NV_GENERAL_FIFO_CH1 0x2000
#define NV_GENERAL_FIFO_CH2 0x4000
#define NV_GENERAL_FIFO_CH3 0x6000
#define NV_GENERAL_FIFO_CH4 0x8000
#define NV_GENERAL_FIFO_CH5 0xa000
#define NV_GENERAL_FIFO_CH6 0xc000
#define NV_GENERAL_FIFO_CH7 0xe000
#define NV_GENERAL_DMAPUT 0x0040
#define NV_GENERAL_DMAGET 0x0044
#define NV_ROP5_SOLID_SETROP5 0x0300
#define NV_IMAGE_BLACK_RECTANGLE_TOPLEFT 0x0300
#define NV_IMAGE_PATTERN_SETCOLORFORMAT 0x0300
#define NV_IMAGE_PATTERN_SETSHAPE 0x0308
#define NV_IMAGE_PATTERN_SETCOLOR0 0x0310
#define NV_IMAGE_BLIT_SOURCEORG 0x0300
#define NV4_GDI_RECTANGLE_TEXT_SETCOLORFORMAT 0x0300
#define NV4_GDI_RECTANGLE_TEXT_COLOR1A 0x03fc
#define NV4_GDI_RECTANGLE_TEXT_UCR0_LEFTTOP 0x0400
#define NV4_SURFACE_FORMAT 0x0300
#define NV_SCALED_IMAGE_FROM_MEMORY_SETCOLORFORMAT 0x0300
#define NV_SCALED_IMAGE_FROM_MEMORY_SOURCEORG 0x0308
#define NV_SCALED_IMAGE_FROM_MEMORY_SOURCESIZE 0x0400
* 3D specific commands *
************************/
#define NV4_DX5_TEXTURE_TRIANGLE_COLORKEY 0x0300
#define NV4_DX5_TEXTURE_TRIANGLE_TLVERTEX(i) 0x0400 + (i << 5)
#define NV4_DX5_TEXTURE_TRIANGLE_TLVDRAWPRIM(i) 0x0600 + (i << 2)
#define NV4_CONTEXT_SURFACES_ARGB_ZS_PITCH 0x0308
#endif