WUT  0.1
Wii U Toolchain
time.h
Go to the documentation of this file.
1 #pragma once
2 #include <wut.h>
3 
10 #ifdef __cplusplus
11 extern "C" {
12 #endif
13 
15 
16 typedef int32_t OSTick;
17 typedef int64_t OSTime;
18 
20 {
21  int32_t tm_sec;
22  int32_t tm_min;
23  int32_t tm_hour;
24  int32_t tm_mday;
25  int32_t tm_mon;
26  int32_t tm_year;
27 };
28 CHECK_OFFSET(OSCalendarTime, 0x00, tm_sec);
29 CHECK_OFFSET(OSCalendarTime, 0x04, tm_min);
30 CHECK_OFFSET(OSCalendarTime, 0x08, tm_hour);
31 CHECK_OFFSET(OSCalendarTime, 0x0C, tm_mday);
32 CHECK_OFFSET(OSCalendarTime, 0x10, tm_mon);
33 CHECK_OFFSET(OSCalendarTime, 0x14, tm_year);
34 CHECK_SIZE(OSCalendarTime, 0x18);
35 
36 #define OSOneSecond ((OSGetSystemInfo()->clockSpeed) / 4)
37 #define OSMilliseconds(val) ((((uint64_t)(val)) * (uint64_t)(OSOneSecond)) / 1000ull)
38 #define OSMicroseconds(val) ((((uint64_t)(val)) * (uint64_t)(OSOneSecond)) / 1000000ull)
39 #define OSNanoseconds(val) ((((uint64_t)(val)) * (uint64_t)(OSOneSecond)) / 1000000000ull)
40 
41 OSTime
42 OSGetTime();
43 
44 OSTime
46 
47 OSTick
48 OSGetTick();
49 
50 OSTick
52 
53 OSTime
55 
56 void
57 OSTicksToCalendarTime(OSTime time,
58  OSCalendarTime *calendarTime);
59 
60 #ifdef __cplusplus
61 }
62 #endif
63 
OSTick OSGetTick()
int64_t OSTime
Definition: time.h:17
int32_t tm_sec
Definition: time.h:21
int32_t tm_hour
Definition: time.h:23
OSTime OSCalendarTimeToTicks(OSCalendarTime *calendarTime)
int32_t tm_mday
Definition: time.h:24
OSTime OSGetTime()
void OSTicksToCalendarTime(OSTime time, OSCalendarTime *calendarTime)
OSTick OSGetSystemTick()
int32_t tm_min
Definition: time.h:22
OSTime OSGetSystemTime()
int32_t OSTick
Definition: time.h:16
int32_t tm_mon
Definition: time.h:25
int32_t tm_year
Definition: time.h:26