Mario Kart 64
Loading...
Searching...
No Matches
gs2dex.h File Reference
#include <PR/ultratypes.h>
Include dependency graph for gs2dex.h:

Go to the source code of this file.

Data Structures

struct  uObjBg_t
 
struct  uObjScaleBg_t
 
union  uObjBg
 
struct  uObjSprite_t
 
union  uObjSprite
 
struct  uObjMtx_t
 
union  uObjMtx
 
struct  uObjSubMtx_t
 
union  uObjSubMtx
 
struct  uObjTxtrBlock_t
 
struct  uObjTxtrTile_t
 
struct  uObjTxtrTLUT_t
 
union  uObjTxtr
 
struct  uObjTxSprite
 

Macros

#define GS_CALC_DXT(line)   (((1 << G_TX_DXT_FRAC) - 1) / (line) + 1)
 
#define GS_PIX2TMEM(pix, siz)   ((pix) >> (4 - (siz)))
 
#define GS_PIX2DXT(pix, siz)   GS_CALC_DXT(GS_PIX2TMEM((pix), (siz)))
 
#define G_BGLT_LOADBLOCK   0x0033
 
#define G_BGLT_LOADTILE   0xfff4
 
#define G_BG_FLAG_FLIPS   0x01
 
#define G_BG_FLAG_FLIPT   0x10
 
#define G_OBJ_FLAG_FLIPS   1 << 0 /* inversion to S-direction */
 
#define G_OBJ_FLAG_FLIPT   1 << 4 /* nversion to T-direction */
 
#define G_OBJLT_TXTRBLOCK   0x00001033
 
#define G_OBJLT_TXTRTILE   0x00fc1034
 
#define G_OBJLT_TLUT   0x00000030
 
#define GS_TB_TSIZE(pix, siz)   (GS_PIX2TMEM((pix), (siz)) - 1)
 
#define GS_TB_TLINE(pix, siz)   (GS_CALC_DXT(GS_PIX2TMEM((pix), (siz))))
 
#define GS_TT_TWIDTH(pix, siz)   ((GS_PIX2TMEM((pix), (siz)) << 2) - 1)
 
#define GS_TT_THEIGHT(pix, siz)   (((pix) << 2) - 1)
 
#define GS_PAL_HEAD(head)   ((head) + 256)
 
#define GS_PAL_NUM(num)   ((num) - 1)
 
#define G_BG_1CYC   0x01
 
#define G_BG_COPY   0x02
 
#define G_OBJ_RECTANGLE   0x03
 
#define G_OBJ_SPRITE   0x04
 
#define G_OBJ_MOVEMEM   0x05
 
#define G_SELECT_DL   0xb0
 
#define G_OBJ_RENDERMODE   0xb1
 
#define G_OBJ_RECTANGLE_R   0xb2
 
#define G_OBJ_LOADTXTR   0xc1
 
#define G_OBJ_LDTX_SPRITE   0xc2
 
#define G_OBJ_LDTX_RECT   0xc3
 
#define G_OBJ_LDTX_RECT_R   0xc4
 
#define G_RDPHALF_0   0xe4
 
#define gSPBgRectangle(pkt, m, mptr)   gDma0p((pkt), (m), (mptr), 0)
 
#define gsSPBgRectangle(m, mptr)   gsDma0p((m), (mptr), 0)
 
#define gSPBgRectCopy(pkt, mptr)   gSPBgRectangle((pkt), G_BG_COPY, (mptr))
 
#define gsSPBgRectCopy(mptr)   gsSPBgRectangle(G_BG_COPY, (mptr))
 
#define gSPBgRect1Cyc(pkt, mptr)   gSPBgRectangle((pkt), G_BG_1CYC, (mptr))
 
#define gsSPBgRect1Cyc(mptr)   gsSPBgRectangle(G_BG_1CYC, (mptr))
 
#define gSPObjSprite(pkt, mptr)   gDma0p((pkt), G_OBJ_SPRITE, (mptr), 0)
 
#define gsSPObjSprite(mptr)   gsDma0p(G_OBJ_SPRITE, (mptr), 0)
 
#define gSPObjRectangle(pkt, mptr)   gDma0p((pkt), G_OBJ_RECTANGLE, (mptr), 0)
 
