2020-07-19 06:15:50 +02:00
|
|
|
#ifndef _MACROS_H_
|
|
|
|
#define _MACROS_H_
|
|
|
|
|
2020-09-22 23:36:30 +02:00
|
|
|
#ifndef SPLAT
|
2020-08-04 08:49:11 +02:00
|
|
|
#define INCLUDE_ASM(FOLDER, NAME, ARGS...) \
|
2020-08-17 19:44:41 +02:00
|
|
|
__attribute__((naked)) NAME(ARGS) { __asm__( ".include \"include/macro.inc\"\n.include \"asm/nonmatchings/"FOLDER"/"#NAME".s\"\n.set reorder\n.set at"); }
|
2020-09-22 23:36:30 +02:00
|
|
|
#define INCLUDE_ASM_T(TYPE, FOLDER, NAME, ARGS...) \
|
|
|
|
TYPE __attribute__((naked)) NAME(ARGS) { __asm__( ".include \"include/macro.inc\"\n.include \"asm/nonmatchings/"FOLDER"/"#NAME".s\"\n.set reorder\n.set at"); }
|
|
|
|
#else
|
2020-09-23 00:54:01 +02:00
|
|
|
#define INCLUDE_ASM(FOLDER, NAME, ARGS...)
|
|
|
|
#define INCLUDE_ASM_T(TYPE, FOLDER, NAME, ARGS...)
|
2020-09-22 23:36:30 +02:00
|
|
|
#endif
|
2020-07-19 06:15:50 +02:00
|
|
|
|
2020-08-09 04:17:37 +02:00
|
|
|
#define ARRAY_COUNT(arr) (s32)(sizeof(arr) / sizeof(arr[0]))
|
|
|
|
#define ARRAY_COUNTU(arr) (u32)(sizeof(arr) / sizeof(arr[0]))
|
2020-08-12 03:01:33 +02:00
|
|
|
|
2020-08-17 14:09:19 +02:00
|
|
|
#define ASSERT(condition) if (!(condition)) { while (1) {} }
|
2020-09-18 03:28:34 +02:00
|
|
|
#define PANIC() ASSERT(0)
|
2020-08-17 14:09:19 +02:00
|
|
|
|
2020-09-14 01:03:22 +02:00
|
|
|
#define GAME_STATUS (*gGameStatusPtr)
|
|
|
|
|
2020-09-11 22:29:52 +02:00
|
|
|
#define SQ(x) (x*x)
|
|
|
|
|
2020-08-12 03:01:33 +02:00
|
|
|
#endif
|