2022-01-01 17:45:41 +00:00
|
|
|
#ifndef COMMON_H
|
|
|
|
#define COMMON_H
|
|
|
|
|
|
|
|
#include "include_asm.h"
|
2022-10-15 22:17:26 +00:00
|
|
|
#include "macros.h"
|
2023-05-09 11:49:20 +00:00
|
|
|
#include "settings.h"
|
2022-01-01 17:45:41 +00:00
|
|
|
#include "types.h"
|
|
|
|
|
2023-05-04 22:32:35 +00:00
|
|
|
#if defined(_internal_version_us)
|
|
|
|
#define VERSION_US
|
2023-06-12 18:59:48 +00:00
|
|
|
#define VERSION "us"
|
2023-05-04 22:32:35 +00:00
|
|
|
#elif defined(_internal_version_hd)
|
|
|
|
#define VERSION_HD
|
2023-06-12 18:59:48 +00:00
|
|
|
#define VERSION "hd"
|
2023-05-04 22:32:35 +00:00
|
|
|
#else
|
|
|
|
#warning "Version not specified. Falling back to the US version."
|
|
|
|
#define VERSION_US
|
2023-06-12 18:59:48 +00:00
|
|
|
#define VERSION "us"
|
2023-05-04 22:32:35 +00:00
|
|
|
#endif
|
|
|
|
|
2023-03-24 12:42:41 +00:00
|
|
|
#define LEN(x) ((s32)(sizeof(x) / sizeof(*(x))))
|
|
|
|
#define LENU(x) ((u32)(sizeof(x) / sizeof(*(x))))
|
2023-03-28 12:14:13 +00:00
|
|
|
#define STRCPY(dst, src) __builtin_memcpy(dst, src, sizeof(src))
|
2023-03-24 12:29:18 +00:00
|
|
|
|
2023-03-04 01:26:05 +00:00
|
|
|
#define LOH(x) (*(s16*)&(x))
|
2023-07-06 11:20:53 +00:00
|
|
|
#define LOHU(x) (*(u16*)&(x))
|
2023-05-27 10:13:49 +00:00
|
|
|
#define LOW(x) (*(s32*)&(x))
|
2023-07-06 11:20:53 +00:00
|
|
|
#define LOWU(x) (*(u32*)&(x))
|
2023-05-27 10:13:49 +00:00
|
|
|
|
2023-03-13 01:43:07 +00:00
|
|
|
#if defined(HACKS) && !defined(PERMUTER)
|
2023-03-12 00:13:28 +00:00
|
|
|
#define ALIGNED4 __attribute__((aligned(4)))
|
2023-03-12 00:11:04 +00:00
|
|
|
#else
|
|
|
|
#define ALIGNED4
|
|
|
|
#endif
|
2023-03-04 01:26:05 +00:00
|
|
|
|
2022-12-22 10:32:56 +00:00
|
|
|
int sprintf(char* dst, const char* fmt, ...);
|
|
|
|
|
2023-08-05 18:36:00 +00:00
|
|
|
#define FIX(x) ((s32)((x)*65536.0))
|
2023-08-08 17:12:53 +00:00
|
|
|
#define FIX_TO_I(x) ((s32)((x) >> 16))
|
2023-07-30 16:44:26 +00:00
|
|
|
|
2022-01-01 17:45:41 +00:00
|
|
|
#endif
|