// Game Boy Advance library for Logic Machines F'05 // Version 4, October 28, 2005 // **************************************************************************************************** // Constants // Use these image size constants for the third parameter to load_image() #define IMAGE_8x8 0 #define IMAGE_16x16 1 #define IMAGE_32x32 2 #define IMAGE_64x64 3 #define IMAGE_16x8 4 #define IMAGE_32x8 5 #define IMAGE_32x16 6 #define IMAGE_64x32 7 #define IMAGE_8x16 8 #define IMAGE_8x32 9 #define IMAGE_16x32 10 #define IMAGE_32x64 11 // Use these constants as the parameter to button_pressed(), button_released() and button_held() #define A_BUTTON (1 << 0) // 1 #define B_BUTTON (1 << 1) // 2 #define SELECT_BUTTON (1 << 2) // 4 #define START_BUTTON (1 << 3) // 8 #define RIGHT_BUTTON (1 << 4) // 16 #define LEFT_BUTTON (1 << 5) // 32 #define UP_BUTTON (1 << 6) // 64 #define DOWN_BUTTON (1 << 7) // 128 #define R_BUTTON (1 << 8) // 256 #define L_BUTTON (1 << 9) // 512 // Use these constants in place of 0 and 1 to improve code legibility #define TRUE 1 #define FALSE 0 #define YES 1 #define NO 0 // **************************************************************************************************** // Functions // Miscellaneous functions void start_game(void); // start up the gbaio library int rand(int min, int max); // return a random number from min to max // Input functions void start_input(void); // get ready to check inputs int button_pressed(int which); // did a button go down? int button_released(int which); // did a button get released? int button_held(int which); // is a button down? // Drawing functions void load_image(int image_number, char *image, int size); // load an image into sprite image memory void start_drawing(void); // get ready to draw void set_sprite_image(int sprite_number, int image_number); // set the image for a sprite void draw_sprite(int sprite_number, int x, int y); // place a sprite on the screen void set_color(int color_number, int red, int green, int blue); // set a color in the sprite palette void draw_dot( int x, int y, int r, int g, int b ); // draw a dot on the screen void video_mode(int mode); // don't call this unsigned short rgb_color(int red, int green, int blue); // same as RGB5