/************************************************ * * * Display a single 8-bit sprite * * * * Author: ScoTT Campbell * * Date: 8/10/98 * * * * www.netyaroze-europe.com/~escotia * * * * E-mail: escotia@escotia.freeserve.co.uk * * * * Please mail me about any BUGS etc. * * * ************************************************/ #include // Header for NY functions. Must be included in all programs #include "screen.h" #include "pad.h" /***************************** Sprite related definitions ****************************/ #define SPRITE_ADDRESS (0x80090000) // Address TIM file will be loaded into main memory #define AMOUNT_SPRITES (1) // Only displaying 1 sprite #define AMOUNT_PRIMITIVES (AMOUNT_SPRITES + 1)// Include space for a clear command GsSPRITE sprite; // Sprite handler /*************************************************************************************/ /************************* Ordering Table related definitions ************************/ #define OT_LENGTH (1) // For 1<attribute = (unsigned long int) (timData.pmode << 24); // Set sprite to correct display mode spritePtr->attribute &= 0x03000000; // Set all other attribute bits to zero spritePtr->w = (timData.pw * 2); // 8-bit clut so rendered as twice actual width spritePtr->h = (timData.ph); // Set sprites height spritePtr->mx = spritePtr->w/2; // Set display point to center of sprite spritePtr->my = spritePtr->h/2; // " spritePtr->x = xPosition; // Set screen display position spritePtr->y = yPosition; // Set screen display position spritePtr->tpage = GetTPage(1, 0, timData.px, timData.py); // Get VRAM TPage number where sprite is stored spritePtr->u = 0; // No offset within the TPage spritePtr->v = 0; // " spritePtr->cx = timData.cx; // Attach CLUT to handler spritePtr->cy = timData.cy; // " spritePtr->r = 128; // spritePtr->g = 128; // Set brightness to normal spritePtr->b = 128; // spritePtr->scalex = ONE; // Set size in X to 1:1 spritePtr->scaley = ONE; // Set size in Y to 1:1 spritePtr->rotate = 0; // No rotation DrawSync(0); }/* InitSprite */ unsigned long int ReadPads() // SONY function // Read from controllers { return (~(*(pad1Buffer+3) | *(pad1Buffer+2) << 8 | *(pad2Buffer+3) << 16 | *(pad2Buffer+2) << 24)); }/* ReadPads */ /*************************************************************************************/