From 267cb812e827604d4829d3afe28a82b0970d3706 Mon Sep 17 00:00:00 2001 From: who-knows-who Date: Sat, 17 Apr 2021 12:32:29 +0100 Subject: Start decompiling unk_0202A1E0 --- include/unk_0202A1E0.h | 171 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 171 insertions(+) create mode 100644 include/unk_0202A1E0.h (limited to 'include') diff --git a/include/unk_0202A1E0.h b/include/unk_0202A1E0.h new file mode 100644 index 00000000..4ed236be --- /dev/null +++ b/include/unk_0202A1E0.h @@ -0,0 +1,171 @@ +#ifndef POKEDIAMOND_UNK_0202A1E0_H +#define POKEDIAMOND_UNK_0202A1E0_H + +#include "mail_message.h" +#include "save_block_2.h" + +struct Unk0202A1F0 +{ + u8 b0; + u8 b1; + u8 b2; + u8 b3; +}; + +struct UnkMailStruct +{ + struct MailMessage messages[4]; +}; + +struct Unk0202A240 +{ + u8 u_0_0 : 1; // used + u8 u_0_1 : 1; // used + u8 u_0_2 : 3; // used + u8 u_0_5 : 3; // used + u8 u_1; + u8 u_2; // used + u8 u_3; // used + u16 u_4; // used + u16 u_6; // used + s32 u_8; // used, cpu copy 4 bytes + s32 u_C[7]; // used, cpu copy 28 bytes + u32 u_28; // used + s32 u_2C[4]; // used, cpu copy 16 bytes +}; + +struct Unk0202A3B4 +{ + u16 u_0; // used + u8 filler_0[6]; + u16 filler_1 : 4; + u16 u_8_4 : 1; // used +}; + +struct Unk0202A40C +{ + u16 filler_0; + u8 u_2; // used + u8 filler_1[5]; + u16 filler_2 : 4; + u16 u_8_4 : 1; // used +}; + +struct Unk0202A444 +{ + u8 filler_0[3]; + u8 u_3; // used +}; + +struct Unk0202A4B8 +{ + u8 filler[2]; + u8 u_2; // used + u8 u_3; // used + u16 u_4; // used + u16 u_6; // used + u16 filler_1[2]; + u16 u_array_C[5]; // used + u16 u_16; // used + u16 u_18; // used +}; + +struct Unk0202A5CC +{ + u32 filler; + u32 u_4; +}; + + +struct UnkSaveStruct_0202A5D4 +{ + u32 filler[15]; + struct Unk0202A1F0 u_3C; + u32 filler1[89]; + struct UnkMailStruct messages; + u32 u_1C4; +}; + +struct Unk0202A670 +{ + u32 b0; + u8 b4; // used +}; + +struct Unk0202A68C +{ + u32 b0; // used + u32 b4; // used + u32 b8; // used +}; + +struct Unk0202A744_substruct1 +{ + u8 data[0x63c]; +}; // total size 0x63C (1596) + +struct Unk0202A744_substruct2 +{ + u8 data[0x3fc]; +}; // total size 0x3FC (1020) + +struct Unk0202A744 +{ + u8 filler[254]; + u8 u_FE; + u8 u_FF; + u8 u_100; + u8 u_101; + u8 u_102; + u8 u_103; + struct Unk0202A744_substruct1 u_104; + struct Unk0202A744_substruct2 u_740; +}; + +struct Unk0202A784 +{ + u8 u_0; + u8 u_1; +}; + +s32 FUN_0202A1E0(); +void FUN_0202A1E4(void *dst); +void FUN_0202A1F0(struct Unk0202A1F0 *unk); +void FUN_0202A204(struct UnkMailStruct *unk); +void FUN_0202A230(void *dst); +u32 FUN_0202A240(struct Unk0202A240 *unk, u32 arg1, void *dst); +void FUN_0202A2C4(struct Unk0202A240 *dst, u32 arg1, void *src); +void FUN_0202A36C(struct Unk0202A240 *unk, s32 arg1, s32 arg2, s32 arg3); +u8 FUN_0202A398(struct Unk0202A240 *unk); +void FUN_0202A3A0(struct Unk0202A240 *unk, u16 arg1); +u16 FUN_0202A3B4(struct Unk0202A3B4 *unk, u16 arg1, s32 arg2); +u8 FUN_0202A40C(struct Unk0202A40C *unk, s32 arg1); +u8 FUN_0202A444(struct Unk0202A444 *unk, s32 arg1); +void FUN_0202A474(void *dst, s32 arg1, const void *src); +void FUN_0202A498(const void *src, s32 arg1, void *dst); +void FUN_0202A4B8(struct Unk0202A4B8 *arg0, struct Unk0202A4B8 *arg1); +u16 FUN_0202A520(struct Unk0202A4B8 *unk); +u8 FUN_0202A524(struct Unk0202A4B8 *unk); +u16 FUN_0202A538(struct Unk0202A4B8 *unk, s32 arg1, s32 arg2); +void FUN_0202A5CC(struct Unk0202A5CC *unk, u32 arg1); +u32 FUN_0202A5D0(struct Unk0202A5CC *unk); +void FUN_0202A5D4(struct SaveBlock2 *sav2, u32 arg1, struct MailMessage *arg2); +struct MailMessage *FUN_0202A5F4(struct SaveBlock2 *sav2, u32 arg1); +void FUN_0202A60C(u32 arg0, u32 arg1, u32 arg2, u32 arg3); +void FUN_0202A670(struct Unk0202A670 *arg0); +u32 FUN_0202A68C(struct Unk0202A68C *arg0, struct Unk0202A68C *arg1); +u8 FUN_0202A744(struct Unk0202A744 *unk); +u8 FUN_0202A74C(struct Unk0202A744 *unk); +void FUN_0202A754(struct Unk0202A744 *dest, void *src, u8 arg2, u8 arg3); +void FUN_0202A784(struct Unk0202A744 *src, struct Unk0202A784 *ptr1); +void FUN_0202A798(); +void FUN_0202A838(struct Unk0202A744 *dest, void *src, u8 arg2, u8 arg3); +void FUN_0202A864(struct Unk0202A744 *src, struct Unk0202A784 *dest); +struct Unk0202A744_substruct2 *FUN_0202A878(struct Unk0202A744 *src, u32 head_id); +s32 FUN_0202A89C(); +void FUN_0202A8A4(struct UnkSaveStruct_0202A5D4 *savStruct); +struct UnkSaveStruct_0202A5D4 *FUN_0202A8CC(struct SaveBlock2* sav2); +void *FUN_0202A8D8(struct SaveBlock2* sav2); +void *FUN_0202A8E4(struct SaveBlock2* sav2); + +#endif //POKEDIAMOND_UNK_0202A1E0_H \ No newline at end of file -- cgit v1.2.3 From a2a17a9426f16ee601ff17840b8bb7851fef7138 Mon Sep 17 00:00:00 2001 From: who-knows-who Date: Wed, 2 Jun 2021 22:01:18 +0100 Subject: Finished file unk_0202A1E0 --- include/unk_0202A1E0.h | 83 +++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 65 insertions(+), 18 deletions(-) (limited to 'include') diff --git a/include/unk_0202A1E0.h b/include/unk_0202A1E0.h index 4ed236be..c07810c3 100644 --- a/include/unk_0202A1E0.h +++ b/include/unk_0202A1E0.h @@ -6,10 +6,8 @@ struct Unk0202A1F0 { - u8 b0; - u8 b1; - u8 b2; - u8 b3; + u8 filler[3]; + u8 u_3; }; struct UnkMailStruct @@ -70,6 +68,12 @@ struct Unk0202A4B8 u16 u_18; // used }; +struct Unk0202A578 +{ + u8 filler[8]; + u16 u_8; +}; + struct Unk0202A5CC { u32 filler; @@ -86,18 +90,21 @@ struct UnkSaveStruct_0202A5D4 u32 u_1C4; }; -struct Unk0202A670 +typedef struct Unk0202A670 { - u32 b0; - u8 b4; // used -}; + u32 u_0; // used + u8 u_4[250]; // used +} +Unk0202A670; -struct Unk0202A68C +typedef struct Unk0202A68C { - u32 b0; // used - u32 b4; // used - u32 b8; // used -}; + u32 u_0; // used + u32 u_4; // used + u32 u_8; // used + u32 u_C; // used +} +Unk0202A68C; // total size 0x10 (16) struct Unk0202A744_substruct1 { @@ -106,7 +113,7 @@ struct Unk0202A744_substruct1 struct Unk0202A744_substruct2 { - u8 data[0x3fc]; + u8 data[1020]; }; // total size 0x3FC (1020) struct Unk0202A744 @@ -128,6 +135,44 @@ struct Unk0202A784 u8 u_1; }; +struct Unk0202A798_substruct1 +{ + u8 u_0[168]; + u8 u_A8[16]; + u16 filler_2[8]; + u8 u_C8_0:1; + u8 u_C8_1:1; + u8 u_C8_filler:6; + u8 u_C9; + u16 u_CA[4]; + u16 u_D2[4]; + u16 u_DA[4]; + u8 filler_3[2]; +}; // total size 0xE4 (228) + +struct Unk0202A798_1 +{ + u8 filler[260]; + struct Unk0202A798_substruct1 u_104[4]; +}; + +struct Unk0202A798_substruct2 +{ + u32 u_0; + u16 u_4; + u8 filler_1[2]; + u16 u_8[8]; + u16 u_18[4]; + u16 u_20[4]; + u16 u_28[4]; +}; // total size 0x30 (48) + +struct Unk0202A798_2 +{ + struct Unk0202A798_substruct2 u_0; + u8 u_30[168]; +}; + s32 FUN_0202A1E0(); void FUN_0202A1E4(void *dst); void FUN_0202A1F0(struct Unk0202A1F0 *unk); @@ -143,17 +188,19 @@ u8 FUN_0202A40C(struct Unk0202A40C *unk, s32 arg1); u8 FUN_0202A444(struct Unk0202A444 *unk, s32 arg1); void FUN_0202A474(void *dst, s32 arg1, const void *src); void FUN_0202A498(const void *src, s32 arg1, void *dst); -void FUN_0202A4B8(struct Unk0202A4B8 *arg0, struct Unk0202A4B8 *arg1); +u16 FUN_0202A4B8(struct Unk0202A4B8 *arg0, struct Unk0202A4B8 *arg1); u16 FUN_0202A520(struct Unk0202A4B8 *unk); u8 FUN_0202A524(struct Unk0202A4B8 *unk); u16 FUN_0202A538(struct Unk0202A4B8 *unk, s32 arg1, s32 arg2); +BOOL FUN_0202A578(struct Unk0202A578 *arg0, u16 arg1, u32 arg2); void FUN_0202A5CC(struct Unk0202A5CC *unk, u32 arg1); u32 FUN_0202A5D0(struct Unk0202A5CC *unk); void FUN_0202A5D4(struct SaveBlock2 *sav2, u32 arg1, struct MailMessage *arg2); struct MailMessage *FUN_0202A5F4(struct SaveBlock2 *sav2, u32 arg1); -void FUN_0202A60C(u32 arg0, u32 arg1, u32 arg2, u32 arg3); +void FUN_0202A60C(struct Unk0202A670 *arg0, u8 arg1, u8 arg2, struct Unk0202A68C *arg3); void FUN_0202A670(struct Unk0202A670 *arg0); -u32 FUN_0202A68C(struct Unk0202A68C *arg0, struct Unk0202A68C *arg1); +BOOL FUN_0202A68C(struct Unk0202A68C *arg0, struct Unk0202A68C *arg1); +BOOL FUN_0202A6B4(struct Unk0202A670 *arg0, u8 arg1, u8 arg2, struct Unk0202A68C *arg3); u8 FUN_0202A744(struct Unk0202A744 *unk); u8 FUN_0202A74C(struct Unk0202A744 *unk); void FUN_0202A754(struct Unk0202A744 *dest, void *src, u8 arg2, u8 arg3); @@ -165,7 +212,7 @@ struct Unk0202A744_substruct2 *FUN_0202A878(struct Unk0202A744 *src, u32 head_id s32 FUN_0202A89C(); void FUN_0202A8A4(struct UnkSaveStruct_0202A5D4 *savStruct); struct UnkSaveStruct_0202A5D4 *FUN_0202A8CC(struct SaveBlock2* sav2); -void *FUN_0202A8D8(struct SaveBlock2* sav2); +struct Unk0202A1F0 *FUN_0202A8D8(struct SaveBlock2* sav2); void *FUN_0202A8E4(struct SaveBlock2* sav2); #endif //POKEDIAMOND_UNK_0202A1E0_H \ No newline at end of file -- cgit v1.2.3 From 5bbef1bba183ad6654edbd0c8fc8244db38ac5c9 Mon Sep 17 00:00:00 2001 From: who-knows-who Date: Mon, 21 Jun 2021 21:36:37 +0100 Subject: Rename functions --- include/unk_0202A1E0.h | 359 ++++++++++++++++++++++++------------------------- 1 file changed, 175 insertions(+), 184 deletions(-) (limited to 'include') diff --git a/include/unk_0202A1E0.h b/include/unk_0202A1E0.h index c07810c3..8c1e5da9 100644 --- a/include/unk_0202A1E0.h +++ b/include/unk_0202A1E0.h @@ -4,215 +4,206 @@ #include "mail_message.h" #include "save_block_2.h" -struct Unk0202A1F0 -{ - u8 filler[3]; - u8 u_3; -}; - -struct UnkMailStruct -{ - struct MailMessage messages[4]; -}; - -struct Unk0202A240 -{ - u8 u_0_0 : 1; // used - u8 u_0_1 : 1; // used - u8 u_0_2 : 3; // used - u8 u_0_5 : 3; // used - u8 u_1; - u8 u_2; // used - u8 u_3; // used - u16 u_4; // used - u16 u_6; // used - s32 u_8; // used, cpu copy 4 bytes - s32 u_C[7]; // used, cpu copy 28 bytes - u32 u_28; // used - s32 u_2C[4]; // used, cpu copy 16 bytes -}; +typedef enum +{ + DATA_GET = 0, + DATA_SET, + DATA_RESET, + DATA_INCREMENT, + DATA_DECREMENT, + DATA_ADD, + DATA_SUBSTRACT +} +DataSetMode; + +typedef enum +{ + FIELD_0x0_2 = 0, + FIELD_0x2, + FIELD_0x3, + FIELD_0x4, + FIELD_0x6, + FIELD_0x8, + FIELD_0x2C, + FIELD_flag0, + FIELD_0xC, + FIELD_0x0_5, + FIELD_0x28, +} +SaveStruct23_Substruct1_Field; + +struct SaveStruct23_Substruct1 +{ + /* 0x000 */ u8 flag0 : 1; + u8 flag1 : 1; + u8 u_0_2 : 3; + u8 u_0_5 : 3; + /* 0x001 */ u8 u_1; + /* 0x002 */ u8 u_2; + /* 0x003 */ u8 u_3; + /* 0x004 */ u16 u_4; + /* 0x006 */ u16 u_6; + /* 0x008 */ s32 u_8; + /* 0x00C */ s32 u_C[7]; + /* 0x028 */ u32 u_28; + /* 0x02C */ s32 u_2C[4]; +}; // total size = 0x3C (60) + +struct SaveStruct23_Substruct2 +{ + /* 0x000 */ u16 u_0; + /* 0x002 */ u8 u_2; + /* 0x003 */ u8 u_3; + /* 0x004 */ u32 u_4; + + union + { + struct + { + /* 0x008 */ u16 flag0:1; + u16 flag1:1; + u16 flag2:1; + u16 flag3:1; + u16 flag4:1; + u16 filler_1:11; + }; + /* 0x008 */ u16 flags; + }; + /* 0x00A */ u8 filler_2[2]; + /* 0x00C */ u16 u_C[5]; + /* 0x016 */ u16 u_16; + /* 0x018 */ u8 u_18[168]; + /* 0x0C0 */ u8 u_C0[168]; +}; // total size 0x168 (360) + +struct SaveStruct23_Messages +{ + /* 0x000 */ struct MailMessage messages[4]; +}; // total size 0x020 (32) + +struct SaveStruct23_Substruct4_Substruct1 +{ + /* 0x000 */ u8 u_0[168]; + /* 0x0A8 */ u8 u_A8[16]; + /* 0x0B8 */ u8 filler_1[16]; + /* 0x0C8 */ u8 u_C8_0:1; + u8 u_C8_1:1; + u8 filler_2:6; + /* 0x0C8 */ u8 u_C9; + /* 0x0CA */ u16 u_CA[4]; + /* 0x0D2 */ u16 u_D2[4]; + /* 0x0DA */ u16 u_DA[4]; + /* 0x0E2 */ u8 filler_3[2]; +}; // total size 0xE4 (228) -struct Unk0202A3B4 +struct SaveStruct23_Substruct4_Substruct2 { - u16 u_0; // used - u8 filler_0[6]; - u16 filler_1 : 4; - u16 u_8_4 : 1; // used + /* 0x00 */ u8 u_0[1020]; }; -struct Unk0202A40C +struct SaveStruct23_Substruct4 { - u16 filler_0; - u8 u_2; // used - u8 filler_1[5]; - u16 filler_2 : 4; - u16 u_8_4 : 1; // used -}; + /* 0x000 */ u32 u_0; + /* 0x004 */ u8 flags[250]; + /* 0x0FE */ u8 u_FE; + /* 0x0FF */ u8 u_FF; + /* 0x100 */ u8 u_100; + /* 0x101 */ u8 u_101; + /* 0x102 */ u8 u_102; + /* 0x103 */ u8 u_103; + /* 0x104 */ struct SaveStruct23_Substruct4_Substruct1 substruct1[7]; + /* 0x740 */ struct SaveStruct23_Substruct4_Substruct2 substruct2; +}; // total size 0xB3C (2876) -struct Unk0202A444 +struct SaveStruct23 // Struct fetched with SavArray_get(sav2, 23) { - u8 filler_0[3]; - u8 u_3; // used -}; + /* 0x000 */ struct SaveStruct23_Substruct1 substruct1; + /* 0x03C */ struct SaveStruct23_Substruct2 substruct2; + /* 0x1A4 */ struct SaveStruct23_Messages messages; + /* 0x1C4 */ struct SaveStruct23_Substruct4 substruct4; +}; // total size = 0xD00 (3328) struct Unk0202A4B8 { - u8 filler[2]; - u8 u_2; // used - u8 u_3; // used - u16 u_4; // used - u16 u_6; // used - u16 filler_1[2]; - u16 u_array_C[5]; // used - u16 u_16; // used - u16 u_18; // used -}; - -struct Unk0202A578 -{ - u8 filler[8]; - u16 u_8; + /* 0x000 */ u8 filler_1[2]; + /* 0x002 */ u8 u_2; + /* 0x003 */ u8 u_3; + /* 0x004 */ u16 u_4; + /* 0x006 */ u16 u_6; }; -struct Unk0202A5CC -{ - u32 filler; - u32 u_4; -}; - - -struct UnkSaveStruct_0202A5D4 -{ - u32 filler[15]; - struct Unk0202A1F0 u_3C; - u32 filler1[89]; - struct UnkMailStruct messages; - u32 u_1C4; -}; - -typedef struct Unk0202A670 -{ - u32 u_0; // used - u8 u_4[250]; // used -} -Unk0202A670; - typedef struct Unk0202A68C { - u32 u_0; // used - u32 u_4; // used - u32 u_8; // used - u32 u_C; // used -} + /* 0x000 */ u32 u_0; + /* 0x004 */ u32 u_4; + /* 0x008 */ u32 u_8; + /* 0x00C */ u32 u_C; +} Unk0202A68C; // total size 0x10 (16) -struct Unk0202A744_substruct1 -{ - u8 data[0x63c]; -}; // total size 0x63C (1596) - -struct Unk0202A744_substruct2 -{ - u8 data[1020]; -}; // total size 0x3FC (1020) - -struct Unk0202A744 -{ - u8 filler[254]; - u8 u_FE; - u8 u_FF; - u8 u_100; - u8 u_101; - u8 u_102; - u8 u_103; - struct Unk0202A744_substruct1 u_104; - struct Unk0202A744_substruct2 u_740; -}; - struct Unk0202A784 { - u8 u_0; - u8 u_1; -}; - -struct Unk0202A798_substruct1 -{ - u8 u_0[168]; - u8 u_A8[16]; - u16 filler_2[8]; - u8 u_C8_0:1; - u8 u_C8_1:1; - u8 u_C8_filler:6; - u8 u_C9; - u16 u_CA[4]; - u16 u_D2[4]; - u16 u_DA[4]; - u8 filler_3[2]; -}; // total size 0xE4 (228) - -struct Unk0202A798_1 -{ - u8 filler[260]; - struct Unk0202A798_substruct1 u_104[4]; + /* 0x000 */ u8 u_0; + /* 0x001 */ u8 u_1; }; -struct Unk0202A798_substruct2 +struct Unk0202A798_substruct { - u32 u_0; - u16 u_4; - u8 filler_1[2]; - u16 u_8[8]; - u16 u_18[4]; - u16 u_20[4]; - u16 u_28[4]; + /* 0x000 */ u32 u_0; + /* 0x004 */ u16 u_4; + /* 0x006 */ u8 filler_1[2]; + /* 0x008 */ u16 u_8[8]; + /* 0x018 */ u16 u_18[4]; + /* 0x020 */ u16 u_20[4]; + /* 0x028 */ u16 u_28[4]; }; // total size 0x30 (48) -struct Unk0202A798_2 +struct Unk0202A798 { - struct Unk0202A798_substruct2 u_0; - u8 u_30[168]; + /* 0x000 */ struct Unk0202A798_substruct u_0; + /* 0x030 */ u8 u_30[168]; }; -s32 FUN_0202A1E0(); -void FUN_0202A1E4(void *dst); -void FUN_0202A1F0(struct Unk0202A1F0 *unk); -void FUN_0202A204(struct UnkMailStruct *unk); -void FUN_0202A230(void *dst); -u32 FUN_0202A240(struct Unk0202A240 *unk, u32 arg1, void *dst); -void FUN_0202A2C4(struct Unk0202A240 *dst, u32 arg1, void *src); -void FUN_0202A36C(struct Unk0202A240 *unk, s32 arg1, s32 arg2, s32 arg3); -u8 FUN_0202A398(struct Unk0202A240 *unk); -void FUN_0202A3A0(struct Unk0202A240 *unk, u16 arg1); -u16 FUN_0202A3B4(struct Unk0202A3B4 *unk, u16 arg1, s32 arg2); -u8 FUN_0202A40C(struct Unk0202A40C *unk, s32 arg1); -u8 FUN_0202A444(struct Unk0202A444 *unk, s32 arg1); -void FUN_0202A474(void *dst, s32 arg1, const void *src); -void FUN_0202A498(const void *src, s32 arg1, void *dst); -u16 FUN_0202A4B8(struct Unk0202A4B8 *arg0, struct Unk0202A4B8 *arg1); -u16 FUN_0202A520(struct Unk0202A4B8 *unk); -u8 FUN_0202A524(struct Unk0202A4B8 *unk); -u16 FUN_0202A538(struct Unk0202A4B8 *unk, s32 arg1, s32 arg2); -BOOL FUN_0202A578(struct Unk0202A578 *arg0, u16 arg1, u32 arg2); -void FUN_0202A5CC(struct Unk0202A5CC *unk, u32 arg1); -u32 FUN_0202A5D0(struct Unk0202A5CC *unk); -void FUN_0202A5D4(struct SaveBlock2 *sav2, u32 arg1, struct MailMessage *arg2); -struct MailMessage *FUN_0202A5F4(struct SaveBlock2 *sav2, u32 arg1); -void FUN_0202A60C(struct Unk0202A670 *arg0, u8 arg1, u8 arg2, struct Unk0202A68C *arg3); -void FUN_0202A670(struct Unk0202A670 *arg0); -BOOL FUN_0202A68C(struct Unk0202A68C *arg0, struct Unk0202A68C *arg1); -BOOL FUN_0202A6B4(struct Unk0202A670 *arg0, u8 arg1, u8 arg2, struct Unk0202A68C *arg3); -u8 FUN_0202A744(struct Unk0202A744 *unk); -u8 FUN_0202A74C(struct Unk0202A744 *unk); -void FUN_0202A754(struct Unk0202A744 *dest, void *src, u8 arg2, u8 arg3); -void FUN_0202A784(struct Unk0202A744 *src, struct Unk0202A784 *ptr1); -void FUN_0202A798(); -void FUN_0202A838(struct Unk0202A744 *dest, void *src, u8 arg2, u8 arg3); -void FUN_0202A864(struct Unk0202A744 *src, struct Unk0202A784 *dest); -struct Unk0202A744_substruct2 *FUN_0202A878(struct Unk0202A744 *src, u32 head_id); -s32 FUN_0202A89C(); -void FUN_0202A8A4(struct UnkSaveStruct_0202A5D4 *savStruct); -struct UnkSaveStruct_0202A5D4 *FUN_0202A8CC(struct SaveBlock2* sav2); -struct Unk0202A1F0 *FUN_0202A8D8(struct SaveBlock2* sav2); -void *FUN_0202A8E4(struct SaveBlock2* sav2); +s32 SaveStruct23_Substruct4_Substruct1_sizeof(); +void SaveStruct23_Substruct1_Init(struct SaveStruct23_Substruct1 *substruct1); +void SaveStruct23_Substruct2_Init(struct SaveStruct23_Substruct2 *substruct2); +void SaveStruct23_Messages_Init(struct SaveStruct23_Messages *mailStruct); +void SaveStruct23_Substruct4_Init(struct SaveStruct23_Substruct4 *substruct4); +u32 SaveStruct23_Substruct1_GetField(struct SaveStruct23_Substruct1 *substruct1, SaveStruct23_Substruct1_Field field, void *dst); +void SaveStruct23_Substruct1_SetField(struct SaveStruct23_Substruct1 *substruct1, SaveStruct23_Substruct1_Field field, void *value); +void FUN_0202A36C(struct SaveStruct23_Substruct1 *substruct1, s32 arg1, s32 arg2, s32 arg3); +BOOL SaveStruct23_Substruct1_GetFlag1(struct SaveStruct23_Substruct1 *substruct1); +void SaveStruct23_Substruct1_SetFlag1(struct SaveStruct23_Substruct1 *substruct1, BOOL arg1); +u16 SaveStruct23_Substruct2_SetField_0x0(struct SaveStruct23_Substruct2 *substruct2, u16 value, DataSetMode mode); +u8 SaveStruct23_Substruct2_SetField_0x2(struct SaveStruct23_Substruct2 *substruct2, DataSetMode mode); +u8 SaveStruct23_Substruct2_SetField_0x3(struct SaveStruct23_Substruct2 *substruct2, DataSetMode mode); +void SaveStruct23_Substruct2_SetArray(struct SaveStruct23_Substruct2 *substruct2, s32 mode, void *src); +void SaveStruct23_Substruct2_GetArray(struct SaveStruct23_Substruct2 *substruct2, s32 mode, void *dst); +u16 SaveStruct23_Substruct2_SetField_0x16(struct SaveStruct23_Substruct2 *substruct2, struct Unk0202A4B8 *arg1); +u16 SaveStruct23_Substruct2_GetField_0x16(struct SaveStruct23_Substruct2 *substruct2); +u8 FUN_0202A524(struct SaveStruct23_Substruct2 *substruct2); +u16 SaveStruct23_Substruct2_SetField_0xC(struct SaveStruct23_Substruct2 *substruct2, u16 arg1, DataSetMode mode); +BOOL SaveStruct23_Substruct2_SetFlag(struct SaveStruct23_Substruct2 *substruct2, u16 flagNumber, DataSetMode mode); +void SaveStruct23_Substruct2_SetField_0x4(struct SaveStruct23_Substruct2 *substruct2, u32 arg1); +u32 SaveStruct23_Substruct2_GetField_0x4(struct SaveStruct23_Substruct2 *substruct2); +void SaveStruct23_SetMessage(struct SaveBlock2 *sav2, u32 index, struct MailMessage *message); +struct MailMessage *SaveStruct23_GetMessage(struct SaveBlock2 *sav2, u32 index); +void SaveStruct23_Substruct4_SetArrayFlag(struct SaveStruct23_Substruct4 *substruct4, u8 arg1, u8 arg2, struct Unk0202A68C *arg3); +void SaveStruct23_Substruct4_ClearArrayFlags(struct SaveStruct23_Substruct4 *substruct4); +BOOL StructUnk0202A68C_Compare(struct Unk0202A68C *struct1, struct Unk0202A68C *struct2); +BOOL SaveStruct23_Substruct4_GetArrayFlag(struct SaveStruct23_Substruct4 *substruct4, u8 arg1, u8 arg2, struct Unk0202A68C *arg3); +u8 SaveStruct23_Substruct4_GetField_0xFE(struct SaveStruct23_Substruct4 *substruct4); +u8 SaveStruct23_Substruct4_GetField_0xFF(struct SaveStruct23_Substruct4 *substruct4); +void SaveStruct23_Substruct4_SetSubstruct1(struct SaveStruct23_Substruct4 *substruct4, struct SaveStruct23_Substruct4_Substruct1 *substruct4_substruct1, u8 arg2, u8 arg3); +void FUN_0202A784(struct SaveStruct23_Substruct4 *substruct4, struct Unk0202A784 *dest); +void FUN_0202A798(struct SaveStruct23_Substruct4 *substruct4, struct Unk0202A798 *arg1, u32 arg2); +void FUN_0202A838(struct SaveStruct23_Substruct4 *substruct4, struct SaveStruct23_Substruct4_Substruct2 *substruct4_substruct2, u8 arg2, u8 arg3); +void FUN_0202A864(struct SaveStruct23_Substruct4 *substruct4, struct Unk0202A784 *dest); +struct SaveStruct23_Substruct4_Substruct2 *FUN_0202A878(struct SaveStruct23_Substruct4 *substruct4, u32 heap_id); +s32 SaveStruct23_sizeof(); +void SaveStruct23_Init(struct SaveStruct23 *saveStruct23); +struct SaveStruct23_Substruct1 *SaveStruct23_GetSubstruct1(struct SaveBlock2* sav2); +struct SaveStruct23_Substruct2 *SaveStruct23_GetSubstruct2(struct SaveBlock2* sav2); +struct SaveStruct23_Substruct4 *SaveStruct23_GetSubstruct4(struct SaveBlock2* sav2); #endif //POKEDIAMOND_UNK_0202A1E0_H \ No newline at end of file -- cgit v1.2.3 From 9d717596e138c8e24aca0be9b963c6dd22a3716e Mon Sep 17 00:00:00 2001 From: GliMusings Date: Wed, 23 Jun 2021 18:05:55 -0500 Subject: Starting unk_0201C6B4 --- include/unk_0201C6B4.h | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 include/unk_0201C6B4.h (limited to 'include') diff --git a/include/unk_0201C6B4.h b/include/unk_0201C6B4.h new file mode 100644 index 00000000..956f7bc2 --- /dev/null +++ b/include/unk_0201C6B4.h @@ -0,0 +1,10 @@ +#ifndef POKEDIAMOND_UNK_0201C6B4_H +#define POKEDIAMOND_UNK_0201C6B4_H + +u32 FUN_0201C6B4(s8 * r0); +s8 * FUN_0201C6C8(s8 * r0, s8 * r1, s8 r2); +s32 FUN_0201C70C(s8 * r4); +void FUN_0201C750(s8 * r5, s8 * r4); +BOOL FUN_0201C78C(u32 r0); + +#endif // POKEDIAMOND_UNK_0201C6B4_H \ No newline at end of file -- cgit v1.2.3 From 9ff579dac825bf4afa7c9fb4ea3e5a1ffb2d996d Mon Sep 17 00:00:00 2001 From: Michael Panzlaff Date: Thu, 24 Jun 2021 15:55:08 +0200 Subject: cleanup header includes and orders Not complete, but a good start. --- include/global.h | 2 +- include/heap.h | 1 + include/nitro/OS_alarm_shared.h | 1 + include/nitro/OS_thread_shared.h | 3 + include/nitro/SND_alarm_shared.h | 30 +++++++ include/nitro/SND_main_shared.h | 176 +++++++++++++++++++++++++++++++++++++++ include/nitro/SND_work_shared.h | 46 ++++++++++ 7 files changed, 258 insertions(+), 1 deletion(-) create mode 100644 include/nitro/SND_alarm_shared.h create mode 100644 include/nitro/SND_main_shared.h create mode 100644 include/nitro/SND_work_shared.h (limited to 'include') diff --git a/include/global.h b/include/global.h index 1853dbc3..8353ed2c 100644 --- a/include/global.h +++ b/include/global.h @@ -5,7 +5,7 @@ #include "MWC_string.h" #include "function_target.h" -#include "nitro.h" +#include "nitro/types.h" #include "constants/global.h" #include "error_handling.h" diff --git a/include/heap.h b/include/heap.h index 36c747a7..57cd88e8 100644 --- a/include/heap.h +++ b/include/heap.h @@ -2,6 +2,7 @@ #define POKEDIAMOND_HEAP_H #include "global.h" +#include "nitro/OS_arena_shared.h" #include "NNS_FND_expheap.h" #include "NNS_FND_allocator.h" diff --git a/include/nitro/OS_alarm_shared.h b/include/nitro/OS_alarm_shared.h index fe549351..1a24f139 100644 --- a/include/nitro/OS_alarm_shared.h +++ b/include/nitro/OS_alarm_shared.h @@ -15,6 +15,7 @@ #include "nitro/types.h" #include "nitro/OS_tick_shared.h" +#include "nitro/OS_thread_shared.h" typedef void (*OSAlarmHandler) (void *); diff --git a/include/nitro/OS_thread_shared.h b/include/nitro/OS_thread_shared.h index a0cce54d..0c0e7f9a 100644 --- a/include/nitro/OS_thread_shared.h +++ b/include/nitro/OS_thread_shared.h @@ -15,6 +15,9 @@ #include "nitro/types.h" +/* UGLY HACK: include proc specific header for OSContext */ +#include "OS_context.h" + typedef struct OSiAlarm OSAlarm; typedef struct _OSThread OSThread; diff --git a/include/nitro/SND_alarm_shared.h b/include/nitro/SND_alarm_shared.h new file mode 100644 index 00000000..a1e8ed9d --- /dev/null +++ b/include/nitro/SND_alarm_shared.h @@ -0,0 +1,30 @@ +/* + * NOTE: + * This file is shared between ARM9 and ARM7 + * DO NOT PUT PROC SPECIFIC CODE IN HERE + * Thank You! + */ + +/* + * DO NOT INCLUDE THIS FILE DIRECTLY + * Include SND_alarm.h from the specific proc's lib + */ + +#ifndef POKEDIAMOND_SND_ALARM_SHARED_H +#define POKEDIAMOND_SND_ALARM_SHARED_H + +#include "nitro/OS_tick_shared.h" +#include "nitro/OS_alarm_shared.h" + +struct SNDAlarm { + u8 enable; // 0x00 + u8 id; // 0x01 + u16 unk_2; // 0x02 + OSTick tick; // 0x04 + OSTick period; // 0x0C + OSAlarm alarm; // 0x14 +}; // size = 0x40 + +#define SND_ALARM_COUNT 8 + +#endif //POKEDIAMOND_SND_ALARM_SHARED_H diff --git a/include/nitro/SND_main_shared.h b/include/nitro/SND_main_shared.h new file mode 100644 index 00000000..d77273ed --- /dev/null +++ b/include/nitro/SND_main_shared.h @@ -0,0 +1,176 @@ +/* + * NOTE: + * This file is shared between ARM9 and ARM7 + * DO NOT PUT PROC SPECIFIC CODE IN HERE + * Thank You! + */ + +/* + * DO NOT INCLUDE THIS FILE DIRECTLY + * Include SND_main.h from the specific proc's lib + */ + +#ifndef POKEDIAMOND_SND_MAIN_SHARED_H +#define POKEDIAMOND_SND_MAIN_SHARED_H + +struct SNDWaveParam { + u8 format; // 0x0 + u8 loopEnabled; // 0x1 + u16 samplerate; // 0x2 + u16 timer; // 0x4 + u16 loopStart; // 0x6 + u32 loopLength; // 0x8 +}; // size = 0xC + +struct SNDLfoParam { + u8 target; // 0x0 + u8 speed; // 0x1 + u8 depth; // 0x2 + u8 range; // 0x3 + u16 delay; // 0x4 +}; // size = 0x6 + +struct SNDLfo { + struct SNDLfoParam param; // 0x0 + u16 delayCounter; // 0x6 + u16 counter; // 0x8 +}; // size = 0xA + +struct SNDExChannel { + u8 id; // 0x00 + u8 type; // 0x01 + u8 envStatus; // 0x02 + + struct { + u8 active : 1; + u8 start : 1; + u8 autoSweep : 1; + u8 syncFlag : 5; + } flags; // 0x03 + + u8 panRange; // 0x04 + u8 rootMidiKey; // 0x05 + s16 userDecay2; // 0x06 + + u8 midiKey; // 0x08 + u8 velocity; // 0x09 + s8 initPan; // 0x0A + s8 userPan; // 0x0B + + s16 userDecay; // 0x0C + s16 userPitch; // 0x0E + + s32 envAttenuation; // 0x10 + s32 sweepCounter; // 0x14 + s32 sweepLength; // 0x18 + + u8 envAttack; // 0x1C + u8 envSustain; // 0x1D + u16 envDecay; // 0x1E + u16 envRelease; // 0x20 + u8 priority; // 0x22 + u8 pan; // 0x23 + u16 volume; // 0x24 + u16 timer; // 0x26 + + struct SNDLfo lfo; // 0x28 + + s16 sweepPitch; // 0x32 + + s32 length; // 0x34 + + struct SNDWaveParam waveParam; // 0x38 + + union { + const void *waveDataPtr; + u32 dutyCycle; + }; // 0x44 + + void (*callback)(struct SNDExChannel *chn, u32 status, void *userData); // 0x48 + void *callbackUserData; // 0x4C + + struct SNDExChannel *channelLLNext; // 0x50 +}; // size = 0x54 + +#define SND_TRACK_COUNT_PER_PLAYER 16 +#define SND_INVALID_TRACK_INDEX 0xFF + +struct SNDBankData; + +struct SNDPlayer { + struct { + u8 active : 1; + u8 prepared : 1; + u8 paused : 1; + } flags; // 0x0 + + u8 playerId; // 0x1 + u8 unk_2[2]; // 0x2 + + u8 prio; // 0x4 + u8 volume; // 0x5 + s16 extFader; // 0x6 + + u8 tracks[SND_TRACK_COUNT_PER_PLAYER]; // 0x8 + + u16 tempo; // 0x18 + u16 tempoRatio; // 0x1A + u16 tempoCounter; // 0x1C + u8 unk_1E[2]; // 0x1E + + struct SNDBankData *bank; // 0x20 +}; // size = 0x24 + +#define SND_TRACK_MAX_CALL 3 + +struct SNDTrack { + struct { + u8 active : 1; + u8 noteWait : 1; + u8 muted : 1; + u8 tie : 1; + u8 noteFinishWait : 1; + u8 portamento : 1; + u8 cmp : 1; // ??? + u8 channelMask : 1; + } flags; // 0x00 + + u8 panRange; // 0x01 + u16 program; // 0x02 + + u8 volume; // 0x04 + u8 expression; // 0x05 + s8 pitchBend; // 0x06 + u8 bendRange; // 0x07 + + s8 pan; // 0x08 + s8 extPan; // 0x09 + s16 extFader; // 0x0A + s16 extPitch; // 0x0C + u8 envAttack; // 0x0E + u8 envDecay; // 0x0F + u8 envSustain; // 0x10 + u8 envRelease; // 0x11 + u8 priority; // 0x12 + s8 transpose; // 0x13 + + u8 portamentoKey; // 0x14 + u8 portamentoTime; // 0x15 + s16 sweepPitch; // 0x16 + + struct SNDLfoParam mod; // 0x18 + u16 channelMask; // 0x1E + + s32 wait; // 0x20 + + const u8 *trackDataStart; // 0x24 + const u8 *trackDataPos; // 0x28 + const u8 *posCallStack[SND_TRACK_MAX_CALL]; // 0x34 + u8 loopCount[SND_TRACK_MAX_CALL]; // 0x38 + u8 callStackDepth; // 0x3B + + struct SNDExChannel *channelLLHead; // 0x3C +}; // size = 0x40 + + #endif //POKEDIAMOND_SND_MAIN_SHARED_H + \ No newline at end of file diff --git a/include/nitro/SND_work_shared.h b/include/nitro/SND_work_shared.h new file mode 100644 index 00000000..0de3981e --- /dev/null +++ b/include/nitro/SND_work_shared.h @@ -0,0 +1,46 @@ +/* + * NOTE: + * This file is shared between ARM9 and ARM7 + * DO NOT PUT PROC SPECIFIC CODE IN HERE + * Thank You! + */ + +/* + * DO NOT INCLUDE THIS FILE DIRECTLY + * Include SND_work.h from the specific proc's lib + */ + +#ifndef POKEDIAMOND_SND_WORK_SHARED_H +#define POKEDIAMOND_SND_WORK_SHARED_H + +#include "nitro/SND_alarm_shared.h" +#include "nitro/SND_main_shared.h" + +#define SND_PLAYER_COUNT 16 +#define SND_CHANNEL_COUNT 16 +#define SND_TRACK_COUNT 32 + +struct SNDWork { + struct SNDExChannel channels[SND_CHANNEL_COUNT]; // 0x00 + struct SNDPlayer players[SND_PLAYER_COUNT]; // 0x540 + struct SNDTrack tracks[SND_TRACK_COUNT]; // 0x780 + struct SNDAlarm alarms[SND_ALARM_COUNT]; // 0xF80 +}; // size = 0x1180 + +struct SNDSharedWork { + u32 finishedCommandTag; // 0x0 + u32 playerStatus; // 0x4 + u16 channelStatus; // 0x8 + u16 captureStatus; // 0xA + u8 unk_C[0x14]; // 0xC + struct { + s16 localVars[16]; // local 0x0 + u32 tickCounter; // local 0x20 + } players[SND_PLAYER_COUNT]; // 0x20 + s16 globalVars[16]; // 0x260 +}; // size = 0x280 + +extern struct SNDWork SNDi_Work; +extern struct SNDSharedWork *SNDi_SharedWork; + + #endif //POKEDIAMOND_SND_WORK_SHARED_H -- cgit v1.2.3 From 7897c7e2946a008098d9e1cc7209bcfd00e43d8a Mon Sep 17 00:00:00 2001 From: GliMusings Date: Fri, 25 Jun 2021 21:17:19 -0500 Subject: Not yet matching, 3 registers rotated in FUN_0201C70C --- include/unk_0201C6B4.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/unk_0201C6B4.h b/include/unk_0201C6B4.h index 956f7bc2..fdd66597 100644 --- a/include/unk_0201C6B4.h +++ b/include/unk_0201C6B4.h @@ -1,9 +1,9 @@ #ifndef POKEDIAMOND_UNK_0201C6B4_H #define POKEDIAMOND_UNK_0201C6B4_H -u32 FUN_0201C6B4(s8 * r0); +int FUN_0201C6B4(s8 * r0); s8 * FUN_0201C6C8(s8 * r0, s8 * r1, s8 r2); -s32 FUN_0201C70C(s8 * r4); +int FUN_0201C70C(s8 * r4); void FUN_0201C750(s8 * r5, s8 * r4); BOOL FUN_0201C78C(u32 r0); -- cgit v1.2.3 From f97bb6e31678d2455999873e14c5a60530f74adb Mon Sep 17 00:00:00 2001 From: GliMusings Date: Fri, 25 Jun 2021 23:40:07 -0500 Subject: OK --- include/unk_0201C6B4.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/unk_0201C6B4.h b/include/unk_0201C6B4.h index fdd66597..c5657388 100644 --- a/include/unk_0201C6B4.h +++ b/include/unk_0201C6B4.h @@ -1,9 +1,9 @@ #ifndef POKEDIAMOND_UNK_0201C6B4_H #define POKEDIAMOND_UNK_0201C6B4_H -int FUN_0201C6B4(s8 * r0); +s32 FUN_0201C6B4(s8 * r0); s8 * FUN_0201C6C8(s8 * r0, s8 * r1, s8 r2); -int FUN_0201C70C(s8 * r4); +s32 FUN_0201C70C(s8 * r4); void FUN_0201C750(s8 * r5, s8 * r4); BOOL FUN_0201C78C(u32 r0); -- cgit v1.2.3 From a1b1d3b47fb5b2fbdedd164bcdf5844fab6f9d3a Mon Sep 17 00:00:00 2001 From: GliMusings Date: Sat, 26 Jun 2021 00:05:23 -0500 Subject: Forget newlines --- include/unk_0201C6B4.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/unk_0201C6B4.h b/include/unk_0201C6B4.h index c5657388..0a501954 100644 --- a/include/unk_0201C6B4.h +++ b/include/unk_0201C6B4.h @@ -7,4 +7,4 @@ s32 FUN_0201C70C(s8 * r4); void FUN_0201C750(s8 * r5, s8 * r4); BOOL FUN_0201C78C(u32 r0); -#endif // POKEDIAMOND_UNK_0201C6B4_H \ No newline at end of file +#endif // POKEDIAMOND_UNK_0201C6B4_H -- cgit v1.2.3