#define gsSPObjRectangle(mptr)   gsDma0p(G_OBJ_RECTANGLE, (mptr), 0)
 
#define gSPObjRectangleR(pkt, mptr)   gDma0p((pkt), G_OBJ_RECTANGLE_R, (mptr), 0)
 
#define gsSPObjRectangleR(mptr)   gsDma0p(G_OBJ_RECTANGLE_R, (mptr), 0)
 
#define gSPObjMatrix(pkt, mptr)   gDma1p((pkt), G_OBJ_MOVEMEM, (mptr), 0, 23)
 
#define gsSPObjMatrix(mptr)   gsDma1p(G_OBJ_MOVEMEM, (mptr), 0, 23)
 
#define gSPObjSubMatrix(pkt, mptr)   gDma1p((pkt), G_OBJ_MOVEMEM, (mptr), 2, 7)
 
#define gsSPObjSubMatrix(mptr)   gsDma1p(G_OBJ_MOVEMEM, (mptr), 2, 7)
 
#define gSPObjLoadTxtr(pkt, tptr)   gDma0p((pkt), G_OBJ_LOADTXTR, (tptr), 23)
 
#define gsSPObjLoadTxtr(tptr)   gsDma0p(G_OBJ_LOADTXTR, (tptr), 23)
 
#define gSPObjLoadTxSprite(pkt, tptr)   gDma0p((pkt), G_OBJ_LDTX_SPRITE, (tptr), 47)
 
#define gsSPObjLoadTxSprite(tptr)   gsDma0p(G_OBJ_LDTX_SPRITE, (tptr), 47)
 
#define gSPObjLoadTxRect(pkt, tptr)   gDma0p((pkt), G_OBJ_LDTX_RECT, (tptr), 47)
 
#define gsSPObjLoadTxRect(tptr)   gsDma0p(G_OBJ_LDTX_RECT, (tptr), 47)
 
#define gSPObjLoadTxRectR(pkt, tptr)   gDma0p((pkt), G_OBJ_LDTX_RECT_R, (tptr), 47)
 
#define gsSPObjLoadTxRectR(tptr)   gsDma0p(G_OBJ_LDTX_RECT_R, (tptr), 47)
 
#define gSPSelectDL(pkt, mptr, sid, flag, mask)
 
#define gsSPSelectDL(mptr, sid, flag, mask)
 
#define gSPSelectBranchDL(pkt, mptr, sid, flag, mask)
 
#define gsSPSelectBranchDL(mptr, sid, flag, mask)
 
#define G_MW_GENSTAT   0x08 /* Note that it is the same value of G_MW_FOG */
 
#define gSPSetStatus(pkt, sid, val)   gMoveWd((pkt), G_MW_GENSTAT, (sid), (val))
 
#define gsSPSetStatus(sid, val)   gsMoveWd(G_MW_GENSTAT, (sid), (val))
 
#define G_OBJRM_NOTXCLAMP   0x01
 
#define G_OBJRM_XLU   0x02 /* Ignored */
 
#define G_OBJRM_ANTIALIAS   0x04 /* Ignored */
 
#define G_OBJRM_BILERP   0x08
 
#define G_OBJRM_SHRINKSIZE_1   0x10
 
#define G_OBJRM_SHRINKSIZE_2   0x20
 
#define G_OBJRM_WIDEN   0x40
 
#define gSPObjRenderMode(pkt, mode)   gImmp1((pkt), G_OBJ_RENDERMODE, (mode))
 
#define gsSPObjRenderMode(mode)   gsImmp1(G_OBJ_RENDERMODE, (mode))
 
#define RM_RA_SPRITE(clk)
 
#define G_RM_SPRITE   G_RM_OPA_SURF
 
#define G_RM_SPRITE2   G_RM_OPA_SURF2
 
#define G_RM_RA_SPRITE   RM_RA_SPRITE(1)
 
#define G_RM_RA_SPRITE2   RM_RA_SPRITE(2)
 
#define G_RM_AA_SPRITE   G_RM_AA_TEX_TERR
 
#define G_RM_AA_SPRITE2   G_RM_AA_TEX_TERR2
 
#define G_RM_XLU_SPRITE   G_RM_XLU_SURF
 
