/*============================*\ Very simple sprite demonstration by Tom \*============================*/ // Include the standard header #include // Include the pad definitions #include "MyPad.h" // Standard #defines for all my progs // Length of the ordering table. If you increase // this value, you can do more levels of depth sorting #define OT_LENGTH 2 // Maximum number of graphics packets you can sort. // I'm still not 100% certain about the way this // works, if your program doesn't work, try increasing // this value #define PACKETMAX 2048 #define PACKETMAX2 (PACKETMAX*24) // Screen resolution #define SCREEN_WIDTH 320 #define SCREEN_HEIGHT 256 // Address of where the TIM file has been loaded #define SPRITE_ADDRESS 0x80090000 // Ordering table (one for each screen buffer) GsOT WorldOT[2]; GsOT_TAG OTTags[2][1<px; rect.y = imageInfo->py; rect.w = imageInfo->pw; rect.h = imageInfo->ph; // Using rect data, load the pixel data held in the TIM file onto // the frame buffer LoadImage(&rect, imageInfo->pixel); // Wait for loading to finish DrawSync(0); // If image needs a CLUT, load it up // (pmode: 8 or 9 ==> texture is 4-bit or 8-bit) if ((imageInfo->pmode>>3) & 0x01) { // define the area of the frame buffer to load the palette onto rect.x = imageInfo->cx; rect.y = imageInfo->cy; rect.w = imageInfo->cw; rect.h = imageInfo->ch; // Using rect data, load the palette onto the frame buffer LoadImage(&rect, imageInfo->clut); // wait for loading to finish DrawSync(0); } } u_long ReadPad(void) { return(~(*(bb0+3) | *(bb0+2) << 8 | *(bb1+3) << 16 | *(bb1+2) << 24)); }