2017-12-11 06:41:46 +00:00
|
|
|
#ifndef GUARD_GLOBAL_H
|
|
|
|
#define GUARD_GLOBAL_H
|
|
|
|
|
2018-01-21 19:57:28 +00:00
|
|
|
#include <string.h>
|
2017-12-11 06:41:46 +00:00
|
|
|
#include "gba/gba.h"
|
|
|
|
|
|
|
|
// IDE support
|
2018-01-21 19:57:28 +00:00
|
|
|
#if defined(__APPLE__) || defined(__CYGWIN__)
|
2017-12-11 06:41:46 +00:00
|
|
|
#define _(x) x
|
|
|
|
#define __(x) x
|
|
|
|
#define INCBIN_U8 {0}
|
|
|
|
#define INCBIN_U16 {0}
|
|
|
|
#define INCBIN_U32 {0}
|
|
|
|
#define INCBIN_S8 {0}
|
|
|
|
#define INCBIN_S16 {0}
|
|
|
|
#define INCBIN_S32 {0}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// Prevent cross-jump optimization.
|
|
|
|
#define BLOCK_CROSS_JUMP asm("");
|
|
|
|
|
|
|
|
// to help in decompiling
|
|
|
|
#define asm_comment(x) asm volatile("@ -- " x " -- ")
|
|
|
|
|
|
|
|
#define asm_unified(x) asm(".syntax unified\n" x "\n.syntax divided\n")
|
|
|
|
|
2018-11-21 10:48:01 +00:00
|
|
|
#define NAKED __attribute__((naked))
|
|
|
|
|
2017-12-11 06:41:46 +00:00
|
|
|
#define ARRAY_COUNT(array) (sizeof(array) / sizeof((array)[0]))
|
|
|
|
|
|
|
|
#endif // GUARD_GLOBAL_H
|