From 2d2304b4c6414ab1486faf6c0c0c9ccf1d693e75 Mon Sep 17 00:00:00 2001 From: tomcw Date: Sat, 3 Mar 2018 22:01:03 +0000 Subject: [PATCH] AppleWin's Config>Benchmark, reported a "Pure CPU MHz" which was not a good indicator of unthrottled speed for v1.26+, as it was still getting the emulator to do full NTSC/cycle-accurate video update. The reality (when in full-speed/unthrottled mode) is that the video is only refreshed at 16.6ms (wall-clock). So added a 2nd "Pure CPU MHz" for full-speed (ie. no video update), eg: --------------------------- Benchmarks --------------------------- Pure Video FPS: 2860 hires, 2868 text Pure CPU MHz: 10.3 (video update) Pure CPU MHz: 241.3 (full-speed) EXPECTED AVERAGE VIDEO GAME PERFORMANCE: 476 FPS (ref: #424, #540) --- source/Video.cpp | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/source/Video.cpp b/source/Video.cpp index 3c53f7e5..da2dd2a8 100644 --- a/source/Video.cpp +++ b/source/Video.cpp @@ -227,16 +227,18 @@ void VideoBenchmark () { // DETERMINE HOW MANY 65C02 CLOCK CYCLES WE CAN EMULATE PER SECOND WITH // NOTHING ELSE GOING ON - CpuSetupBenchmark(); - DWORD totalmhz10 = 0; - milliseconds = GetTickCount(); - while (GetTickCount() == milliseconds) ; - milliseconds = GetTickCount(); - cycle = 0; - do { - CpuExecute(100000, true); - totalmhz10++; - } while (GetTickCount() - milliseconds < 1000); + DWORD totalmhz10[2] = {0,0}; // bVideoUpdate & !bVideoUpdate + for (UINT i=0; i<2; i++) + { + CpuSetupBenchmark(); + milliseconds = GetTickCount(); + while (GetTickCount() == milliseconds) ; + milliseconds = GetTickCount(); + do { + CpuExecute(100000, i==0 ? true : false); + totalmhz10[i]++; + } while (GetTickCount() - milliseconds < 1000); + } // IF THE PROGRAM COUNTER IS NOT IN THE EXPECTED RANGE AT THE END OF THE // CPU BENCHMARK, REPORT AN ERROR AND OPTIONALLY TRACK IT DOWN @@ -321,14 +323,14 @@ void VideoBenchmark () { TCHAR outstr[256]; wsprintf(outstr, TEXT("Pure Video FPS:\t%u hires, %u text\n") - TEXT("Pure CPU MHz:\t%u.%u%s\n\n") + TEXT("Pure CPU MHz:\t%u.%u%s (video update)\n") + TEXT("Pure CPU MHz:\t%u.%u%s (full-speed)\n\n") TEXT("EXPECTED AVERAGE VIDEO GAME\n") TEXT("PERFORMANCE: %u FPS"), (unsigned)totalhiresfps, (unsigned)totaltextfps, - (unsigned)(totalmhz10/10), - (unsigned)(totalmhz10 % 10), - (LPCTSTR)(IS_APPLE2 ? TEXT(" (6502)") : TEXT("")), + (unsigned)(totalmhz10[0] / 10), (unsigned)(totalmhz10[0] % 10), (LPCTSTR)(IS_APPLE2 ? TEXT(" (6502)") : TEXT("")), + (unsigned)(totalmhz10[1] / 10), (unsigned)(totalmhz10[1] % 10), (LPCTSTR)(IS_APPLE2 ? TEXT(" (6502)") : TEXT("")), (unsigned)realisticfps); MessageBox(g_hFrameWindow, outstr,