sotn-decomp/include/common.h

37 lines
787 B
C
Raw Normal View History

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
#define VERSION "us"
2023-05-04 22:32:35 +00:00
#elif defined(_internal_version_hd)
#define VERSION_HD
#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
#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-04 01:26:05 +00:00
#define LOH(x) (*(s16*)&(x))
2023-05-27 10:13:49 +00:00
#define LOW(x) (*(s32*)&(x))
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
int sprintf(char* dst, const char* fmt, ...);
2022-01-01 17:45:41 +00:00
#endif