Added optional PERF_LOG* defines.
This commit is contained in:
parent
114db71711
commit
65d3a19499
@ -340,6 +340,19 @@ void menuLoop() {
|
||||
DrawText(interuiregular14, 180, 46, themeCurrent.textColor, "v2.0.0");
|
||||
DrawTextTruncate(interuiregular18, 40, 720 - 47, themeCurrent.textColor, menu->dirname, 918, "...");
|
||||
|
||||
#ifdef PERF_LOG_DRAW//Seperate from the PERF_LOG define since this might affect perf.
|
||||
extern u64 g_tickdiff_vsync;
|
||||
extern u64 g_tickdiff_frame;
|
||||
|
||||
char tmpstr[64];
|
||||
|
||||
snprintf(tmpstr, sizeof(tmpstr)-1, "%lu", g_tickdiff_vsync);
|
||||
DrawText(interuiregular14, 180 + 256, 46, themeCurrent.textColor, tmpstr);
|
||||
|
||||
snprintf(tmpstr, sizeof(tmpstr)-1, "%lu", g_tickdiff_frame);
|
||||
DrawText(interuiregular14, 180 + 256, 46 + 16, themeCurrent.textColor, tmpstr);
|
||||
#endif
|
||||
|
||||
//drawTime();
|
||||
|
||||
if (menu->nEntries==0)
|
||||
|
@ -7,8 +7,17 @@
|
||||
uint8_t* g_framebuf;
|
||||
u32 g_framebuf_width;
|
||||
|
||||
#ifdef PERF_LOG
|
||||
u64 g_tickdiff_vsync=0;
|
||||
u64 g_tickdiff_frame=0;
|
||||
#endif
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
#ifdef PERF_LOG
|
||||
u64 start_tick=0;
|
||||
#endif
|
||||
|
||||
gfxInitDefault();
|
||||
|
||||
appletSetScreenShotPermission(1);
|
||||
@ -21,8 +30,20 @@ int main(int argc, char **argv)
|
||||
|
||||
launchInit();
|
||||
|
||||
#ifdef PERF_LOG
|
||||
gfxWaitForVsync();
|
||||
|
||||
start_tick = svcGetSystemTick();
|
||||
gfxWaitForVsync();
|
||||
g_tickdiff_vsync = svcGetSystemTick() - start_tick;
|
||||
#endif
|
||||
|
||||
while (appletMainLoop())
|
||||
{
|
||||
#ifdef PERF_LOG
|
||||
start_tick = svcGetSystemTick();
|
||||
#endif
|
||||
|
||||
//Scan all the inputs. This should be done once for each frame
|
||||
hidScanInput();
|
||||
|
||||
@ -32,6 +53,11 @@ int main(int argc, char **argv)
|
||||
menuLoop();
|
||||
|
||||
gfxFlushBuffers();
|
||||
|
||||
#ifdef PERF_LOG
|
||||
g_tickdiff_frame = svcGetSystemTick() - start_tick;
|
||||
#endif
|
||||
|
||||
gfxSwapBuffers();
|
||||
gfxWaitForVsync();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user