2021-06-23 19:25:12 +02:00
|
|
|
#define VMODE 0 // 0 == NTSC, 1 == PAL
|
2021-07-14 15:21:29 +02:00
|
|
|
#define VSYNC 1
|
2021-06-23 19:25:12 +02:00
|
|
|
#define SCREENXRES 320
|
|
|
|
#define SCREENYRES 240
|
|
|
|
#define CENTERX SCREENXRES/2
|
|
|
|
#define CENTERY SCREENYRES/2
|
|
|
|
#define FOV CENTERX
|
2021-07-03 11:57:06 +02:00
|
|
|
#define FOG_COLOR {128, 128, 128} // Default to neutral grey
|
2021-06-23 19:25:12 +02:00
|
|
|
#define CLEAR_COLOR_R 0
|
|
|
|
#define CLEAR_COLOR_G 0
|
|
|
|
#define CLEAR_COLOR_B 0
|
|
|
|
|
|
|
|
// Debug Font
|
|
|
|
#define FNT_VRAM_X 960
|
|
|
|
#define FNT_VRAM_Y 256
|
|
|
|
#define FNT_SCR_X 16
|
|
|
|
#define FNT_SCR_Y 192
|
|
|
|
#define FNT_SCR_W 240
|
2021-07-10 12:08:52 +02:00
|
|
|
#define FNT_SCR_H 48
|
2021-06-23 19:25:12 +02:00
|
|
|
#define FNT_SCR_BG 0
|
|
|
|
#define FNT_SCR_MAX_CHAR 256
|
|
|
|
|
|
|
|
// Ordering table
|
|
|
|
#define OT2LEN 8
|
2021-07-05 17:47:30 +02:00
|
|
|
#define OTLEN 4096
|
|
|
|
#define PRIMBUFFLEN 4096 * sizeof(POLY_GT4) // Maximum number of POLY_GT4 primitives
|
2021-06-23 19:25:12 +02:00
|
|
|
|
2021-07-10 12:08:52 +02:00
|
|
|
#define cpu_uldr(r,dp) \
|
|
|
|
asm(\
|
|
|
|
"sw %0, 0(%1);" \
|
|
|
|
: "=r" (r)\
|
|
|
|
: "r" (dp)\
|
|
|
|
)
|
|
|
|
|
|
|
|
// DCache setup
|
|
|
|
#define dc_camdirp ((sshort*) getScratchAddr(0))
|
|
|
|
#define dc_ip ((uchar*) getScratchAddr(1))
|
|
|
|
#define dc_opzp ((slong*) getScratchAddr(2))
|
|
|
|
#define dc_wrkmatp ((MATRIX*) getScratchAddr(3))
|
|
|
|
#define dc_retmatp ((MATRIX*) getScratchAddr(9))
|
|
|
|
#define dc_lgtmatp ((MATRIX*) getScratchAddr(12))
|
|
|
|
#define dc_lvllgtmatp ((MATRIX*) getScratchAddr(16))
|
|
|
|
#define dc_lvlcmatp ((MATRIX*) getScratchAddr(24))
|
|
|
|
#define dc_lgtangp ((SVECTOR*) getScratchAddr(32))
|
|
|
|
#define dc_wrklvector ((VECTOR*) getScratchAddr(34))
|
|
|
|
#define dc_camMat ((MATRIX*) getScratchAddr(38))
|
|
|
|
#define dc_camRot ((SVECTOR*) getScratchAddr(46))
|
2021-07-13 13:23:02 +02:00
|
|
|
#define dc_camPos ((SVECTOR*) getScratchAddr(48))
|
|
|
|
#define dc_actorRot ((VECTOR*) getScratchAddr(50))
|
2021-07-10 12:08:52 +02:00
|
|
|
|
|
|
|
//~ #define dc_sxytbl ((DVECTOR*) getScratchAddr(15)) // 6 DVEC == 12
|
|
|
|
//~ #define dc_verts ((SVECTOR*) getScratchAddr(27)) // store verts here
|
|
|
|
//~ #define dc_verts1 ((SVECTOR*) getScratchAddr(35)) // store verts here
|
|
|
|
//~ #define dc_verts2 ((SVECTOR*) getScratchAddr(43)) // store verts here
|
|
|
|
|
2021-06-23 19:25:12 +02:00
|
|
|
// Fog
|
2021-06-24 12:26:30 +02:00
|
|
|
#define FOG_NEAR 2300
|
|
|
|
#define FOG_FAR 2600
|
2021-06-23 19:25:12 +02:00
|
|
|
|
|
|
|
// Physics
|
|
|
|
#define GRAVITY 10
|
|
|
|
#define SCALE 4
|
|
|
|
|
|
|
|
// Pad codes defines
|
2021-07-02 14:49:47 +02:00
|
|
|
|
|
|
|
// Dual shock sticks dead zone
|
|
|
|
#define DS_DZ 60
|
2021-06-23 19:25:12 +02:00
|
|
|
// Applied on PADL
|
|
|
|
#define PadSelect ( 1 )
|
|
|
|
#define PadStart ( 1 << 3 )
|
|
|
|
|
|
|
|
// Up, Right, Down, Left will be used on PADL (left side of pad )and PADR (right side of pad)
|
|
|
|
#define PadUp ( 1 << 4 )
|
|
|
|
#define PadRight ( 1 << 5 )
|
|
|
|
#define PadDown ( 1 << 6 )
|
|
|
|
#define PadLeft ( 1 << 7 )
|
2021-07-14 15:21:29 +02:00
|
|
|
|
|
|
|
#define Tri ( 1 << 12 )
|
|
|
|
#define Circ ( 1 << 13 )
|
|
|
|
#define Cross ( 1 << 14 )
|
|
|
|
#define Squar ( 1 << 15 )
|
|
|
|
// Joysticks
|
2021-06-23 19:25:12 +02:00
|
|
|
#define PadR3 ( 1 << 2 )
|
|
|
|
#define PadL3 ( 1 << 1 )
|
|
|
|
|
|
|
|
// Triggers applied on PADR
|
2021-07-14 15:21:29 +02:00
|
|
|
#define PadShldL1 ( 1 << 10 )
|
|
|
|
#define PadShldL2 ( 1 << 8)
|
|
|
|
#define PadShldR1 ( 1 << 11 )
|
|
|
|
#define PadShldR2 ( 1 << 9 )
|