15#ifdef _LANGUAGE_C_PLUS_PLUS
24#define GS_CALC_DXT(line) (((1 << G_TX_DXT_FRAC) - 1) / (line) + 1)
25#define GS_PIX2TMEM(pix, siz) ((pix) >> (4 - (siz)))
26#define GS_PIX2DXT(pix, siz) GS_CALC_DXT(GS_PIX2TMEM((pix), (siz)))
35#define G_BGLT_LOADBLOCK 0x0033
36#define G_BGLT_LOADTILE 0xfff4
38#define G_BG_FLAG_FLIPS 0x01
39#define G_BG_FLAG_FLIPT 0x10
116#define G_OBJ_FLAG_FLIPS 1 << 0
117#define G_OBJ_FLAG_FLIPT 1 << 4
170#define G_OBJLT_TXTRBLOCK 0x00001033
171#define G_OBJLT_TXTRTILE 0x00fc1034
172#define G_OBJLT_TLUT 0x00000030
174#define GS_TB_TSIZE(pix, siz) (GS_PIX2TMEM((pix), (siz)) - 1)
175#define GS_TB_TLINE(pix, siz) (GS_CALC_DXT(GS_PIX2TMEM((pix), (siz))))
188#define GS_TT_TWIDTH(pix, siz) ((GS_PIX2TMEM((pix), (siz)) << 2) - 1)
189#define GS_TT_THEIGHT(pix, siz) (((pix) << 2) - 1)
202#define GS_PAL_HEAD(head) ((head) + 256)
203#define GS_PAL_NUM(num) ((num) - 1)
236#define G_OBJ_RECTANGLE_R 0xda
237#define G_OBJ_MOVEMEM 0xdc
238#define G_RDPHALF_0 0xe4
239#define G_OBJ_RECTANGLE 0x01
240#define G_OBJ_SPRITE 0x02
241#define G_SELECT_DL 0x04
242#define G_OBJ_LOADTXTR 0x05
243#define G_OBJ_LDTX_SPRITE 0x06
244#define G_OBJ_LDTX_RECT 0x07
245#define G_OBJ_LDTX_RECT_R 0x08
246#define G_BG_1CYC 0x09
247#define G_BG_COPY 0x0a
248#define G_OBJ_RENDERMODE 0x0b
250#define G_BG_1CYC 0x01
251#define G_BG_COPY 0x02
252#define G_OBJ_RECTANGLE 0x03
253#define G_OBJ_SPRITE 0x04
254#define G_OBJ_MOVEMEM 0x05
255#define G_SELECT_DL 0xb0
256#define G_OBJ_RENDERMODE 0xb1
257#define G_OBJ_RECTANGLE_R 0xb2
258#define G_OBJ_LOADTXTR 0xc1
259#define G_OBJ_LDTX_SPRITE 0xc2
260#define G_OBJ_LDTX_RECT 0xc3
261#define G_OBJ_LDTX_RECT_R 0xc4
262#define G_RDPHALF_0 0xe4
268#define gSPBgRectangle(pkt, m, mptr) gDma0p((pkt), (m), (mptr), 0)
269#define gsSPBgRectangle(m, mptr) gsDma0p((m), (mptr), 0)
270#define gSPBgRectCopy(pkt, mptr) gSPBgRectangle((pkt), G_BG_COPY, (mptr))
271#define gsSPBgRectCopy(mptr) gsSPBgRectangle(G_BG_COPY, (mptr))
272#define gSPBgRect1Cyc(pkt, mptr) gSPBgRectangle((pkt), G_BG_1CYC, (mptr))
273#define gsSPBgRect1Cyc(mptr) gsSPBgRectangle(G_BG_1CYC, (mptr))
278#define gSPObjSprite(pkt, mptr) gDma0p((pkt), G_OBJ_SPRITE, (mptr), 0)
279#define gsSPObjSprite(mptr) gsDma0p(G_OBJ_SPRITE, (mptr), 0)
280#define gSPObjRectangle(pkt, mptr) gDma0p((pkt), G_OBJ_RECTANGLE, (mptr), 0)
281#define gsSPObjRectangle(mptr) gsDma0p(G_OBJ_RECTANGLE, (mptr), 0)
282#define gSPObjRectangleR(pkt, mptr) gDma0p((pkt), G_OBJ_RECTANGLE_R, (mptr), 0)
283#define gsSPObjRectangleR(mptr) gsDma0p(G_OBJ_RECTANGLE_R, (mptr), 0)
288#define gSPObjMatrix(pkt, mptr) gDma1p((pkt), G_OBJ_MOVEMEM, (mptr), 0, 23)
289#define gsSPObjMatrix(mptr) gsDma1p(G_OBJ_MOVEMEM, (mptr), 0, 23)
290#define gSPObjSubMatrix(pkt, mptr) gDma1p((pkt), G_OBJ_MOVEMEM, (mptr), 2, 7)
291#define gsSPObjSubMatrix(mptr) gsDma1p(G_OBJ_MOVEMEM, (mptr), 2, 7)
296#define gSPObjLoadTxtr(pkt, tptr) gDma0p((pkt), G_OBJ_LOADTXTR, (tptr), 23)
297#define gsSPObjLoadTxtr(tptr) gsDma0p(G_OBJ_LOADTXTR, (tptr), 23)
298#define gSPObjLoadTxSprite(pkt, tptr) gDma0p((pkt), G_OBJ_LDTX_SPRITE, (tptr), 47)
299#define gsSPObjLoadTxSprite(tptr) gsDma0p(G_OBJ_LDTX_SPRITE, (tptr), 47)
300#define gSPObjLoadTxRect(pkt, tptr) gDma0p((pkt), G_OBJ_LDTX_RECT, (tptr), 47)
301#define gsSPObjLoadTxRect(tptr) gsDma0p(G_OBJ_LDTX_RECT, (tptr), 47)
302#define gSPObjLoadTxRectR(pkt, tptr) gDma0p((pkt), G_OBJ_LDTX_RECT_R, (tptr), 47)
303#define gsSPObjLoadTxRectR(tptr) gsDma0p(G_OBJ_LDTX_RECT_R, (tptr), 47)
308#define gSPSelectDL(pkt, mptr, sid, flag, mask) \
310 gDma1p((pkt), G_RDPHALF_0, (flag), (u32) (mptr) & 0xffff, (sid)); \
311 gDma1p((pkt), G_SELECT_DL, (mask), (u32) (mptr) >> 16, G_DL_PUSH); \
313#define gsSPSelectDL(mptr, sid, flag, mask) \
315 gsDma1p(G_RDPHALF_0, (flag), (u32) (mptr) & 0xffff, (sid)); \
316 gsDma1p(G_SELECT_DL, (mask), (u32) (mptr) >> 16, G_DL_PUSH); \
318#define gSPSelectBranchDL(pkt, mptr, sid, flag, mask) \
320 gDma1p((pkt), G_RDPHALF_0, (flag), (u32) (mptr) & 0xffff, (sid)); \
321 gDma1p((pkt), G_SELECT_DL, (mask), (u32) (mptr) >> 16, G_DL_NOPUSH); \
323#define gsSPSelectBranchDL(mptr, sid, flag, mask) \
325 gsDma1p(G_RDPHALF_0, (flag), (u32) (mptr) & 0xffff, (sid)); \
326 gsDma1p(G_SELECT_DL, (mask), (u32) (mptr) >> 16, G_DL_NOPUSH); \
332#define G_MW_GENSTAT 0x08
334#define gSPSetStatus(pkt, sid, val) gMoveWd((pkt), G_MW_GENSTAT, (sid), (val))
335#define gsSPSetStatus(sid, val) gsMoveWd(G_MW_GENSTAT, (sid), (val))
340#define G_OBJRM_NOTXCLAMP 0x01
341#define G_OBJRM_XLU 0x02
342#define G_OBJRM_ANTIALIAS 0x04
343#define G_OBJRM_BILERP 0x08
344#define G_OBJRM_SHRINKSIZE_1 0x10
345#define G_OBJRM_SHRINKSIZE_2 0x20
346#define G_OBJRM_WIDEN 0x40
348#define gSPObjRenderMode(pkt, mode) gImmp1((pkt), G_OBJ_RENDERMODE, (mode))
349#define gsSPObjRenderMode(mode) gsImmp1(G_OBJ_RENDERMODE, (mode))
354#define RM_RA_SPRITE(clk) \
355 AA_EN | CVG_DST_CLAMP | CVG_X_ALPHA | ALPHA_CVG_SEL | ZMODE_OPA | TEX_EDGE | \
356 GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA)
358#define G_RM_SPRITE G_RM_OPA_SURF
359#define G_RM_SPRITE2 G_RM_OPA_SURF2
360#define G_RM_RA_SPRITE RM_RA_SPRITE(1)
361#define G_RM_RA_SPRITE2 RM_RA_SPRITE(2)
362#define G_RM_AA_SPRITE G_RM_AA_TEX_TERR
363#define G_RM_AA_SPRITE2 G_RM_AA_TEX_TERR2
364#define G_RM_XLU_SPRITE G_RM_XLU_SURF
365#define G_RM_XLU_SPRITE2 G_RM_XLU_SURF2
366#define G_RM_AA_XLU_SPRITE G_RM_AA_XLU_SURF
367#define G_RM_AA_XLU_SPRITE2 G_RM_AA_XLU_SURF2
383#define guS2DEmuBgRect1Cyc guS2D2EmuBgRect1Cyc
384#define guS2DEmuSetScissor guS2D2EmuSetScissor
386extern void guS2D2EmuBgRect1Cyc(Gfx**,
uObjBg*);
392#ifdef _LANGUAGE_C_PLUS_PLUS
@ B
Definition common_structs.h:25
u64 gspS2DEX_fifo_dTextStart[]
u64 gspS2DEX2_fifoTextStart[]
u64 gspS2DEX2_fifoDataEnd[]
Definition gs2dex.h:377
u64 gspS2DEX_fifoTextEnd[]
Definition gs2dex.h:372
u64 gspS2DEX_fifo_dDataStart[]
u64 gspS2DEX2_xbusDataStart[]
void guS2DInitBg(uObjBg *)
u64 gspS2DEX2_xbusTextEnd[]
Definition gs2dex.h:378
u64 gspS2DEX2_xbusDataEnd[]
Definition gs2dex.h:379
u64 gspS2DEX2_xbusTextStart[]
void guS2DEmuBgRect1Cyc(Gfx **, uObjBg *)
u64 gspS2DEX_fifoTextStart[]
u64 gspS2DEX_fifo_dTextEnd[]
Definition gs2dex.h:374
u64 gspS2DEX_fifo_dDataEnd[]
Definition gs2dex.h:375
u64 gspS2DEX_fifoDataEnd[]
Definition gs2dex.h:373
u64 gspS2DEX2_fifoDataStart[]
u64 gspS2DEX2_fifoTextEnd[]
Definition gs2dex.h:376
void guS2DEmuSetScissor(u32, u32, u32, u32, u8)
u64 gspS2DEX_fifoDataStart[]
unsigned long long int u64
Definition llconv.c:2
s32 padding[2048]
Definition main.c:143
u16 imageY
Definition gs2dex.h:48
u16 frameH
Definition gs2dex.h:51
u16 imageLoad
Definition gs2dex.h:54
u16 tmemW
Definition gs2dex.h:61
u8 imageFmt
Definition gs2dex.h:55
u16 imageW
Definition gs2dex.h:44
u16 tmemH
Definition gs2dex.h:64
u16 tmemLoadSH
Definition gs2dex.h:67
s16 frameX
Definition gs2dex.h:45
u64 * imagePtr
Definition gs2dex.h:53
u16 tmemSize
Definition gs2dex.h:76
u16 imageX
Definition gs2dex.h:43
u8 imageSiz
Definition gs2dex.h:56
u16 imageH
Definition gs2dex.h:49
u16 frameW
Definition gs2dex.h:46
s16 frameY
Definition gs2dex.h:50
u16 tmemSizeW
Definition gs2dex.h:73
u16 imagePal
Definition gs2dex.h:57
u16 tmemLoadTH
Definition gs2dex.h:70
u16 imageFlip
Definition gs2dex.h:58
u16 BaseScaleY
Definition gs2dex.h:148
u16 BaseScaleX
Definition gs2dex.h:147
s16 X
Definition gs2dex.h:146
s32 A
Definition gs2dex.h:145
u16 imageY
Definition gs2dex.h:87
u16 imageH
Definition gs2dex.h:88
s16 frameX
Definition gs2dex.h:84
u16 imageFlip
Definition gs2dex.h:97
s32 imageYorig
Definition gs2dex.h:101
s16 frameY
Definition gs2dex.h:89
u16 scaleH
Definition gs2dex.h:100
u16 imageLoad
Definition gs2dex.h:93
u16 imageW
Definition gs2dex.h:83
u16 imagePal
Definition gs2dex.h:96
u16 scaleW
Definition gs2dex.h:99
u16 frameW
Definition gs2dex.h:85
u64 * imagePtr
Definition gs2dex.h:92
u16 imageX
Definition gs2dex.h:82
u8 imageFmt
Definition gs2dex.h:94
u16 frameH
Definition gs2dex.h:90
u8 imageSiz
Definition gs2dex.h:95
u8 imagePal
Definition gs2dex.h:132
u16 imageW
Definition gs2dex.h:122
u8 imageFmt
Definition gs2dex.h:130
u16 paddingY
Definition gs2dex.h:127
u16 imageAdrs
Definition gs2dex.h:129
u16 scaleW
Definition gs2dex.h:121
u16 imageH
Definition gs2dex.h:126
u8 imageFlags
Definition gs2dex.h:133
u16 imageStride
Definition gs2dex.h:128
s16 objX
Definition gs2dex.h:120
u8 imageSiz
Definition gs2dex.h:131
u16 scaleH
Definition gs2dex.h:125
s16 objY
Definition gs2dex.h:124
u16 paddingX
Definition gs2dex.h:123
u16 BaseScaleX
Definition gs2dex.h:158
u16 BaseScaleY
Definition gs2dex.h:159
s16 X
Definition gs2dex.h:157
uObjTxtr txtr
Definition gs2dex.h:227
uObjSprite sprite
Definition gs2dex.h:228
u64 * image
Definition gs2dex.h:179
u16 sid
Definition gs2dex.h:183
u16 tsize
Definition gs2dex.h:181
u32 mask
Definition gs2dex.h:185
u16 tmem
Definition gs2dex.h:180
u32 type
Definition gs2dex.h:178
u32 flag
Definition gs2dex.h:184
u16 tline
Definition gs2dex.h:182
u32 type
Definition gs2dex.h:206
u16 zero
Definition gs2dex.h:210
u16 pnum
Definition gs2dex.h:209
u32 mask
Definition gs2dex.h:213
u64 * image
Definition gs2dex.h:207
u16 phead
Definition gs2dex.h:208
u16 sid
Definition gs2dex.h:211
u32 flag
Definition gs2dex.h:212
u32 mask
Definition gs2dex.h:199
u16 theight
Definition gs2dex.h:196
u16 tmem
Definition gs2dex.h:194
u32 flag
Definition gs2dex.h:198
u32 type
Definition gs2dex.h:192
u16 sid
Definition gs2dex.h:197
u16 twidth
Definition gs2dex.h:195
u64 * image
Definition gs2dex.h:193
signed int s32
Definition ultratypes.h:15
unsigned int u32
Definition ultratypes.h:16
signed short int s16
Definition ultratypes.h:13
unsigned short int u16
Definition ultratypes.h:14
unsigned char u8
Definition ultratypes.h:12
long long int force_structure_alignment
Definition gs2dex.h:110
uObjBg_t b
Definition gs2dex.h:108
uObjScaleBg_t s
Definition gs2dex.h:109
uObjMtx_t m
Definition gs2dex.h:152
long long int force_structure_alignment
Definition gs2dex.h:153
long long int force_structure_alignment
Definition gs2dex.h:138
uObjSprite_t s
Definition gs2dex.h:137
uObjSubMtx_t m
Definition gs2dex.h:163
long long int force_structure_alignment
Definition gs2dex.h:164
long long int force_structure_alignment
Definition gs2dex.h:220
uObjTxtrBlock_t block
Definition gs2dex.h:217
uObjTxtrTile_t tile
Definition gs2dex.h:218
uObjTxtrTLUT_t tlut
Definition gs2dex.h:219