#define G_RM_XLU_SPRITE2   G_RM_XLU_SURF2
 
#define G_RM_AA_XLU_SPRITE   G_RM_AA_XLU_SURF
 
#define G_RM_AA_XLU_SPRITE2   G_RM_AA_XLU_SURF2
 

Functions

void guS2DInitBg (uObjBg *)
 
void guS2DEmuSetScissor (u32, u32, u32, u32, u8)
 
void guS2DEmuBgRect1Cyc (Gfx **, uObjBg *)
 

Variables

u64 gspS2DEX_fifoTextStart []
 
u64 gspS2DEX_fifoTextEnd []
 
u64 gspS2DEX_fifoDataStart []
 
u64 gspS2DEX_fifoDataEnd []
 
u64 gspS2DEX_fifo_dTextStart []
 
u64 gspS2DEX_fifo_dTextEnd []
 
u64 gspS2DEX_fifo_dDataStart []
 
u64 gspS2DEX_fifo_dDataEnd []
 
u64 gspS2DEX2_fifoTextStart []
 
u64 gspS2DEX2_fifoTextEnd []
 
u64 gspS2DEX2_fifoDataStart []
 
u64 gspS2DEX2_fifoDataEnd []
 
u64 gspS2DEX2_xbusTextStart []
 
u64 gspS2DEX2_xbusTextEnd []
 
u64 gspS2DEX2_xbusDataStart []
 
u64 gspS2DEX2_xbusDataEnd []
 

Macro Definition Documentation

◆ G_BG_1CYC

#define G_BG_1CYC   0x01

◆ G_BG_COPY

#define G_BG_COPY   0x02

◆ G_BG_FLAG_FLIPS

#define G_BG_FLAG_FLIPS   0x01

◆ G_BG_FLAG_FLIPT

#define G_BG_FLAG_FLIPT   0x10

◆ G_BGLT_LOADBLOCK

#define G_BGLT_LOADBLOCK   0x0033

◆ G_BGLT_LOADTILE

#define G_BGLT_LOADTILE   0xfff4

◆ G_MW_GENSTAT

#define G_MW_GENSTAT   0x08 /* Note that it is the same value of G_MW_FOG */

◆ G_OBJ_FLAG_FLIPS

#define G_OBJ_FLAG_FLIPS   1 << 0 /* inversion to S-direction */

◆ G_OBJ_FLAG_FLIPT

#define G_OBJ_FLAG_FLIPT   1 << 4 /* nversion to T-direction */

◆ G_OBJ_LDTX_RECT

#define G_OBJ_LDTX_RECT   0xc3

◆ G_OBJ_LDTX_RECT_R

#define G_OBJ_LDTX_RECT_R   0xc4

◆ G_OBJ_LDTX_SPRITE

#define G_OBJ_LDTX_SPRITE   0xc2

◆ G_OBJ_LOADTXTR

#define G_OBJ_LOADTXTR   0xc1

◆ G_OBJ_MOVEMEM

#define G_OBJ_MOVEMEM   0x05

◆ G_OBJ_RECTANGLE

#define G_OBJ_RECTANGLE   0x03

◆ G_OBJ_RECTANGLE_R

#define G_OBJ_RECTANGLE_R   0xb2

◆ G_OBJ_RENDERMODE

#define G_OBJ_RENDERMODE   0xb1

◆ G_OBJ_SPRITE

#define G_OBJ_SPRITE   0x04

◆ G_OBJLT_TLUT

#define G_OBJLT_TLUT   0x00000030

◆ G_OBJLT_TXTRBLOCK

#define G_OBJLT_TXTRBLOCK   0x00001033

◆ G_OBJLT_TXTRTILE

#define G_OBJLT_TXTRTILE   0x00fc1034

◆ G_OBJRM_ANTIALIAS

#define G_OBJRM_ANTIALIAS   0x04 /* Ignored */

◆ G_OBJRM_BILERP

#define G_OBJRM_BILERP   0x08

◆ G_OBJRM_NOTXCLAMP

#define G_OBJRM_NOTXCLAMP   0x01

◆ G_OBJRM_SHRINKSIZE_1

#define G_OBJRM_SHRINKSIZE_1   0x10

