From fba5fc17df5c5e2e6a56ca13844771984cf30dc7 Mon Sep 17 00:00:00 2001 From: Bad Diode Date: Sun, 23 Apr 2023 21:28:41 +0200 Subject: Add remaining UI elements for next RC --- src/drawing.c | 11 ++++++++--- src/globals.c | 1 + src/main.c | 3 +-- 3 files changed, 10 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/drawing.c b/src/drawing.c index 83ffb50..7a3fff0 100644 --- a/src/drawing.c +++ b/src/drawing.c @@ -144,9 +144,9 @@ draw_right_col_cursor(int i, u8 clr) { } void -draw_current_step(u8 col) { - size_t offset_x = TRIG_OFFSET_X * (step_counter % 8); - size_t offset_y = step_counter < 8 ? 2 : 2 + TRIG_OFFSET_Y; +draw_current_step(u8 step, u8 col) { + size_t offset_x = TRIG_OFFSET_X * (step % 8); + size_t offset_y = step < 8 ? 2 : 2 + TRIG_OFFSET_Y; size_t x0 = TRIG_START_X + 3 + offset_x; size_t x1 = TRIG_START_X - 3 + TRIG_W + offset_x; size_t y = TRIG_START_Y - 4 + TRIG_H + offset_y; @@ -1251,11 +1251,15 @@ clear_cursors(void) { draw_channel_cursor(last_channel_loc, COL_BG); draw_pattern_cursor(last_pattern_loc, COL_BG); draw_right_col_cursor(last_right_col_loc, COL_BG); + for (size_t i = 0; i < 16; i++) { + draw_current_step(i, COL_GREY); + } } void draw_cursors(void) { clear_cursors(); + draw_current_step(step_counter, COL_RED); if (input_handler == handle_trigger_selection) { draw_trig_cursor(trig_selection_loc, COL_CURSOR); } @@ -1277,5 +1281,6 @@ draw_cursors(void) { input_handler == handle_param_selection_wave || input_handler == handle_param_selection_noise) { draw_params_cursor(param_selection_loc, COL_CURSOR); + draw_trig_cursor(trig_selection_loc, COL_GREY); } } diff --git a/src/globals.c b/src/globals.c index e718dd4..34e9bb5 100644 --- a/src/globals.c +++ b/src/globals.c @@ -16,6 +16,7 @@ u32 last_trig_loc = 0; u32 last_channel_loc = 0; u32 last_pattern_loc = 0; u32 last_right_col_loc = 0; +u32 last_step_counter = 0; // // Color indexes. diff --git a/src/main.c b/src/main.c index 525a0d9..0fb018f 100644 --- a/src/main.c +++ b/src/main.c @@ -15,7 +15,7 @@ WITH REGARD TO THIS SOFTWARE. #include "renderer_m0.c" #include "sequencer.c" -#define PROF_ENABLE 1 +#define PROF_ENABLE 0 #include "profiling.c" void @@ -66,7 +66,6 @@ render(void) { redraw_params = false; } - // PROF(draw_current_step(COL_RED), draw_cursor_cycles); PROF(draw_cursors(), draw_cursor_cycles); } -- cgit v1.2.1