2023-10-13 10:50:53 +03:00
|
|
|
#ifndef MACROS_H
|
|
|
|
#define MACROS_H
|
|
|
|
|
2023-11-13 19:18:43 +03:00
|
|
|
#define SCREEN_WIDTH 320
|
|
|
|
#define SCREEN_HEIGHT 240
|
|
|
|
|
2023-11-16 05:14:33 +03:00
|
|
|
#define SEGMENTED_TO_VIRTUAL(segment) ((void*)OS_PHYSICAL_TO_K0(gSegments[((uintptr_t)(segment)<<4)>>0x1C]+(((uintptr_t)(segment))&0xFFFFFF)))
|
|
|
|
|
2023-10-16 19:32:12 +03:00
|
|
|
#define ARRAY_COUNT(arr) (s32)(sizeof(arr) / sizeof(arr[0]))
|
2023-10-17 23:43:47 +03:00
|
|
|
#define SQ(x) ((x) * (x))
|
2023-10-13 10:50:53 +03:00
|
|
|
|
2023-11-16 05:14:33 +03:00
|
|
|
#define VEC3F_SQ(vec) (SQ((vec).x) + SQ((vec).y) + SQ((vec).z))
|
|
|
|
|
2023-11-08 01:32:09 +03:00
|
|
|
#define USEC_TO_CYCLES(n) (((u64)(n)*(osClockRate/15625LL))/(1000000LL/15625LL))
|
|
|
|
#define MSEC_TO_CYCLES(n) (USEC_TO_CYCLES((n) * 1000LL))
|
|
|
|
|
2023-10-13 12:19:10 +03:00
|
|
|
#endif // MACROS_H
|