all repos — mgba @ 6f336ce0ec9cbc93db3fdae2b9df021198a674f9

mGBA Game Boy Advance Emulator

Switch: Fix perf-main for new console API
Vicki Pfau vi@endrift.com
Wed, 16 Jan 2019 11:46:34 -0800
commit

6f336ce0ec9cbc93db3fdae2b9df021198a674f9

parent

eee29545b6309176121131944a471a0eceaaf123

1 files changed, 10 insertions(+), 2 deletions(-)

jump to
M src/platform/test/perf-main.csrc/platform/test/perf-main.c

@@ -81,7 +81,6 @@ return 1;

} #elif defined(__SWITCH__) UNUSED(_mPerfShutdown); - gfxInitDefault(); consoleInit(NULL); #else signal(SIGINT, _mPerfShutdown);

@@ -123,6 +122,9 @@

_outputBuffer = malloc(256 * 256 * 4); if (perfOpts.csv) { puts("game_code,frames,duration,renderer"); +#ifdef __SWITCH__ + consoleUpdate(NULL); +#endif } if (perfOpts.server) { didFail = !_mPerfRunServer(args.fname, &args, &perfOpts);

@@ -141,7 +143,7 @@ #ifdef _3DS

gfxExit(); acExit(); #elif defined(__SWITCH__) - gfxExit(); + consoleExit(NULL); #endif return didFail;

@@ -221,6 +223,9 @@ }

} else { printf("%u frames in %" PRIu64 " microseconds: %g fps (%gx)\n", frames, duration, scaledFrames / duration, scaledFrames / (duration * 60.f)); } +#ifdef __SWITCH__ + consoleUpdate(NULL); +#endif return true; }

@@ -245,6 +250,9 @@ timeDiff += (currentTime.tv_usec - lastEcho.tv_usec) / 1000;

if (timeDiff >= 1000) { printf("\033[2K\rCurrent FPS: %g (%gx)", lastFrames / (timeDiff / 1000.0f), lastFrames / (float) (60 * (timeDiff / 1000.0f))); fflush(stdout); +#ifdef __SWITCH__ + consoleUpdate(NULL); +#endif lastEcho = currentTime; lastFrames = 0; }