-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathS2DEX.cpp
101 lines (85 loc) · 2.5 KB
/
S2DEX.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#include "OpenGL.h"
#include "S2DEX.h"
#include "F3D.h"
#include "F3DEX.h"
#include "GBI.h"
#include "gSP.h"
#include "gDP.h"
#include "RSP.h"
#include "Types.h"
void S2DEX_BG_1Cyc(u32 w0, u32 w1)
{
gSPBgRect1Cyc(w1);
}
void S2DEX_BG_Copy(u32 w0, u32 w1)
{
gSPBgRectCopy(w1);
}
void S2DEX_Obj_Rectangle(u32 w0, u32 w1)
{
gSPObjRectangle(w1);
}
void S2DEX_Obj_Sprite(u32 w0, u32 w1)
{
gSPObjSprite(w1);
}
void S2DEX_Obj_MoveMem(u32 w0, u32 w1)
{
if (_SHIFTR(w0, 0, 16) == 0)
gSPObjMatrix(w1);
else
gSPObjSubMatrix(w1);
}
void S2DEX_Select_DL(u32 w0, u32 w1)
{
}
void S2DEX_Obj_RenderMode(u32 w0, u32 w1)
{
}
void S2DEX_Obj_Rectangle_R(u32 w0, u32 w1)
{
}
void S2DEX_Obj_LoadTxtr(u32 w0, u32 w1)
{
gSPObjLoadTxtr(w1);
}
void S2DEX_Obj_LdTx_Sprite(u32 w0, u32 w1)
{
gSPObjLoadTxSprite(w1);
}
void S2DEX_Obj_LdTx_Rect(u32 w0, u32 w1)
{
}
void S2DEX_Obj_LdTx_Rect_R(u32 w0, u32 w1)
{
gSPObjLoadTxRectR(w1);
}
void S2DEX_Init()
{
// Set GeometryMode flags
GBI_InitFlags(F3DEX);
gSP.geometryMode = 0;
GBI.PCStackSize = 18;
// GBI Command Command Value Command Function
GBI_SetGBI(G_SPNOOP, F3D_SPNOOP, F3D_SPNoOp);
GBI_SetGBI(G_BG_1CYC, S2DEX_BG_1CYC, S2DEX_BG_1Cyc);
GBI_SetGBI(G_BG_COPY, S2DEX_BG_COPY, S2DEX_BG_Copy);
GBI_SetGBI(G_OBJ_RECTANGLE, S2DEX_OBJ_RECTANGLE, S2DEX_Obj_Rectangle);
GBI_SetGBI(G_OBJ_SPRITE, S2DEX_OBJ_SPRITE, S2DEX_Obj_Sprite);
GBI_SetGBI(G_OBJ_MOVEMEM, S2DEX_OBJ_MOVEMEM, S2DEX_Obj_MoveMem);
GBI_SetGBI(G_DL, F3D_DL, F3D_DList);
GBI_SetGBI(G_SELECT_DL, S2DEX_SELECT_DL, S2DEX_Select_DL);
GBI_SetGBI(G_OBJ_RENDERMODE, S2DEX_OBJ_RENDERMODE, S2DEX_Obj_RenderMode);
GBI_SetGBI(G_OBJ_RECTANGLE_R, S2DEX_OBJ_RECTANGLE_R, S2DEX_Obj_Rectangle_R);
GBI_SetGBI(G_OBJ_LOADTXTR, S2DEX_OBJ_LOADTXTR, S2DEX_Obj_LoadTxtr);
GBI_SetGBI(G_OBJ_LDTX_SPRITE, S2DEX_OBJ_LDTX_SPRITE, S2DEX_Obj_LdTx_Sprite);
GBI_SetGBI(G_OBJ_LDTX_RECT, S2DEX_OBJ_LDTX_RECT, S2DEX_Obj_LdTx_Rect);
GBI_SetGBI(G_OBJ_LDTX_RECT_R, S2DEX_OBJ_LDTX_RECT_R, S2DEX_Obj_LdTx_Rect_R);
GBI_SetGBI(G_MOVEWORD, F3D_MOVEWORD, F3D_MoveWord);
GBI_SetGBI(G_SETOTHERMODE_H, F3D_SETOTHERMODE_H, F3D_SetOtherMode_H);
GBI_SetGBI(G_SETOTHERMODE_L, F3D_SETOTHERMODE_L, F3D_SetOtherMode_L);
GBI_SetGBI(G_ENDDL, F3D_ENDDL, F3D_EndDL);
GBI_SetGBI(G_RDPHALF_1, F3D_RDPHALF_1, F3D_RDPHalf_1);
GBI_SetGBI(G_RDPHALF_2, F3D_RDPHALF_2, F3D_RDPHalf_2);
GBI_SetGBI(G_LOAD_UCODE, S2DEX_LOAD_UCODE, F3DEX_Load_uCode);
}