Starship/include/macros.h
petrie911 3fbfdf01d2
names and namespaces cleaned up (#23)
* threads galore

* something's up

* try this

* I don't even

* who knows

* I can't stop it

* let's try data for fun

* ok I think I've gone far enough

* well maybe a little more

* visual assets somewhat documented

* just keeps going

* forgot formatting

* let
's try bss

* too much?

* one fix

* even more things

* one quick thing

* oh come on

* graph complete?

* format and such

* decomp and such

* small cleanup

* 6 and such

* more overlay fixes

* more of them

* again

* and done
2023-11-15 23:14:33 -03:00

18 lines
544 B
C

#ifndef MACROS_H
#define MACROS_H
#define SCREEN_WIDTH 320
#define SCREEN_HEIGHT 240
#define SEGMENTED_TO_VIRTUAL(segment) ((void*)OS_PHYSICAL_TO_K0(gSegments[((uintptr_t)(segment)<<4)>>0x1C]+(((uintptr_t)(segment))&0xFFFFFF)))
#define ARRAY_COUNT(arr) (s32)(sizeof(arr) / sizeof(arr[0]))
#define SQ(x) ((x) * (x))
#define VEC3F_SQ(vec) (SQ((vec).x) + SQ((vec).y) + SQ((vec).z))
#define USEC_TO_CYCLES(n) (((u64)(n)*(osClockRate/15625LL))/(1000000LL/15625LL))
#define MSEC_TO_CYCLES(n) (USEC_TO_CYCLES((n) * 1000LL))
#endif // MACROS_H