From e181b0e2209fd7a2e843bbb7cfe2151497450325 Mon Sep 17 00:00:00 2001 From: Bad Diode Date: Thu, 25 Jan 2024 13:39:32 +0100 Subject: Update profiling macros --- src/main.c | 54 ++++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 48 insertions(+), 6 deletions(-) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index 6f1d0e6..cec540e 100644 --- a/src/main.c +++ b/src/main.c @@ -48,6 +48,9 @@ WITH REGARD TO THIS SOFTWARE. #include "gba/gba.h" +#define PROF_ENABLE 0 +#include "profiling.c" + #include "renderer_m0.c" #include "globals.c" #include "assets.c" @@ -57,9 +60,6 @@ WITH REGARD TO THIS SOFTWARE. #include "scale.c" #include "sequencer.c" -#define PROF_ENABLE 0 -#include "profiling.c" - static int frames = 0; void @@ -191,10 +191,52 @@ render(void) { void handle_input(void) { - if (key_tap(KEY_SELECT) && key_hold(KEY_START)) { - PROF_SHOW(); - clear_screen = true; +#if PROF_ENABLE > 0 + if (key_hold(KEY_SELECT)) { + if (key_tap(KEY_DOWN)) { + PROF_SHOW(); + clear_screen = true; + redraw_trigs = true; + redraw_channels = true; + redraw_pattern_buttons = true; + redraw_bank_buttons = true; + redraw_bpm = true; + redraw_play_pause = true; + redraw_params = true; + redraw_scale = true; + return; + } + static int prof_detail = 0; + if (key_tap(KEY_RIGHT)) { + prof_detail = CLAMP(prof_detail + 1, 0, 3); + PROF_DETAIL(prof_detail); + clear_screen = true; + redraw_trigs = true; + redraw_channels = true; + redraw_pattern_buttons = true; + redraw_bank_buttons = true; + redraw_bpm = true; + redraw_play_pause = true; + redraw_params = true; + redraw_scale = true; + return; + } + if (key_tap(KEY_LEFT)) { + prof_detail = CLAMP(prof_detail - 1, 0, 3); + PROF_DETAIL(prof_detail); + clear_screen = true; + redraw_trigs = true; + redraw_channels = true; + redraw_pattern_buttons = true; + redraw_bank_buttons = true; + redraw_bpm = true; + redraw_play_pause = true; + redraw_params = true; + redraw_scale = true; + return; + } } +#endif switch (scene) { case SCENE_SETTINGS: { handle_settings_input(); -- cgit v1.2.1