mirror of
https://github.com/citra-emu/citra.git
synced 2024-11-25 13:30:15 +00:00
Implement actual system time
libctru: osGetTime();
This commit is contained in:
parent
e3905cdfd8
commit
287d34621d
@ -3,6 +3,7 @@
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include <cstring>
|
||||
#include <ctime>
|
||||
|
||||
#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
|
||||
|
Loading…
Reference in New Issue
Block a user