From deb9c48fbd3dc5854de4ae3a04dc999029c10ae0 Mon Sep 17 00:00:00 2001 From: Bad Diode Date: Sat, 22 Apr 2023 21:12:14 +0200 Subject: Add new renderer and prepare for render overhaul --- src/profiling.c | 106 +++++++++++++++++++++++++------------------------------- 1 file changed, 48 insertions(+), 58 deletions(-) (limited to 'src/profiling.c') diff --git a/src/profiling.c b/src/profiling.c index de969d2..7a4f4ad 100644 --- a/src/profiling.c +++ b/src/profiling.c @@ -52,22 +52,23 @@ static bool profile_bg_show = true; profile_bg_show ^= 1;\ }\ if (profile_show) {\ + txt_color(1);\ txt_position((PROF_SHOW_X), (PROF_SHOW_Y));\ - draw_filled_rect((PROF_SHOW_X), (PROF_SHOW_X), 8 * 18, 8 * 16, 0);\ + if (profile_bg_show) {\ + draw_filled_rect((PROF_SHOW_X), (PROF_SHOW_X), 8 * 18, 8 * 14, 0);\ + }\ txt_printf("VIDEO\n");\ txt_printf(">CLEAR %.8lu\n", avg_clear_cycles);\ - txt_printf(">LINES %.8lu\n", avg_line_cycles);\ - txt_printf(">RECT %.8lu\n", avg_rect_cycles);\ - txt_printf(">FRECT %.8lu\n", avg_fill_rect_cycles);\ - txt_printf(">1BPP %.8lu\n", avg_icn_cycles);\ - txt_printf(">2BPP %.8lu\n", avg_chr_cycles);\ txt_printf(">FLIP %.8lu\n", avg_flip_cycles);\ - txt_printf("TEXT\n");\ - txt_printf(">DRAWF %.8lu\n", avg_txt_drawf_cycles);\ - txt_printf(">PRINTF %.8lu\n", avg_txt_printf_cycles);\ - txt_printf(">RENDER %.8lu\n", avg_txt_render_cycles);\ - txt_printf(">CLEAR %.8lu\n", avg_txt_clear_cycles);\ + txt_printf("SEQUENCER RENDER\n");\ + txt_printf(">TRIGS %.8lu\n", avg_draw_trigs_cycles);\ + txt_printf(">BTNS %.8lu\n", avg_draw_btns_cycles);\ + 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("TOTAL %.8lu\n", avg_frame_cycles);\ + txt_render();\ }\ if (profile_bg_show) {\ u32 frame_time =\ @@ -80,40 +81,35 @@ static bool profile_bg_show = true; FP_NUM(280896 * 60, 2),\ FP_NUM(avg_frame_cycles + 1, 2),\ 2);\ - txt_printf("TIME %.8lu\n", frame_time >> 2);\ - txt_printf("FPS %.8lu\n", (fps >> 2) + 1);\ + 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; -static u32 frame_cycles = 0; -static u32 flip_cycles = 0; -static u32 clear_cycles = 0; -static u32 line_cycles = 0; -static u32 rect_cycles = 0; -static u32 fill_rect_cycles = 0; -static u32 chr_cycles = 0; -static u32 icn_cycles = 0; -static u32 txt_drawf_cycles = 0; -static u32 txt_printf_cycles = 0; -static u32 txt_render_cycles = 0; -static u32 txt_clear_cycles = 0; -static u32 input_cycles = 0; +static u32 frame_cycles = 0; +static u32 flip_cycles = 0; +static u32 clear_cycles = 0; +static u32 input_cycles = 0; +static u32 draw_trigs_cycles = 0; +static u32 draw_btn_cycles = 0; +static u32 draw_piano_cycles = 0; +static u32 draw_param_cycles = 0; +static u32 draw_cursor_cycles = 0; +static u32 render_cycles = 0; -static u32 avg_frame_cycles = 0; -static u32 avg_flip_cycles = 0; -static u32 avg_clear_cycles = 0; -static u32 avg_line_cycles = 0; -static u32 avg_rect_cycles = 0; -static u32 avg_fill_rect_cycles = 0; -static u32 avg_chr_cycles = 0; -static u32 avg_icn_cycles = 0; -static u32 avg_txt_drawf_cycles = 0; -static u32 avg_txt_printf_cycles = 0; -static u32 avg_txt_render_cycles = 0; -static u32 avg_txt_clear_cycles = 0; -static u32 avg_input_cycles = 0; +static u32 avg_frame_cycles = 0; +static u32 avg_flip_cycles = 0; +static u32 avg_clear_cycles = 0; +static u32 avg_input_cycles = 0; +static u32 avg_draw_trigs_cycles = 0; +static u32 avg_draw_btns_cycles = 0; +static u32 avg_draw_piano_cycles = 0; +static u32 avg_draw_param_cycles = 0; +static u32 avg_draw_cursor_cycles = 0; +static u32 avg_render_cycles = 0; #if PROF_ENABLE == 1 #define FRAME_START()\ @@ -122,29 +118,23 @@ static u32 avg_input_cycles = 0; avg_frame_cycles = frame_cycles / prof_frame_counter;\ avg_flip_cycles = flip_cycles / prof_frame_counter;\ avg_clear_cycles = clear_cycles / prof_frame_counter;\ - avg_line_cycles = line_cycles / prof_frame_counter;\ - avg_rect_cycles = rect_cycles / prof_frame_counter;\ - avg_fill_rect_cycles = fill_rect_cycles / prof_frame_counter;\ - avg_chr_cycles = chr_cycles / prof_frame_counter;\ - avg_icn_cycles = icn_cycles / prof_frame_counter;\ - avg_txt_drawf_cycles = txt_drawf_cycles / prof_frame_counter;\ - avg_txt_printf_cycles = txt_printf_cycles / prof_frame_counter;\ - avg_txt_render_cycles = txt_render_cycles / prof_frame_counter;\ - avg_txt_clear_cycles = txt_clear_cycles / prof_frame_counter;\ - avg_input_cycles = input_cycles / prof_frame_counter;\ + avg_draw_trigs_cycles = draw_trigs_cycles / prof_frame_counter;\ + avg_draw_btns_cycles = draw_btn_cycles / prof_frame_counter;\ + avg_draw_piano_cycles = draw_piano_cycles / prof_frame_counter;\ + avg_draw_param_cycles = draw_param_cycles / prof_frame_counter;\ + avg_draw_cursor_cycles = draw_cursor_cycles / prof_frame_counter;\ + avg_input_cycles = input_cycles / prof_frame_counter;\ + avg_render_cycles = render_cycles / prof_frame_counter;\ frame_cycles = 0;\ flip_cycles = 0;\ clear_cycles = 0;\ - line_cycles = 0;\ - rect_cycles = 0;\ - fill_rect_cycles = 0;\ - chr_cycles = 0;\ - icn_cycles = 0;\ - txt_drawf_cycles = 0;\ - txt_printf_cycles = 0;\ - txt_render_cycles = 0;\ - txt_clear_cycles = 0;\ input_cycles = 0;\ + render_cycles = 0;\ + draw_trigs_cycles = 0;\ + draw_param_cycles = 0;\ + draw_cursor_cycles = 0;\ + draw_btn_cycles = 0;\ + draw_piano_cycles = 0;\ prof_frame_counter = 0;\ }\ profile_start();\ -- cgit v1.2.1