aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/main.c b/src/main.c
index c6242c2..a2a43d4 100644
--- a/src/main.c
+++ b/src/main.c
@@ -88,8 +88,19 @@
88 txt_printf(">FLIP %.8lu\n", avg_flip_cycles);\ 88 txt_printf(">FLIP %.8lu\n", avg_flip_cycles);\
89 txt_printf("AUDIO %.8lu\n", avg_mix_cycles);\ 89 txt_printf("AUDIO %.8lu\n", avg_mix_cycles);\
90 txt_printf("TOTAL %.8lu\n", avg_frame_cycles);\ 90 txt_printf("TOTAL %.8lu\n", avg_frame_cycles);\
91 screen_fill(BG_BACK, 0, 0, 8 * 16, 8 * 10, 0);\ 91 u32 frame_time =\
92 flipbuf();\ 92 FP_DIV(\
93 FP_NUM(avg_frame_cycles + 1, 2),\
94 FP_NUM(2809, 2),\
95 2) * 166;\
96 u32 fps =\
97 FP_DIV(\
98 FP_NUM(280896 * 60, 2),\
99 FP_NUM(avg_frame_cycles + 1, 2),\
100 2);\
101 txt_printf("TIME %.8lu\n", frame_time >> 2);\
102 txt_printf("FPS %.8lu\n", (fps >> 2) + 1);\
103 screen_fill(BG_BACK, 0, 0, 8 * 16, 8 * 12, 2);\
93 } while (0) 104 } while (0)
94 105
95static u32 prof_frame_counter = 0; 106static u32 prof_frame_counter = 0;
@@ -727,7 +738,6 @@ main(void) {
727 // NOTE: A VBLANK is 83776 cycles, anything other than that will make it so 738 // NOTE: A VBLANK is 83776 cycles, anything other than that will make it so
728 // we fail to render at 60FPS. 739 // we fail to render at 60FPS.
729 while(true) { 740 while(true) {
730 PROF_SHOW();
731 bios_vblank_wait(); 741 bios_vblank_wait();
732 FRAME_START(); 742 FRAME_START();
733 PROF(handle_input(&u), input_cycles); 743 PROF(handle_input(&u), input_cycles);
@@ -735,6 +745,7 @@ main(void) {
735 PROF(sound_mix(), mix_cycles); 745 PROF(sound_mix(), mix_cycles);
736 // TODO: allow configuration to do VSYNC at 15 or 30 fps to avoid too 746 // TODO: allow configuration to do VSYNC at 15 or 30 fps to avoid too
737 // much memory copying on demanding uxn roms. 747 // much memory copying on demanding uxn roms.
748 PROF_SHOW();
738 PROF(flipbuf(), flip_cycles); 749 PROF(flipbuf(), flip_cycles);
739 frame_counter++; 750 frame_counter++;
740 if (frame_counter == 60) { 751 if (frame_counter == 60) {