diff options
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 26 |
1 files changed, 6 insertions, 20 deletions
@@ -22,6 +22,8 @@ int main(void) { | |||
22 | 22 | ||
23 | // Initialize sprite button overlay. | 23 | // Initialize sprite button overlay. |
24 | init_sprite_pal(0, COLOR_WHITE); | 24 | init_sprite_pal(0, COLOR_WHITE); |
25 | init_sprite_pal(16, COLOR_CYAN); | ||
26 | init_sprite_pal(32, COLOR_RED); | ||
25 | init_sprites(0); | 27 | init_sprites(0); |
26 | init_sequencer_sprites(); | 28 | init_sequencer_sprites(); |
27 | 29 | ||
@@ -38,31 +40,16 @@ int main(void) { | |||
38 | SOUND_DSOUND_MASTER = SOUND_DMG100; | 40 | SOUND_DSOUND_MASTER = SOUND_DMG100; |
39 | 41 | ||
40 | // Initialize timer. | 42 | // Initialize timer. |
41 | int bpm = 120; | ||
42 | |||
43 | while(true) { | 43 | while(true) { |
44 | bios_vblank_wait(); | 44 | bios_vblank_wait(); |
45 | poll_keys(); | 45 | poll_keys(); |
46 | if (key_hold(KEY_UP)) { | ||
47 | bpm += 1; | ||
48 | set_time(bpm); | ||
49 | } | ||
50 | if (key_hold(KEY_DOWN)) { | ||
51 | bpm -= 1; | ||
52 | set_time(bpm); | ||
53 | } | ||
54 | |||
55 | if (key_pressed(KEY_START)) { | ||
56 | step_counter = 0; | ||
57 | set_time(bpm); | ||
58 | } | ||
59 | if (key_pressed(KEY_SELECT)) { | ||
60 | TIMER_CTRL_0 ^= TIMER_CTRL_ENABLE; | ||
61 | } | ||
62 | 46 | ||
47 | handle_sequencer_input(); | ||
63 | update_sequencer_sprites(); | 48 | update_sequencer_sprites(); |
49 | render_sequencer_sprites(); | ||
64 | 50 | ||
65 | // txt_position(1,6); | 51 | // DEBUG: Output |
52 | // txt_position(1,0); | ||
66 | // txt_clear_line(); | 53 | // txt_clear_line(); |
67 | // txt_printf(" BPM: %d\n\n", bpm); | 54 | // txt_printf(" BPM: %d\n\n", bpm); |
68 | 55 | ||
@@ -70,7 +57,6 @@ int main(void) { | |||
70 | // txt_printf(" Step: %d\n", step_counter); | 57 | // txt_printf(" Step: %d\n", step_counter); |
71 | // txt_clear_line(); | 58 | // txt_clear_line(); |
72 | // txt_printf(" Note: %s\n", note_names[active_note]); | 59 | // txt_printf(" Note: %s\n", note_names[active_note]); |
73 | render_sequencer_sprites(); | ||
74 | }; | 60 | }; |
75 | 61 | ||
76 | return 0; | 62 | return 0; |