-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathgfxinit.c
35 lines (30 loc) · 830 Bytes
/
gfxinit.c
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
#include <nusys.h>
#include "graphic.h"
/*
The viewport structure
The conversion from (-1,-1,-1)-(1,1,1). The decimal part of 2-bit.
*/
static Vp vp = {
SCREEN_WD*2, SCREEN_HT*2, G_MAXZ/2, 0, /* The scale factor */
SCREEN_WD*2, SCREEN_HT*2, G_MAXZ/2, 0, /* Move */
};
/*
The initialization of RDP
*/
Gfx setup_rdpstate[] = {
gsDPSetRenderMode(G_RM_OPA_SURF, G_RM_OPA_SURF2),
gsDPSetCombineMode(G_CC_SHADE, G_CC_SHADE),
gsDPSetScissor(G_SC_NON_INTERLACE, 0,0, SCREEN_WD,SCREEN_HT),
gsDPSetColorDither(G_CD_BAYER),
gsSPEndDisplayList(),
};
/*
The initialization of RSP
*/
Gfx setup_rspstate[] = {
gsSPViewport(&vp),
gsSPClearGeometryMode(0xFFFFFFFF),
gsSPSetGeometryMode(G_ZBUFFER | G_SHADE | G_SHADING_SMOOTH | G_CULL_BACK),
gsSPTexture(0, 0, 0, 0, G_OFF),
gsSPEndDisplayList(),
};