From cce651aabe5d00d45ca0a11055e278f40eb774cc Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Tue, 30 Jan 2018 17:54:25 -0500 Subject: match sub_8116100 --- include/global.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include/global.h') diff --git a/include/global.h b/include/global.h index d0af4a4d1..6dd772795 100644 --- a/include/global.h +++ b/include/global.h @@ -65,6 +65,15 @@ enum #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) +// Credits to Made (dolphin emoji) +#define S16TOPOSFLOAT(val) \ +({ \ + s16 v = (val); \ + float f = (float)v; \ + if(v < 0) f += 65536.0f; \ + f; \ +}) + enum { VERSION_SAPPHIRE = 1, -- cgit v1.2.3 From b9f8d43825463363a67be0ce9fcd00b23d264e05 Mon Sep 17 00:00:00 2001 From: Cameron Hall Date: Sat, 17 Feb 2018 15:32:57 -0600 Subject: decompile more debug code --- include/global.h | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) (limited to 'include/global.h') diff --git a/include/global.h b/include/global.h index 6dd772795..4b23fded7 100644 --- a/include/global.h +++ b/include/global.h @@ -734,9 +734,10 @@ struct Pokedex struct BattleTowerTrainer { - u8 trainerClass; - u8 name[8]; - u8 teamFlags; + /*0x00*/ u8 trainerClass; + /*0x01*/ u8 name[8]; + /*0x09*/ u8 teamFlags; + /*0x0C*/ struct { u16 easyChat[6]; } greeting; @@ -756,6 +757,7 @@ struct BattleTowerRecord // record mixing /*0xA0*/u32 checksum; }; +#if 0 struct BattleTowerEReaderTrainer { /*0x00*/u8 unk0; @@ -775,6 +777,21 @@ struct BattleTowerEReaderTrainer /*0x34*/struct UnknownPokemonStruct party[3]; /*0xB8*/u32 checksum; }; +#endif + +struct BattleTowerEReaderTrainer +{ + /*0x00*/ u8 unk0; + /*0x01*/ u8 trainerClass; + /*0x02*/ u16 winStreak; + /*0x04*/ u8 name[8]; + /*0x0C*/ u8 trainerId[4]; + /*0x10*/ u16 greeting[6]; + /*0x1C*/ u16 farewellPlayerLost[6]; + /*0x28*/ u16 farewellPlayerWon[6]; + /*0x34*/ struct UnknownPokemonStruct party[3]; + /*0xB8*/ u32 checksum; +}; struct BattleTowerData { @@ -831,7 +848,7 @@ struct MapPosition { s16 x; s16 y; - u8 height; + s8 height; }; struct UnkStruct_8054FF8 -- cgit v1.2.3 From 17a5968adbc1dfb6586641729b39eeb3873481df Mon Sep 17 00:00:00 2001 From: Cameron Hall Date: Sat, 17 Feb 2018 17:30:31 -0600 Subject: decompile more debug code --- include/global.h | 26 +------------------------- 1 file changed, 1 insertion(+), 25 deletions(-) (limited to 'include/global.h') diff --git a/include/global.h b/include/global.h index 4b23fded7..dcd20981e 100644 --- a/include/global.h +++ b/include/global.h @@ -740,7 +740,7 @@ struct BattleTowerTrainer /*0x0C*/ struct { u16 easyChat[6]; - } greeting; + } greeting[6]; }; struct BattleTowerRecord // record mixing @@ -757,28 +757,6 @@ struct BattleTowerRecord // record mixing /*0xA0*/u32 checksum; }; -#if 0 -struct BattleTowerEReaderTrainer -{ - /*0x00*/u8 unk0; - /*0x01*/u8 trainerClass; - /*0x02*/u16 winStreak; - /*0x04*/u8 name[8]; - /*0x0C*/u8 trainerId[4]; - /*0x10*/struct { - u16 easyChat[6]; - } greeting; - /*0x1C*/struct { - u16 easyChat[6]; - } farewellPlayerLost; - /*0x28*/struct { - u16 easyChat[6]; - } farewellPlayerWon; - /*0x34*/struct UnknownPokemonStruct party[3]; - /*0xB8*/u32 checksum; -}; -#endif - struct BattleTowerEReaderTrainer { /*0x00*/ u8 unk0; @@ -867,8 +845,6 @@ struct HallOfFame u8 filler[0x1F00]; }; -extern struct HallOfFame gHallOfFame; extern struct SaveBlock2 gSaveBlock2; -extern u8 ewram[]; #endif // GUARD_GLOBAL_H -- cgit v1.2.3 From 99befda409870bedc2120f3af0b84f3d6d55806b Mon Sep 17 00:00:00 2001 From: Cameron Hall Date: Sat, 17 Feb 2018 17:54:53 -0600 Subject: remove unnecessary struct in battle tower data --- include/global.h | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) (limited to 'include/global.h') diff --git a/include/global.h b/include/global.h index dcd20981e..ec82d5d1d 100644 --- a/include/global.h +++ b/include/global.h @@ -737,24 +737,20 @@ struct BattleTowerTrainer /*0x00*/ u8 trainerClass; /*0x01*/ u8 name[8]; /*0x09*/ u8 teamFlags; - /*0x0C*/ - struct { - u16 easyChat[6]; - } greeting[6]; + u8 filler0A[2]; + /*0x0C*/ u16 greeting[6]; }; struct BattleTowerRecord // record mixing { - /*0x00*/u8 battleTowerLevelType; // 0 = level 50, 1 = level 100 - /*0x01*/u8 trainerClass; - /*0x02*/u16 winStreak; - /*0x04*/u8 name[8]; - /*0x0C*/u8 trainerId[4]; - /*0x10*/struct { - u16 easyChat[6]; - } greeting; - /*0x1C*/struct UnknownPokemonStruct party[3]; - /*0xA0*/u32 checksum; + /*0x00*/ u8 battleTowerLevelType; // 0 = level 50, 1 = level 100 + /*0x01*/ u8 trainerClass; + /*0x02*/ u16 winStreak; + /*0x04*/ u8 name[8]; + /*0x0C*/ u8 trainerId[4]; + /*0x10*/ u16 greeting[6]; + /*0x1C*/ struct UnknownPokemonStruct party[3]; + /*0xA0*/ u32 checksum; }; struct BattleTowerEReaderTrainer -- cgit v1.2.3 From 583724758e97fafc8e6796f13d2c46660d6f4388 Mon Sep 17 00:00:00 2001 From: Marcus Huderle Date: Mon, 19 Mar 2018 21:18:06 -0700 Subject: Label and use constants for weather cycle logic --- 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 ec82d5d1d..faa4ace68 100644 --- a/include/global.h +++ b/include/global.h @@ -632,7 +632,7 @@ struct SaveBlock1 /* 0x02025734 */ /*0x24*/ struct WarpData warp4; /*0x2C*/ u16 savedMusic; /*0x2E*/ u8 weather; - /*0x2F*/ u8 filler_2F; + /*0x2F*/ u8 weatherCycleStage; /*0x30*/ u8 flashLevel; // flash level on current map, 0 being normal and 4 being the darkest /*0x32*/ u16 mapDataId; /*0x34*/ u16 mapView[0x100]; -- cgit v1.2.3