◆ G_OBJRM_SHRINKSIZE_2

#define G_OBJRM_SHRINKSIZE_2   0x20

◆ G_OBJRM_WIDEN

#define G_OBJRM_WIDEN   0x40

◆ G_OBJRM_XLU

#define G_OBJRM_XLU   0x02 /* Ignored */

◆ G_RDPHALF_0

#define G_RDPHALF_0   0xe4

◆ G_RM_AA_SPRITE

#define G_RM_AA_SPRITE   G_RM_AA_TEX_TERR

◆ G_RM_AA_SPRITE2

#define G_RM_AA_SPRITE2   G_RM_AA_TEX_TERR2

◆ G_RM_AA_XLU_SPRITE

#define G_RM_AA_XLU_SPRITE   G_RM_AA_XLU_SURF

◆ G_RM_AA_XLU_SPRITE2

#define G_RM_AA_XLU_SPRITE2   G_RM_AA_XLU_SURF2

◆ G_RM_RA_SPRITE

#define G_RM_RA_SPRITE   RM_RA_SPRITE(1)

◆ G_RM_RA_SPRITE2

#define G_RM_RA_SPRITE2   RM_RA_SPRITE(2)

◆ G_RM_SPRITE

#define G_RM_SPRITE   G_RM_OPA_SURF

◆ G_RM_SPRITE2

#define G_RM_SPRITE2   G_RM_OPA_SURF2

◆ G_RM_XLU_SPRITE

#define G_RM_XLU_SPRITE   G_RM_XLU_SURF

◆ G_RM_XLU_SPRITE2

#define G_RM_XLU_SPRITE2   G_RM_XLU_SURF2

◆ G_SELECT_DL

#define G_SELECT_DL   0xb0

◆ GS_CALC_DXT

#define GS_CALC_DXT ( line)    (((1 << G_TX_DXT_FRAC) - 1) / (line) + 1)

◆ GS_PAL_HEAD

#define GS_PAL_HEAD ( head)    ((head) + 256)

◆ GS_PAL_NUM

#define GS_PAL_NUM ( num)    ((num) - 1)

◆ GS_PIX2DXT

#define GS_PIX2DXT ( pix,
siz )   GS_CALC_DXT(GS_PIX2TMEM((pix), (siz)))

◆ GS_PIX2TMEM

#define GS_PIX2TMEM ( pix,
siz )   ((pix) >> (4 - (siz)))

◆ GS_TB_TLINE

#define GS_TB_TLINE ( pix,
siz )   (GS_CALC_DXT(GS_PIX2TMEM((pix), (siz))))

◆ GS_TB_TSIZE

#define GS_TB_TSIZE ( pix,
siz )   (GS_PIX2TMEM((pix), (siz)) - 1)

◆ GS_TT_THEIGHT

#define GS_TT_THEIGHT ( pix,
siz )   (((pix) << 2) - 1)

◆ GS_TT_TWIDTH

#define GS_TT_TWIDTH ( pix,
siz )   ((GS_PIX2TMEM((pix), (siz)) << 2) - 1)

◆ gSPBgRect1Cyc

#define gSPBgRect1Cyc ( pkt,
mptr )   gSPBgRectangle((pkt), G_BG_1CYC, (mptr))

◆ gSPBgRectangle

#define gSPBgRectangle ( pkt,
m,
mptr )   gDma0p((pkt), (m), (mptr), 0)

◆ gSPBgRectCopy

#define gSPBgRectCopy ( pkt,
mptr )   gSPBgRectangle((pkt), G_BG_COPY, (mptr))

◆ gSPObjLoadTxRect

#define gSPObjLoadTxRect ( pkt,
tptr )   gDma0p((pkt), G_OBJ_LDTX_RECT, (tptr), 47)

◆ gSPObjLoadTxRectR

#define gSPObjLoadTxRectR ( pkt,
tptr )   gDma0p((pkt), G_OBJ_LDTX_RECT_R, (tptr), 47)

◆ gSPObjLoadTxSprite

#define gSPObjLoadTxSprite ( pkt,
tptr )   gDma0p((pkt), G_OBJ_LDTX_SPRITE, (tptr), 47)

◆ gSPObjLoadTxtr

