// 8-bit hi-res sprite viewer, just to demonstrate how hi-res is implemented // I know this isn't the best way to show hi-res being implemented but it shows the basics // 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 // Yaroze library #include "pad.h" #define Screen_Width 640 // Screen resolution variables. #define Screen_Height 480 #define Sprite_Add 0x80090000 // memory address of sprite #define OT_LENGTH 2 //Ordering Table length #define MOVESPEED 1 #define TOP_WALL 15 // collision boundaries for the scren #define BOTTOM_WALL (Screen_Height-15) #define LEFT_WALL 15 // so sprite doesnt move off the screen #define RIGHT_WALL (Screen_Width-15) // 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)