diff --git a/src/drivers/Qt/fceuWrapper.cpp b/src/drivers/Qt/fceuWrapper.cpp index b906a870..c907b104 100644 --- a/src/drivers/Qt/fceuWrapper.cpp +++ b/src/drivers/Qt/fceuWrapper.cpp @@ -62,6 +62,7 @@ #include "common/os_utils.h" #include "common/configSys.h" +#include "utils/timeStamp.h" #include "../../oldmovie.h" #include "../../types.h" @@ -191,7 +192,23 @@ const char *FCEUD_GetCompilerString(void) uint64 FCEUD_GetTime(void) { - return SDL_GetTicks(); + uint64 t; + + if (FCEU::timeStampModuleInitialized()) + { + FCEU::timeStampRecord ts; + + ts.readNew(); + + t = ts.toCounts(); + } + else + { + t = (double)SDL_GetTicks(); + + t = t * 1e-3; + } + return t; } /** @@ -201,7 +218,13 @@ uint64 FCEUD_GetTimeFreq(void) { // SDL_GetTicks() is in milliseconds - return 1000; + uint64 f = 1000; + + if (FCEU::timeStampModuleInitialized()) + { + f = FCEU::timeStampRecord::countFreq(); + } + return f; } /**