#define gSPObjLoadTxtr ( pkt,
tptr )   gDma0p((pkt), G_OBJ_LOADTXTR, (tptr), 23)

◆ gSPObjMatrix

#define gSPObjMatrix ( pkt,
mptr )   gDma1p((pkt), G_OBJ_MOVEMEM, (mptr), 0, 23)

◆ gSPObjRectangle

#define gSPObjRectangle ( pkt,
mptr )   gDma0p((pkt), G_OBJ_RECTANGLE, (mptr), 0)

◆ gSPObjRectangleR

#define gSPObjRectangleR ( pkt,
mptr )   gDma0p((pkt), G_OBJ_RECTANGLE_R, (mptr), 0)

◆ gSPObjRenderMode

#define gSPObjRenderMode ( pkt,
mode )   gImmp1((pkt), G_OBJ_RENDERMODE, (mode))

◆ gSPObjSprite

#define gSPObjSprite ( pkt,
mptr )   gDma0p((pkt), G_OBJ_SPRITE, (mptr), 0)

◆ gSPObjSubMatrix

#define gSPObjSubMatrix ( pkt,
mptr )   gDma1p((pkt), G_OBJ_MOVEMEM, (mptr), 2, 7)

◆ gSPSelectBranchDL

#define gSPSelectBranchDL ( pkt,
mptr,
sid,
flag,
mask )
Value:
{ \
gDma1p((pkt), G_RDPHALF_0, (flag), (u32) (mptr) & 0xffff, (sid)); \
gDma1p((pkt), G_SELECT_DL, (mask), (u32) (mptr) >> 16, G_DL_NOPUSH); \
}
#define G_DL_NOPUSH
Definition gbi.h:1000
#define G_SELECT_DL
Definition gs2dex.h:255
#define G_RDPHALF_0
Definition gs2dex.h:262
unsigned int u32
Definition ultratypes.h:16

◆ gSPSelectDL

#define gSPSelectDL ( pkt,
mptr,
sid,
flag,
mask )
Value:
{ \
gDma1p((pkt), G_RDPHALF_0, (flag), (u32) (mptr) & 0xffff, (sid)); \
gDma1p((pkt), G_SELECT_DL, (mask), (u32) (mptr) >> 16, G_DL_PUSH); \
}
#define G_DL_PUSH
Definition gbi.h:999

◆ gSPSetStatus

#define gSPSetStatus ( pkt,
sid,
val )   gMoveWd((pkt), G_MW_GENSTAT, (sid), (val))

◆ gsSPBgRect1Cyc

#define gsSPBgRect1Cyc ( mptr)    gsSPBgRectangle(G_BG_1CYC, (mptr))

◆ gsSPBgRectangle

#define gsSPBgRectangle ( m,
mptr )   gsDma0p((m), (mptr), 0)

◆ gsSPBgRectCopy

#define gsSPBgRectCopy ( mptr)    gsSPBgRectangle(G_BG_COPY, (mptr))

◆ gsSPObjLoadTxRect

#define gsSPObjLoadTxRect ( tptr)    gsDma0p(G_OBJ_LDTX_RECT, (tptr), 47)

◆ gsSPObjLoadTxRectR

#define gsSPObjLoadTxRectR ( tptr)    gsDma0p(G_OBJ_LDTX_RECT_R, (tptr), 47)

◆ gsSPObjLoadTxSprite

#define gsSPObjLoadTxSprite ( tptr)    gsDma0p(G_OBJ_LDTX_SPRITE, (tptr), 47)

◆ gsSPObjLoadTxtr

#define gsSPObjLoadTxtr ( tptr)    gsDma0p(G_OBJ_LOADTXTR, (tptr), 23)

◆ gsSPObjMatrix

#define gsSPObjMatrix ( mptr)    gsDma1p(G_OBJ_MOVEMEM, (mptr), 0, 23)

◆ gsSPObjRectangle

#define gsSPObjRectangle ( mptr)    gsDma0p(G_OBJ_RECTANGLE, (mptr), 0)

◆ gsSPObjRectangleR

#define gsSPObjRectangleR ( mptr)    gsDma0p(G_OBJ_RECTANGLE_R, (mptr), 0)

◆ gsSPObjRenderMode

