simple profiler added
[picodrive.git] / platform / common / emu.c
index bde10e4..f86526c 100644 (file)
@@ -1347,6 +1347,8 @@ void emu_init(void)
        mkdir_path(path, pos, "srm");\r
        mkdir_path(path, pos, "brm");\r
 \r
+       pprof_init();\r
+\r
        make_config_cfg(path);\r
        config_readlrom(path);\r
 \r
@@ -1373,6 +1375,8 @@ void emu_finish(void)
 #endif\r
        }\r
 \r
+       pprof_finish();\r
+\r
        PicoExit();\r
 }\r
 \r
@@ -1432,6 +1436,8 @@ void emu_loop(void)
                unsigned int timestamp;\r
                int diff, diff_lim;\r
 \r
+               pprof_start(main);\r
+\r
                timestamp = get_ticks();\r
                if (reset_timing) {\r
                        reset_timing = 0;\r
@@ -1537,7 +1543,7 @@ void emu_loop(void)
                PicoFrame();\r
                pemu_finalize_frame(fpsbuff, notice_msg);\r
 \r
-               //plat_video_flip();\r
+               // plat_video_flip();\r
 \r
                /* frame limiter */\r
                if (!reset_timing && !(currentConfig.EmuOpt & (EOPT_NO_FRMLIMIT|EOPT_EXT_FRMLIMIT)))\r
@@ -1560,6 +1566,8 @@ void emu_loop(void)
                plat_video_flip();\r
 \r
                pframes_done++; frames_done++; frames_shown++;\r
+\r
+               pprof_end(main);\r
        }\r
 \r
        emu_set_fastforward(0);\r