diff --git a/include/coreinit/systeminfo.h b/include/coreinit/systeminfo.h index 2b840fd..00c7ab9 100644 --- a/include/coreinit/systeminfo.h +++ b/include/coreinit/systeminfo.h @@ -25,10 +25,6 @@ CHECK_OFFSET(OSSystemInfo, 0x0, clockSpeed); CHECK_OFFSET(OSSystemInfo, 0x8, baseTime); CHECK_SIZE(OSSystemInfo, 0x20); - -#define OSOneSecond ((OSGetSystemInfo()->clockSpeed) / 4) -#define OSMilliseconds(val) ((((uint64_t)(val)) * (uint64_t)(OSOneSecond)) / 1000ull) - OSSystemInfo * OSGetSystemInfo(); diff --git a/include/coreinit/time.h b/include/coreinit/time.h index ac868ff..aed728d 100644 --- a/include/coreinit/time.h +++ b/include/coreinit/time.h @@ -33,6 +33,11 @@ CHECK_OFFSET(OSCalendarTime, 0x10, tm_mon); CHECK_OFFSET(OSCalendarTime, 0x14, tm_year); CHECK_SIZE(OSCalendarTime, 0x18); +#define OSOneSecond ((OSGetSystemInfo()->clockSpeed) / 4) +#define OSMilliseconds(val) ((((uint64_t)(val)) * (uint64_t)(OSOneSecond)) / 1000ull) +#define OSMicroseconds(val) ((((uint64_t)(val)) * (uint64_t)(OSOneSecond)) / 1000000ull) +#define OSNanoseconds(val) ((((uint64_t)(val)) * (uint64_t)(OSOneSecond)) / 1000000000ull) + OSTime OSGetTime();