| 1 | /* |
| 2 | Copyright (C) 2002 Rice1964 |
| 3 | |
| 4 | This program is free software; you can redistribute it and/or |
| 5 | modify it under the terms of the GNU General Public License |
| 6 | as published by the Free Software Foundation; either version 2 |
| 7 | of the License, or (at your option) any later version. |
| 8 | |
| 9 | This program is distributed in the hope that it will be useful, |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | GNU General Public License for more details. |
| 13 | |
| 14 | You should have received a copy of the GNU General Public License |
| 15 | along with this program; if not, write to the Free Software |
| 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
| 17 | |
| 18 | */ |
| 19 | |
| 20 | #ifndef _RSP_S2DEX_H_ |
| 21 | #define _RSP_S2DEX_H_ |
| 22 | |
| 23 | #define S2DEX_BG_1CYC 0x01 |
| 24 | #define S2DEX_BG_COPY 0x02 |
| 25 | #define S2DEX_OBJ_RECTANGLE 0x03 |
| 26 | #define S2DEX_OBJ_SPRITE 0x04 |
| 27 | #define S2DEX_OBJ_MOVEMEM 0x05 |
| 28 | #define S2DEX_SELECT_DL 0xb0 |
| 29 | #define S2DEX_OBJ_RENDERMODE 0xb1 |
| 30 | #define S2DEX_OBJ_RECTANGLE_R 0xb2 |
| 31 | #define S2DEX_OBJ_LOADTXTR 0xc1 |
| 32 | #define S2DEX_OBJ_LDTX_SPRITE 0xc2 |
| 33 | #define S2DEX_OBJ_LDTX_RECT 0xc3 |
| 34 | #define S2DEX_OBJ_LDTX_RECT_R 0xc4 |
| 35 | #define S2DEX_RDPHALF_0 0xe4 |
| 36 | |
| 37 | #define S2DEX_OBJLT_TXTRBLOCK 0x00001033 |
| 38 | #define S2DEX_OBJLT_TXTRTILE 0x00fc1034 |
| 39 | #define S2DEX_OBJLT_TLUT 0x00000030 |
| 40 | #define S2DEX_BGLT_LOADBLOCK 0x0033 |
| 41 | #define S2DEX_BGLT_LOADTILE 0xfff4 |
| 42 | |
| 43 | typedef struct { //Intel format |
| 44 | uint32 type; |
| 45 | uint32 image; |
| 46 | |
| 47 | uint16 tsize; |
| 48 | uint16 tmem; |
| 49 | |
| 50 | uint16 sid; |
| 51 | uint16 tline; |
| 52 | |
| 53 | uint32 flag; |
| 54 | uint32 mask; |
| 55 | } uObjTxtrBlock; |
| 56 | |
| 57 | typedef struct { //Intel Format |
| 58 | uint32 type; |
| 59 | uint32 image; |
| 60 | |
| 61 | uint16 twidth; |
| 62 | uint16 tmem; |
| 63 | |
| 64 | uint16 sid; |
| 65 | uint16 theight; |
| 66 | |
| 67 | uint32 flag; |
| 68 | uint32 mask; |
| 69 | } uObjTxtrTile; // 24 bytes |
| 70 | |
| 71 | typedef struct { // Intel Format |
| 72 | uint32 type; |
| 73 | uint32 image; |
| 74 | |
| 75 | uint16 pnum; |
| 76 | uint16 phead; |
| 77 | |
| 78 | uint16 sid; |
| 79 | uint16 zero; |
| 80 | |
| 81 | uint32 flag; |
| 82 | uint32 mask; |
| 83 | } uObjTxtrTLUT; |
| 84 | |
| 85 | typedef union { |
| 86 | uObjTxtrBlock block; |
| 87 | uObjTxtrTile tile; |
| 88 | uObjTxtrTLUT tlut; |
| 89 | } uObjTxtr; |
| 90 | |
| 91 | typedef struct { // Intel format |
| 92 | uint16 scaleW; |
| 93 | short objX; |
| 94 | |
| 95 | uint16 paddingX; |
| 96 | uint16 imageW; |
| 97 | |
| 98 | uint16 scaleH; |
| 99 | short objY; |
| 100 | |
| 101 | uint16 paddingY; |
| 102 | uint16 imageH; |
| 103 | |
| 104 | uint16 imageAdrs; |
| 105 | uint16 imageStride; |
| 106 | |
| 107 | uint8 imageFlags; |
| 108 | uint8 imagePal; |
| 109 | uint8 imageSiz; |
| 110 | uint8 imageFmt; |
| 111 | } uObjSprite; |
| 112 | |
| 113 | |
| 114 | typedef struct { |
| 115 | uObjTxtr txtr; |
| 116 | uObjSprite sprite; |
| 117 | } uObjTxSprite; /* 48 bytes */ |
| 118 | |
| 119 | typedef struct { // Intel format |
| 120 | s32 A, B, C, D; |
| 121 | |
| 122 | short Y; |
| 123 | short X; |
| 124 | |
| 125 | uint16 BaseScaleY; |
| 126 | uint16 BaseScaleX; |
| 127 | } uObjMtx; |
| 128 | |
| 129 | typedef struct { |
| 130 | float A, B, C, D; |
| 131 | float X; |
| 132 | float Y; |
| 133 | float BaseScaleX; |
| 134 | float BaseScaleY; |
| 135 | } uObjMtxReal; |
| 136 | |
| 137 | typedef struct { //Intel format |
| 138 | short Y; |
| 139 | short X; |
| 140 | uint16 BaseScaleY; |
| 141 | uint16 BaseScaleX; |
| 142 | } uObjSubMtx; |
| 143 | |
| 144 | typedef struct { // Intel Format |
| 145 | uint16 imageW; |
| 146 | uint16 imageX; |
| 147 | |
| 148 | uint16 frameW; |
| 149 | short frameX; |
| 150 | |
| 151 | uint16 imageH; |
| 152 | uint16 imageY; |
| 153 | |
| 154 | uint16 frameH; |
| 155 | short frameY; |
| 156 | |
| 157 | uint32 imagePtr; |
| 158 | |
| 159 | uint8 imageSiz; |
| 160 | uint8 imageFmt; |
| 161 | uint16 imageLoad; |
| 162 | |
| 163 | uint16 imageFlip; |
| 164 | uint16 imagePal; |
| 165 | |
| 166 | uint16 tmemH; |
| 167 | uint16 tmemW; |
| 168 | uint16 tmemLoadTH; |
| 169 | uint16 tmemLoadSH; |
| 170 | uint16 tmemSize; |
| 171 | uint16 tmemSizeW; |
| 172 | } uObjBg; |
| 173 | |
| 174 | typedef struct { // Intel Format |
| 175 | uint16 imageW; |
| 176 | uint16 imageX; |
| 177 | |
| 178 | uint16 frameW; |
| 179 | short frameX; |
| 180 | |
| 181 | uint16 imageH; |
| 182 | uint16 imageY; |
| 183 | |
| 184 | uint16 frameH; |
| 185 | short frameY; |
| 186 | |
| 187 | uint32 imagePtr; |
| 188 | |
| 189 | uint8 imageSiz; |
| 190 | uint8 imageFmt; |
| 191 | uint16 imageLoad; |
| 192 | |
| 193 | uint16 imageFlip; |
| 194 | uint16 imagePal; |
| 195 | |
| 196 | uint16 scaleH; |
| 197 | uint16 scaleW; |
| 198 | |
| 199 | s32 imageYorig; |
| 200 | uint8 padding[4]; |
| 201 | } uObjScaleBg; |
| 202 | |
| 203 | #endif |
| 204 | |