From d2ee6351c08518c866bb48d89f58a67bb36931fc Mon Sep 17 00:00:00 2001 From: harry Date: Thu, 7 Sep 2023 19:12:44 -0400 Subject: [PATCH] Added feature macro __FCEU_X86_TSC_ENABLE to enable usage of the X86 TSC. --- src/utils/timeStamp.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/utils/timeStamp.cpp b/src/utils/timeStamp.cpp index a748fd40..efb45aac 100644 --- a/src/utils/timeStamp.cpp +++ b/src/utils/timeStamp.cpp @@ -14,7 +14,7 @@ //------------------------------------------------------------------------- //---- Time Stamp Record //------------------------------------------------------------------------- -#ifdef __QT_DRIVER__ +#ifdef __FCEU_X86_TSC_ENABLE #if defined(WIN32) #include #pragma intrinsic(__rdtsc) @@ -38,14 +38,14 @@ uint64_t timeStampRecord::qpcFreq = 0; void timeStampRecord::readNew(void) { - #ifdef __QT_DRIVER__ + #ifdef __FCEU_X86_TSC_ENABLE tsc = rdtsc(); + #endif + + #if defined(__linux__) || defined(__APPLE__) || defined(__unix__) + clock_gettime( CLOCK_REALTIME, &ts ); #else - #if defined(__linux__) || defined(__APPLE__) || defined(__unix__) - clock_gettime( CLOCK_REALTIME, &ts ); - #else - QueryPerformanceCounter((LARGE_INTEGER*)&ts); - #endif + QueryPerformanceCounter((LARGE_INTEGER*)&ts); #endif } #if defined(WIN32)