summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDizzyEggg <jajkodizzy@wp.pl>2017-11-29 19:54:15 +0100
committerDizzyEggg <jajkodizzy@wp.pl>2017-11-29 19:54:15 +0100
commite8ecb01ab2f7d7e67a525621e6ea7ada08c52952 (patch)
tree9764a85781bb0d70d0259d870e18085fb1189bf2 /include
parent10470ef536132c317f0c478e42ad37657a0f00aa (diff)
more work on battle setup
Diffstat (limited to 'include')
-rw-r--r--include/global.h23
-rw-r--r--include/vars.h3
2 files changed, 23 insertions, 3 deletions
diff --git a/include/global.h b/include/global.h
index f3ec9ce33..8e936aa8c 100644
--- a/include/global.h
+++ b/include/global.h
@@ -36,6 +36,24 @@ extern u8 gStringVar2[];
extern u8 gStringVar3[];
extern u8 gStringVar4[];
+// 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,
@@ -45,7 +63,8 @@ enum
VERSION_LEAF_GREEN = 5,
};
-enum LanguageId {
+enum LanguageId
+{
LANGUAGE_JAPANESE = 1,
LANGUAGE_ENGLISH = 2,
LANGUAGE_GERMAN = 5,
@@ -240,7 +259,7 @@ struct SaveBlock2
/*0xCA9*/ u8 field_CA9_f : 1; // 0x80
/*0xCAA*/ u16 field_CAA[4];
/*0xCB2*/ u16 battlePyramidWildHeaderId;
- /*0xCB4*/ u8 field_CB4[82];
+ /*0xCB4*/ u16 field_CB4[82];
/*0xD06*/ u8 field_D06;
/*0xD07*/ u8 field_D07;
/*0xD08*/ u8 filler_D08[0x112];
diff --git a/include/vars.h b/include/vars.h
index 0851ad700..bc3f2ab1f 100644
--- a/include/vars.h
+++ b/include/vars.h
@@ -21,7 +21,7 @@
#define VAR_RECYCLE_GOODS 0x4020
#define VAR_REPEL_STEP_COUNT 0x4021
#define VAR_ICE_STEP_COUNT 0x4022
-#define VAR_FIRST_POKE 0x4023
+#define VAR_STARTER_ID 0x4023
#define VAR_MIRAGE_RND_H 0x4024
#define VAR_MIRAGE_RND_L 0x4025
#define VAR_SECRET_BASE_MAP 0x4026
@@ -58,6 +58,7 @@
#define VAR_0x40BC 0x40BC
#define VAR_0x40C2 0x40C2
+#define VAR_0x40CE 0x40CE
#define VAR_FRONTIER_FACILITY 0x40CF
#define VAR_DAILY_SLOTS 0x40E6