From 4c23adb5f53a61d0e7426376aba9a04de5c8f2b3 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Sat, 8 Dec 2018 19:05:03 +0100 Subject: Decompile field weather --- include/global.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/global.h') diff --git a/include/global.h b/include/global.h index cc8df049f..83eb93eec 100644 --- a/include/global.h +++ b/include/global.h @@ -881,7 +881,7 @@ struct SaveBlock1 /*0x24*/ struct WarpData warp4; /*0x2C*/ u16 savedMusic; /*0x2E*/ u8 weather; - /*0x2F*/ u8 filler_2F; + /*0x2F*/ u8 weatherCycleStage; /*0x30*/ u8 flashLevel; /*0x32*/ u16 mapLayoutId; /*0x34*/ u16 mapView[0x100]; -- cgit v1.2.3 From a7722a0b936132527ff0bf8fd8213ab0bbd25e44 Mon Sep 17 00:00:00 2001 From: Marcus Huderle Date: Sun, 9 Dec 2018 13:41:52 -0600 Subject: Decompile cable_car.c (#438) --- include/global.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'include/global.h') diff --git a/include/global.h b/include/global.h index 83eb93eec..33a31bf4d 100644 --- a/include/global.h +++ b/include/global.h @@ -79,6 +79,14 @@ #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) +#define S16TOPOSFLOAT(val) \ +({ \ + s16 v = (val); \ + float f = (float)v; \ + if(v < 0) f += 65536.0f; \ + f; \ +}) + // Invalid Versions show as "----------" in Gen 4 and Gen 5's summary screen. // In Gens 6 and 7, invalid versions instead show "a distant land" in the summary screen. // In Gen 4 only, migrated Pokemon with Diamond, Pearl, or Platinum's ID show as "----------". -- cgit v1.2.3 From 68017b531a47bce7c125eea617a701a89013c983 Mon Sep 17 00:00:00 2001 From: Meowsy Date: Mon, 10 Dec 2018 15:49:33 -0500 Subject: Rename UnknownPokemonStruct to BattleTowerPokemon. --- include/global.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include/global.h') diff --git a/include/global.h b/include/global.h index 33a31bf4d..97625c890 100644 --- a/include/global.h +++ b/include/global.h @@ -301,7 +301,7 @@ struct Apprentice u32 checksum; }; -struct UnknownPokemonStruct +struct BattleTowerPokemon { u16 species; u16 heldItem; @@ -338,7 +338,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 +353,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; }; -- cgit v1.2.3 From 2c6849bee81f2c05cbf0df1f88c6d5460e7b1e2d Mon Sep 17 00:00:00 2001 From: Marcus Huderle Date: Thu, 13 Dec 2018 21:33:54 -0600 Subject: Decompile battle_anim_8170478.c (#445) --- include/global.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include/global.h') diff --git a/include/global.h b/include/global.h index 33a31bf4d..58b338f9e 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 -- cgit v1.2.3 From bc11a4a9f4233ce5795f5181729862b26d899f60 Mon Sep 17 00:00:00 2001 From: Meowsy Date: Sat, 15 Dec 2018 15:12:28 -0500 Subject: Document various things relating to the Pokedex. --- include/global.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/global.h') diff --git a/include/global.h b/include/global.h index 33a31bf4d..8395d5943 100644 --- a/include/global.h +++ b/include/global.h @@ -230,7 +230,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 -- cgit v1.2.3