diff options
author | Yotam Barnoy | 2010-10-31 11:08:43 +0000 |
---|---|---|
committer | Yotam Barnoy | 2010-10-31 11:08:43 +0000 |
commit | 94c8d0a14df429a1b25bd9f5c5d75497fd0ddbd1 (patch) | |
tree | 3df2a4ae7967c56d464729669fc06ce4e93dff36 /backends/platform/psp/rtc.cpp | |
parent | 8df4278ba8cfbf71228e1927f9db635a9a30a57f (diff) | |
parent | dca3c8d8bfc6c4db38cf8e8291818dd472041d4e (diff) | |
download | scummvm-rg350-94c8d0a14df429a1b25bd9f5c5d75497fd0ddbd1.tar.gz scummvm-rg350-94c8d0a14df429a1b25bd9f5c5d75497fd0ddbd1.tar.bz2 scummvm-rg350-94c8d0a14df429a1b25bd9f5c5d75497fd0ddbd1.zip |
Updated with latest from trunk
svn-id: r53976
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]; } |