/*======================*\ Motion Blurring tutorial by Tom \*======================*/ #include #include "MyPad.h" #define OT_LENGTH 2 #define PACKETMAX 2048 #define PACKETMAX2 (PACKETMAX*24) #define SCREEN_WIDTH 320 #define SCREEN_HEIGHT 256 #define SPRITE_ADDRESS 0x80090000 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); } } void SetUpSprite(GsSPRITE *sprite, GsIMAGE *image) { ProperInitialiseTexture(SPRITE_ADDRESS, image); sprite->x = 160; sprite->y = 128; switch(image->pmode) { case(8): sprite->w = image->pw * 4; sprite->attribute = 0; // 4 bit image break; case(9): sprite->w = image->pw * 2; sprite->attribute = 1<<24; // 8 bit image break; case(2): sprite->w = image->pw; sprite->attribute = 2<<24; // 16 bit image break; default: printf("Sorry, image bit depth '%d' is not supported (is the image 24 bit?)\n", image->pmode); exit(0); break; } sprite->h = image->ph; sprite->u = image->px % 64; sprite->v = image->py % 256; sprite->cx = image->cx; sprite->cy = image->cy; sprite->r = 128; sprite->g = 128; sprite->b = 128; sprite->mx = 32; sprite->my = 16; sprite->tpage = GetTPage(image->pmode & 7, 0, image->px, image->py); } u_long ReadPad(void) { return(~(*(bb0+3) | *(bb0+2) << 8 | *(bb1+3) << 16 | *(bb1+2) << 24)); }