#include #include // **** Global defines #define BitSet(_v,_b) \ (*(_v) = (*(_v)) | (_b)) #define BitClear(_v,_b) \ (*(_v) -= (*(_v)) & (_b)) #define BitCheck(_v,_b) \ (*(_v)& (_b)) #define DrawSprite(_s,_p) \ GsSortSprite((_s),&OTable_Header[CurrentBuffer], (_p)) #define SetSpriteRGB(_s,_r,_g,_b) \ (_s)->r = (_r), \ (_s)->g = (_g), \ (_s)->b = (_b) #define SetSpriteAnim(_s,_xf,_yf,_w,_h) \ (_s)->u = (_w)*(_xf), \ (_s)->v = (_h)*(_yf), \ (_s)->w = (_w), \ (_s)->h = (_h), \ (_s)->mx = (_w)/2, \ (_s)->my = (_h)/2 #define DrawLine(_l,_p) \ GsSortLine((_l),&OTable_Header[CurrentBuffer], (_p)) #define DrawGradLine(_l,_p) \ GsSortGLine((_l),&OTable_Header[CurrentBuffer], (_p)) #define DrawBox(_b,_p) \ GsSortBoxFill((_b),&OTable_Header[CurrentBuffer], (_p)) #define SetLinePos(_l,_x0,_y0,_x1,_y1) \ (_l)->x0 = (_x0), \ (_l)->y0 = (_y0), \ (_l)->x1 = (_x1), \ (_l)->y1 = (_y1) #define SetGradLinePos \ SetLinePos #define SetBoxPos(_b,_x,_y,_w,_h) \ (_b)->x = (_x), \ (_b)->y = (_y), \ (_b)->w = (_w), \ (_b)->h = (_h) #define SetLineRGB(_l,_r,_g,_b) \ (_l)->r = (_r), \ (_l)->g = (_g), \ (_l)->b = (_b) #define SetGradLineRGB(_l,_r0,_g0,_b0,_r1,_g1,_b1) \ (_l)->r0 = (_r0), \ (_l)->g0 = (_g0), \ (_l)->b0 = (_b0), \ (_l)->r1 = (_r1), \ (_l)->g1 = (_g1), \ (_l)->b1 = (_b1) #define SetBoxRGB \ SetLineRGB // **** Global variables u_char SCREENR, SCREENG, SCREENB; // FUNCTION PROTOTYPES //--------------------- void SetSpriteInfo(GsSPRITE *tSprite, u_long tMemAddress, long tX, long tY);