From 287d34621d59159d00649d34ac174a9ded204dfa Mon Sep 17 00:00:00 2001 From: Ryan Loebs Date: Mon, 4 Apr 2016 01:31:48 -0700 Subject: [PATCH] Implement actual system time libctru: osGetTime(); --- src/core/hle/shared_page.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/core/hle/shared_page.cpp b/src/core/hle/shared_page.cpp index 50c5bc01b..029be8242 100644 --- a/src/core/hle/shared_page.cpp +++ b/src/core/hle/shared_page.cpp @@ -3,6 +3,7 @@ // Refer to the license.txt file included. #include +#include #include "core/hle/shared_page.h" @@ -15,7 +16,16 @@ SharedPageDef shared_page; void Init() { std::memset(&shared_page, 0, sizeof(shared_page)); + // 3DS uses 1/1/1900 for Epoch + time_t plat_time = time(NULL); + struct tm console_epoch = {0}; + console_epoch.tm_mday = 1; + u64_le console_time = (u64_le) difftime(plat_time, mktime(&console_epoch)) * 1000L; + shared_page.running_hw = 0x1; // product + shared_page.date_time_0 = { + .date_time = console_time, + }; } } // namespace