From fa136a7ffbdeee5f8e1174b2d36c2e34c653a08a Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Mon, 18 Dec 2017 21:36:26 -0600 Subject: decompile sub_80AF438 - unref_sub_80B01B0 --- include/global.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include/global.h') diff --git a/include/global.h b/include/global.h index 6670f3837..620806d1a 100644 --- a/include/global.h +++ b/include/global.h @@ -41,8 +41,8 @@ fndec\ #define POKEMON_NAME_LENGTH 10 #define OT_NAME_LENGTH 7 -#define min(a, b) (a >= b ? a : b) -#define max(a, b) (a <= b ? a : b) +#define min(a, b) ((a) <= (b) ? (a) : (b)) +#define max(a, b) ((a) >= (b) ? (a) : (b)) // why does GF hate 2d arrays #define MULTI_DIM_ARR(x, dim, y) ((x) * dim + (y)) -- cgit v1.2.3 From 71d3e605290b2069d3571478a3736b04d658decb Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Fri, 22 Dec 2017 00:22:48 -0600 Subject: save work --- include/global.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'include/global.h') diff --git a/include/global.h b/include/global.h index 620806d1a..330e047fd 100644 --- a/include/global.h +++ b/include/global.h @@ -632,6 +632,16 @@ struct RecordMixingGift struct RecordMixingGiftData data; }; +struct ContestWinner +{ + /*0x00*/ u32 unk0; // personality + /*0x04*/ u32 unk4; // otId + /*0x08*/ u16 unk8; // species + /*0x0A*/ u8 unkA; + /*0x0B*/ u8 unkB[0x16-0xB]; + /*0x16*/ u8 unk16[0x20-0x16]; +}; + // there should be enough flags for all 412 slots // each slot takes up 8 flags // if the value is not divisible by 8, we need to account for the reminder as well @@ -710,8 +720,14 @@ struct SaveBlock1 /* 0x02025734 */ /*0x2D90*/ u8 filler_2D90[0x4]; /*0x2D94*/ union MauvilleMan mauvilleMan; /*0x2DD4*/ struct EasyChatPair easyChatPairs[5]; //Dewford trend [0] and some other stuff +#if 0 + // I don't think this is right. /*0x2DFC*/ u8 filler_2DFC[0x8]; /*0x2E04*/ SB_Struct sbStruct; +#else + /*0x2DFC*/ struct ContestWinner contestWinners[4]; + /*0x2E7C*/ u8 filler_2E7C[0x2F9C-0x2E7C]; +#endif /*0x2F9C*/ struct DayCare daycare; /*0x30B8*/ struct LinkBattleRecord linkBattleRecords[5]; /*0x3108*/ u8 filler_3108[8]; -- cgit v1.2.3 From 2415720ea6760217355f286da83b9955c881bf1b Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Fri, 22 Dec 2017 00:57:31 -0600 Subject: fix 0x2DFC in SaveBlock1 --- include/global.h | 46 +++++++--------------------------------------- 1 file changed, 7 insertions(+), 39 deletions(-) (limited to 'include/global.h') diff --git a/include/global.h b/include/global.h index 330e047fd..d5b1bfa59 100644 --- a/include/global.h +++ b/include/global.h @@ -230,12 +230,6 @@ struct RamScript struct RamScriptData data; }; -struct SB1_2EFC_Struct -{ - u16 var; - u8 unknown[0x1E]; -}; - struct EasyChatPair { u16 unk0_0:7; @@ -530,26 +524,6 @@ union MauvilleMan u8 filler[0x40]; // needed to pad out the struct }; -struct Unk_SB_Access_Struct1 -{ - u8 filler0[0xF8]; - struct SB1_2EFC_Struct sb1_2EFC_struct[5]; -}; - -struct Unk_SB_Access_Struct2 -{ - /*0x0000*/ struct SB1_2EFC_Struct sb1_2EFC_struct2[12]; // each is 0x20 - /*0x2F84*/ u8 filler[0x18]; -}; - -/*0x2E04*/ -typedef union SB_Struct -{ - struct Unk_SB_Access_Struct1 unkSB1; - struct Unk_SB_Access_Struct2 unkSB2; -} SB_Struct; -// size is 0x198 - struct UnknownSaveStruct2ABC { u8 val0; @@ -634,12 +608,12 @@ struct RecordMixingGift struct ContestWinner { - /*0x00*/ u32 unk0; // personality - /*0x04*/ u32 unk4; // otId - /*0x08*/ u16 unk8; // species - /*0x0A*/ u8 unkA; - /*0x0B*/ u8 unkB[0x16-0xB]; - /*0x16*/ u8 unk16[0x20-0x16]; + /*0x00*/ u32 personality; // personality + /*0x04*/ u32 otId; // otId + /*0x08*/ u16 species; // species + /*0x0A*/ u8 contestCategory; + /*0x0B*/ u8 nickname[0x16-0xB]; + /*0x16*/ u8 trainerName[0x20-0x16]; }; // there should be enough flags for all 412 slots @@ -720,14 +694,8 @@ struct SaveBlock1 /* 0x02025734 */ /*0x2D90*/ u8 filler_2D90[0x4]; /*0x2D94*/ union MauvilleMan mauvilleMan; /*0x2DD4*/ struct EasyChatPair easyChatPairs[5]; //Dewford trend [0] and some other stuff -#if 0 - // I don't think this is right. - /*0x2DFC*/ u8 filler_2DFC[0x8]; - /*0x2E04*/ SB_Struct sbStruct; -#else - /*0x2DFC*/ struct ContestWinner contestWinners[4]; + /*0x2DFC*/ struct ContestWinner contestWinners[4]; // how long is this? /*0x2E7C*/ u8 filler_2E7C[0x2F9C-0x2E7C]; -#endif /*0x2F9C*/ struct DayCare daycare; /*0x30B8*/ struct LinkBattleRecord linkBattleRecords[5]; /*0x3108*/ u8 filler_3108[8]; -- cgit v1.2.3 From d108f8dbe7f5fb08557d9ea82a0a9710532cac54 Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Fri, 22 Dec 2017 01:57:16 -0600 Subject: finish decompiling contest.s --- include/global.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include/global.h') diff --git a/include/global.h b/include/global.h index d5b1bfa59..a8c185731 100644 --- a/include/global.h +++ b/include/global.h @@ -694,8 +694,8 @@ struct SaveBlock1 /* 0x02025734 */ /*0x2D90*/ u8 filler_2D90[0x4]; /*0x2D94*/ union MauvilleMan mauvilleMan; /*0x2DD4*/ struct EasyChatPair easyChatPairs[5]; //Dewford trend [0] and some other stuff - /*0x2DFC*/ struct ContestWinner contestWinners[4]; // how long is this? - /*0x2E7C*/ u8 filler_2E7C[0x2F9C-0x2E7C]; + /*0x2DFC*/ struct ContestWinner contestWinners[8]; + /*0x2EFC*/ struct ContestWinner museumPortraits[5]; /*0x2F9C*/ struct DayCare daycare; /*0x30B8*/ struct LinkBattleRecord linkBattleRecords[5]; /*0x3108*/ u8 filler_3108[8]; -- cgit v1.2.3 From 255f0d4ee4327c2eac59d55d5e50dccbb353370d Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Fri, 22 Dec 2017 17:42:05 -0600 Subject: clean up and label more of contest.c --- include/global.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'include/global.h') diff --git a/include/global.h b/include/global.h index a8c185731..a4e71852c 100644 --- a/include/global.h +++ b/include/global.h @@ -50,9 +50,9 @@ fndec\ // dim access enums enum { - B_8 = 1, - B_16 = 2, - B_32 = 4 + B_8 = 1, + B_16 = 2, + B_32 = 4 }; // There are many quirks in the source code which have overarching behavioral differences from @@ -694,7 +694,7 @@ struct SaveBlock1 /* 0x02025734 */ /*0x2D90*/ u8 filler_2D90[0x4]; /*0x2D94*/ union MauvilleMan mauvilleMan; /*0x2DD4*/ struct EasyChatPair easyChatPairs[5]; //Dewford trend [0] and some other stuff - /*0x2DFC*/ struct ContestWinner contestWinners[8]; + /*0x2DFC*/ struct ContestWinner contestWinners[8]; /*0x2EFC*/ struct ContestWinner museumPortraits[5]; /*0x2F9C*/ struct DayCare daycare; /*0x30B8*/ struct LinkBattleRecord linkBattleRecords[5]; -- cgit v1.2.3