diff options
author | YamaArashi <shadow962@live.com> | 2016-09-25 01:43:12 -0700 |
---|---|---|
committer | YamaArashi <shadow962@live.com> | 2016-09-25 01:43:12 -0700 |
commit | fd0e633b7961b4790390f3c335a1af88d1db2f19 (patch) | |
tree | b3d3136b35961f6b65720953b3966999c2d4d962 | |
parent | e5fd0e3e1b6bbbc4d506be9e450d85281c10c516 (diff) |
remove common variable workaround macros
-rw-r--r-- | include/gba/defines.h | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/include/gba/defines.h b/include/gba/defines.h index f3fa53496..0f7f06755 100644 --- a/include/gba/defines.h +++ b/include/gba/defines.h @@ -11,25 +11,6 @@ #define ALIGNED(n) __attribute__((aligned(n))) -// The original build process placed COMMON data (i.e. uninitialized globals) -// in IWRAM after the static variables. -// When ld places COMMON variables in the output, it aligns the variable -// according to the size of the variable, with a maximum alignment of 16. This -// results in large alignment values. -// Initialized variables are aligned according to the size of the largest -// primitive type in the object, so their alignment will often be smaller. -// However, we cannot use COMMON data in pokeruby because the order of COMMON -// data in the output is not reliable. Instead, we need to initialize the -// variables so that their order in the source file is preserved in the output. -// But using initialized variables brings us into conflict with those large -// alignment values. -// These macros allow us to get around this by manually specifying what the -// alignment would be if the variable were uninitialized. -#define COMM(decl, n) IWRAM_DATA ALIGNED(1 << n) decl = {0}; -#define COMM_2(decl) COMM(decl, 2) -#define COMM_3(decl) COMM(decl, 3) -#define COMM_4(decl) COMM(decl, 4) - #define SOUND_INFO_PTR (*(struct SoundInfo **)0x3007FF0) #define INTR_CHECK (*(u16 *)0x3007FF8) #define INTR_VECTOR (*(void **)0x3007FFC) |