summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBad Diode <bd@badd10de.dev>2021-06-20 09:43:38 +0200
committerBad Diode <bd@badd10de.dev>2021-06-20 09:43:38 +0200
commitc9135315d7bab62a00efbce2758ceed855de66d5 (patch)
tree2db2b792690a6acd5463970a23aaff2c01b7f86e
parent0391e4b7ac374bf210be79db66d188494ed2dd45 (diff)
downloadgba-sequencer-c9135315d7bab62a00efbce2758ceed855de66d5.tar.gz
gba-sequencer-c9135315d7bab62a00efbce2758ceed855de66d5.zip
Move UI down
-rw-r--r--src/gba/gba.h15
-rw-r--r--src/sequencer.c22
2 files changed, 20 insertions, 17 deletions
diff --git a/src/gba/gba.h b/src/gba/gba.h
index 3a84b89..cdb3b31 100644
--- a/src/gba/gba.h
+++ b/src/gba/gba.h
@@ -101,12 +101,15 @@ typedef Color Palette[16];
101#define RGB15(R,G,B) (u16)(((B) << 10) | ((G) << 5) | (R)); 101#define RGB15(R,G,B) (u16)(((B) << 10) | ((G) << 5) | (R));
102 102
103// Some nice default colors. 103// Some nice default colors.
104#define COLOR_RED RGB15(31, 0,12) 104#define COLOR_BLACK RGB15(0, 0, 0)
105#define COLOR_BLUE RGB15(2, 15,30) 105#define COLOR_RED RGB15(31, 0,10)
106#define COLOR_CYAN RGB15(0, 30,30) 106#define COLOR_GREEN RGB15(31, 0,10)
107#define COLOR_GREY RGB15(12,12,12) 107#define COLOR_YELLOW RGB15(31, 0,10)
108#define COLOR_BLACK RGB15(0, 0, 0) 108#define COLOR_BLUE RGB15(2, 17,31)
109#define COLOR_WHITE RGB15(28,28,28) 109#define COLOR_PURPLE RGB15(2, 17,31)
110#define COLOR_CYAN RGB15(0, 27,30)
111#define COLOR_GREY RGB15(16,17,19)
112#define COLOR_WHITE RGB15(28,28,28)
110 113
111// 114//
112// Tile memory access. 115// Tile memory access.
diff --git a/src/sequencer.c b/src/sequencer.c
index 6859ba5..a5addf4 100644
--- a/src/sequencer.c
+++ b/src/sequencer.c
@@ -313,7 +313,7 @@ static ChannelWave ch3 = {
313#define TRIG_W 15 313#define TRIG_W 15
314#define TRIG_H 24 314#define TRIG_H 24
315#define TRIG_START_X 64 315#define TRIG_START_X 64
316#define TRIG_START_Y 90 316#define TRIG_START_Y 97
317#define TRIG_OFFSET_X (TRIG_W + 3) 317#define TRIG_OFFSET_X (TRIG_W + 3)
318#define TRIG_OFFSET_Y (TRIG_H + 7) 318#define TRIG_OFFSET_Y (TRIG_H + 7)
319 319
@@ -388,7 +388,7 @@ draw_triggers(void) {
388#define CHAN_W 19 388#define CHAN_W 19
389#define CHAN_H 8 389#define CHAN_H 8
390#define CHAN_START_X 35 390#define CHAN_START_X 35
391#define CHAN_START_Y 90 391#define CHAN_START_Y 97
392#define CHAN_OFFSET_Y 12 392#define CHAN_OFFSET_Y 12
393 393
394void 394void
@@ -431,7 +431,7 @@ draw_channel_cursor(size_t i, u8 clr) {
431#define PIANO_W 170 431#define PIANO_W 170
432#define PIANO_H 20 432#define PIANO_H 20
433#define PIANO_START_X 35 433#define PIANO_START_X 35
434#define PIANO_START_Y 65 434#define PIANO_START_Y 72
435#define PIANO_NOTE_W 2 435#define PIANO_NOTE_W 2
436 436
437void 437void
@@ -569,9 +569,9 @@ draw_piano(void) {
569} 569}
570 570
571#define PARAMS_W 170 571#define PARAMS_W 170
572#define PARAMS_H 48 572#define PARAMS_H 64
573#define PARAMS_START_X 35 573#define PARAMS_START_X 35
574#define PARAMS_START_Y 12 574#define PARAMS_START_Y 8
575 575
576void 576void
577draw_params_cursor_ch3(size_t i, u8 clr) { 577draw_params_cursor_ch3(size_t i, u8 clr) {
@@ -624,7 +624,7 @@ draw_params_cursor_ch3(size_t i, u8 clr) {
624 cursor_length = 30; 624 cursor_length = 30;
625 } 625 }
626 size_t x = PARAMS_START_X + x_positions[i] - 1; 626 size_t x = PARAMS_START_X + x_positions[i] - 1;
627 size_t y = PARAMS_START_Y + PARAMS_H - 18 + y_positions[i]; 627 size_t y = PARAMS_START_Y + PARAMS_H - 23 + y_positions[i];
628 draw_line(x, y, x + cursor_length, y, clr); 628 draw_line(x, y, x + cursor_length, y, clr);
629} 629}
630 630
@@ -665,7 +665,7 @@ clear_parameters(void) {
665 size_t x0 = PARAMS_START_X; 665 size_t x0 = PARAMS_START_X;
666 size_t y0 = PARAMS_START_Y; 666 size_t y0 = PARAMS_START_Y;
667 size_t x1 = PARAMS_START_X + PARAMS_W; 667 size_t x1 = PARAMS_START_X + PARAMS_W;
668 size_t y1 = PARAMS_START_Y + PARAMS_H; 668 size_t y1 = PARAMS_START_Y + PARAMS_H - 1;
669 draw_filled_rect(x0, y0, x1, y1, COL_BG); 669 draw_filled_rect(x0, y0, x1, y1, COL_BG);
670} 670}
671 671
@@ -680,7 +680,7 @@ draw_parameters_ch3(void) {
680 u8 *wave_b = ch3.params[trig_selection_loc].wave_b; 680 u8 *wave_b = ch3.params[trig_selection_loc].wave_b;
681 681
682 size_t x = PARAMS_START_X; 682 size_t x = PARAMS_START_X;
683 size_t y = PARAMS_START_Y + 2; 683 size_t y = PARAMS_START_Y + 13;
684 684
685 // Wave Patterns. 685 // Wave Patterns.
686 draw_wave_pattern(wave_a, x, y, COL_WAVE_A); 686 draw_wave_pattern(wave_a, x, y, COL_WAVE_A);
@@ -712,7 +712,7 @@ draw_parameters_ch3(void) {
712 { 712 {
713 Tile *wave_tiles = ASSETS_DEFAULT_WAVES; 713 Tile *wave_tiles = ASSETS_DEFAULT_WAVES;
714 size_t x = PARAMS_START_X; 714 size_t x = PARAMS_START_X;
715 size_t y = PARAMS_START_Y + PARAMS_H - 7; 715 size_t y = PARAMS_START_Y + PARAMS_H - 12;
716 for (size_t i = 0, k = 0; i < 4 * 2; i += 2, k++) { 716 for (size_t i = 0, k = 0; i < 4 * 2; i += 2, k++) {
717 draw_tile(x + 17 * k, y, wave_tiles + i, COL_FG, true); 717 draw_tile(x + 17 * k, y, wave_tiles + i, COL_FG, true);
718 draw_tile(x + 17 * k + 8, y, wave_tiles + i + 1, COL_FG, true); 718 draw_tile(x + 17 * k + 8, y, wave_tiles + i + 1, COL_FG, true);
@@ -726,7 +726,7 @@ draw_parameters_ch3(void) {
726 // Mode selection. 726 // Mode selection.
727 { 727 {
728 size_t x = PARAMS_START_X + 140; 728 size_t x = PARAMS_START_X + 140;
729 size_t y = PARAMS_START_Y + PARAMS_H - 17; 729 size_t y = PARAMS_START_Y + PARAMS_H - 22;
730 draw_line(x, y + 4, x + 5, y + 4, COL_FG); 730 draw_line(x, y + 4, x + 5, y + 4, COL_FG);
731 draw_line(x + 25, y + 4, x + 30, y + 4, COL_FG); 731 draw_line(x + 25, y + 4, x + 30, y + 4, COL_FG);
732 draw_line(x, y + 5, x, y + 16, COL_FG); 732 draw_line(x, y + 5, x, y + 16, COL_FG);
@@ -750,7 +750,7 @@ draw_parameters_ch3(void) {
750 // Wave volume. 750 // Wave volume.
751 { 751 {
752 size_t x = PARAMS_START_X + 140; 752 size_t x = PARAMS_START_X + 140;
753 size_t y = PARAMS_START_Y + PARAMS_H - 40; 753 size_t y = PARAMS_START_Y + PARAMS_H - 45;
754 draw_line(x, y + 7, x + 7, y + 7, COL_FG); 754 draw_line(x, y + 7, x + 7, y + 7, COL_FG);
755 draw_line(x + 23, y + 7, x + 30, y + 7, COL_FG); 755 draw_line(x + 23, y + 7, x + 30, y + 7, COL_FG);
756 draw_line(x, y + 8, x, y + 19, COL_FG); 756 draw_line(x, y + 8, x, y + 19, COL_FG);