// 16-bit sprite viewer, just to demonstrate how to get a sprite on screen // I know its all been done before but if you are still stuck this might help // This is an adaption of my 8-bit viewer, just slight alteration in sprites attribute. // Author : Paul Bircham [Doodle] // Date : 3/7/98 // Notice : Please feel free to use this source, or parts in your program // as long as a thanks in your demos credits are given to me // Contact : If you have any questions about this program feel free to e-mail me at doodlek@globalnet.co.uk // with any of your questions and I will try and answer them #include #include "pad.h" #define Screen_Width 320 // Screen resolution variables. #define Screen_Height 240 #define Sprite_Add 0x80090000 // memory address of sprite #define OT_LENGTH 2 //Ordering Table length #define MOVESPEED 1 #define TOP_WALL 50 // collision boundaries for the screen #define BOTTOM_WALL ((Screen_Height-50)) #define LEFT_WALL 50 // so sprite doesnt move to far off the screen #define RIGHT_WALL (Screen_Width-50) // PROTOTYPE FUNCTIONS void InitGraphics(); void InitOTs(); void InitControllers() ; void InitSprite(); void InitBox() ; void MoveSprite(); // GLOBALS AND SYSTEM RELATED STUFF GsOT WorldOT[2]; GsOT_TAG OTTags[2][1<BOTTOM_WALL) { sprite1.y = BOTTOM_WALL ; } else sprite1.y += MOVESPEED ; } if (PadStatus&PADLright) { if ((sprite1.x+MOVESPEED)>RIGHT_WALL) { sprite1.x = RIGHT_WALL ; } else sprite1.x += MOVESPEED ; } if (PadStatus&PADLleft) { if ((sprite1.x-MOVESPEED)