From 623661a39ccb5da33288e71a7a9f407db8dde44d Mon Sep 17 00:00:00 2001 From: James Benton Date: Sun, 9 Oct 2016 20:36:33 +0100 Subject: [PATCH] coreinit: Move time macros from systeminfo.h to time.h --- include/coreinit/systeminfo.h | 4 ---- include/coreinit/time.h | 5 +++++ 2 files changed, 5 insertions(+), 4 deletions(-) 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();