From e6caf0ff1019a1744df5b7c550a1a40db33d0154 Mon Sep 17 00:00:00 2001 From: Marcus Huderle Date: Sun, 24 Mar 2019 17:20:35 -0500 Subject: Port mevent2.c from pokefirered --- include/global.h | 75 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 73 insertions(+), 2 deletions(-) (limited to 'include/global.h') diff --git a/include/global.h b/include/global.h index 1f9ac5185..d738deb3c 100644 --- a/include/global.h +++ b/include/global.h @@ -808,6 +808,76 @@ struct SaveTrainerHill /*0x3D6E*/ u16 tag:2; // x40, x80 = xC0 }; +struct MysteryEventStruct +{ + u8 unk_0_0:2; + u8 unk_0_2:3; + u8 unk_0_5:3; + u8 unk_1; +}; + + struct MEventBuffer_3120_Sub +{ + u16 unk_00; + u8 unk_02; + u8 unk_03; + u8 unk_04[40]; + u8 unk_2C[10][40]; +}; + + struct MEventBuffer_3120 +{ + u32 crc; + struct MEventBuffer_3120_Sub data; +}; + + struct MEventBuffer_32E0_Sub +{ + u16 unk_00; + u16 unk_02; + u32 unk_04; + u8 unk_08_0:2; + u8 unk_08_2:4; + u8 unk_08_6:2; + u8 unk_09; + u8 unk_0A[40]; + u8 unk_32[40]; + u8 unk_5A[4][40]; + u8 unk_FA[40]; + u8 unk_122[40]; +}; + + struct MEventBuffer_32E0 +{ + u32 crc; + struct MEventBuffer_32E0_Sub data; +}; + + struct MEventBuffer_3430_Sub +{ + u16 unk_00; + u16 unk_02; + u16 unk_04; + u16 unk_06; + u16 unk_08[2][7]; +}; + + struct MEventBuffer_3430 +{ + u32 crc; + struct MEventBuffer_3430_Sub data; +}; + + struct MEventBuffers +{ + /*0x000 0x322C*/ struct MEventBuffer_3120 buffer_000; + /*0x1c0 0x33EC*/ struct MEventBuffer_32E0 buffer_1c0; + /*0x310 0x353C*/ struct MEventBuffer_3430 buffer_310; + /*0x338 0x3564*/ u16 unk_338[4]; + /*0x340 0x356C*/ struct MysteryEventStruct unk_340; + /*0x344 0x3570*/ u32 unk_344[2][5]; +}; // 0x36C 0x3598 + struct SaveBlock1 { /*0x00*/ struct Coords16 pos; @@ -884,14 +954,15 @@ struct SaveBlock1 /*0x31A8*/ u8 giftRibbons[52]; /*0x31DC*/ struct Roamer roamer; /*0x31F8*/ struct EnigmaBerry enigmaBerry; - /*0x322C*/ u8 field_322C[1260]; + /*0x322C*/ struct MEventBuffers unk_322C; + /*0x3598*/ u8 field_3598[0x180]; /*0x3718*/ u32 trainerHillTimes[4]; /*0x3728*/ struct RamScript ramScript; /*0x3B14*/ struct RecordMixingGift recordMixingGift; /*0x3B24*/ u8 seen2[DEX_FLAGS_NO]; /*0x3B58*/ LilycoveLady lilycoveLady; /*0x3B98*/ struct TrainerNameRecord trainerNameRecords[20]; - /*0x3C88*/ u8 filler_3C88[0xDC]; + /*0x3C88*/ u8 unk3C88[11][20]; /*0x3D64*/ struct SaveTrainerHill trainerHill; /*0x3D70*/ struct WaldaPhrase waldaPhrase; // sizeof: 0x3D88 -- cgit v1.2.3 From af1baa89f1c7f657eb096df5bf2677527301b5c4 Mon Sep 17 00:00:00 2001 From: Marcus Huderle Date: Tue, 26 Mar 2019 19:03:46 -0500 Subject: Start decompiling union_room_chat.c --- include/global.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include/global.h') diff --git a/include/global.h b/include/global.h index d738deb3c..0506c036e 100644 --- a/include/global.h +++ b/include/global.h @@ -962,7 +962,8 @@ struct SaveBlock1 /*0x3B24*/ u8 seen2[DEX_FLAGS_NO]; /*0x3B58*/ LilycoveLady lilycoveLady; /*0x3B98*/ struct TrainerNameRecord trainerNameRecords[20]; - /*0x3C88*/ u8 unk3C88[11][20]; + /*0x3C88*/ u8 unk3C88[10][21]; + /*0x3D5A*/ u8 filler3D5A[0xA]; /*0x3D64*/ struct SaveTrainerHill trainerHill; /*0x3D70*/ struct WaldaPhrase waldaPhrase; // sizeof: 0x3D88 -- cgit v1.2.3 From d220f876fc9e7281075419ce6bbb5bf9e8dbef8f Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Tue, 2 Apr 2019 13:57:03 -0400 Subject: Some symbol documentation --- include/global.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'include/global.h') diff --git a/include/global.h b/include/global.h index 0506c036e..7b570d72e 100644 --- a/include/global.h +++ b/include/global.h @@ -816,7 +816,7 @@ struct MysteryEventStruct u8 unk_1; }; - struct MEventBuffer_3120_Sub + struct WonderNews { u16 unk_00; u8 unk_02; @@ -825,13 +825,13 @@ struct MysteryEventStruct u8 unk_2C[10][40]; }; - struct MEventBuffer_3120 + struct WonderNewsSaveStruct { u32 crc; - struct MEventBuffer_3120_Sub data; + struct WonderNews data; }; - struct MEventBuffer_32E0_Sub + struct WonderCard { u16 unk_00; u16 unk_02; @@ -847,10 +847,10 @@ struct MysteryEventStruct u8 unk_122[40]; }; - struct MEventBuffer_32E0 + struct WonderCardSaveStruct { u32 crc; - struct MEventBuffer_32E0_Sub data; + struct WonderCard data; }; struct MEventBuffer_3430_Sub @@ -870,8 +870,8 @@ struct MysteryEventStruct struct MEventBuffers { - /*0x000 0x322C*/ struct MEventBuffer_3120 buffer_000; - /*0x1c0 0x33EC*/ struct MEventBuffer_32E0 buffer_1c0; + /*0x000 0x322C*/ struct WonderNewsSaveStruct wonderNews; + /*0x1c0 0x33EC*/ struct WonderCardSaveStruct wonderCard; /*0x310 0x353C*/ struct MEventBuffer_3430 buffer_310; /*0x338 0x3564*/ u16 unk_338[4]; /*0x340 0x356C*/ struct MysteryEventStruct unk_340; -- cgit v1.2.3 From a47abb3949f8d1050379f51005368a5093c15113 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Wed, 3 Apr 2019 21:46:59 -0400 Subject: union_room_chat data, 1 --- include/global.h | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'include/global.h') diff --git a/include/global.h b/include/global.h index 7b570d72e..864a7fa55 100644 --- a/include/global.h +++ b/include/global.h @@ -18,12 +18,13 @@ #if defined (__APPLE__) || defined (__CYGWIN__) || defined (_MSC_VER) #define _(x) x #define __(x) x -#define INCBIN_U8 {0} -#define INCBIN_U16 {0} -#define INCBIN_U32 {0} -#define INCBIN_S8 {0} -#define INCBIN_S16 {0} -#define INCBIN_S32 {0} +// CLion is an idiot +#define INCBIN_U8(x) {0} +#define INCBIN_U16(x) {0} +#define INCBIN_U32(x) {0} +#define INCBIN_S8(x) {0} +#define INCBIN_S16(x) {0} +#define INCBIN_S32(x) {0} #endif // IDE support #define ARRAY_COUNT(array) (size_t)(sizeof(array) / sizeof((array)[0])) -- cgit v1.2.3 From 53efbe2832f5e7a6973c3c5a6a6d7240ea5ecbdd Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Thu, 4 Apr 2019 08:49:01 -0400 Subject: Finish decomp of union_room_chat --- include/global.h | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'include/global.h') diff --git a/include/global.h b/include/global.h index 864a7fa55..7b570d72e 100644 --- a/include/global.h +++ b/include/global.h @@ -18,13 +18,12 @@ #if defined (__APPLE__) || defined (__CYGWIN__) || defined (_MSC_VER) #define _(x) x #define __(x) x -// CLion is an idiot -#define INCBIN_U8(x) {0} -#define INCBIN_U16(x) {0} -#define INCBIN_U32(x) {0} -#define INCBIN_S8(x) {0} -#define INCBIN_S16(x) {0} -#define INCBIN_S32(x) {0} +#define INCBIN_U8 {0} +#define INCBIN_U16 {0} +#define INCBIN_U32 {0} +#define INCBIN_S8 {0} +#define INCBIN_S16 {0} +#define INCBIN_S32 {0} #endif // IDE support #define ARRAY_COUNT(array) (size_t)(sizeof(array) / sizeof((array)[0])) -- cgit v1.2.3 From 033580da9623d6519c35efcb3594552d3389772d Mon Sep 17 00:00:00 2001 From: Marcus Huderle Date: Fri, 5 Apr 2019 16:11:24 -0500 Subject: Document secret base --- include/global.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'include/global.h') diff --git a/include/global.h b/include/global.h index 7b570d72e..4523ece21 100644 --- a/include/global.h +++ b/include/global.h @@ -471,21 +471,21 @@ struct SecretBaseParty u8 EVs[PARTY_SIZE]; }; -struct SecretBaseRecord +struct SecretBase { /*0x1A9C*/ u8 secretBaseId; /*0x1A9D*/ u8 sbr_field_1_0:4; /*0x1A9D*/ u8 gender:1; - /*0x1A9D*/ u8 sbr_field_1_5:1; - /*0x1A9D*/ u8 sbr_field_1_6:2; + /*0x1A9D*/ u8 battledOwnerToday:1; + /*0x1A9D*/ u8 registryStatus:2; /*0x1A9E*/ u8 trainerName[PLAYER_NAME_LENGTH]; /*0x1AA5*/ u8 trainerId[4]; // byte 0 is used for determining trainer class /*0x1AA9*/ u8 language; - /*0x1AAA*/ u16 sbr_field_e; - /*0x1AAC*/ u8 sbr_field_10; + /*0x1AAA*/ u16 numSecretBasesReceived; + /*0x1AAC*/ u8 numTimesEntered; /*0x1AAD*/ u8 sbr_field_11; /*0x1AAE*/ u8 decorations[16]; - /*0x1ABE*/ u8 decorationPos[16]; + /*0x1ABE*/ u8 decorationPositions[16]; /*0x1AD0*/ struct SecretBaseParty party; }; @@ -915,7 +915,7 @@ struct SaveBlock1 /*0x139C*/ u16 vars[VARS_COUNT]; /*0x159C*/ u32 gameStats[NUM_GAME_STATS]; /*0x169C*/ struct BerryTree berryTrees[BERRY_TREES_COUNT]; - /*0x1A9C*/ struct SecretBaseRecord secretBases[SECRET_BASES_COUNT]; + /*0x1A9C*/ struct SecretBase secretBases[SECRET_BASES_COUNT]; /*0x271C*/ u8 playerRoomDecor[12]; /*0x2728*/ u8 playerRoomDecorPos[12]; /*0x2734*/ u8 decorDesk[10]; -- cgit v1.2.3