#include #include "common.h" #include "gba-buttons.c" #include "background-tiles.c" #include "sprites.h" #include "text.h" // // Main functions. // // TODO: Cleanup OBJ/OAM memory copying and access. // int main(void) { // Configure the display in mode 0 to show OBJs, where tile memory is // sequential. DISP_CTRL = DISP_ENABLE_SPRITES | DISP_MODE_0 | DISP_BG_0; // Initialize sprite button overlay. init_sprite_pal(0, COLOR_WHITE); init_sprites(0); init_button_sprites(); Color colors[16] = { COLOR_BLUE, COLOR_BLUE, COLOR_BLUE, COLOR_BLUE, COLOR_BLUE, COLOR_BLUE, COLOR_BLUE, COLOR_BLUE, COLOR_BLUE, COLOR_BLUE, COLOR_BLUE, COLOR_BLUE, COLOR_BLUE, COLOR_BLUE, COLOR_BLUE, COLOR_BLUE, }; // These should be equivalent here, but remember that the dma_copy and // dma_fill functions will always work on U32 chunks. // // memcpy(&PAL_BUFFER_SPRITES[0], colors, 16 * sizeof(Color)); // dma_copy(&PAL_BUFFER_SPRITES[0], colors, 16 * sizeof(Color), 3); u32 color = COLOR_RED | COLOR_RED << 16; dma_fill(&PAL_BUFFER_SPRITES[0], color, 16 * sizeof(Color), 3); // Initialize text engine. // txt_init(0, COLOR_RED, 0); // txt_printf("TEST"); int frame_counter = 0; while(true) { wait_vsync(); poll_keys(); frame_counter++; update_button_sprites(); }; return 0; }