24static inline void *_gsKit_heap_alloc(GSQUEUE *q,
int qsize,
int bsize,
int type)
31 printf(
"GSKIT: WARNING! HEAP OVERFLOW FOR RENDERQUEUE %p!!\n", q);
65static inline void *gsKit_heap_alloc(GSGLOBAL *
gsGlobal,
int qsize,
int bsize,
int type)
71static inline void *_gsKit_heap_alloc_dma(GSQUEUE *q,
int qsize,
int bsize)
78 printf(
"GSKIT: WARNING! HEAP OVERFLOW FOR RENDERQUEUE %p!!\n", q);
103static inline void *gsKit_heap_alloc_dma(GSGLOBAL *
gsGlobal,
int qsize,
int bsize)
108static inline int __gsKit_float_to_int_uv(
float fuv,
int imax)
110 int iuv = (int)(fuv * 16.0f);
122 if (iuv >= (1024 * 16))
123 iuv = (1024 * 16) - 1;
128static inline int gsKit_float_to_int_u(
const GSTEXTURE *Texture,
float fu)
130 return __gsKit_float_to_int_uv(fu, Texture->
Width * 16);
133static inline int gsKit_float_to_int_v(
const GSTEXTURE *Texture,
float fv)
135 return __gsKit_float_to_int_uv(fv, Texture->
Height * 16);
138static inline int __gsKit_float_to_int_xy(
float fxy,
int offset)
140 int ixy = (int)(fxy * 16.0f) + offset;
147 if (ixy >= (4096 * 16))
148 ixy = (4096 * 16) - 1;
153static inline int gsKit_float_to_int_x(
const GSGLOBAL *
gsGlobal,
float fx)
158static inline int gsKit_float_to_int_y(
const GSGLOBAL *
gsGlobal,
float fy)
163static inline gs_xyz2 vertex_to_XYZ2(
const GSGLOBAL *
gsGlobal,
float fx,
float fy,
int iz)
167 res.xyz.x = gsKit_float_to_int_x(
gsGlobal, fx);
168 res.xyz.y = gsKit_float_to_int_y(
gsGlobal, fy);
176static inline gs_rgbaq color_to_RGBAQ(uint8_t r, uint8_t g, uint8_t b, uint8_t a,
float q)
180 res.color.components.r = r;
181 res.color.components.g = g;
182 res.color.components.b = b;
183 res.color.components.a = a;
191static inline gs_rgbaq rgba_to_RGBAQ(uint32_t rgba,
float q)
195 res.color.components.rgba = rgba;
202static inline gs_rgbaq rgbaq_to_RGBAQ(uint64_t rgbaq)
206 res.color.rgbaq = rgbaq;
212static inline gs_uv vertex_to_UV(
const GSTEXTURE *Texture,
float u,
float v)
216 int iu = gsKit_float_to_int_u(Texture, u);
217 int iv = gsKit_float_to_int_v(Texture, v);
226static inline gs_stq vertex_to_STQ(
float s,
float t)
237static inline gs_texclut postion_to_TEXCLUT(u8 cbw, u8 cou, u8 cov)
241 res.specification.cbw = cbw;
242 res.specification.cou = cou;
243 res.specification.cov = cov;
#define GS_GIF_BLOCKSIZE
GS GIF Data Transfer Blocksize.
#define GS_XYZ2
GS Vertex Coordinate Value.
#define GS_RGBAQ
GS Color in RGBAQ Format.
#define GS_ST
GS Texture Coordinate Value in Texture Coordinates.
#define GS_TEXCLUT
GS Texture CLUT Location.
#define GS_UV
GS Texture Coordinate Value in Texel Coordinates.
#define GIF_AD
GIF_TAG Address+Data Setting. (Used after GIF_TAG).
#define GIF_RESERVED
Reserved GIF Tag. This is never sent, only used for sanity checks.
GSQUEUE * CurQueue
Draw Queue (Current).
int OffsetX
X Window Offset.
int OffsetY
Y Window Offset.
void * dma_tag
Pointer to last DMA_TAG.
int same_obj
Number of times in a row the same REGLIST enabled object has been added (Used for NLOOP fixup later).
void * pool_max[2]
Pool Maximum Address (Used for bounds checking).
void * pool_cur
Current Pool Address (Offset from Base).
void * last_tag
Pointer to the GIF_TAG of the last object in this draw queue.
int dbuf
Which of the pool[2] buffers we are using.
int last_type
Last type of object in this draw queue.
u32 tag_size
Quadwords in current DMA_TAG.
u32 Height
Height of the Texture.
u32 Width
Width of the Texture.