summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBad Diode <bd@badd10de.dev>2021-06-20 16:49:32 +0200
committerBad Diode <bd@badd10de.dev>2021-06-20 16:49:32 +0200
commitd4fad7432a13cc4fefe1e782899b8ad38d6ba160 (patch)
treebe424d854b1d642c055b7417c6f2d781c5a9cfff
parent6bc6d66bbe4b644c958723b02564cc7d64b8266d (diff)
downloadgba-sequencer-d4fad7432a13cc4fefe1e782899b8ad38d6ba160.tar.gz
gba-sequencer-d4fad7432a13cc4fefe1e782899b8ad38d6ba160.zip
Add labels to sq1 params
-rw-r--r--src/sequencer.c43
1 files changed, 24 insertions, 19 deletions
diff --git a/src/sequencer.c b/src/sequencer.c
index 2978e9b..60b70df 100644
--- a/src/sequencer.c
+++ b/src/sequencer.c
@@ -806,21 +806,12 @@ draw_parameters_wave(void) {
806 806
807void 807void
808draw_parameters_square(ChannelSquareParams *params, bool sweep) { 808draw_parameters_square(ChannelSquareParams *params, bool sweep) {
809 // DEBUG: Bounding box.
810 // {
811 // size_t x0 = PARAMS_START_X;
812 // size_t y0 = PARAMS_START_Y;
813 // size_t x1 = PARAMS_START_X + PARAMS_W;
814 // size_t y1 = PARAMS_START_Y + PARAMS_H - 5;
815 // draw_rect(x0, y0, x1, y1, COL_FG);
816 // }
817
818 // Duty cycle. 809 // Duty cycle.
819 { 810 {
820 // Shape drawing. 811 // Shape drawing.
821 { 812 {
822 size_t x = PARAMS_START_X; 813 size_t x = PARAMS_START_X;
823 size_t y = PARAMS_START_Y + PARAMS_H - 42; 814 size_t y = PARAMS_START_Y + PARAMS_H - 43;
824 815
825 size_t x0 = x + 2; 816 size_t x0 = x + 2;
826 size_t x1 = x0; 817 size_t x1 = x0;
@@ -871,8 +862,8 @@ draw_parameters_square(ChannelSquareParams *params, bool sweep) {
871 draw_line(x4, y1, x4, y0, COL_RED); 862 draw_line(x4, y1, x4, y0, COL_RED);
872 draw_line(x4, y0, x5, y0, COL_RED); 863 draw_line(x4, y0, x5, y0, COL_RED);
873 864
874 // DEBUG: Bounding box. 865 // Bounding box.
875 // draw_rect(x, y - 1, x + 24, y + 17, COL_RED); 866 draw_rect(x, y - 3, x + 24, y + 18, COL_RED);
876 } 867 }
877 868
878 // Param box. 869 // Param box.
@@ -907,19 +898,24 @@ draw_parameters_square(ChannelSquareParams *params, bool sweep) {
907 { 898 {
908 // Env. drawing. 899 // Env. drawing.
909 { 900 {
910 size_t x = PARAMS_START_X + 43; 901 // Bounding box.
911 size_t y = PARAMS_START_Y + PARAMS_H - 41; 902 {
903 size_t x0 = PARAMS_START_X + 31;
904 size_t y0 = PARAMS_START_Y + PARAMS_H - 46;
905 size_t x1 = x0 + 79;
906 size_t y1 = y0 + 21;
907 draw_rect(x0, y0, x1, y1, COL_CYAN);
908 }
909
910 size_t x = PARAMS_START_X + 42;
911 size_t y = PARAMS_START_Y + PARAMS_H - 43;
912 size_t x0 = x; 912 size_t x0 = x;
913 size_t y0 = y + 15 - params->env_volume; 913 size_t y0 = y + 15 - params->env_volume;
914 size_t x1 = x + 8 * params->env_time; 914 size_t x1 = x + 8 * params->env_time;
915 size_t y1 = params->env_direction == 0 ? y + 15 : y; 915 size_t y1 = params->env_direction == 0 ? y + 15 : y;
916 size_t x2 = x + 8 * 7; 916 size_t x2 = x + 8 * 7 + 1;
917 size_t y2 = y1; 917 size_t y2 = y1;
918 918
919 // Axis.
920 draw_line(x, y - 2, x, y + 16, COL_CYAN);
921 draw_line(x, y + 16, x + 8 * 7 + 2, y + 16, COL_CYAN);
922
923 // Env. 919 // Env.
924 if (params->env_time == 0) { 920 if (params->env_time == 0) {
925 draw_line(x1, y0, x2, y0, COL_CYAN); 921 draw_line(x1, y0, x2, y0, COL_CYAN);
@@ -1131,6 +1127,15 @@ draw_parameters_square(ChannelSquareParams *params, bool sweep) {
1131 } break; 1127 } break;
1132 } 1128 }
1133 } 1129 }
1130
1131 // Labels.
1132 {
1133 size_t x = PARAMS_START_X;
1134 size_t y = PARAMS_START_Y + PARAMS_H - 43;
1135 txt_drawf_small("shape", x + 1, y - 12, 4, COL_FG);
1136 txt_drawf_small("envelope", x + 54, y - 12, 4, COL_FG);
1137 txt_drawf_small("sweep", x + 133, y - 12, 4, COL_FG);
1138 }
1134} 1139}
1135 1140
1136void 1141void