Build fix for win64 Qt GUI.

This commit is contained in:
harry 2023-05-21 16:56:52 -04:00
parent 1a3170fd68
commit 70aa850c15
2 changed files with 13 additions and 5 deletions

View File

@ -43,6 +43,15 @@ void timeStampRecord::readNew(void)
#endif #endif
tsc = rdtsc(); tsc = rdtsc();
} }
#if defined(WIN32)
void timeStampRecord::qpcCalibrate(void)
{
if (QueryPerformanceFrequency((LARGE_INTEGER*)&timeStampRecord::qpcFreq) == 0)
{
printf("QueryPerformanceFrequency FAILED!\n");
}
}
#endif
class timeStampModule class timeStampModule
{ {
@ -51,10 +60,7 @@ class timeStampModule
{ {
printf("timeStampModuleInit\n"); printf("timeStampModuleInit\n");
#if defined(WIN32) #if defined(WIN32)
if (QueryPerformanceFrequency((LARGE_INTEGER*)&timeStampRecord::qpcFreq) == 0) timeStampRecord::qpcCalibrate();
{
printf("QueryPerformanceFrequency FAILED!\n");
}
#endif #endif
} }
}; };
@ -64,7 +70,7 @@ static timeStampModule module;
bool timeStampModuleInitialized(void) bool timeStampModuleInitialized(void)
{ {
#if defined(WIN32) #if defined(WIN32)
bool initialized = timeStampRecord::qpcFreq != 0; bool initialized = timeStampRecord::countFreq() != 0;
#else #else
bool initialized = true; bool initialized = true;
#endif #endif

View File

@ -346,6 +346,8 @@ namespace FCEU
{ {
return qpcFreq; return qpcFreq;
} }
static void qpcCalibrate(void);
#endif #endif
uint64_t getTSC(void){ return tsc; }; uint64_t getTSC(void){ return tsc; };