diff options
author | Marcus Huderle <huderlem@gmail.com> | 2017-11-11 13:20:03 -0800 |
---|---|---|
committer | Marcus Huderle <huderlem@gmail.com> | 2017-11-11 13:20:03 -0800 |
commit | 92fda2cc0d5afa76e94927cb72ceac9700f54c1b (patch) | |
tree | 24a7840f1c49602a6ad033ea6cc1cb27b7e12be4 /include/global.h | |
parent | 955c5a8e90c9afba35114c583628f74f849a0da4 (diff) | |
parent | 999c4d59793e761ca71ab7b27272de46d78de138 (diff) |
Merge remote-tracking branch 'upstream/master' into pokenav
Diffstat (limited to 'include/global.h')
-rw-r--r-- | include/global.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/include/global.h b/include/global.h index 29804a5a9..647f66bc8 100644 --- a/include/global.h +++ b/include/global.h @@ -55,6 +55,24 @@ enum B_32 = 4 }; +// There are many quirks in the source code which have overarching behavioral differences from +// a number of other files. For example, diploma.c seems to declare rodata before each use while +// other files declare out of order and must be at the beginning. There are also a number of +// macros which differ from one file to the next due to the method of obtaining the result, such +// as these below. Because of this, there is a theory (Two Team Theory) that states that these +// programming projects had more than 1 "programming team" which utilized different macros for +// each of the files that were worked on. +#define T1_READ_8(ptr) ((ptr)[0]) +#define T1_READ_16(ptr) ((ptr)[0] | ((ptr)[1] << 8)) +#define T1_READ_32(ptr) ((ptr)[0] | ((ptr)[1] << 8) | ((ptr)[2] << 16) | ((ptr)[3] << 24)) +#define T1_READ_PTR(ptr) (u8*) T1_READ_32(ptr) + +// T2_READ_8 is a duplicate to remain consistent with each group. +#define T2_READ_8(ptr) ((ptr)[0]) +#define T2_READ_16(ptr) ((ptr)[0] + ((ptr)[1] << 8)) +#define T2_READ_32(ptr) ((ptr)[0] + ((ptr)[1] << 8) + ((ptr)[2] << 16) + ((ptr)[3] << 24)) +#define T2_READ_PTR(ptr) (void*) T2_READ_32(ptr) + enum { VERSION_SAPPHIRE = 1, |