From 0d02b2eab23f92720e3c47bbed27976cb9eccae7 Mon Sep 17 00:00:00 2001 From: Bad Diode Date: Fri, 2 Feb 2024 10:35:18 +0100 Subject: Replace unnecessary drawf with draws calls for performance --- src/drawing.c | 534 +++++++++++++++++++++++++++++----------------------------- 1 file changed, 267 insertions(+), 267 deletions(-) diff --git a/src/drawing.c b/src/drawing.c index 16a914a..1d91d86 100644 --- a/src/drawing.c +++ b/src/drawing.c @@ -256,7 +256,7 @@ void draw_bank_buttons() { size_t x = BANK_START_X + 1; size_t y = BANK_START_Y; - txt_drawf_small("BANK", x - 3, y - 10, COL_FG); + txt_draws_small("BANK", x - 3, y - 10, COL_FG); char bank_names[] = { 'A', 'B', 'C', 'D', 'E', 'F' }; @@ -303,7 +303,7 @@ draw_pattern_buttons() { size_t x = PAT_START_X; size_t y = PAT_START_Y; - txt_drawf_small("PAT", x, y - 10, COL_FG); + txt_draws_small("PAT", x, y - 10, COL_FG); char pat_names[] = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', @@ -416,7 +416,7 @@ draw_bpm() { // Draw bounding box. draw_filled_rect(x, y, x + R_COL_W - 2, y + BPM_H - 3, COL_BG); draw_rect(x, y, x + R_COL_W - 2, y + BPM_H - 3, COL_FG); - txt_drawf_small("BPM", x + 7, y - 10, COL_FG); + txt_draws_small("BPM", x + 7, y - 10, COL_FG); if (settings.sync == SYNC_IN_LINK_96BPQ || settings.sync == SYNC_IN_LINK_48BPQ || @@ -424,7 +424,7 @@ draw_bpm() { settings.sync == SYNC_IN_LINK_12BPQ || settings.sync == SYNC_IN_LINK_6BPQ || settings.sync == SYNC_IN_LINK_4BPQ) { - txt_drawf("SYNC", x + 2, y + 2, COL_FG); + txt_draws("SYNC", x + 2, y + 2, COL_FG); } else { // Make sure its horizontally centered if only 2 digits int bpm; @@ -449,9 +449,9 @@ draw_scale() { // Draw bounding box. draw_filled_rect(x, y, x + R_COL_W - 2, y + SCALE_H - 3, COL_BG); draw_rect(x, y, x + R_COL_W - 2, y + SCALE_H - 3, COL_FG); - txt_drawf_small("SCALE", x + 3, y - 10, COL_FG); + txt_draws_small("SCALE", x + 3, y - 10, COL_FG); - txt_drawf(scale_short[current_scale], x + 2, y + 2, COL_FG); + txt_draws(scale_short[current_scale], x + 2, y + 2, COL_FG); } void @@ -650,52 +650,52 @@ draw_params_cursor_wave(size_t i, u8 clr) { case 0: { x += 4 + PARAMS_BOX_OFFSET_X * 0; y += PARAMS_BOX_H - 7; - txt_drawf_small("shape", x, y, COL_BG); + txt_draws_small("shape", x, y, COL_BG); } break; case 1: { x += 6 + PARAMS_BOX_OFFSET_X * 1; y += PARAMS_BOX_H - 7; - txt_drawf_small("type", x, y, COL_BG); + txt_draws_small("type", x, y, COL_BG); } break; case 2: { x += 4 + PARAMS_BOX_OFFSET_X * 2; y += PARAMS_BOX_H - 7; - txt_drawf_small("shape", x, y, COL_BG); + txt_draws_small("shape", x, y, COL_BG); } break; case 3: { x += 6 + PARAMS_BOX_OFFSET_X * 3; y += PARAMS_BOX_H - 7; - txt_drawf_small("type", x, y, COL_BG); + txt_draws_small("type", x, y, COL_BG); } break; case 4: { x += 6 + PARAMS_BOX_OFFSET_X * 4; y += PARAMS_BOX_H - 7; - txt_drawf_small("prob", x, y, COL_BG); + txt_draws_small("prob", x, y, COL_BG); } break; case 5: { x += 4 + PARAMS_BOX_OFFSET_X * 0; y += PARAMS_BOX_H - 7 + PARAMS_BOX_OFFSET_Y; - txt_drawf_small("voice", x, y, COL_BG); + txt_draws_small("voice", x, y, COL_BG); } break; case 6: { x += 8 + PARAMS_BOX_OFFSET_X * 1; y += PARAMS_BOX_H - 7 + PARAMS_BOX_OFFSET_Y; - txt_drawf_small("vol", x, y, COL_BG); + txt_draws_small("vol", x, y, COL_BG); } break; case 7: { x += 2 + PARAMS_BOX_OFFSET_X * 2; y += PARAMS_BOX_H - 7 + PARAMS_BOX_OFFSET_Y; - txt_drawf_small("attack", x, y, COL_BG); + txt_draws_small("attack", x, y, COL_BG); } break; case 8: { x += 4 + PARAMS_BOX_OFFSET_X * 3; y += PARAMS_BOX_H - 7 + PARAMS_BOX_OFFSET_Y; - txt_drawf_small("decay", x, y, COL_BG); + txt_draws_small("decay", x, y, COL_BG); } break; case 9: { x += 8 + PARAMS_BOX_OFFSET_X * 4; y += PARAMS_BOX_H - 7 + PARAMS_BOX_OFFSET_Y; - txt_drawf_small("pan", x, y, COL_BG); + txt_draws_small("pan", x, y, COL_BG); } break; default: break; } @@ -723,32 +723,32 @@ draw_params_cursor_noise(size_t i, u8 clr) { case 0: { x += 6 + PARAMS_BOX_OFFSET_X * 0; y += PARAMS_BOX_H - 7; - txt_drawf_small("mode", x, y, COL_BG); + txt_draws_small("mode", x, y, COL_BG); } break; case 1: { x += 8 + PARAMS_BOX_OFFSET_X * 1; y += PARAMS_BOX_H - 7; - txt_drawf_small("vol", x, y, COL_BG); + txt_draws_small("vol", x, y, COL_BG); } break; case 2: { x += 6 + PARAMS_BOX_OFFSET_X * 2; y += PARAMS_BOX_H - 7; - txt_drawf_small("time", x, y, COL_BG); + txt_draws_small("time", x, y, COL_BG); } break; case 3: { x += 8 + PARAMS_BOX_OFFSET_X * 3; y += PARAMS_BOX_H - 7; - txt_drawf_small("dir", x, y, COL_BG); + txt_draws_small("dir", x, y, COL_BG); } break; case 4: { x += 6 + PARAMS_BOX_OFFSET_X * 4; y += PARAMS_BOX_H - 7; - txt_drawf_small("prob", x, y, COL_BG); + txt_draws_small("prob", x, y, COL_BG); } break; case 9: { x += 8 + PARAMS_BOX_OFFSET_X * 4; y += PARAMS_BOX_H - 7 + PARAMS_BOX_OFFSET_Y; - txt_drawf_small("pan", x, y, COL_BG); + txt_draws_small("pan", x, y, COL_BG); } break; default: break; } @@ -776,47 +776,47 @@ draw_params_cursor_square(size_t i, u8 clr) { case 0: { x += 4 + PARAMS_BOX_OFFSET_X * 0; y += PARAMS_BOX_H - 7; - txt_drawf_small("shape", x, y, COL_BG); + txt_draws_small("shape", x, y, COL_BG); } break; case 1: { x += 8 + PARAMS_BOX_OFFSET_X * 1; y += PARAMS_BOX_H - 7; - txt_drawf_small("vol", x, y, COL_BG); + txt_draws_small("vol", x, y, COL_BG); } break; case 2: { x += 6 + PARAMS_BOX_OFFSET_X * 2; y += PARAMS_BOX_H - 7; - txt_drawf_small("time", x, y, COL_BG); + txt_draws_small("time", x, y, COL_BG); } break; case 3: { x += 8 + PARAMS_BOX_OFFSET_X * 3; y += PARAMS_BOX_H - 7; - txt_drawf_small("dir", x, y, COL_BG); + txt_draws_small("dir", x, y, COL_BG); } break; case 4: { x += 6 + PARAMS_BOX_OFFSET_X * 4; y += PARAMS_BOX_H - 7; - txt_drawf_small("prob", x, y, COL_BG); + txt_draws_small("prob", x, y, COL_BG); } break; case 5: { x += 4 + PARAMS_BOX_OFFSET_X * 0; y += PARAMS_BOX_H - 7 + PARAMS_BOX_OFFSET_Y; - txt_drawf_small("sweep", x, y, COL_BG); + txt_draws_small("sweep", x, y, COL_BG); } break; case 6: { x += 6 + PARAMS_BOX_OFFSET_X * 1; y += PARAMS_BOX_H - 7 + PARAMS_BOX_OFFSET_Y; - txt_drawf_small("time", x, y, COL_BG); + txt_draws_small("time", x, y, COL_BG); } break; case 7: { x += 8 + PARAMS_BOX_OFFSET_X * 2; y += PARAMS_BOX_H - 7 + PARAMS_BOX_OFFSET_Y; - txt_drawf_small("dir", x, y, COL_BG); + txt_draws_small("dir", x, y, COL_BG); } break; case 9: { x += 8 + PARAMS_BOX_OFFSET_X * 4; y += PARAMS_BOX_H - 7 + PARAMS_BOX_OFFSET_Y; - txt_drawf_small("pan", x, y, COL_BG); + txt_draws_small("pan", x, y, COL_BG); } break; default: break; } @@ -865,39 +865,39 @@ draw_prob(u8 prob, u8 clr) { size_t y = PARAMS_START_Y + 5; switch (prob) { case PROB_100: { - txt_drawf("100", x, y, clr); + txt_draws("100", x, y, clr); txt_drawc('%', x + 18, y, clr); } break; case PROB_80: { - txt_drawf("80", x + 3, y, clr); + txt_draws("80", x + 3, y, clr); txt_drawc('%', x + 15, y, clr); } break; case PROB_60: { - txt_drawf("60", x + 3, y, clr); + txt_draws("60", x + 3, y, clr); txt_drawc('%', x + 15, y, clr); } break; case PROB_40: { - txt_drawf("40", x + 3, y, clr); + txt_draws("40", x + 3, y, clr); txt_drawc('%', x + 15, y, clr); } break; case PROB_20: { - txt_drawf("20", x + 3, y, clr); + txt_draws("20", x + 3, y, clr); txt_drawc('%', x + 15, y, clr); } break; - case PROB_FIRST: { txt_drawf("1st", x + 3, y, clr); } break; + case PROB_FIRST: { txt_draws("1st", x + 3, y, clr); } break; case PROB_NOT_FIRST: { - txt_drawf("1st", x + 3, y, clr); + txt_draws("1st", x + 3, y, clr); draw_line(x + 3, y - 1, x + 21, y - 1, clr); } break; - case PROB_ONE_TWO: { txt_drawf("1:2", x + 3, y, clr); } break; - case PROB_TWO_TWO: { txt_drawf("2:2", x + 3, y, clr); } break; - case PROB_ONE_THREE: { txt_drawf("1:3", x + 3, y, clr); } break; - case PROB_TWO_THREE: { txt_drawf("2:3", x + 3, y, clr); } break; - case PROB_THREE_THREE: { txt_drawf("3:3", x + 3, y, clr); } break; - case PROB_ONE_FOUR: { txt_drawf("1:4", x + 3, y, clr); } break; - case PROB_TWO_FOUR: { txt_drawf("2:4", x + 3, y, clr); } break; - case PROB_THREE_FOUR: { txt_drawf("3:4", x + 3, y, clr); } break; - case PROB_FOUR_FOUR: { txt_drawf("4:4", x + 3, y, clr); } break; + case PROB_ONE_TWO: { txt_draws("1:2", x + 3, y, clr); } break; + case PROB_TWO_TWO: { txt_draws("2:2", x + 3, y, clr); } break; + case PROB_ONE_THREE: { txt_draws("1:3", x + 3, y, clr); } break; + case PROB_TWO_THREE: { txt_draws("2:3", x + 3, y, clr); } break; + case PROB_THREE_THREE: { txt_draws("3:3", x + 3, y, clr); } break; + case PROB_ONE_FOUR: { txt_draws("1:4", x + 3, y, clr); } break; + case PROB_TWO_FOUR: { txt_draws("2:4", x + 3, y, clr); } break; + case PROB_THREE_FOUR: { txt_draws("3:4", x + 3, y, clr); } break; + case PROB_FOUR_FOUR: { txt_draws("4:4", x + 3, y, clr); } break; default: break; } } @@ -919,13 +919,13 @@ draw_panning(s8 pan, u8 clr) { size_t y = PARAMS_START_Y + PARAMS_BOX_OFFSET_Y + 5; switch (pan) { case -1: { - txt_drawf("L", x + 9, y, clr); + txt_draws("L", x + 9, y, clr); } break; case 0: { - txt_drawf("MID", x + 3, y, clr); + txt_draws("MID", x + 3, y, clr); } break; case 1: { - txt_drawf("R", x + 9, y, clr); + txt_draws("R", x + 9, y, clr); } break; default: break; } @@ -1004,9 +1004,9 @@ draw_parameters_wave(ChannelWaveParams *params, bool global) { size_t x = PARAMS_START_X; size_t y = PARAMS_START_Y + PARAMS_BOX_OFFSET_Y; switch (params->wave_mode) { - case 0: { txt_drawf("A", x + 12, y + 5, cols[5]); } break; - case 1: { txt_drawf("B", x + 12, y + 5, cols[5]); } break; - case 2: { txt_drawf("A+B", x + 6, y + 5, cols[5]); } break; + case 0: { txt_draws("A", x + 12, y + 5, cols[5]); } break; + case 1: { txt_draws("B", x + 12, y + 5, cols[5]); } break; + case 2: { txt_draws("A+B", x + 6, y + 5, cols[5]); } break; } } @@ -1016,23 +1016,23 @@ draw_parameters_wave(ChannelWaveParams *params, bool global) { size_t y = PARAMS_START_Y + PARAMS_BOX_OFFSET_Y + 5; switch (params->wave_volume) { case 0: { - txt_drawf("0", x + 6, y, cols[6]); + txt_draws("0", x + 6, y, cols[6]); txt_drawc('%', x + 12, y, cols[6]); } break; case 1: { - txt_drawf("25", x + 3, y, cols[6]); + txt_draws("25", x + 3, y, cols[6]); txt_drawc('%', x + 15, y, cols[6]); } break; case 2: { - txt_drawf("50", x + 3, y, cols[6]); + txt_draws("50", x + 3, y, cols[6]); txt_drawc('%', x + 15, y, cols[6]); } break; case 3: { - txt_drawf("75", x + 3, y, cols[6]); + txt_draws("75", x + 3, y, cols[6]); txt_drawc('%', x + 15, y, cols[6]); } break; case 4: { - txt_drawf("100", x, y, cols[6]); + txt_draws("100", x, y, cols[6]); txt_drawc('%', x + 18, y, cols[6]); } break; } @@ -1070,17 +1070,17 @@ draw_parameters_wave(ChannelWaveParams *params, bool global) { { size_t x = PARAMS_START_X; size_t y = PARAMS_START_Y; - txt_drawf_small("shape", x + 4 + PARAMS_BOX_OFFSET_X * 0, y + PARAMS_BOX_H - 7, cols[0]); - txt_drawf_small("type", x + 6 + PARAMS_BOX_OFFSET_X * 1, y + PARAMS_BOX_H - 7, cols[1]); - txt_drawf_small("shape", x + 4 + PARAMS_BOX_OFFSET_X * 2, y + PARAMS_BOX_H - 7, cols[2]); - txt_drawf_small("type", x + 6 + PARAMS_BOX_OFFSET_X * 3, y + PARAMS_BOX_H - 7, cols[3]); - txt_drawf_small("prob", x + 6 + PARAMS_BOX_OFFSET_X * 4, y + PARAMS_BOX_H - 7, cols[4]); + txt_draws_small("shape", x + 4 + PARAMS_BOX_OFFSET_X * 0, y + PARAMS_BOX_H - 7, cols[0]); + txt_draws_small("type", x + 6 + PARAMS_BOX_OFFSET_X * 1, y + PARAMS_BOX_H - 7, cols[1]); + txt_draws_small("shape", x + 4 + PARAMS_BOX_OFFSET_X * 2, y + PARAMS_BOX_H - 7, cols[2]); + txt_draws_small("type", x + 6 + PARAMS_BOX_OFFSET_X * 3, y + PARAMS_BOX_H - 7, cols[3]); + txt_draws_small("prob", x + 6 + PARAMS_BOX_OFFSET_X * 4, y + PARAMS_BOX_H - 7, cols[4]); y += PARAMS_BOX_OFFSET_Y; - txt_drawf_small("voice", x + 4 + PARAMS_BOX_OFFSET_X * 0, y + PARAMS_BOX_H - 7, cols[5]); - txt_drawf_small("vol", x + 8 + PARAMS_BOX_OFFSET_X * 1, y + PARAMS_BOX_H - 7, cols[6]); - txt_drawf_small("attack", x + 2 + PARAMS_BOX_OFFSET_X * 2, y + PARAMS_BOX_H - 7, cols[7]); - txt_drawf_small("decay", x + 4 + PARAMS_BOX_OFFSET_X * 3, y + PARAMS_BOX_H - 7, cols[8]); - txt_drawf_small("pan", x + 8 + PARAMS_BOX_OFFSET_X * 4, y + PARAMS_BOX_H - 7, cols[9]); + txt_draws_small("voice", x + 4 + PARAMS_BOX_OFFSET_X * 0, y + PARAMS_BOX_H - 7, cols[5]); + txt_draws_small("vol", x + 8 + PARAMS_BOX_OFFSET_X * 1, y + PARAMS_BOX_H - 7, cols[6]); + txt_draws_small("attack", x + 2 + PARAMS_BOX_OFFSET_X * 2, y + PARAMS_BOX_H - 7, cols[7]); + txt_draws_small("decay", x + 4 + PARAMS_BOX_OFFSET_X * 3, y + PARAMS_BOX_H - 7, cols[8]); + txt_draws_small("pan", x + 8 + PARAMS_BOX_OFFSET_X * 4, y + PARAMS_BOX_H - 7, cols[9]); } } @@ -1232,27 +1232,27 @@ draw_parameters_square1(ChannelSquare1Params *params, bool global) { // Number. switch (params->sweep_number) { - case 0: { txt_drawf("0", x + 12, y + 5, cols[5]); } break; - case 1: { txt_drawf("1", x + 12, y + 5, cols[5]); } break; - case 2: { txt_drawf("2", x + 12, y + 5, cols[5]); } break; - case 3: { txt_drawf("3", x + 12, y + 5, cols[5]); } break; - case 4: { txt_drawf("4", x + 12, y + 5, cols[5]); } break; - case 5: { txt_drawf("5", x + 12, y + 5, cols[5]); } break; - case 6: { txt_drawf("6", x + 12, y + 5, cols[5]); } break; - case 7: { txt_drawf("7", x + 12, y + 5, cols[5]); } break; + case 0: { txt_draws("0", x + 12, y + 5, cols[5]); } break; + case 1: { txt_draws("1", x + 12, y + 5, cols[5]); } break; + case 2: { txt_draws("2", x + 12, y + 5, cols[5]); } break; + case 3: { txt_draws("3", x + 12, y + 5, cols[5]); } break; + case 4: { txt_draws("4", x + 12, y + 5, cols[5]); } break; + case 5: { txt_draws("5", x + 12, y + 5, cols[5]); } break; + case 6: { txt_draws("6", x + 12, y + 5, cols[5]); } break; + case 7: { txt_draws("7", x + 12, y + 5, cols[5]); } break; } // Time. x += PARAMS_BOX_OFFSET_X; switch (params->sweep_time) { - case 0: { txt_drawf("Off", x + 6, y + 5, cols[6]); } break; - case 1: { txt_drawf("7ms", x + 6, y + 5, cols[6]); } break; - case 2: { txt_drawf("15ms", x + 3, y + 5, cols[6]); } break; - case 3: { txt_drawf("23ms", x + 3, y + 5, cols[6]); } break; - case 4: { txt_drawf("31ms", x + 3, y + 5, cols[6]); } break; - case 5: { txt_drawf("39ms", x + 3, y + 5, cols[6]); } break; - case 6: { txt_drawf("46ms", x + 3, y + 5, cols[6]); } break; - case 7: { txt_drawf("54ms", x + 3, y + 5, cols[6]); } break; + case 0: { txt_draws("Off", x + 6, y + 5, cols[6]); } break; + case 1: { txt_draws("7ms", x + 6, y + 5, cols[6]); } break; + case 2: { txt_draws("15ms", x + 3, y + 5, cols[6]); } break; + case 3: { txt_draws("23ms", x + 3, y + 5, cols[6]); } break; + case 4: { txt_draws("31ms", x + 3, y + 5, cols[6]); } break; + case 5: { txt_draws("39ms", x + 3, y + 5, cols[6]); } break; + case 6: { txt_draws("46ms", x + 3, y + 5, cols[6]); } break; + case 7: { txt_draws("54ms", x + 3, y + 5, cols[6]); } break; } // Direction. @@ -1260,8 +1260,8 @@ draw_parameters_square1(ChannelSquare1Params *params, bool global) { char arr_down[2] = { 0x19, 0 }; char arr_up[2] = { 0x18, 0 }; switch (params->sweep_direction) { - case 0: { txt_drawf(arr_up, x + 12, y + 5, cols[7]); } break; - case 1: { txt_drawf(arr_down, x + 12, y + 5, cols[7]); } break; + case 0: { txt_draws(arr_up, x + 12, y + 5, cols[7]); } break; + case 1: { txt_draws(arr_down, x + 12, y + 5, cols[7]); } break; } } @@ -1269,16 +1269,16 @@ draw_parameters_square1(ChannelSquare1Params *params, bool global) { { size_t x = PARAMS_START_X; size_t y = PARAMS_START_Y; - txt_drawf_small("shape", x + 4 + PARAMS_BOX_OFFSET_X * 0, y + PARAMS_BOX_H - 7, cols[0]); - txt_drawf_small("vol", x + 8 + PARAMS_BOX_OFFSET_X * 1, y + PARAMS_BOX_H - 7, cols[1]); - txt_drawf_small("time", x + 6 + PARAMS_BOX_OFFSET_X * 2, y + PARAMS_BOX_H - 7, cols[2]); - txt_drawf_small("dir", x + 8 + PARAMS_BOX_OFFSET_X * 3, y + PARAMS_BOX_H - 7, cols[3]); - txt_drawf_small("prob", x + 6 + PARAMS_BOX_OFFSET_X * 4, y + PARAMS_BOX_H - 7, cols[4]); + txt_draws_small("shape", x + 4 + PARAMS_BOX_OFFSET_X * 0, y + PARAMS_BOX_H - 7, cols[0]); + txt_draws_small("vol", x + 8 + PARAMS_BOX_OFFSET_X * 1, y + PARAMS_BOX_H - 7, cols[1]); + txt_draws_small("time", x + 6 + PARAMS_BOX_OFFSET_X * 2, y + PARAMS_BOX_H - 7, cols[2]); + txt_draws_small("dir", x + 8 + PARAMS_BOX_OFFSET_X * 3, y + PARAMS_BOX_H - 7, cols[3]); + txt_draws_small("prob", x + 6 + PARAMS_BOX_OFFSET_X * 4, y + PARAMS_BOX_H - 7, cols[4]); y += PARAMS_BOX_OFFSET_Y; - txt_drawf_small("sweep", x + 4 + PARAMS_BOX_OFFSET_X * 0, y + PARAMS_BOX_H - 7, cols[5]); - txt_drawf_small("time", x + 6 + PARAMS_BOX_OFFSET_X * 1, y + PARAMS_BOX_H - 7, cols[6]); - txt_drawf_small("dir", x + 8 + PARAMS_BOX_OFFSET_X * 2, y + PARAMS_BOX_H - 7, cols[7]); - txt_drawf_small("pan", x + 8 + PARAMS_BOX_OFFSET_X * 4, y + PARAMS_BOX_H - 7, cols[9]); + txt_draws_small("sweep", x + 4 + PARAMS_BOX_OFFSET_X * 0, y + PARAMS_BOX_H - 7, cols[5]); + txt_draws_small("time", x + 6 + PARAMS_BOX_OFFSET_X * 1, y + PARAMS_BOX_H - 7, cols[6]); + txt_draws_small("dir", x + 8 + PARAMS_BOX_OFFSET_X * 2, y + PARAMS_BOX_H - 7, cols[7]); + txt_draws_small("pan", x + 8 + PARAMS_BOX_OFFSET_X * 4, y + PARAMS_BOX_H - 7, cols[9]); } // Empty spacers. @@ -1411,13 +1411,13 @@ draw_parameters_square2(ChannelSquare2Params *params, bool global) { { size_t x = PARAMS_START_X; size_t y = PARAMS_START_Y; - txt_drawf_small("shape", x + 4 + PARAMS_BOX_OFFSET_X * 0, y + PARAMS_BOX_H - 7, cols[0]); - txt_drawf_small("vol", x + 8 + PARAMS_BOX_OFFSET_X * 1, y + PARAMS_BOX_H - 7, cols[1]); - txt_drawf_small("time", x + 6 + PARAMS_BOX_OFFSET_X * 2, y + PARAMS_BOX_H - 7, cols[2]); - txt_drawf_small("dir", x + 8 + PARAMS_BOX_OFFSET_X * 3, y + PARAMS_BOX_H - 7, cols[3]); - txt_drawf_small("prob", x + 6 + PARAMS_BOX_OFFSET_X * 4, y + PARAMS_BOX_H - 7, cols[4]); + txt_draws_small("shape", x + 4 + PARAMS_BOX_OFFSET_X * 0, y + PARAMS_BOX_H - 7, cols[0]); + txt_draws_small("vol", x + 8 + PARAMS_BOX_OFFSET_X * 1, y + PARAMS_BOX_H - 7, cols[1]); + txt_draws_small("time", x + 6 + PARAMS_BOX_OFFSET_X * 2, y + PARAMS_BOX_H - 7, cols[2]); + txt_draws_small("dir", x + 8 + PARAMS_BOX_OFFSET_X * 3, y + PARAMS_BOX_H - 7, cols[3]); + txt_draws_small("prob", x + 6 + PARAMS_BOX_OFFSET_X * 4, y + PARAMS_BOX_H - 7, cols[4]); y += PARAMS_BOX_OFFSET_Y; - txt_drawf_small("pan", x + 8 + PARAMS_BOX_OFFSET_X * 4, y + PARAMS_BOX_H - 7, cols[9]); + txt_draws_small("pan", x + 8 + PARAMS_BOX_OFFSET_X * 4, y + PARAMS_BOX_H - 7, cols[9]); } // Empty spacers. @@ -1467,8 +1467,8 @@ draw_parameters_noise(ChannelNoiseParams* params, bool global) { size_t x = PARAMS_START_X; size_t y = PARAMS_START_Y; switch (params->bit_mode) { - case 0: { txt_drawf("A", x + 12, y + 5, cols[0]); } break; - case 1: { txt_drawf("B", x + 12, y + 5, cols[0]); } break; + case 0: { txt_draws("A", x + 12, y + 5, cols[0]); } break; + case 1: { txt_draws("B", x + 12, y + 5, cols[0]); } break; } } @@ -1504,13 +1504,13 @@ draw_parameters_noise(ChannelNoiseParams* params, bool global) { { size_t x = PARAMS_START_X; size_t y = PARAMS_START_Y; - txt_drawf_small("mode", x + 6 + PARAMS_BOX_OFFSET_X * 0, y + PARAMS_BOX_H - 7, cols[0]); - txt_drawf_small("vol", x + 8 + PARAMS_BOX_OFFSET_X * 1, y + PARAMS_BOX_H - 7, cols[1]); - txt_drawf_small("time", x + 6 + PARAMS_BOX_OFFSET_X * 2, y + PARAMS_BOX_H - 7, cols[2]); - txt_drawf_small("dir", x + 8 + PARAMS_BOX_OFFSET_X * 3, y + PARAMS_BOX_H - 7, cols[3]); - txt_drawf_small("prob", x + 6 + PARAMS_BOX_OFFSET_X * 4, y + PARAMS_BOX_H - 7, cols[4]); + txt_draws_small("mode", x + 6 + PARAMS_BOX_OFFSET_X * 0, y + PARAMS_BOX_H - 7, cols[0]); + txt_draws_small("vol", x + 8 + PARAMS_BOX_OFFSET_X * 1, y + PARAMS_BOX_H - 7, cols[1]); + txt_draws_small("time", x + 6 + PARAMS_BOX_OFFSET_X * 2, y + PARAMS_BOX_H - 7, cols[2]); + txt_draws_small("dir", x + 8 + PARAMS_BOX_OFFSET_X * 3, y + PARAMS_BOX_H - 7, cols[3]); + txt_draws_small("prob", x + 6 + PARAMS_BOX_OFFSET_X * 4, y + PARAMS_BOX_H - 7, cols[4]); y += PARAMS_BOX_OFFSET_Y; - txt_drawf_small("pan", x + 8 + PARAMS_BOX_OFFSET_X * 4, y + PARAMS_BOX_H - 7, cols[9]); + txt_draws_small("pan", x + 8 + PARAMS_BOX_OFFSET_X * 4, y + PARAMS_BOX_H - 7, cols[9]); } // Empty spacers. @@ -1718,81 +1718,81 @@ draw_piano_notes(void) { void draw_notif_param_edit_prob(u8 prob, u8 x, u8 y, u8 color) { - txt_drawf_small("PROB/CONDITION: ", x + 2, y + 1, color); + txt_draws_small("PROB/CONDITION: ", x + 2, y + 1, color); switch (prob) { - case PROB_100: { txt_drawf_small("100", x + 2 + 16 * 4, y + 1, color); txt_drawc_small('%', x + 2 + 19 * 4, y + 1, color); } break; - case PROB_80: { txt_drawf_small("80", x + 2 + 16 * 4, y + 1, color); txt_drawc_small('%', x + 2 + 18 * 4, y + 1, color); } break; - case PROB_60: { txt_drawf_small("60", x + 2 + 16 * 4, y + 1, color); txt_drawc_small('%', x + 2 + 18 * 4, y + 1, color); } break; - case PROB_40: { txt_drawf_small("40", x + 2 + 16 * 4, y + 1, color); txt_drawc_small('%', x + 2 + 18 * 4, y + 1, color); } break; - case PROB_20: { txt_drawf_small("20", x + 2 + 16 * 4, y + 1, color); txt_drawc_small('%', x + 2 + 18 * 4, y + 1, color); } break; - case PROB_FIRST: { txt_drawf_small("first bar", x + 2 + 16 * 4, y + 1, color); } break; - case PROB_NOT_FIRST: { txt_drawf_small("not first bar", x + 2 + 16 * 4, y + 1, color); } break; - case PROB_ONE_TWO: { txt_drawf_small("1st bar out of 2", x + 2 + 16 * 4, y + 1, color); } break; - case PROB_TWO_TWO: { txt_drawf_small("2nd bar out of 2", x + 2 + 16 * 4, y + 1, color); } break; - case PROB_ONE_THREE: { txt_drawf_small("1st bar out of 3", x + 2 + 16 * 4, y + 1, color); } break; - case PROB_TWO_THREE: { txt_drawf_small("2nd bar out of 3", x + 2 + 16 * 4, y + 1, color); } break; - case PROB_THREE_THREE: { txt_drawf_small("3rd bar out of 3", x + 2 + 16 * 4, y + 1, color); } break; - case PROB_ONE_FOUR: { txt_drawf_small("1st bar out of 4", x + 2 + 16 * 4, y + 1, color); } break; - case PROB_TWO_FOUR: { txt_drawf_small("2nd bar out of 4", x + 2 + 16 * 4, y + 1, color); } break; - case PROB_THREE_FOUR: { txt_drawf_small("3rd bar out of 4", x + 2 + 16 * 4, y + 1, color); } break; - case PROB_FOUR_FOUR: { txt_drawf_small("4th bar out of 4", x + 2 + 16 * 4, y + 1, color); } break; + case PROB_100: { txt_draws_small("100", x + 2 + 16 * 4, y + 1, color); txt_drawc_small('%', x + 2 + 19 * 4, y + 1, color); } break; + case PROB_80: { txt_draws_small("80", x + 2 + 16 * 4, y + 1, color); txt_drawc_small('%', x + 2 + 18 * 4, y + 1, color); } break; + case PROB_60: { txt_draws_small("60", x + 2 + 16 * 4, y + 1, color); txt_drawc_small('%', x + 2 + 18 * 4, y + 1, color); } break; + case PROB_40: { txt_draws_small("40", x + 2 + 16 * 4, y + 1, color); txt_drawc_small('%', x + 2 + 18 * 4, y + 1, color); } break; + case PROB_20: { txt_draws_small("20", x + 2 + 16 * 4, y + 1, color); txt_drawc_small('%', x + 2 + 18 * 4, y + 1, color); } break; + case PROB_FIRST: { txt_draws_small("first bar", x + 2 + 16 * 4, y + 1, color); } break; + case PROB_NOT_FIRST: { txt_draws_small("not first bar", x + 2 + 16 * 4, y + 1, color); } break; + case PROB_ONE_TWO: { txt_draws_small("1st bar out of 2", x + 2 + 16 * 4, y + 1, color); } break; + case PROB_TWO_TWO: { txt_draws_small("2nd bar out of 2", x + 2 + 16 * 4, y + 1, color); } break; + case PROB_ONE_THREE: { txt_draws_small("1st bar out of 3", x + 2 + 16 * 4, y + 1, color); } break; + case PROB_TWO_THREE: { txt_draws_small("2nd bar out of 3", x + 2 + 16 * 4, y + 1, color); } break; + case PROB_THREE_THREE: { txt_draws_small("3rd bar out of 3", x + 2 + 16 * 4, y + 1, color); } break; + case PROB_ONE_FOUR: { txt_draws_small("1st bar out of 4", x + 2 + 16 * 4, y + 1, color); } break; + case PROB_TWO_FOUR: { txt_draws_small("2nd bar out of 4", x + 2 + 16 * 4, y + 1, color); } break; + case PROB_THREE_FOUR: { txt_draws_small("3rd bar out of 4", x + 2 + 16 * 4, y + 1, color); } break; + case PROB_FOUR_FOUR: { txt_draws_small("4th bar out of 4", x + 2 + 16 * 4, y + 1, color); } break; } } void draw_notif_param_edit_pan(s8 pan, u8 x, u8 y, u8 color) { - txt_drawf_small("panning: ", x + 2, y + 1, color); + txt_draws_small("panning: ", x + 2, y + 1, color); switch (pan) { - case -1: { txt_drawf_small("left", x + 2 + 9 * 4, y + 1, color); } break; - case 0: { txt_drawf_small("middle", x + 2 + 9 * 4, y + 1, color); } break; - case 1: { txt_drawf_small("right", x + 2 + 9 * 4, y + 1, color); } break; + case -1: { txt_draws_small("left", x + 2 + 9 * 4, y + 1, color); } break; + case 0: { txt_draws_small("middle", x + 2 + 9 * 4, y + 1, color); } break; + case 1: { txt_draws_small("right", x + 2 + 9 * 4, y + 1, color); } break; } } void draw_notif_param_env_vol(u8 vol, u8 x, u8 y, u8 color) { - txt_drawf_small("VOL: ", x + 2, y + 1, color); + txt_draws_small("VOL: ", x + 2, y + 1, color); switch (vol) { - case 0: { txt_drawf_small("0", x + 2 + 5 * 4, y + 1, color); txt_drawc_small('%', x + 2 + 6 * 4, y + 1, color); } break; - case 1: { txt_drawf_small("6", x + 2 + 5 * 4, y + 1, color); txt_drawc_small('%', x + 2 + 6 * 4, y + 1, color); } break; - case 2: { txt_drawf_small("13", x + 2 + 5 * 4, y + 1, color); txt_drawc_small('%', x + 2 + 7 * 4, y + 1, color); } break; - case 3: { txt_drawf_small("20", x + 2 + 5 * 4, y + 1, color); txt_drawc_small('%', x + 2 + 7 * 4, y + 1, color); } break; - case 4: { txt_drawf_small("26", x + 2 + 5 * 4, y + 1, color); txt_drawc_small('%', x + 2 + 7 * 4, y + 1, color); } break; - case 5: { txt_drawf_small("33", x + 2 + 5 * 4, y + 1, color); txt_drawc_small('%', x + 2 + 7 * 4, y + 1, color); } break; - case 6: { txt_drawf_small("40", x + 2 + 5 * 4, y + 1, color); txt_drawc_small('%', x + 2 + 7 * 4, y + 1, color); } break; - case 7: { txt_drawf_small("46", x + 2 + 5 * 4, y + 1, color); txt_drawc_small('%', x + 2 + 7 * 4, y + 1, color); } break; - case 8: { txt_drawf_small("53", x + 2 + 5 * 4, y + 1, color); txt_drawc_small('%', x + 2 + 7 * 4, y + 1, color); } break; - case 9: { txt_drawf_small("60", x + 2 + 5 * 4, y + 1, color); txt_drawc_small('%', x + 2 + 7 * 4, y + 1, color); } break; - case 10: { txt_drawf_small("66", x + 2 + 5 * 4, y + 1, color); txt_drawc_small('%', x + 2 + 7 * 4, y + 1, color); } break; - case 11: { txt_drawf_small("73", x + 2 + 5 * 4, y + 1, color); txt_drawc_small('%', x + 2 + 7 * 4, y + 1, color); } break; - case 12: { txt_drawf_small("80", x + 2 + 5 * 4, y + 1, color); txt_drawc_small('%', x + 2 + 7 * 4, y + 1, color); } break; - case 13: { txt_drawf_small("86", x + 2 + 5 * 4, y + 1, color); txt_drawc_small('%', x + 2 + 7 * 4, y + 1, color); } break; - case 14: { txt_drawf_small("93", x + 2 + 5 * 4, y + 1, color); txt_drawc_small('%', x + 2 + 7 * 4, y + 1, color); } break; - case 15: { txt_drawf_small("100", x + 2 + 5 * 4, y + 1, color); txt_drawc_small('%', x + 2 + 8 * 4, y + 1, color); } break; + case 0: { txt_draws_small("0", x + 2 + 5 * 4, y + 1, color); txt_drawc_small('%', x + 2 + 6 * 4, y + 1, color); } break; + case 1: { txt_draws_small("6", x + 2 + 5 * 4, y + 1, color); txt_drawc_small('%', x + 2 + 6 * 4, y + 1, color); } break; + case 2: { txt_draws_small("13", x + 2 + 5 * 4, y + 1, color); txt_drawc_small('%', x + 2 + 7 * 4, y + 1, color); } break; + case 3: { txt_draws_small("20", x + 2 + 5 * 4, y + 1, color); txt_drawc_small('%', x + 2 + 7 * 4, y + 1, color); } break; + case 4: { txt_draws_small("26", x + 2 + 5 * 4, y + 1, color); txt_drawc_small('%', x + 2 + 7 * 4, y + 1, color); } break; + case 5: { txt_draws_small("33", x + 2 + 5 * 4, y + 1, color); txt_drawc_small('%', x + 2 + 7 * 4, y + 1, color); } break; + case 6: { txt_draws_small("40", x + 2 + 5 * 4, y + 1, color); txt_drawc_small('%', x + 2 + 7 * 4, y + 1, color); } break; + case 7: { txt_draws_small("46", x + 2 + 5 * 4, y + 1, color); txt_drawc_small('%', x + 2 + 7 * 4, y + 1, color); } break; + case 8: { txt_draws_small("53", x + 2 + 5 * 4, y + 1, color); txt_drawc_small('%', x + 2 + 7 * 4, y + 1, color); } break; + case 9: { txt_draws_small("60", x + 2 + 5 * 4, y + 1, color); txt_drawc_small('%', x + 2 + 7 * 4, y + 1, color); } break; + case 10: { txt_draws_small("66", x + 2 + 5 * 4, y + 1, color); txt_drawc_small('%', x + 2 + 7 * 4, y + 1, color); } break; + case 11: { txt_draws_small("73", x + 2 + 5 * 4, y + 1, color); txt_drawc_small('%', x + 2 + 7 * 4, y + 1, color); } break; + case 12: { txt_draws_small("80", x + 2 + 5 * 4, y + 1, color); txt_drawc_small('%', x + 2 + 7 * 4, y + 1, color); } break; + case 13: { txt_draws_small("86", x + 2 + 5 * 4, y + 1, color); txt_drawc_small('%', x + 2 + 7 * 4, y + 1, color); } break; + case 14: { txt_draws_small("93", x + 2 + 5 * 4, y + 1, color); txt_drawc_small('%', x + 2 + 7 * 4, y + 1, color); } break; + case 15: { txt_draws_small("100", x + 2 + 5 * 4, y + 1, color); txt_drawc_small('%', x + 2 + 8 * 4, y + 1, color); } break; } } void draw_notif_param_env_time(u8 time, u8 x, u8 y, u8 color) { - txt_drawf_small("TIME: ", x + 2, y + 1, color); + txt_draws_small("TIME: ", x + 2, y + 1, color); switch (time) { - case 0: { txt_drawf_small("off", x + 2 + 6 * 4, y + 1, color); } break; - case 1: { txt_drawf_small("150ms", x + 2 + 6 * 4, y + 1, color); } break; - case 2: { txt_drawf_small("310ms", x + 2 + 6 * 4, y + 1, color); } break; - case 3: { txt_drawf_small("460ms", x + 2 + 6 * 4, y + 1, color); } break; - case 4: { txt_drawf_small("620ms", x + 2 + 6 * 4, y + 1, color); } break; - case 5: { txt_drawf_small("780ms", x + 2 + 6 * 4, y + 1, color); } break; - case 6: { txt_drawf_small("930ms", x + 2 + 6 * 4, y + 1, color); } break; - case 7: { txt_drawf_small("1s", x + 2 + 6 * 4, y + 1, color); } break; + case 0: { txt_draws_small("off", x + 2 + 6 * 4, y + 1, color); } break; + case 1: { txt_draws_small("150ms", x + 2 + 6 * 4, y + 1, color); } break; + case 2: { txt_draws_small("310ms", x + 2 + 6 * 4, y + 1, color); } break; + case 3: { txt_draws_small("460ms", x + 2 + 6 * 4, y + 1, color); } break; + case 4: { txt_draws_small("620ms", x + 2 + 6 * 4, y + 1, color); } break; + case 5: { txt_draws_small("780ms", x + 2 + 6 * 4, y + 1, color); } break; + case 6: { txt_draws_small("930ms", x + 2 + 6 * 4, y + 1, color); } break; + case 7: { txt_draws_small("1s", x + 2 + 6 * 4, y + 1, color); } break; } } void draw_notif_param_env_dir(u8 dir, u8 x, u8 y, u8 color) { - txt_drawf_small("DIRECTION: ", x + 2, y + 1, color); + txt_draws_small("DIRECTION: ", x + 2, y + 1, color); switch (dir) { - case 0: { txt_drawf_small("down", x + 2 + 11 * 4, y + 1, color); } break; - case 1: { txt_drawf_small("up", x + 2 + 11 * 4, y + 1, color); } break; + case 0: { txt_draws_small("down", x + 2 + 11 * 4, y + 1, color); } break; + case 1: { txt_draws_small("up", x + 2 + 11 * 4, y + 1, color); } break; } } @@ -1816,12 +1816,12 @@ draw_notif_bar() { msg[i] = notif.msg[i]; } } - txt_drawf_small(msg, x0 + 2, y0 + 1, color); + txt_draws_small(msg, x0 + 2, y0 + 1, color); } else { if (play_status && chain.len != 0 && chain.enabled) { u8 x = x0 + 2; u8 y = y0 + 1; - txt_drawf_small("CHAIN: ", x, y, color); + txt_draws_small("CHAIN: ", x, y, color); x += 4 * 7; bool first = true; for (size_t i = 0, k = 0; i < MAX_CHAIN; i++) { @@ -1850,16 +1850,16 @@ draw_notif_bar() { params = &ch1_params; } if (input_handler == handle_param_selection_ch1) { - txt_drawf_small("(ALL)", x0 + NOTIF_W - 7 * 3 - 3, y0 + 1, color); + txt_draws_small("(ALL)", x0 + NOTIF_W - 7 * 3 - 3, y0 + 1, color); } switch (param_selection_loc) { case 0: { - txt_drawf_small("SHAPE: ", x0 + 2, y0 + 1, color); + txt_draws_small("SHAPE: ", x0 + 2, y0 + 1, color); switch (params->duty_cycle) { - case 0: { txt_drawf_small("12", x0 + 2 + 7 * 4, y0 + 1, color); } break; - case 1: { txt_drawf_small("25", x0 + 2 + 7 * 4, y0 + 1, color); } break; - case 2: { txt_drawf_small("50", x0 + 2 + 7 * 4, y0 + 1, color); } break; - case 3: { txt_drawf_small("75", x0 + 2 + 7 * 4, y0 + 1, color); } break; + case 0: { txt_draws_small("12", x0 + 2 + 7 * 4, y0 + 1, color); } break; + case 1: { txt_draws_small("25", x0 + 2 + 7 * 4, y0 + 1, color); } break; + case 2: { txt_draws_small("50", x0 + 2 + 7 * 4, y0 + 1, color); } break; + case 3: { txt_draws_small("75", x0 + 2 + 7 * 4, y0 + 1, color); } break; } txt_drawc_small('%', x0 + 2 + 9 * 4, y0 + 1, color); } break; @@ -1868,36 +1868,36 @@ draw_notif_bar() { case 3: { draw_notif_param_env_dir(params->env_direction, x0, y0, color); } break; case 4: { draw_notif_param_edit_prob(params->prob, x0, y0, color); } break; case 5: { - txt_drawf_small("SWEEP BITS: ", x0 + 2, y0 + 1, color); + txt_draws_small("SWEEP BITS: ", x0 + 2, y0 + 1, color); switch (params->sweep_number) { - case 0: { txt_drawf_small("0", x0 + 2 + 12 * 4, y0 + 1, color); } break; - case 1: { txt_drawf_small("1", x0 + 2 + 12 * 4, y0 + 1, color); } break; - case 2: { txt_drawf_small("2", x0 + 2 + 12 * 4, y0 + 1, color); } break; - case 3: { txt_drawf_small("3", x0 + 2 + 12 * 4, y0 + 1, color); } break; - case 4: { txt_drawf_small("4", x0 + 2 + 12 * 4, y0 + 1, color); } break; - case 5: { txt_drawf_small("5", x0 + 2 + 12 * 4, y0 + 1, color); } break; - case 6: { txt_drawf_small("6", x0 + 2 + 12 * 4, y0 + 1, color); } break; - case 7: { txt_drawf_small("7", x0 + 2 + 12 * 4, y0 + 1, color); } break; + case 0: { txt_draws_small("0", x0 + 2 + 12 * 4, y0 + 1, color); } break; + case 1: { txt_draws_small("1", x0 + 2 + 12 * 4, y0 + 1, color); } break; + case 2: { txt_draws_small("2", x0 + 2 + 12 * 4, y0 + 1, color); } break; + case 3: { txt_draws_small("3", x0 + 2 + 12 * 4, y0 + 1, color); } break; + case 4: { txt_draws_small("4", x0 + 2 + 12 * 4, y0 + 1, color); } break; + case 5: { txt_draws_small("5", x0 + 2 + 12 * 4, y0 + 1, color); } break; + case 6: { txt_draws_small("6", x0 + 2 + 12 * 4, y0 + 1, color); } break; + case 7: { txt_draws_small("7", x0 + 2 + 12 * 4, y0 + 1, color); } break; } } break; case 6: { - txt_drawf_small("SWEEP TIME: ", x0 + 2, y0 + 1, color); + txt_draws_small("SWEEP TIME: ", x0 + 2, y0 + 1, color); switch (params->sweep_time) { - case 0: { txt_drawf_small("off", x0 + 2 + 12 * 4, y0 + 1, color); } break; - case 1: { txt_drawf_small("7ms", x0 + 2 + 12 * 4, y0 + 1, color); } break; - case 2: { txt_drawf_small("15ms", x0 + 2 + 12 * 4, y0 + 1, color); } break; - case 3: { txt_drawf_small("23ms", x0 + 2 + 12 * 4, y0 + 1, color); } break; - case 4: { txt_drawf_small("31ms", x0 + 2 + 12 * 4, y0 + 1, color); } break; - case 5: { txt_drawf_small("39ms", x0 + 2 + 12 * 4, y0 + 1, color); } break; - case 6: { txt_drawf_small("46ms", x0 + 2 + 12 * 4, y0 + 1, color); } break; - case 7: { txt_drawf_small("54ms", x0 + 2 + 12 * 4, y0 + 1, color); } break; + case 0: { txt_draws_small("off", x0 + 2 + 12 * 4, y0 + 1, color); } break; + case 1: { txt_draws_small("7ms", x0 + 2 + 12 * 4, y0 + 1, color); } break; + case 2: { txt_draws_small("15ms", x0 + 2 + 12 * 4, y0 + 1, color); } break; + case 3: { txt_draws_small("23ms", x0 + 2 + 12 * 4, y0 + 1, color); } break; + case 4: { txt_draws_small("31ms", x0 + 2 + 12 * 4, y0 + 1, color); } break; + case 5: { txt_draws_small("39ms", x0 + 2 + 12 * 4, y0 + 1, color); } break; + case 6: { txt_draws_small("46ms", x0 + 2 + 12 * 4, y0 + 1, color); } break; + case 7: { txt_draws_small("54ms", x0 + 2 + 12 * 4, y0 + 1, color); } break; } } break; case 7: { - txt_drawf_small("SWEEP DIRECTION: ", x0 + 2, y0 + 1, color); + txt_draws_small("SWEEP DIRECTION: ", x0 + 2, y0 + 1, color); switch (params->sweep_direction) { - case 0: { txt_drawf_small("up", x0 + 2 + 17 * 4, y0 + 1, color); } break; - case 1: { txt_drawf_small("down", x0 + 2 + 17 * 4, y0 + 1, color); } break; + case 0: { txt_draws_small("up", x0 + 2 + 17 * 4, y0 + 1, color); } break; + case 1: { txt_draws_small("down", x0 + 2 + 17 * 4, y0 + 1, color); } break; } } break; case 9: { draw_notif_param_edit_pan(params->pan, x0, y0, color); } break; @@ -1915,12 +1915,12 @@ draw_notif_bar() { } switch (param_selection_loc) { case 0: { - txt_drawf_small("SHAPE: ", x0 + 2, y0 + 1, color); + txt_draws_small("SHAPE: ", x0 + 2, y0 + 1, color); switch (params->duty_cycle) { - case 0: { txt_drawf_small("12", x0 + 2 + 7 * 4, y0 + 1, color); } break; - case 1: { txt_drawf_small("25", x0 + 2 + 7 * 4, y0 + 1, color); } break; - case 2: { txt_drawf_small("50", x0 + 2 + 7 * 4, y0 + 1, color); } break; - case 3: { txt_drawf_small("75", x0 + 2 + 7 * 4, y0 + 1, color); } break; + case 0: { txt_draws_small("12", x0 + 2 + 7 * 4, y0 + 1, color); } break; + case 1: { txt_draws_small("25", x0 + 2 + 7 * 4, y0 + 1, color); } break; + case 2: { txt_draws_small("50", x0 + 2 + 7 * 4, y0 + 1, color); } break; + case 3: { txt_draws_small("75", x0 + 2 + 7 * 4, y0 + 1, color); } break; } txt_drawc_small('%', x0 + 2 + 9 * 4, y0 + 1, color); } break; @@ -1943,64 +1943,64 @@ draw_notif_bar() { } switch (param_selection_loc) { case 0: { - txt_drawf_small("SHAPE A: ", x0 + 2, y0 + 1, color); + txt_draws_small("SHAPE A: ", x0 + 2, y0 + 1, color); switch (params->shape_a) { - case 0: { txt_drawf_small("sin", x0 + 2 + 9 * 4, y0 + 1, color); } break; - case 1: { txt_drawf_small("saw", x0 + 2 + 9 * 4, y0 + 1, color); } break; - case 2: { txt_drawf_small("square", x0 + 2 + 9 * 4, y0 + 1, color); } break; + case 0: { txt_draws_small("sin", x0 + 2 + 9 * 4, y0 + 1, color); } break; + case 1: { txt_draws_small("saw", x0 + 2 + 9 * 4, y0 + 1, color); } break; + case 2: { txt_draws_small("square", x0 + 2 + 9 * 4, y0 + 1, color); } break; } } break; case 1: { - txt_drawf_small("TYPE A: ", x0 + 2, y0 + 1, color); + txt_draws_small("TYPE A: ", x0 + 2, y0 + 1, color); switch (params->type_a) { - case 0: { txt_drawf_small("a", x0 + 2 + 8 * 4, y0 + 1, color); } break; - case 1: { txt_drawf_small("b", x0 + 2 + 8 * 4, y0 + 1, color); } break; - case 2: { txt_drawf_small("c", x0 + 2 + 8 * 4, y0 + 1, color); } break; - case 3: { txt_drawf_small("d", x0 + 2 + 8 * 4, y0 + 1, color); } break; - case 4: { txt_drawf_small("e", x0 + 2 + 8 * 4, y0 + 1, color); } break; - case 5: { txt_drawf_small("f", x0 + 2 + 8 * 4, y0 + 1, color); } break; - case 6: { txt_drawf_small("g", x0 + 2 + 8 * 4, y0 + 1, color); } break; - case 7: { txt_drawf_small("h", x0 + 2 + 8 * 4, y0 + 1, color); } break; + case 0: { txt_draws_small("a", x0 + 2 + 8 * 4, y0 + 1, color); } break; + case 1: { txt_draws_small("b", x0 + 2 + 8 * 4, y0 + 1, color); } break; + case 2: { txt_draws_small("c", x0 + 2 + 8 * 4, y0 + 1, color); } break; + case 3: { txt_draws_small("d", x0 + 2 + 8 * 4, y0 + 1, color); } break; + case 4: { txt_draws_small("e", x0 + 2 + 8 * 4, y0 + 1, color); } break; + case 5: { txt_draws_small("f", x0 + 2 + 8 * 4, y0 + 1, color); } break; + case 6: { txt_draws_small("g", x0 + 2 + 8 * 4, y0 + 1, color); } break; + case 7: { txt_draws_small("h", x0 + 2 + 8 * 4, y0 + 1, color); } break; } } break; case 2: { - txt_drawf_small("SHAPE B: ", x0 + 2, y0 + 1, color); + txt_draws_small("SHAPE B: ", x0 + 2, y0 + 1, color); switch (params->shape_b) { - case 0: { txt_drawf_small("sin", x0 + 2 + 9 * 4, y0 + 1, color); } break; - case 1: { txt_drawf_small("saw", x0 + 2 + 9 * 4, y0 + 1, color); } break; - case 2: { txt_drawf_small("square", x0 + 2 + 9 * 4, y0 + 1, color); } break; + case 0: { txt_draws_small("sin", x0 + 2 + 9 * 4, y0 + 1, color); } break; + case 1: { txt_draws_small("saw", x0 + 2 + 9 * 4, y0 + 1, color); } break; + case 2: { txt_draws_small("square", x0 + 2 + 9 * 4, y0 + 1, color); } break; } } break; case 3: { - txt_drawf_small("TYPE B: ", x0 + 2, y0 + 1, color); + txt_draws_small("TYPE B: ", x0 + 2, y0 + 1, color); switch (params->type_b) { - case 0: { txt_drawf_small("a", x0 + 2 + 8 * 4, y0 + 1, color); } break; - case 1: { txt_drawf_small("b", x0 + 2 + 8 * 4, y0 + 1, color); } break; - case 2: { txt_drawf_small("c", x0 + 2 + 8 * 4, y0 + 1, color); } break; - case 3: { txt_drawf_small("d", x0 + 2 + 8 * 4, y0 + 1, color); } break; - case 4: { txt_drawf_small("e", x0 + 2 + 8 * 4, y0 + 1, color); } break; - case 5: { txt_drawf_small("f", x0 + 2 + 8 * 4, y0 + 1, color); } break; - case 6: { txt_drawf_small("g", x0 + 2 + 8 * 4, y0 + 1, color); } break; - case 7: { txt_drawf_small("h", x0 + 2 + 8 * 4, y0 + 1, color); } break; + case 0: { txt_draws_small("a", x0 + 2 + 8 * 4, y0 + 1, color); } break; + case 1: { txt_draws_small("b", x0 + 2 + 8 * 4, y0 + 1, color); } break; + case 2: { txt_draws_small("c", x0 + 2 + 8 * 4, y0 + 1, color); } break; + case 3: { txt_draws_small("d", x0 + 2 + 8 * 4, y0 + 1, color); } break; + case 4: { txt_draws_small("e", x0 + 2 + 8 * 4, y0 + 1, color); } break; + case 5: { txt_draws_small("f", x0 + 2 + 8 * 4, y0 + 1, color); } break; + case 6: { txt_draws_small("g", x0 + 2 + 8 * 4, y0 + 1, color); } break; + case 7: { txt_draws_small("h", x0 + 2 + 8 * 4, y0 + 1, color); } break; } } break; case 4: { draw_notif_param_edit_prob(params->prob, x0, y0, color); } break; case 5: { - txt_drawf_small("VOICE: ", x0 + 2, y0 + 1, color); + txt_draws_small("VOICE: ", x0 + 2, y0 + 1, color); switch (params->wave_mode) { - case 0: { txt_drawf_small("A", x0 + 2 + 7 * 4, y0 + 1, color); } break; - case 1: { txt_drawf_small("B", x0 + 2 + 7 * 4, y0 + 1, color); } break; - case 2: { txt_drawf_small("A + B", x0 + 2 + 7 * 4, y0 + 1, color); } break; + case 0: { txt_draws_small("A", x0 + 2 + 7 * 4, y0 + 1, color); } break; + case 1: { txt_draws_small("B", x0 + 2 + 7 * 4, y0 + 1, color); } break; + case 2: { txt_draws_small("A + B", x0 + 2 + 7 * 4, y0 + 1, color); } break; } } break; case 6: { - txt_drawf_small("VOLUME: ", x0 + 2, y0 + 1, color); + txt_draws_small("VOLUME: ", x0 + 2, y0 + 1, color); switch (params->wave_volume) { - case 0: { txt_drawf_small("0", x0 + 2 + 8 * 4, y0 + 1, color); txt_drawc_small('%', x0 + 2 + 9 * 4, y0 + 1, color); } break; - case 1: { txt_drawf_small("25", x0 + 2 + 8 * 4, y0 + 1, color); txt_drawc_small('%', x0 + 2 + 10 * 4, y0 + 1, color); } break; - case 2: { txt_drawf_small("50", x0 + 2 + 8 * 4, y0 + 1, color); txt_drawc_small('%', x0 + 2 + 10 * 4, y0 + 1, color); } break; - case 3: { txt_drawf_small("75", x0 + 2 + 8 * 4, y0 + 1, color); txt_drawc_small('%', x0 + 2 + 10 * 4, y0 + 1, color); } break; - case 4: { txt_drawf_small("100", x0 + 2 + 8 * 4, y0 + 1, color); txt_drawc_small('%', x0 + 2 + 11 * 4, y0 + 1, color); } break; + case 0: { txt_draws_small("0", x0 + 2 + 8 * 4, y0 + 1, color); txt_drawc_small('%', x0 + 2 + 9 * 4, y0 + 1, color); } break; + case 1: { txt_draws_small("25", x0 + 2 + 8 * 4, y0 + 1, color); txt_drawc_small('%', x0 + 2 + 10 * 4, y0 + 1, color); } break; + case 2: { txt_draws_small("50", x0 + 2 + 8 * 4, y0 + 1, color); txt_drawc_small('%', x0 + 2 + 10 * 4, y0 + 1, color); } break; + case 3: { txt_draws_small("75", x0 + 2 + 8 * 4, y0 + 1, color); txt_drawc_small('%', x0 + 2 + 10 * 4, y0 + 1, color); } break; + case 4: { txt_draws_small("100", x0 + 2 + 8 * 4, y0 + 1, color); txt_drawc_small('%', x0 + 2 + 11 * 4, y0 + 1, color); } break; } } break; case 7: { @@ -2032,10 +2032,10 @@ draw_notif_bar() { } switch (param_selection_loc) { case 0: { - txt_drawf_small("MODE: ", x0 + 2, y0 + 1, color); + txt_draws_small("MODE: ", x0 + 2, y0 + 1, color); switch (params->bit_mode) { - case 0: { txt_drawf_small("a", x0 + 2 + 6 * 4, y0 + 1, color); } break; - case 1: { txt_drawf_small("b", x0 + 2 + 6 * 4, y0 + 1, color); } break; + case 0: { txt_draws_small("a", x0 + 2 + 6 * 4, y0 + 1, color); } break; + case 1: { txt_draws_small("b", x0 + 2 + 6 * 4, y0 + 1, color); } break; } } break; case 1: { draw_notif_param_env_vol(params->env_volume, x0, y0, color); } break; @@ -2050,53 +2050,53 @@ draw_notif_bar() { if (settings.help == TOGGLE_ON) { if (input_handler == handle_trigger_selection) { if (key_pressed(KEY_B) && ctrl.key_b > 10) { - txt_drawf_small("D-PAD:NUDGE TRIGGER", x0 + 2, y0 + 1, color); + txt_draws_small("D-PAD:NUDGE TRIGGER", x0 + 2, y0 + 1, color); } else if (key_pressed(KEY_SELECT)) { - txt_drawf_small("SEL+B:COPY TRIG SEL+A:PASTE TRIG", x0 + 2, y0 + 1, color); + txt_draws_small("SEL+B:COPY TRIG SEL+A:PASTE TRIG", x0 + 2, y0 + 1, color); } else { - txt_drawf_small("L/R:NOTE SEL+L/R:OCTAVE A:PARAMS B:TOGGLE", x0 + 2, y0 + 1, color); + txt_draws_small("L/R:NOTE SEL+L/R:OCTAVE A:PARAMS B:TOGGLE", x0 + 2, y0 + 1, color); } } else if (input_handler == handle_channel_selection) { if (key_pressed(KEY_SELECT)) { - txt_drawf_small("SEL+B:COPY CHANNEL SEL+A:PASTE CHANNEL", x0 + 2, y0 + 1, color); + txt_draws_small("SEL+B:COPY CHANNEL SEL+A:PASTE CHANNEL", x0 + 2, y0 + 1, color); } else { - txt_drawf_small("L/R:NOTE SEL+L/R:OCTAVE A:PARAMS B:TOGGLE", x0 + 2, y0 + 1, color); + txt_draws_small("L/R:NOTE SEL+L/R:OCTAVE A:PARAMS B:TOGGLE", x0 + 2, y0 + 1, color); } } else if (input_handler == handle_param_selection_sq1 || input_handler == handle_param_selection_sq2 || input_handler == handle_param_selection_wave || input_handler == handle_param_selection_noise) { - txt_drawf_small("L/R:ADJUST SELECT:COPY PARAMETERS", x0 + 2, y0 + 1, color); + txt_draws_small("L/R:ADJUST SELECT:COPY PARAMETERS", x0 + 2, y0 + 1, color); } else if (input_handler == handle_pattern_selection) { if (key_pressed(KEY_SELECT)) { - txt_drawf_small("SEL+B:COPY PATTERN SEL+A:PASTE PATTERN", x0 + 2, y0 + 1, color); + txt_draws_small("SEL+B:COPY PATTERN SEL+A:PASTE PATTERN", x0 + 2, y0 + 1, color); } else { - txt_drawf_small("L/R:CHAIN A:PARAMS B:QUEUE SEL+L+R:CLEAR", x0 + 2, y0 + 1, color); + txt_draws_small("L/R:CHAIN A:PARAMS B:QUEUE SEL+L+R:CLEAR", x0 + 2, y0 + 1, color); } } else if (input_handler == handle_pattern_chain) { switch (param_selection_loc) { case CHAIN_BTN_ENABLE: { - txt_drawf_small("A:BACK B:TOGGLE CHAIN", x0 + 2, y0 + 1, color); + txt_draws_small("A:BACK B:TOGGLE CHAIN", x0 + 2, y0 + 1, color); } break; case CHAIN_BTN_CLEAR: { - txt_drawf_small("A:BACK B:CLEAR CHAIN", x0 + 2, y0 + 1, color); + txt_draws_small("A:BACK B:CLEAR CHAIN", x0 + 2, y0 + 1, color); } break; case CHAIN_BTN_RANDOM: { - txt_drawf_small("A:BACK B:RANDOMIZE CHAIN", x0 + 2, y0 + 1, color); + txt_draws_small("A:BACK B:RANDOMIZE CHAIN", x0 + 2, y0 + 1, color); } break; default: { - txt_drawf_small("L/R:CHANGE PATTERN A:BACK B:TOGGLE STEP", x0 + 2, y0 + 1, color); + txt_draws_small("L/R:CHANGE PATTERN A:BACK B:TOGGLE STEP", x0 + 2, y0 + 1, color); } break; } } else if (input_handler == handle_right_col_selection) { if (right_col_selection_loc == R_COL_STOP) { - txt_drawf_small("B:STOP", x0 + 2, y0 + 1, color); + txt_draws_small("B:STOP", x0 + 2, y0 + 1, color); } else if (right_col_selection_loc == R_COL_PLAY) { if (play_status == 0) { - txt_drawf_small("B:PLAY", x0 + 2, y0 + 1, color); + txt_draws_small("B:PLAY", x0 + 2, y0 + 1, color); } else { - txt_drawf_small("B:PAUSE", x0 + 2, y0 + 1, color); + txt_draws_small("B:PAUSE", x0 + 2, y0 + 1, color); } } else if (right_col_selection_loc == R_COL_BPM) { if (key_pressed(KEY_SELECT)) { @@ -2108,10 +2108,10 @@ draw_notif_bar() { } txt_drawf_small("TEMPO: %d bpm", x0 + 2, y0 + 1, color, bpm); } else { - txt_drawf_small("L/R:TEMPO (+1) SEL+L/R:TEMPO (+10)", x0 + 2, y0 + 1, color); + txt_draws_small("L/R:TEMPO (+1) SEL+L/R:TEMPO (+10)", x0 + 2, y0 + 1, color); } } else if (right_col_selection_loc == R_COL_SETTINGS) { - txt_drawf_small("B:SETTINGS", x0 + 2, y0 + 1, color); + txt_draws_small("B:SETTINGS", x0 + 2, y0 + 1, color); } else if (right_col_selection_loc == R_COL_SCALE) { if (key_pressed(KEY_SELECT)) { const char *roots[12] = { @@ -2121,7 +2121,7 @@ draw_notif_bar() { txt_drawf_small("ROOT: %s SCALE: %s", x0 + 2, y0 + 1, color, roots[current_scale_root], scale_long[current_scale]); } else { - txt_drawf_small("L/R:SCALE SEL+L/R:ROOT NOTE", x0 + 2, y0 + 1, color); + txt_draws_small("L/R:SCALE SEL+L/R:ROOT NOTE", x0 + 2, y0 + 1, color); } } else if (right_col_selection_loc == R_COL_BANK_A || right_col_selection_loc == R_COL_BANK_B || @@ -2130,9 +2130,9 @@ draw_notif_bar() { right_col_selection_loc == R_COL_BANK_E || right_col_selection_loc == R_COL_BANK_F) { if (settings.auto_save) { - txt_drawf_small("B:SAVE CURRENT BANK AND SWITCH", x0 + 2, y0 + 1, color); + txt_draws_small("B:SAVE CURRENT BANK AND SWITCH", x0 + 2, y0 + 1, color); } else { - txt_drawf_small("B:SWITCH BANK", x0 + 2, y0 + 1, color); + txt_draws_small("B:SWITCH BANK", x0 + 2, y0 + 1, color); } } } @@ -2140,24 +2140,24 @@ draw_notif_bar() { } if (input_handler == handle_right_col_selection) { switch (right_col_selection_loc) { - case R_COL_BANK_A: { txt_drawf_small("BANK A", x0 + 2, y0 + 1, color); } break; - case R_COL_BANK_B: { txt_drawf_small("BANK B", x0 + 2, y0 + 1, color); } break; - case R_COL_BANK_C: { txt_drawf_small("BANK C", x0 + 2, y0 + 1, color); } break; - case R_COL_BANK_D: { txt_drawf_small("BANK D", x0 + 2, y0 + 1, color); } break; - case R_COL_BANK_E: { txt_drawf_small("BANK E", x0 + 2, y0 + 1, color); } break; - case R_COL_BANK_F: { txt_drawf_small("BANK F", x0 + 2, y0 + 1, color); } break; + case R_COL_BANK_A: { txt_draws_small("BANK A", x0 + 2, y0 + 1, color); } break; + case R_COL_BANK_B: { txt_draws_small("BANK B", x0 + 2, y0 + 1, color); } break; + case R_COL_BANK_C: { txt_draws_small("BANK C", x0 + 2, y0 + 1, color); } break; + case R_COL_BANK_D: { txt_draws_small("BANK D", x0 + 2, y0 + 1, color); } break; + case R_COL_BANK_E: { txt_draws_small("BANK E", x0 + 2, y0 + 1, color); } break; + case R_COL_BANK_F: { txt_draws_small("BANK F", x0 + 2, y0 + 1, color); } break; case R_COL_STOP: { - txt_drawf_small("STOP", x0 + 2, y0 + 1, color); + txt_draws_small("STOP", x0 + 2, y0 + 1, color); } break; case R_COL_PLAY: { if (play_status == 0) { - txt_drawf_small("PLAY", x0 + 2, y0 + 1, color); + txt_draws_small("PLAY", x0 + 2, y0 + 1, color); } else { - txt_drawf_small("PAUSE", x0 + 2, y0 + 1, color); + txt_draws_small("PAUSE", x0 + 2, y0 + 1, color); } } break; case R_COL_SETTINGS: { - txt_drawf_small("SETTINGS", x0 + 2, y0 + 1, color); + txt_draws_small("SETTINGS", x0 + 2, y0 + 1, color); } break; case R_COL_SCALE: { const char *roots[12] = { @@ -2181,9 +2181,9 @@ draw_notif_bar() { } if (play_status == 0) { - txt_drawf_small("STOPPED", x0 + 2, y0 + 1, color); + txt_draws_small("STOPPED", x0 + 2, y0 + 1, color); } else { - txt_drawf_small("PLAYING", x0 + 2, y0 + 1, color); + txt_draws_small("PLAYING", x0 + 2, y0 + 1, color); } } } @@ -2223,14 +2223,14 @@ draw_pattern_chain() { size_t x1 = x0 + 30; size_t y0 = PAT_TRIG_START_Y - 16 + 1; size_t y1 = y0 + 8; - txt_drawf_small("toggle", x0 + 2, y0, COL_FG); + txt_draws_small("toggle", x0 + 2, y0, COL_FG); draw_rect(x0, y0, x1, y1, COL_FG); x0 += 42; x1 += 42; - txt_drawf_small("clear", x0 + 4, y0, COL_FG); + txt_draws_small("clear", x0 + 4, y0, COL_FG); draw_rect(x0, y0, x1, y1, COL_FG); x0 += 42; x1 += 42; - txt_drawf_small("random", x0 + 2, y0, COL_FG); + txt_draws_small("random", x0 + 2, y0, COL_FG); draw_rect(x0, y0, x1, y1, COL_FG); } -- cgit v1.2.1