Compare commits

...

1 Commits

Author SHA1 Message Date
devin
cdf39d5d94 net: link nettime (genuine implementation, objdiff 100%)
Co-Authored-By: wch <usernamecole7@gmail.com>
2026-09-29 04:37:48 +00:00
2 changed files with 34 additions and 1 deletions

View File

@@ -1041,7 +1041,7 @@ config.libs = [
]
),
RevoEXLib("net", [
Object(NonMatching, "net/nettime.c"),
Object(Matching, "net/nettime.c"),
Object(Matching, "net/crc.c"),
Object(NonMatching, "net/md5.c"),
Object(NonMatching, "net/sha1.c"),

View File

@@ -0,0 +1,33 @@
#include <revolution/net.h>
#include <private/nwc24.h>
#include <private/os.h>
#include <revolution/NWC24.h>
#include <revolution/OS.h>
NWC24Err NWC24iEpochSecondsToDate(NWC24Date* date, OSTime time);
NWC24Err NWC24iDateToOSCalendarTime(OSCalendarTime* cal, const NWC24Date* date);
BOOL NETGetUniversalCalendar(OSCalendarTime* pTime) {
static s64 whenCached = 0;
NWC24Date date;
s64 universalTime;
if (whenCached == 0 ||
whenCached + OSSecondsToTicks(60) < __OSGetSystemTime()) {
NWC24iSynchronizeRtcCounter(FALSE);
whenCached = __OSGetSystemTime();
}
if (NWC24iGetUniversalTime(&universalTime) >= 0 &&
NWC24iEpochSecondsToDate(&date, universalTime) >= 0 &&
NWC24iDateToOSCalendarTime(pTime, &date) >= 0) {
return TRUE;
}
OSTicksToCalendarTime(OSGetTime(), pTime);
return FALSE;
}