From 1aa0e17df7c325a41de8cf8a57f52ed853f08bf3 Mon Sep 17 00:00:00 2001 From: "John Wilbert M. Villamor" Date: Fri, 24 Apr 2020 19:01:28 +0800 Subject: Refined toolchain instructions, organized examples, added automatic retry for CdRead(), added FIOCSCAN ioctl in psxsio TTY driver, added tty and console examples. --- examples/demos/n00bdemo/smd.h | 68 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 examples/demos/n00bdemo/smd.h (limited to 'examples/demos/n00bdemo/smd.h') diff --git a/examples/demos/n00bdemo/smd.h b/examples/demos/n00bdemo/smd.h new file mode 100644 index 0000000..29c2812 --- /dev/null +++ b/examples/demos/n00bdemo/smd.h @@ -0,0 +1,68 @@ +#ifndef _SMD_H +#define _SMD_H + +typedef struct { + int *ot; + short otlen; + unsigned char zdiv,zoff; +} SC_OT; + +typedef struct { + char id[3]; + unsigned char version; + unsigned short flags; + unsigned short n_verts; + unsigned short n_norms; + unsigned short n_prims; + SVECTOR *p_verts; + SVECTOR *p_norms; + void *p_prims; +} SMD; + +typedef struct { + unsigned char type:2; + unsigned char l_type:2; + unsigned char c_type:1; + unsigned char texture:1; + unsigned char blend:2; + unsigned char zoff:4; + unsigned char nocull:1; + unsigned char mask:1; + unsigned char texwin:2; + unsigned char texoff:2; + unsigned char reserved:6; + unsigned char len; +} SMD_PRI_TYPE; + +typedef struct { + SMD_PRI_TYPE prim_id; + unsigned short v0,v1,v2,v3; // Vertex indices + unsigned short n0,n1,n2,n3; // Normal indices + unsigned char r0,g0,b0,code; // RGB0 + unsigned char r1,g1,b1,p0; // RGB1 + unsigned char r2,g2,b2,p1; // RGB2 + unsigned char r3,g3,b3,p2; // RGB3 + unsigned char tu0,tv0; + unsigned char tu1,tv1; + unsigned char tu2,tv2; + unsigned char tu3,tv3; + unsigned short tpage,clut; +} SMD_PRIM; + + +int OpenSMD(void *smd); +SMD_PRIM *ReadSMD(SMD_PRIM *pri); + +void scSetClipRect(int x0, int y0, int x1, int y1); + +SMD *smdInitData(void *data); +void smdSetBaseTPage(unsigned short tpage); + +char *smdSortModel(SC_OT *ot, char* pribuff, SMD *smd); +char *smdSortModelFlat(unsigned int *ot, char* pribuff, SMD *smd); + +void smdSetCelTex(unsigned short tpage, unsigned short clut); +void smdSetCelParam(int udiv, int vdiv, unsigned int col); +char *smdSortModelCel(SC_OT *ot, char* pribuff, SMD *smd); + +#endif \ No newline at end of file -- cgit v1.2.3