summaryrefslogtreecommitdiff
path: root/include/global.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/global.h')
-rw-r--r--include/global.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/include/global.h b/include/global.h
index 33a31bf4d..e3792ac56 100644
--- a/include/global.h
+++ b/include/global.h
@@ -61,6 +61,12 @@
#define min(a, b) ((a) < (b) ? (a) : (b))
#define max(a, b) ((a) >= (b) ? (a) : (b))
+// Extracts the upper 16 bits of a 32-bit number
+#define HIHALF(n) (((n) & 0xFFFF0000) >> 16)
+
+// Extracts the lower 16 bits of a 32-bit number
+#define LOHALF(n) ((n) & 0xFFFF)
+
// 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
@@ -230,7 +236,7 @@ struct Time
struct Pokedex
{
/*0x00*/ u8 order;
- /*0x01*/ u8 unknown1;
+ /*0x01*/ u8 mode;
/*0x02*/ u8 nationalMagic; // must equal 0xDA in order to have National mode
/*0x03*/ u8 unknown2;
/*0x04*/ u32 unownPersonality; // set when you first see Unown
@@ -301,7 +307,7 @@ struct Apprentice
u32 checksum;
};
-struct UnknownPokemonStruct
+struct BattleTowerPokemon
{
u16 species;
u16 heldItem;
@@ -338,7 +344,7 @@ struct EmeraldBattleTowerRecord
/*0x10*/ u16 greeting[6];
/*0x1C*/ u16 speechWon[6];
/*0x28*/ u16 speechLost[6];
- /*0x34*/ struct UnknownPokemonStruct party[4];
+ /*0x34*/ struct BattleTowerPokemon party[4];
/*0xE4*/ u8 language;
/*0xE8*/ u32 checksum;
};
@@ -353,7 +359,7 @@ struct BattleTowerEReaderTrainer
/*0x10*/ u16 greeting[6];
/*0x1C*/ u16 farewellPlayerLost[6];
/*0x28*/ u16 farewellPlayerWon[6];
- /*0x34*/ struct UnknownPokemonStruct party[3];
+ /*0x34*/ struct BattleTowerPokemon party[3];
/*0xB8*/ u32 checksum;
};