From ff6e784e7c5ebe223666c6c631305397ad358289 Mon Sep 17 00:00:00 2001 From: Bad Diode Date: Sun, 23 Apr 2023 15:48:59 +0200 Subject: Start decoupling of rendering from update passes --- src/profiling.c | 39 ++++++++++++++++----------------------- 1 file changed, 16 insertions(+), 23 deletions(-) (limited to 'src/profiling.c') diff --git a/src/profiling.c b/src/profiling.c index 7a4f4ad..a3b073b 100644 --- a/src/profiling.c +++ b/src/profiling.c @@ -41,22 +41,16 @@ #endif static bool profile_show = true; -static bool profile_bg_show = true; #define PROF_SHOW() \ do { \ if (key_tap(KEY_START)) {\ profile_show ^= 1;\ }\ - if (key_tap(KEY_SELECT)) {\ - profile_bg_show ^= 1;\ - }\ if (profile_show) {\ txt_color(1);\ txt_position((PROF_SHOW_X), (PROF_SHOW_Y));\ - if (profile_bg_show) {\ - draw_filled_rect((PROF_SHOW_X), (PROF_SHOW_X), 8 * 18, 8 * 14, 0);\ - }\ + draw_filled_rect((PROF_SHOW_X), (PROF_SHOW_X), 8 * 14, 8 * 10, 0);\ txt_printf("VIDEO\n");\ txt_printf(">CLEAR %.8lu\n", avg_clear_cycles);\ txt_printf(">FLIP %.8lu\n", avg_flip_cycles);\ @@ -66,25 +60,24 @@ static bool profile_bg_show = true; txt_printf(">PARAM %.8lu\n", avg_draw_param_cycles);\ txt_printf(">PIANO %.8lu\n", avg_draw_piano_cycles);\ txt_printf(">CURSOR %.8lu\n", avg_draw_cursor_cycles);\ - txt_printf(">RENDER %.8lu\n", avg_render_cycles);\ + txt_printf("RENDER %.8lu\n", avg_render_cycles);\ + txt_printf("INPUT %.8lu\n", avg_input_cycles);\ txt_printf("TOTAL %.8lu\n", avg_frame_cycles);\ txt_render();\ }\ - if (profile_bg_show) {\ - u32 frame_time =\ - FP_DIV(\ - FP_NUM(avg_frame_cycles + 1, 2),\ - FP_NUM(2809, 2),\ - 2) * 166;\ - u32 fps =\ - FP_DIV(\ - FP_NUM(280896 * 60, 2),\ - FP_NUM(avg_frame_cycles + 1, 2),\ - 2);\ - draw_filled_rect(8 * 18, 0, 239, 16, 0);\ - txt_drawf("TIME: %.6lu", 8 * 18, 0, 1, frame_time >> 2);\ - txt_drawf("MAX FPS:%.4lu", 8 * 18, 8, 1, (fps >> 2) + 1);\ - }\ + u32 frame_time =\ + FP_DIV(\ + FP_NUM(avg_frame_cycles + 1, 2),\ + FP_NUM(2809, 2),\ + 2) * 166;\ + u32 fps =\ + FP_DIV(\ + FP_NUM(280896 * 60, 2),\ + FP_NUM(avg_frame_cycles + 1, 2),\ + 2);\ + draw_filled_rect(8 * 18, 0, 239, 16, 0);\ + txt_drawf("TIME: %.6lu", 8 * 18, 0, 1, frame_time >> 2);\ + txt_drawf("MAX FPS: %.4lu", 8 * 18, 8, 1, (fps >> 2) + 1);\ } while (0) static u32 prof_frame_counter = 0; -- cgit v1.2.1