/* Structure definitions for TMD data */ #ifndef _TMDDEF #define _TMDDEF #include /* Structures for TMD data. Not all here - simply added to when I want another polygon type... */ typedef struct { short x,y,z,pad; } TMDVertex; typedef TMDVertex TMDNormal; typedef struct { u_long *vert; u_long no_vert; u_long *norm; u_long no_norm; u_long *prim; u_long no_prim; long scale; } TMDObject; /* Object type (only polygons) */ #define TMD_POLYGON 0x01 /* Gradiation or flat shading (only for untextured polygons) */ #define TMD_GRADSHADE (0x01<<3) #define TMD_FLATSHADE (0x00<<3) /* Double or single faced polygon */ #define TMD_ONEFACE (0x00<<1) #define TMD_TWOFACE (0x01<<1) /* Perform light source calculation flags */ #define TMD_LIGHT 0x00 #define TMD_NOLIGHT 0x01 /* Transparency mixture rates - used in TSB */ #define TMD_50_P_50 (0x00<<5) #define TMD_100_P_50 (0x01<<5) #define TMD_100_M_100 (0x20<<5) #define TMD_100_P_25 (0x03<<5) /* Texture CLUT mode - used in TSB */ #define TMD_CLUT4 (0x00<<7) #define TMD_CLUT8 (0x01<<7) #define TMD_CLUT15 (0x20<<7) /* Texture CLUT position - used in CBA */ #define TMD_CLUT(x,y) (((y)<<6)|(((x)&0x3ff)>>4)) /* Mode values */ #define TMD_MODEGOURARD (0x01<<4) #define TMD_MODEFLAT (0x00<<4) #define TMD_MODETEXT (0x01<<2) #define TMD_MODENOTEXT (0x00<<2) #define TMD_MODETRANS (0x01<<1) #define TMD_MODENOTRANS (0x00<<1) #define TMD_MODELIGHT (0x00) #define TMD_MODENOLIGHT (0x01) /* Triangle Object types - x_NL indicates the lighting disabled version */ typedef struct { u_char wa_conv; /* Always 0x06 */ u_char size; /* Always 0x05 */ u_char flags; /* Generally 0x01 */ u_char mode; /* Generally 0x31 */ u_char r0,g0,b0; /* RGB of vertex 0 */ u_char filler; /* Copy mode (0x31) into here */ u_char r1,g1,b1; /* RGB of vertex 1 */ u_char filler1; /* Filler */ u_char r2,g2,b2; /* RGB of vertex 2 */ u_char filler2; /* Filler */ u_short vert0,vert1; /* Index of vertexs */ u_short vert2,filler3; /* Index of vertexs */ } TMDTriGouraud_NL; typedef struct { u_char wa_conv; /* Always 0x09 */ u_char size; /* Always 0x08 */ u_char flags; /* Generally 0x01 */ u_char mode; /* Generally 0x35 */ u_char u0,v0; /* TMAP coords */ u_short cba; /* TMAP CLUT co-ords TMD_CLUT(x,y) */ u_char u1,v1; /* TMAP coords */ u_short tsb; /* TMAP pattern TPAGE|(TMD_tran)|(TMD_clut) */ u_char u2,v2; /* TMAP coords */ u_short filler1; /* Filler */ u_char r0,g0,b0; /* RGB of vertex 0 */ u_char filler2; /* Filler */ u_char r1,g1,b1; /* RGB of vertex 1 */ u_char filler3; /* Filler */ u_char r2,g2,b2; /* RGB of vertex 2 */ u_char filler4; /* Filler */ u_short vert0,vert1; /* Index of vertexs */ u_short vert2,filler5; /* Index of vertexs */ } TMDTriTmapGouraud_NL; typedef struct { u_char wa_conv; /* Always 0x07 */ u_char size; /* Always 0x06 */ u_char flags; /* Generally 0x01 */ u_char mode; /* Generally 0x25 */ u_char u0,v0; /* TMAP coords */ u_short cba; /* TMAP CLUT co-ords TMD_CLUT(x,y) */ u_char u1,v1; /* TMAP coords */ u_short tsb; /* TMAP pattern TPAGE|(TMD_tran)|(TMD_clut) */ u_char u2,v2; /* TMAP coords */ u_short filler1; /* Filler */ u_char r,g,b; /* Brightness to draw TMAP */ u_char filler2; /* Filler */ u_short vert0,vert1; /* Index of vertexs */ u_short vert2,filler3; /* Index of vertexs */ } TMDTriTmapFlat_NL; typedef struct { u_char wa_conv; /* Always 0x07 */ u_char size; /* Always 0x05 */ u_char flags; /* Generally 0x01 */ u_char mode; /* Generally 0x25 */ u_char u0,v0; /* TMAP coords */ u_short cba; /* TMAP CLUT co-ords TMD_CLUT(x,y) */ u_char u1,v1; /* TMAP coords */ u_short tsb; /* TMAP pattern TPAGE|(TMD_tran)|(TMD_clut) */ u_char u2,v2; /* TMAP coords */ u_short filler; /* Filler */ u_short norm0,vert0; /* Index of normal and first vertex */ u_short vert1,vert2; /* Index of vertexs */ } TMDTriTmapFlat; /* Quadralateral Object types - x_NL indicates the lighting disabled version */ typedef struct { u_char wa_conv; /* Always 0x08 */ u_char size; /* Always 0x05 */ u_char flags; /* Generally 0x00 */ u_char mode; /* Generally 0x38 */ u_char r,g,b; /* RGB */ u_char filler; /* Copy mode (0x38) into here */ u_short norm0,vert0; /* Index of vertex and normal 0 */ u_short norm1,vert1; /* Index of vertex and normal 1 */ u_short norm2,vert2; /* Index of vertex and normal 2 */ u_short norm3,vert3; /* Index of vertex and normal 3 */ } TMDQuadSolidGouraud; typedef struct { u_char wa_conv; /* Always 0x08 */ u_char size; /* Always 0x06 */ u_char flags; /* Generally 0x01 */ u_char mode; /* Generally 0x39 */ u_char r0,g0,b0; /* RGB of vertex 0 */ u_char filler; /* Copy mode (0x38) into here */ u_char r1,g1,b1; /* RGB of vertex 1 */ u_char filler1; /* Filler */ u_char r2,g2,b2; /* RGB of vertex 2 */ u_char filler2; /* Filler */ u_char r3,g3,b3; /* RGB of vertex 3 */ u_char filler3; /* Filler */ u_short vert0,vert1; /* Index of vertexs */ u_short vert2,vert3; /* Index of vertexs */ } TMDQuadGouraud_NL; typedef struct { u_char wa_conv; /* Always 0x05 */ u_char size; /* Always 0x04 */ u_char flags; /* Generally 0x00 */ u_char mode; /* Generally 0x28 */ u_char r,g,b; /* RGB */ u_char filler; /* Copy mode (0x38) into here */ u_short norm0; /* Index of normal */ u_short vert0,vert1; /* Index of vertexs */ u_short vert2,vert3; /* Index of vertexs */ u_short filler2; } TMDQuadSolidFlat; typedef struct { u_char wa_conv; /* Always 0x05 */ u_char size; /* Always 0x03 */ u_char flags; /* Generally 0x01 */ u_char mode; /* Generally 0x29 */ u_char r,g,b; /* RGB */ u_char filler; /* Copy mode (0x29) into here */ u_short vert0,vert1; /* Index of vertexs */ u_short vert2,vert3; /* Index of vertexs */ } TMDQuadSolidFlat_NL; typedef struct { u_char wa_conv; /* Always 0x09 */ u_char size; /* Always 0x07 */ u_char flags; /* Generally 0x00 */ u_char mode; /* Generally 0x2c */ u_char u0,v0; /* TMAP coords */ u_short cba; /* TMAP CLUT co-ords TMD_CLUT(x,y) */ u_char u1,v1; /* TMAP coords */ u_short tsb; /* TMAP pattern TPAGE|(TMD_tran)|(TMD_clut) */ u_char u2,v2; /* TMAP coords */ u_short filler1; u_char u3,v3; /* TMAP coords */ u_short filler2; u_short norm0; /* Index of normal */ u_short vert0,vert1; /* Index of vertexs */ u_short vert2,vert3; /* Index of vertexs */ u_short filler3; } TMDQuadTmapFlat; typedef struct { u_char wa_conv; /* Always 0x09 */ u_char size; /* Always 0x07 */ u_char flags; /* Generally 0x01 */ u_char mode; /* Generally 0x2c */ u_char u0,v0; /* TMAP coords */ u_short cba; /* TMAP CLUT co-ords TMD_CLUT(x,y) */ u_char u1,v1; /* TMAP coords */ u_short tsb; /* TMAP pattern TPAGE|(TMD_tran)|(TMD_clut) */ u_char u2,v2; /* TMAP coords */ u_short filler1; u_char u3,v3; /* TMAP coords */ u_short filler2; u_char r,g,b,filler3; /* Brightness to draw TMAP */ u_short vert0,vert1; /* Index of vertexs */ u_short vert2,vert3; /* Index of vertexs */ } TMDQuadTmapFlat_NL; #endif