diff options
Diffstat (limited to 'backends/platform/psp/rtc.cpp')
-rw-r--r-- | backends/platform/psp/rtc.cpp | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/backends/platform/psp/rtc.cpp b/backends/platform/psp/rtc.cpp index 57edea7e49..f26e5770a6 100644 --- a/backends/platform/psp/rtc.cpp +++ b/backends/platform/psp/rtc.cpp @@ -23,13 +23,13 @@ * */ -#include <time.h> +#include <time.h> #include <psptypes.h> #include <psprtc.h> - -#include "common/scummsys.h" -#include "backends/platform/psp/rtc.h" - + +#include "common/scummsys.h" +#include "backends/platform/psp/rtc.h" + //#define __PSP_DEBUG_FUNCS__ /* For debugging function calls */ //#define __PSP_DEBUG_PRINT__ /* For debug printouts */ @@ -51,13 +51,13 @@ void PspRtc::init() { // init our starting ticks #define MS_LOOP_AROUND 4294967 /* We loop every 2^32 / 1000 = 71 minutes */ #define MS_LOOP_CHECK 60000 /* Threading can cause weird mixups without this */ -// Note that after we fill up 32 bits ie 50 days we'll loop back to 0, which may cause +// Note that after we fill up 32 bits ie 50 days we'll loop back to 0, which may cause // unpredictable results uint32 PspRtc::getMillis() { uint32 ticks[2]; - + sceRtcGetCurrentTick((u64 *)ticks); // can introduce weird thread delays - + uint32 millis = ticks[0]/1000; millis -= _startMillis; // get ms since start of program @@ -66,22 +66,22 @@ uint32 PspRtc::getMillis() { _looped = true; _milliOffset += MS_LOOP_AROUND; // add the needed offset PSP_DEBUG_PRINT("looping around. last ms[%d], curr ms[%d]\n", _lastMillis, millis); - } + } } else { _looped = false; } - - _lastMillis = millis; - + + _lastMillis = millis; + return millis + _milliOffset; } uint32 PspRtc::getMicros() { uint32 ticks[2]; - + sceRtcGetCurrentTick((u64 *)ticks); ticks[0] -= _startMicros; - - return ticks[0]; + + return ticks[0]; } |