// Example 1 #include // Contains all net yaroze functions #include "pad.h" // Contains pad definitions, for use with reading pads #define Screen_Width (320) // Screen resolution definitions #define Screen_Height (240) #define Sprite_Mem_Addr (0x80090000) // memory address of sprite #define OT_LENGTH (2) //Ordering Table length #define NUM_OF_SPRITES (1) // Used to calculate packet size #define MAX_NUM_SPRITES (NUM_OF_SPRITES + 1) // Used to calculate packet size GsOT WorldOT[2]; // OT headers GsOT_TAG OTTags[2][1<cx = timdata.cx; sprite->cy = timdata.cy; } // Set Sprite attribute to specify colour depth sprite->attribute = (1<<24); // Set Screen position of sprite sprite->x = tx; sprite->y = ty; // Set width and height of sprite sprite->w = (timdata.pw*tmp2); sprite->h = (timdata.ph); // Get texture page sprite is on sprite->tpage = GetTPage(tmp1,0,timdata.px,timdata.py); // Set texture page offset from top-left of page sprite->u = timdata.px%64; sprite->v = timdata.py%256; // Set sprite brightness to normal sprite->r = sprite->g = sprite->b = 128; // Set sprite rotation point to center sprite->mx = (sprite->w/2); sprite->my = (sprite->h/2); // Set sprite size and orientation to normal sprite->scalex = ONE; sprite->scaley = ONE; sprite->rotate = 0; } void RenderPrepare() { // Stores what buffer is in use, in activeBuff activeBuff = GsGetActiveBuff(); // Initialises the OT GsClearOt(0,0,&WorldOT[activeBuff]); // Sets drawing command storage address GsSetWorkBase((PACKET *)GpuPacketArea[activeBuff]); } void RenderFinish() { // Waits for drawing to be completed DrawSync(0); // Waits for vertical synchronisation before moving on VSync(0); // Swaps display buffers GsSwapDispBuff(); // Registers a drawing clear command in the OT GsSortClear(0,0,0,&WorldOT[activeBuff]); // Executes the drawing commands in the OT GsDrawOt(&WorldOT[activeBuff]); }