[Scummvm-cvs-logs] SF.net SVN: scummvm:[48170] scummvm/trunk/backends/platform/n64/ osys_n64_base.cpp
Hkz at users.sourceforge.net
Hkz at users.sourceforge.net
Sat Mar 6 14:49:21 CET 2010
Revision: 48170
http://scummvm.svn.sourceforge.net/scummvm/?rev=48170&view=rev
Author: Hkz
Date: 2010-03-06 13:49:20 +0000 (Sat, 06 Mar 2010)
Log Message:
-----------
N64: Use mips timer to partially simulate an RTC for the n64 port
Modified Paths:
--------------
scummvm/trunk/backends/platform/n64/osys_n64_base.cpp
Modified: scummvm/trunk/backends/platform/n64/osys_n64_base.cpp
===================================================================
--- scummvm/trunk/backends/platform/n64/osys_n64_base.cpp 2010-03-06 12:59:19 UTC (rev 48169)
+++ scummvm/trunk/backends/platform/n64/osys_n64_base.cpp 2010-03-06 13:49:20 UTC (rev 48170)
@@ -860,14 +860,18 @@
}
void OSystem_N64::getTimeAndDate(TimeDate &t) const {
- // No clock inside the N64
- // TODO: use getMillis to provide some kind of time-counting feature?
- t.tm_sec = 0;
- t.tm_min = 0;
- t.tm_hour = 0;
- t.tm_mday = 0;
+ // No RTC inside the N64, read mips timer to simulate
+ // passing of time, not a perfect solution, but can't think
+ // of anything better.
+
+ uint32 now = getMilliTick();
+
+ t.tm_sec = (now / 1000) % 60;
+ t.tm_min = ((now / 1000) / 60) % 60;
+ t.tm_hour = (((now / 1000) / 60) / 60) % 24;
+ t.tm_mday = 1;
t.tm_mon = 0;
- t.tm_year = 0;
+ t.tm_year = 1900;
return;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list