mirror of
https://github.com/zeldaret/tp
synced 2026-06-13 05:57:09 -04:00
Match dvdlow Read and extract repeating code to __setAlarm
This commit is contained in:
@@ -38,23 +38,6 @@ extern "C" {
|
||||
#define OS_BASE_CACHED (OS_CACHED_REGION_PREFIX << 16)
|
||||
#define OS_BASE_UNCACHED (OS_UNCACHED_REGION_PREFIX << 16)
|
||||
|
||||
extern u32 __OSBusClock : 0x800000F8;
|
||||
|
||||
#define OS_BUS_CLOCK (__OSBusClock)
|
||||
#define OS_CORE_CLOCK (*(u32*)0x800000FC)
|
||||
#define OS_TIMER_CLOCK (OS_BUS_CLOCK / 4)
|
||||
#define OS_TIMER_CLOCK_MS (OS_TIMER_CLOCK / 1000)
|
||||
|
||||
#define OSTicksToCycles(ticks) (((ticks) * ((OS_CORE_CLOCK * 2) / OS_TIMER_CLOCK)) / 2)
|
||||
#define OSTicksToSeconds(ticks) ((ticks) / OS_TIMER_CLOCK)
|
||||
#define OSTicksToMilliseconds(ticks) ((ticks) / (OS_TIMER_CLOCK / 1000))
|
||||
#define OSTicksToMicroseconds(ticks) (((ticks)*8) / (OS_TIMER_CLOCK / 125000))
|
||||
#define OSTicksToNanoseconds(ticks) (((ticks)*8000) / (OS_TIMER_CLOCK / 125000))
|
||||
#define OSSecondsToTicks(sec) ((sec)*OS_TIMER_CLOCK)
|
||||
#define OSMillisecondsToTicks(msec) ((msec) * (OS_TIMER_CLOCK / 1000))
|
||||
#define OSMicrosecondsToTicks(usec) (((usec) * (OS_TIMER_CLOCK / 125000)) / 8)
|
||||
#define OSNanosecondsToTicks(nsec) (((nsec) * (OS_TIMER_CLOCK / 125000)) / 8000)
|
||||
|
||||
#define OS_MESSAGE_NON_BLOCKING 0
|
||||
#define OS_MESSAGE_BLOCKING 1
|
||||
|
||||
|
||||
@@ -32,6 +32,23 @@ OSTime __OSTimeToSystemTime(OSTime time);
|
||||
void GetDates(s32 days, OSCalendarTime* ct);
|
||||
void OSTicksToCalendarTime(OSTime ticks, OSCalendarTime* ct);
|
||||
|
||||
extern u32 __OSBusClock : 0x800000F8;
|
||||
|
||||
#define OS_BUS_CLOCK (__OSBusClock)
|
||||
#define OS_CORE_CLOCK (*(u32*)0x800000FC)
|
||||
#define OS_TIMER_CLOCK (OS_BUS_CLOCK / 4)
|
||||
#define OS_TIMER_CLOCK_MS (OS_TIMER_CLOCK / 1000)
|
||||
|
||||
#define OSTicksToCycles(ticks) (((ticks) * ((OS_CORE_CLOCK * 2) / OS_TIMER_CLOCK)) / 2)
|
||||
#define OSTicksToSeconds(ticks) ((ticks) / OS_TIMER_CLOCK)
|
||||
#define OSTicksToMilliseconds(ticks) ((ticks) / (OS_TIMER_CLOCK / 1000))
|
||||
#define OSTicksToMicroseconds(ticks) (((ticks)*8) / (OS_TIMER_CLOCK / 125000))
|
||||
#define OSTicksToNanoseconds(ticks) (((ticks)*8000) / (OS_TIMER_CLOCK / 125000))
|
||||
#define OSSecondsToTicks(sec) ((sec)*OS_TIMER_CLOCK)
|
||||
#define OSMillisecondsToTicks(msec) ((msec) * (OS_TIMER_CLOCK / 1000))
|
||||
#define OSMicrosecondsToTicks(usec) (((usec) * (OS_TIMER_CLOCK / 125000)) / 8)
|
||||
#define OSNanosecondsToTicks(nsec) (((nsec) * (OS_TIMER_CLOCK / 125000)) / 8000)
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user