From 0eda19bd2bb551bf9186b0fbe1a806a28d5a3597 Mon Sep 17 00:00:00 2001 From: Bad Diode Date: Thu, 3 Jun 2021 11:24:31 +0200 Subject: Add initial text background drawing functions --- src/main.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index 1e1ef11..6226bcd 100644 --- a/src/main.c +++ b/src/main.c @@ -35,10 +35,14 @@ WITH REGARD TO THIS SOFTWARE. do { \ txt_position((PROF_SHOW_X), (PROF_SHOW_Y));\ txt_printf("EVAL: %lu ", eval_cycles);\ - txt_position((PROF_SHOW_X), (PROF_SHOW_Y));\ + txt_position((PROF_SHOW_X), (PROF_SHOW_Y)+1);\ txt_printf("FLIP: %lu ", flip_cycles);\ + txt_position((PROF_SHOW_X), (PROF_SHOW_Y)+2);\ + txt_printf("FRAME: %lu ", frame_counter);\ + frame_counter++;\ } while (0) #define PROF_INIT() \ + u32 frame_counter = 0;\ u32 eval_cycles = 0;\ u32 flip_cycles = 0; #else @@ -65,19 +69,19 @@ int main(void) { draw_pixel(10, 1, 2); draw_pixel(10, 2, 3); draw_pixel(10, 3, 4); - draw_pixel(0, 0, 1); - draw_pixel(0, 1, 2); - draw_pixel(0, 2, 3); - draw_pixel(0, 3, 4); + draw_pixel( 0, 0, 1); + draw_pixel( 0, 1, 2); + draw_pixel( 0, 2, 3); + draw_pixel( 0, 3, 4); + txt_position(8, 8); + txt_printf("Hello world!"); // Main loop. PROF_INIT(); - size_t frame_counter = 0; while(true) { bios_vblank_wait(); PROF_SHOW(); PROF(flip_buffer(), flip_cycles); - frame_counter++; } return 0; -- cgit v1.2.1