Updated Qt driver FCEUD_GetTime and FCEUD_GetTimeFreq functions to allow for a higher timing resolution.
This commit is contained in:
parent
70aa850c15
commit
43cd7ef60a
|
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue