aboutsummaryrefslogtreecommitdiff
path: root/backends
diff options
context:
space:
mode:
authorRobert Göffringmann2005-05-13 19:51:12 +0000
committerRobert Göffringmann2005-05-13 19:51:12 +0000
commitc4e258ed2176466283b86117ab406a1c0228594b (patch)
tree16a9c720efc7544708befc9fff6d8204947a3ba5 /backends
parent564c30a9addf297063deecb41db1e5bb13dd9e63 (diff)
downloadscummvm-rg350-c4e258ed2176466283b86117ab406a1c0228594b.tar.gz
scummvm-rg350-c4e258ed2176466283b86117ab406a1c0228594b.tar.bz2
scummvm-rg350-c4e258ed2176466283b86117ab406a1c0228594b.zip
fixed time().
svn-id: r18083
Diffstat (limited to 'backends')
-rw-r--r--backends/ps2/systemps2.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/backends/ps2/systemps2.cpp b/backends/ps2/systemps2.cpp
index fabd362812..33c93fb753 100644
--- a/backends/ps2/systemps2.cpp
+++ b/backends/ps2/systemps2.cpp
@@ -702,22 +702,23 @@ void readRtcTime(void) {
if (configIsDaylightSavingEnabled())
gmtOfs += 60;
- g_timeSecs = (FROM_BCD(cdClock.hour) * 60 + FROM_BCD(cdClock.minute)) * 60 + FROM_BCD(cdClock.second);
-
- g_timeSecs -= 9 * 60 * 60; // minus 9 hours, JST -> GMT conversion
- g_timeSecs += gmtOfs * 60; // GMT -> timezone the user selected
+ int timeSecs = (FROM_BCD(cdClock.hour) * 60 + FROM_BCD(cdClock.minute)) * 60 + FROM_BCD(cdClock.second);
+ timeSecs -= 9 * 60 * 60; // minus 9 hours, JST -> GMT conversion
+ timeSecs += gmtOfs * 60; // GMT -> timezone the user selected
g_day = FROM_BCD(cdClock.day);
g_month = FROM_BCD(cdClock.month);
g_year = FROM_BCD(cdClock.year);
- if (g_timeSecs < 0) {
+ if (timeSecs < 0) {
buildNewDate(-1);
- g_timeSecs += SECONDS_PER_DAY;
- } else if (g_timeSecs >= SECONDS_PER_DAY) {
+ timeSecs += SECONDS_PER_DAY;
+ } else if (timeSecs >= SECONDS_PER_DAY) {
buildNewDate(+1);
- g_timeSecs -= SECONDS_PER_DAY;
+ timeSecs -= SECONDS_PER_DAY;
}
+
+ g_timeSecs = (uint32)timeSecs;
}
sioprintf("Time: %d:%02d:%02d - %d.%d.%4d", g_timeSecs / (60 * 60), (g_timeSecs / 60) % 60, g_timeSecs % 60,