From 6ecfa94ffb3d8c9ed8548c573a2ec1c1ef9357a4 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Tue, 30 Jan 2018 16:30:08 -0500 Subject: Remove some explicit calls to memcpy in matsuda_debug_menu; label fields in ContestPokemon --- include/contest.h | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) (limited to 'include') diff --git a/include/contest.h b/include/contest.h index b0bdd7f61..557b9e5c4 100644 --- a/include/contest.h +++ b/include/contest.h @@ -43,17 +43,13 @@ struct ContestPokemon /*0x02*/ u8 nickname[POKEMON_NAME_LENGTH + 1]; /*0x0D*/ u8 trainerName[8]; /*0x15*/ u8 trainerGfxId; - /*0x16*/ u8 unk16; - /*0x17*/ u8 filler17; /*0x18*/ u32 flags; - /*0x1C*/ u8 unk1C_0:2; - u8 unk1C_2:1; - u8 unk1C_3:1; - u8 unk1C_4:1; - u8 unk1C_5:1; - u8 unk1C_6:1; - u8 unk1C_7:1; - u8 filler1D; + /*0x1C*/ u8 whichRank:2; + u8 aiPool_Cool:1; + u8 aiPool_Beauty:1; + u8 aiPool_Cute:1; + u8 aiPool_Smart:1; + u8 aiPool_Tough:1; /*0x1E*/ u16 moves[4]; // moves /*0x26*/ u8 cool; // cool /*0x27*/ u8 beauty; // beauty @@ -61,8 +57,7 @@ struct ContestPokemon /*0x29*/ u8 smart; // smart /*0x2A*/ u8 tough; // tough /*0x2B*/ u8 sheen; // sheen - /*0x2C*/ u8 unk2C; - /*0x2D*/ u8 unk2D[11]; + /*0x2C*/ u8 unk2C[12]; /*0x38*/ u32 personality; // personality /*0x3C*/ u32 otId; // otId }; // wow -- cgit v1.2.3 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') 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 9776f51f0643a8d988fcd5fc2ac404a7ea285235 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sat, 3 Feb 2018 09:18:12 -0500 Subject: Declare gBagPockets as non-const in item.c for the sake of getting AddBagItem to match without the NONMATCHING define --- include/item.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'include') diff --git a/include/item.h b/include/item.h index 8f6cc883b..bafa8a3fd 100644 --- a/include/item.h +++ b/include/item.h @@ -30,8 +30,6 @@ struct BagPocket #define NUM_BAG_POCKETS 5 -extern const struct BagPocket gBagPockets[NUM_BAG_POCKETS]; - void CopyItemName(u16 itemId, u8 *string); bool8 IsBagPocketNonEmpty(u8 pocket); bool8 CheckBagHasItem(u16 itemId, u16 count); -- cgit v1.2.3