aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c34
1 files changed, 26 insertions, 8 deletions
diff --git a/src/main.c b/src/main.c
index e694057..f89e743 100644
--- a/src/main.c
+++ b/src/main.c
@@ -12,17 +12,33 @@ WITH REGARD TO THIS SOFTWARE.
12#include "gba/gba.h" 12#include "gba/gba.h"
13 13
14#include "filesystem.c" 14#include "filesystem.c"
15#include "renderer.c" 15#include "renderer_m0.c"
16#include "sequencer.c" 16#include "sequencer.c"
17 17
18#define PROF_ENABLE 0 18#define PROF_ENABLE 1
19#include "profiling.c" 19#include "profiling.c"
20 20
21//
22// Config parameters.
23//
24 21
25int main(void) { 22void
23render(void) {
24 PROF(screen_fill(0), clear_cycles);
25 PROF(draw_triggers(), draw_trigs_cycles);
26 PROF(draw_channels(), draw_btn_cycles);
27 PROF(draw_pattern_buttons(), draw_btn_cycles);
28 PROF(draw_bank_buttons(), draw_btn_cycles);
29 PROF(draw_bpm(), draw_btn_cycles);
30 PROF(draw_play(), draw_btn_cycles);
31 PROF(draw_stop(), draw_btn_cycles);
32 PROF(draw_piano(), draw_piano_cycles);
33 PROF(draw_parameters(), draw_param_cycles);
34 PROF(draw_trig_cursor(trig_selection_loc, COL_CURSOR), draw_cursor_cycles);
35 PROF(draw_channel_cursor(channel_selection_loc, COL_GREY), draw_cursor_cycles);
36 PROF(draw_pattern_cursor(pattern_selection_loc, COL_GREY), draw_cursor_cycles);
37 PROF(draw_current_step(COL_RED), draw_cursor_cycles);
38}
39
40int
41main(void) {
26 // Adjust system wait times. 42 // Adjust system wait times.
27 SYSTEM_WAIT = SYSTEM_WAIT_CARTRIDGE; 43 SYSTEM_WAIT = SYSTEM_WAIT_CARTRIDGE;
28 44
@@ -38,15 +54,17 @@ int main(void) {
38 54
39 // Initialize sequencer. 55 // Initialize sequencer.
40 sequencer_init(); 56 sequencer_init();
57 txt_spacing(6);
41 58
42 // Main loop. 59 // Main loop.
43 while (true) { 60 while (true) {
44 poll_keys(); 61 poll_keys();
45 bios_vblank_wait(); 62 bios_vblank_wait();
46 FRAME_START();
47 PROF(handle_sequencer_input(), input_cycles);
48 PROF_SHOW(); 63 PROF_SHOW();
64 FRAME_START();
49 PROF(flip_buffer(), flip_cycles); 65 PROF(flip_buffer(), flip_cycles);
66 PROF(handle_sequencer_input(), input_cycles);
67 PROF(render(), render_cycles);
50 FRAME_END(); 68 FRAME_END();
51 } 69 }
52 70