#define gsSPObjRenderMode ( mode)    gsImmp1(G_OBJ_RENDERMODE, (mode))

◆ gsSPObjSprite

#define gsSPObjSprite ( mptr)    gsDma0p(G_OBJ_SPRITE, (mptr), 0)

◆ gsSPObjSubMatrix

#define gsSPObjSubMatrix ( mptr)    gsDma1p(G_OBJ_MOVEMEM, (mptr), 2, 7)

◆ gsSPSelectBranchDL

#define gsSPSelectBranchDL ( mptr,
sid,
flag,
mask )
Value:
{ \
gsDma1p(G_RDPHALF_0, (flag), (u32) (mptr) & 0xffff, (sid)); \
gsDma1p(G_SELECT_DL, (mask), (u32) (mptr) >> 16, G_DL_NOPUSH); \
}

◆ gsSPSelectDL

#define gsSPSelectDL ( mptr,
sid,
flag,
mask )
Value:
{ \
gsDma1p(G_RDPHALF_0, (flag), (u32) (mptr) & 0xffff, (sid)); \
gsDma1p(G_SELECT_DL, (mask), (u32) (mptr) >> 16, G_DL_PUSH); \
}

◆ gsSPSetStatus

#define gsSPSetStatus ( sid,
val )   gsMoveWd(G_MW_GENSTAT, (sid), (val))

◆ RM_RA_SPRITE

#define RM_RA_SPRITE ( clk)
Value:
#define G_BL_CLR_MEM
Definition gbi.h:700
#define CVG_X_ALPHA
Definition gbi.h:694
#define G_BL_A_IN
Definition gbi.h:705
#define CVG_DST_CLAMP
Definition gbi.h:686
#define G_BL_1MA
Definition gbi.h:703
#define ALPHA_CVG_SEL
Definition gbi.h:695
#define AA_EN
Definition gbi.h:681
#define TEX_EDGE
Definition gbi.h:697
#define G_BL_CLR_IN
Definition gbi.h:699
#define ZMODE_OPA
Definition gbi.h:690

Function Documentation

◆ guS2DEmuBgRect1Cyc()

void guS2DEmuBgRect1Cyc ( Gfx ** ,
uObjBg *  )
extern

◆ guS2DEmuSetScissor()

void guS2DEmuSetScissor ( u32 ,
u32 ,
u32 ,
u32 ,
u8  )
extern

◆ guS2DInitBg()

void guS2DInitBg ( uObjBg * )
extern

Variable Documentation

◆ gspS2DEX2_fifoDataEnd

u64 gspS2DEX2_fifoDataEnd[]

◆ gspS2DEX2_fifoDataStart

u64 gspS2DEX2_fifoDataStart[]
extern

◆ gspS2DEX2_fifoTextEnd

u64 gspS2DEX2_fifoTextEnd[]

◆ gspS2DEX2_fifoTextStart

u64 gspS2DEX2_fifoTextStart[]
extern

◆ gspS2DEX2_xbusDataEnd

u64 gspS2DEX2_xbusDataEnd[]

◆ gspS2DEX2_xbusDataStart

u64 gspS2DEX2_xbusDataStart[]
extern

◆ gspS2DEX2_xbusTextEnd

u64 gspS2DEX2_xbusTextEnd[]

◆ gspS2DEX2_xbusTextStart

u64 gspS2DEX2_xbusTextStart[]
extern

◆ gspS2DEX_fifo_dDataEnd

u64 gspS2DEX_fifo_dDataEnd[]

◆ gspS2DEX_fifo_dDataStart

u64 gspS2DEX_fifo_dDataStart[]
extern

◆ gspS2DEX_fifo_dTextEnd

u64 gspS2DEX_fifo_dTextEnd[]

◆ gspS2DEX_fifo_dTextStart

u64 gspS2DEX_fifo_dTextStart[]
extern

◆ gspS2DEX_fifoDataEnd

u64 gspS2DEX_fifoDataEnd[]

◆ gspS2DEX_fifoDataStart

u64 gspS2DEX_fifoDataStart[]
extern

◆ gspS2DEX_fifoTextEnd

u64 gspS2DEX_fifoTextEnd[]

◆ gspS2DEX_fifoTextStart

u64 gspS2DEX_fifoTextStart[]
extern