#include #include "common.h" #include "gba-buttons.c" #include "background-tiles.c" #include "sprites.h" #include "text.h" #include "sequencer.c" // // 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_sprite_pal(16, COLOR_CYAN); init_sprite_pal(32, COLOR_RED); init_sprites(0); init_sequencer_sprites(); // Initialize text engine. // txt_init(0, COLOR_RED, 0); // Register interrupts. irq_init(); irs_set(IRQ_VBLANK, irs_stub); // turn sound on SOUND_STATUS = SOUND_ENABLE; SOUND_DMG_MASTER = sound_volume(SOUND_SQUARE1 | SOUND_SQUARE2, 3); SOUND_DSOUND_MASTER = SOUND_DMG100; // Initialize timer. while(true) { bios_vblank_wait(); poll_keys(); handle_sequencer_input(); update_sequencer_sprites(); render_sequencer_sprites(); // DEBUG: Output // txt_position(1,0); // txt_clear_line(); // txt_printf(" BPM: %d\n\n", bpm); // txt_clear_line(); // txt_printf(" Step: %d\n", step_counter); // txt_clear_line(); // txt_printf(" Note: %s\n", note_names[active_note]); }; return 0; }