/* Copyright (c) 2021 Bad Diode Permission to use, copy, modify, and distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE. */ #include "gba/gba.h" #include "filesystem.c" #include "renderer.c" #include "sequencer.c" #define PROF_ENABLE 0 #include "profiling.c" // // Config parameters. // int main(void) { // Adjust system wait times. SYSTEM_WAIT = SYSTEM_WAIT_CARTRIDGE; // Initialize filesystem. fs_init(); // Initialize renderer. renderer_init(); // Register interrupts. irq_init(); irs_set(IRQ_VBLANK, irs_stub); // Initialize sequencer. sequencer_init(); // Main loop. while (true) { poll_keys(); bios_vblank_wait(); FRAME_START(); PROF(handle_sequencer_input(), input_cycles); PROF_SHOW(); PROF(flip_buffer(), flip_cycles); FRAME_END(); } return 0; }