From fcd62bf39372bbb26e21f3dfb67ccf1782954834 Mon Sep 17 00:00:00 2001 From: Marcus Huderle Date: Sun, 15 Oct 2017 14:36:53 -0700 Subject: Start decomp on rest of secret_base --- include/decoration.h | 1 + include/global.fieldmap.h | 10 +++++----- include/global.h | 2 +- include/secret_base.h | 2 +- 4 files changed, 8 insertions(+), 7 deletions(-) (limited to 'include') diff --git a/include/decoration.h b/include/decoration.h index 2e72e305a..bd8c41d1e 100644 --- a/include/decoration.h +++ b/include/decoration.h @@ -292,6 +292,7 @@ extern bool8 sub_807D770(void); extern void sub_8109DAC(u8); // src/trader extern void ReshowPlayerPC(u8); // src/player_pc +void Task_SecretBasePC_Decoration(u8 taskId); void sub_80FE2B4(void); void Task_DecorationPCProcessMenuInput(u8); void sub_80FE394(void); diff --git a/include/global.fieldmap.h b/include/global.fieldmap.h index 5c93eb8ab..7a8cc4592 100644 --- a/include/global.fieldmap.h +++ b/include/global.fieldmap.h @@ -111,11 +111,11 @@ struct CoordEvent struct BgEvent { - u16 x, y; - u8 unk4; - u8 kind; - // 0x2 padding for the union beginning. - union { // carried over from diego's FR/LG work, seems to be the same struct + /*0x00*/u16 x; + /*0x02*/u16 y; + /*0x04*/u8 unk4; + /*0x05*/u8 kind; + /*0x08*/union { // carried over from diego's FR/LG work, seems to be the same struct // in gen 3, "kind" (0x3 in BgEvent struct) determines the method to read the union. u8 *script; diff --git a/include/global.h b/include/global.h index f0eb7401f..51c599a73 100644 --- a/include/global.h +++ b/include/global.h @@ -130,7 +130,7 @@ struct UCoords16 struct SecretBaseRecord { - /*ID?*/ /*0x1A08*/ u8 sbr_field_0; + /*ID?*/ /*0x1A08*/ u8 secretBaseId; /*0x1A09*/ u8 sbr_field_1_0:4; /*0x1A09*/ u8 gender:1; /*0x1A09*/ u8 sbr_field_1_5:1; diff --git a/include/secret_base.h b/include/secret_base.h index bb747bb02..0318445ec 100644 --- a/include/secret_base.h +++ b/include/secret_base.h @@ -9,7 +9,7 @@ void sub_80BC038(); u8 sub_80BC050(); u8 *GetSecretBaseMapName(u8 *); void sub_80BC300(); -const u8 sub_80BCCA4(u8); +u8 sub_80BCCA4(u8); u8 *sub_80BCCE8(void); void sub_80BCF1C(u8); void sub_80BD674(void *, u32, u8); -- cgit v1.2.3 From b29c65b176bc7441ac38002e2ea9e38f8e4e9ce6 Mon Sep 17 00:00:00 2001 From: Marcus Huderle Date: Sun, 15 Oct 2017 19:25:32 -0700 Subject: Continue decomp of secret_base --- include/field_specials.h | 1 + include/global.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/field_specials.h b/include/field_specials.h index d61aa3b20..52325879c 100644 --- a/include/field_specials.h +++ b/include/field_specials.h @@ -25,5 +25,6 @@ void ScriptShowElevatorMenu(void); void SetShoalItemFlag(u16); u8 GetLeadMonIndex(void); void ResetFanClub(void); +u8 sub_810FB10(u8 a0); #endif // GUARD_FIELD_SPECIALS_H diff --git a/include/global.h b/include/global.h index 51c599a73..e6a073aa5 100644 --- a/include/global.h +++ b/include/global.h @@ -136,7 +136,7 @@ struct SecretBaseRecord /*0x1A09*/ u8 sbr_field_1_5:1; /*0x1A09*/ u8 sbr_field_1_6:2; /*0x1A0A*/ u8 sbr_field_2[7]; // 0xFF bytes? - /*0x1A12*/ u8 trainerId[4]; // byte 0 is used for determining trainer class + /*0x1A11*/ u8 trainerId[4]; // byte 0 is used for determining trainer class /*0x1A16*/ u16 sbr_field_e; /*0x1A18*/ u8 sbr_field_10; /*0x1A19*/ u8 sbr_field_11; -- cgit v1.2.3 From 687fee8891816c7d9b21670ba326edde8b15dce1 Mon Sep 17 00:00:00 2001 From: Marcus Huderle Date: Mon, 16 Oct 2017 14:38:52 -0700 Subject: Finish secret_base decomp --- include/global.h | 4 ++-- include/secret_base.h | 15 +++++++++------ 2 files changed, 11 insertions(+), 8 deletions(-) (limited to 'include') diff --git a/include/global.h b/include/global.h index e6a073aa5..7c1ac9c68 100644 --- a/include/global.h +++ b/include/global.h @@ -130,12 +130,12 @@ struct UCoords16 struct SecretBaseRecord { - /*ID?*/ /*0x1A08*/ u8 secretBaseId; + /*0x1A08*/ u8 secretBaseId; /*0x1A09*/ u8 sbr_field_1_0:4; /*0x1A09*/ u8 gender:1; /*0x1A09*/ u8 sbr_field_1_5:1; /*0x1A09*/ u8 sbr_field_1_6:2; - /*0x1A0A*/ u8 sbr_field_2[7]; // 0xFF bytes? + /*0x1A0A*/ u8 playerName[OT_NAME_LENGTH]; /*0x1A11*/ u8 trainerId[4]; // byte 0 is used for determining trainer class /*0x1A16*/ u16 sbr_field_e; /*0x1A18*/ u8 sbr_field_10; diff --git a/include/secret_base.h b/include/secret_base.h index 0c4ae6694..07784556f 100644 --- a/include/secret_base.h +++ b/include/secret_base.h @@ -1,17 +1,20 @@ #ifndef GUARD_SECRET_BASE_H #define GUARD_SECRET_BASE_H +// Maximum number of secret bases the game can store. This include 1 for the player, and up to 19 others from linked players. +#define MAX_SECRET_BASES 20 + void ResetSecretBases(void); -void sub_80BB970(struct MapEvents *); +void sub_80BB970(struct MapEvents *events); u8 sub_80BBB24(void); -void sub_80BBCCC(u8); +void sub_80BBCCC(u8 flagIn); void sub_80BC038(struct MapPosition *, struct MapEvents *); u8 sub_80BC050(); -u8 *GetSecretBaseMapName(u8 *); +u8 *GetSecretBaseMapName(u8 *dest); void sub_80BC300(); -u8 sub_80BCCA4(u8); +u8 sub_80BCCA4(u8 secretBaseIndex); const u8 *sub_80BCCE8(void); -void sub_80BCF1C(u8); -void sub_80BD674(void *, u32, u8); +void sub_80BCF1C(u8 taskId); +void sub_80BD674(void *playerRecords, u32 size, u8 c); #endif // GUARD_SECRET_BASE_H -- cgit v1.2.3