From 3e7155981e020bc19540abc8486b816cb57c8a41 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Fri, 23 Jan 2009 03:23:30 +0000 Subject: DS: Nothing is supposed to use time(), so don't globally include -- in particular, no need to fake a time() impl if the only code using it is the backend itself ;) svn-id: r36012 --- backends/platform/ds/arm9/source/osystem_ds.cpp | 11 ++++++++++- backends/platform/ds/arm9/source/portdefs.cpp | 21 --------------------- backends/platform/ds/arm9/source/portdefs.h | 11 ----------- 3 files changed, 10 insertions(+), 33 deletions(-) (limited to 'backends') diff --git a/backends/platform/ds/arm9/source/osystem_ds.cpp b/backends/platform/ds/arm9/source/osystem_ds.cpp index df7e426df5..38aa57948c 100644 --- a/backends/platform/ds/arm9/source/osystem_ds.cpp +++ b/backends/platform/ds/arm9/source/osystem_ds.cpp @@ -38,6 +38,9 @@ #include "touchkeyboard.h" #include "backends/fs/ds/ds-fs-factory.h" +#include + + OSystem_DS* OSystem_DS::_instance = NULL; OSystem_DS::OSystem_DS() @@ -545,8 +548,14 @@ void OSystem_DS::delayMillis(uint msecs) { DS::addEventsToQueue(); } + void OSystem_DS::getTimeAndDate(struct tm &t) const { - time_t curTime = time(0); + time_t curTime; +#if 0 + curTime = time(0); +#else + curTime = 0xABCD1234 + getMillis() / 1000; +#endif t = *localtime(&curTime); } diff --git a/backends/platform/ds/arm9/source/portdefs.cpp b/backends/platform/ds/arm9/source/portdefs.cpp index 74a41faca0..0dcdc1d5a3 100644 --- a/backends/platform/ds/arm9/source/portdefs.cpp +++ b/backends/platform/ds/arm9/source/portdefs.cpp @@ -33,24 +33,3 @@ extern "C" time_t __wrap_time(time_t* t) { return OSystem_DS::instance()->getMillis() / 1000; } */ - - - -time_t DS_time(time_t) { - if (OSystem_DS::instance()) { - return 0xABCD1234 + (OSystem_DS::instance()->getMillis() / 1000); - } else { - return 0xABCD1234; - } -} - -time_t DS_time(long* t) { - if (OSystem_DS::instance()) { - if (t) *t = 0xABCD1234 + (OSystem_DS::instance()->getMillis() / 1000); - return 0xABCD1234 + (OSystem_DS::instance()->getMillis() / 1000); - } else { - if (t) *t = 0xABCD1234; - return 0xABCD1234; - } -} - diff --git a/backends/platform/ds/arm9/source/portdefs.h b/backends/platform/ds/arm9/source/portdefs.h index 8a14420907..58d4df9020 100644 --- a/backends/platform/ds/arm9/source/portdefs.h +++ b/backends/platform/ds/arm9/source/portdefs.h @@ -38,7 +38,6 @@ typedef signed int s32; #include "nds/jtypes.h" - // Somebody removed these from scummsys.h, but they're still required, so I'm adding them here // in the hope that they'll stay. #include @@ -47,7 +46,6 @@ typedef signed int s32; #include #include #include -#include #define double float @@ -76,8 +74,6 @@ int consolePrintf(const char* s, ...); //#define debug(fmt, ...) consolePrintf(fmt, ##__VA_ARGS__) //#define debug(fmt, ...) debug(0, fmt, ##__VA_ARGS__) -#define time(t) DS_time(t) -//#define memcpy(dest, src, size) DS_memcpy(dest, src, size) #define ITCM_DATA __attribute__((section(".itcm"))) @@ -86,11 +82,4 @@ int consolePrintf(const char* s, ...); // a more conventional form of input where the menus can be clicked on. #define LURE_CLICKABLE_MENUS -//#include "common/array.h" -//#include "common/str.h" - -time_t DS_time(time_t* t); -time_t DS_time(long* t); -void* DS_memcpy(void* s1, void const* s2, size_t n); - #endif -- cgit v1.2.3