summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBad Diode <bd@badd10de.dev>2021-06-11 15:53:07 +0200
committerBad Diode <bd@badd10de.dev>2021-06-11 15:53:07 +0200
commit2a3e728c3d4ca3e3ad3479456e7a02bd72931745 (patch)
treebe746c17336b880455b9656af402d19b688726d5
parent3caf8f1e040c9d186fddc3039e5e4e8dcf5c9d0f (diff)
downloadgba-sequencer-2a3e728c3d4ca3e3ad3479456e7a02bd72931745.tar.gz
gba-sequencer-2a3e728c3d4ca3e3ad3479456e7a02bd72931745.zip
Add mode drawing for parameters of ch3
-rw-r--r--src/sequencer.c45
1 files changed, 43 insertions, 2 deletions
diff --git a/src/sequencer.c b/src/sequencer.c
index 0c2f2a5..b82ee8a 100644
--- a/src/sequencer.c
+++ b/src/sequencer.c
@@ -588,7 +588,7 @@ clear_parameters(void) {
588 588
589IWRAM_CODE 589IWRAM_CODE
590void 590void
591draw_parameters(void) { 591draw_parameters_ch3(void) {
592 // Clear until the default parameters, since those don't change. 592 // Clear until the default parameters, since those don't change.
593 { 593 {
594 size_t x0 = PARAMS_START_X; 594 size_t x0 = PARAMS_START_X;
@@ -650,6 +650,47 @@ draw_parameters(void) {
650 } 650 }
651 } 651 }
652 652
653 // Mode selection.
654 {
655 size_t x = PARAMS_START_X + 140;
656 size_t y = PARAMS_START_Y + PARAMS_H - 20;
657 draw_line(x, y + 4, x + 5, y + 4, COL_FG);
658 draw_line(x + 25, y + 4, x + 30, y + 4, COL_FG);
659 draw_line(x, y + 5, x, y + 19, COL_FG);
660 draw_line(x + 30, y + 5, x + 30, y + 19, COL_FG);
661 draw_line(x, y + 20, x + 30, y + 20, COL_FG);
662 txt_drawf_small("mode", x + 6, y, 4, COL_FG);
663
664 switch (ch3.params[trig_selection_loc].wave_mode) {
665 case 0: {
666 txt_drawf("A", x + 12, y + 9, 6, COL_FG);
667 } break;
668 case 1: {
669 txt_drawf("B", x + 12, y + 9, 6, COL_FG);
670 } break;
671 case 2: {
672 txt_drawf("A+B", x + 6, y + 9, 6, COL_FG);
673 } break;
674 case 3: {
675 txt_drawf("B+A", x + 6, y + 9, 6, COL_FG);
676 } break;
677 }
678 }
679}
680
681void
682draw_parameters(void) {
683 switch (channel_selection_loc) {
684 case 0: {
685 } break;
686 case 1: {
687 } break;
688 case 2: {
689 draw_parameters_ch3();
690 } break;
691 case 3: {
692 } break;
693 }
653} 694}
654 695
655void 696void
@@ -1225,13 +1266,13 @@ sequencer_init(void) {
1225 draw_piano(); 1266 draw_piano();
1226 TriggerNote *trig = get_current_trig(); 1267 TriggerNote *trig = get_current_trig();
1227 draw_note(trig->note, COL_BLUE); 1268 draw_note(trig->note, COL_BLUE);
1228 draw_parameters();
1229 1269
1230 // Initialize input handler. 1270 // Initialize input handler.
1231 channel_selection_loc = 2; // DEBUG: Starting on CH3 1271 channel_selection_loc = 2; // DEBUG: Starting on CH3
1232 input_handler = handle_trigger_selection; 1272 input_handler = handle_trigger_selection;
1233 draw_trig_cursor(trig_selection_loc, 3); 1273 draw_trig_cursor(trig_selection_loc, 3);
1234 draw_channel_cursor(channel_selection_loc, 5); 1274 draw_channel_cursor(channel_selection_loc, 5);
1275 draw_parameters();
1235 1276
1236 // Initialize sound system. 1277 // Initialize sound system.
1237 SOUND_STATUS = SOUND_ENABLE; 1278 SOUND_STATUS = SOUND_ENABLE;