diff options
| author | Anghelo Carvajal <angheloalf95@gmail.com> | 2023-09-10 13:45:07 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-09-10 09:45:07 -0700 |
| commit | 67934dfa87091278cad91df45e9b9577236e5742 (patch) | |
| tree | 688298159de2684a2794c94d0d1c93bfb34894b0 /include | |
| parent | 28cdec47bc4cc93bdfbc5fbeeda2a827817d07a8 (diff) | |
`m_mail.c` OK (#92)
* C files
* mMl_clear_mail
* bunch of functions
* mMl_clear_mail_header_common, mMl_copy_mail_header_common
* mMl_hunt_for_send_address
* mMl_set_mail_name_npcinfo, mMl_get_npcinfo_from_mail_name
* mMl_check_send_mail
* mMl_check_set_present_myself
* func_8009C284_jp
* func_8009C1C0_jp
* func_8009C2D8_jp
* renames
* format
* fix
Diffstat (limited to 'include')
| -rw-r--r-- | include/6B8A70.h | 7 | ||||
| -rw-r--r-- | include/6BFE60.h | 38 | ||||
| -rw-r--r-- | include/6DB420.h | 22 | ||||
| -rw-r--r-- | include/m_common_data.h | 19 | ||||
| -rw-r--r-- | include/m_home.h | 11 | ||||
| -rw-r--r-- | include/m_lib.h | 2 | ||||
| -rw-r--r-- | include/m_mail.h | 75 | ||||
| -rw-r--r-- | include/m_npc.h | 6 | ||||
| -rw-r--r-- | include/m_private.h | 17 | ||||
| -rw-r--r-- | include/m_submenu.h | 4 | ||||
| -rw-r--r-- | include/unknown_structs.h | 15 |
11 files changed, 145 insertions, 71 deletions
diff --git a/include/6B8A70.h b/include/6B8A70.h index db73f5e..4f4a3d1 100644 --- a/include/6B8A70.h +++ b/include/6B8A70.h @@ -2,13 +2,18 @@ #define C_6B8A70_H #include "ultra64.h" +#include "unk.h" + +typedef struct LandName { + /* 0x0 */ UNK_TYPE1 unk_0[0x6]; +} LandName; // size = 0x6 // void func_80094DD0_jp(); // void func_80094E10_jp(); // void func_80094E38_jp(); // void func_80094E90_jp(); // void func_80094EE0_jp(); -// void mLd_CopyLandName(); +void mLd_CopyLandName(LandName* arg0, LandName* arg1); // void func_80094F24_jp(); // void func_80094F84_jp(); // void func_8009504C_jp(); diff --git a/include/6BFE60.h b/include/6BFE60.h deleted file mode 100644 index 917d622..0000000 --- a/include/6BFE60.h +++ /dev/null @@ -1,38 +0,0 @@ -#ifndef C_6BFE60_H -#define C_6BFE60_H - -#include "ultra64.h" -#include "unk.h" - -struct struct_func_8085CE18_jp_arg4; - -typedef struct mMl { - /* 0x00 */ UNK_TYPE1 unk_00[0xA4]; -} mMl; // size = 0xA4 - -// void func_8009C1C0_jp(); -// void func_8009C284_jp(); -// void func_8009C2D8_jp(); -// void func_8009C344_jp(); -void mMl_clear_mail(mMl* arg0); -// void mMl_clear_mail_box(); -// void func_8009C414_jp(); -// void func_8009C438_jp(); -// void func_8009C45C_jp(); -// void func_8009C480_jp(); -// void func_8009C4A0_jp(); -// void func_8009C4C8_jp(); -// void func_8009C4F4_jp(); -// void func_8009C534_jp(); -// void func_8009C5A4_jp(); -// void func_8009C608_jp(); -// void func_8009C67C_jp(); -// void func_8009C69C_jp(); -// void func_8009C6EC_jp(); -// void mMl_set_mail_name_npcinfo(); -// void mMl_get_npcinfo_from_mail_name(); -// void mMl_hunt_for_send_address(); -UNK_TYPE mMl_check_send_mail(struct struct_func_8085CE18_jp_arg4* arg0); -// void func_8009C8C0_jp(); - -#endif diff --git a/include/6DB420.h b/include/6DB420.h index f110141..eeef6cc 100644 --- a/include/6DB420.h +++ b/include/6DB420.h @@ -2,23 +2,35 @@ #define C_6DB420_H #include "ultra64.h" -#include "m_actor.h" +#include "6B8A70.h" +#include "unk.h" struct Private_c; struct mPr_map_info_c; struct mLd_land_info_c; struct mPr_mother_mail_info_c; +typedef struct PlayerName { + /* 0x0 */ UNK_TYPE1 unk_0[0x6]; +} PlayerName; // size = 0x6 + +typedef struct PersonalID { + /* 0x0 */ PlayerName unk_0; + /* 0x6 */ LandName unk_6; + /* 0xC */ u16 unk_C; + /* 0xE */ u16 unk_E; +} PersonalID; // size = 0x10 + // void func_800B7780_jp(); -// void mPr_CopyPlayerName(); +void mPr_CopyPlayerName(PlayerName* dst, PlayerName* src); // void func_800B77C4_jp(); // void func_800B7804_jp(); // void func_800B785C_jp(); // void func_800B7914_jp(); -// void func_800B795C_jp(); +void mPr_ClearPersonalID(PersonalID* arg0); // void func_800B7998_jp(); -// void func_800B79E0_jp(); -// void mPr_CheckCmpPersonalID(); +void mPr_CopyPersonalID(PersonalID* arg0, PersonalID* arg1); +s32 mPr_CheckCmpPersonalID(PersonalID* arg0, PersonalID* arg1); // void func_800B7A94_jp(); // void func_800B7AB0_jp(); void mPr_ClearPrivateInfo(struct Private_c* private); diff --git a/include/m_common_data.h b/include/m_common_data.h index 9e74dda..bd3d432 100644 --- a/include/m_common_data.h +++ b/include/m_common_data.h @@ -2,16 +2,17 @@ #define M_COMMON_DATA_H #include "ultra64.h" -#include "unk.h" -#include "m_npc.h" -#include "m_npc_walk.h" -#include "m_quest.h" -#include "m_private.h" -#include "m_land.h" #include "lb_rtc.h" -#include "m_home.h" #include "m_event.h" #include "m_field_make.h" +#include "m_home.h" +#include "m_land.h" +#include "m_mail.h" +#include "m_npc.h" +#include "m_npc_walk.h" +#include "m_private.h" +#include "m_quest.h" +#include "unk.h" struct Actor; struct ActorOverlay; @@ -157,7 +158,9 @@ typedef struct CommonData { /* 0x0EDA4 */ mEv_event_save_c event_save_data; /* 0x0EE40 */ u8 unk0EE40[0x118]; /* 0x0EF58 */ u16 fruit; - /* 0x0EF5A */ u8 unk0EF5A[0x4DE]; + /* 0x0EF5A */ UNK_TYPE1 unk_0EF5A[0x12]; + /* 0x0EF6C */ Mail unk_0EF6C[5]; + /* 0x0F2A0 */ UNK_TYPE1 unk_0F2A0[0x198]; /* 0x0F438 */ u8 station_type; /* train station type */ /* 0x0F439 */ u8 unk0F439[0x3]; /* 0x0F43C */ u16 deposit[FG_BLOCK_X_NUM * FG_BLOCK_Z_NUM][UT_Z_NUM]; /* flags for which items are buried around town */ diff --git a/include/m_home.h b/include/m_home.h index 3f2cfda..3d0b73c 100644 --- a/include/m_home.h +++ b/include/m_home.h @@ -2,6 +2,8 @@ #define M_HOME_H_H #include "ultra64.h" +#include "6DB420.h" +#include "unk.h" #define HOME_MAILBOX_SIZE 10 #define HANIWA_ITEM_HOLD_NUM 4 @@ -47,13 +49,14 @@ typedef struct Haniwa_c { } Haniwa_c; // size = 0x5C typedef struct mHm_hs_c { - /* 0x000 */ char unk000[0x22]; + /* 0x000 */ PersonalID unk_000; + /* 0x010 */ UNK_TYPE1 unk_010[0x12]; /* 0x022 */ u8 unk_022; - /* 0x023 */ char unk023[0x1]; + /* 0x023 */ UNK_TYPE1 unk023[0x1]; /* 0x024 */ u8 unk_024; - /* 0x025 */ char unk025[0xABB]; + /* 0x025 */ UNK_TYPE1 unk025[0xABB]; /* 0xAE0 */ Haniwa_c haniwa; - /* 0xB3C */ char unkB3C[0xC]; + /* 0xB3C */ UNK_TYPE1 unkB3C[0xC]; } mHm_hs_c; // size = 0xB48 diff --git a/include/m_lib.h b/include/m_lib.h index 005c7d6..2478201 100644 --- a/include/m_lib.h +++ b/include/m_lib.h @@ -7,7 +7,7 @@ struct Game_Play; -void mem_copy(u8* dst, u8* src, u32 size); +void mem_copy(void* dst, void* src, u32 size); s32 mem_clear(void* ptr, size_t size, u8 value); // void mem_cmp(); f32 cos_s(s16 angle); diff --git a/include/m_mail.h b/include/m_mail.h new file mode 100644 index 0000000..cbb9fdd --- /dev/null +++ b/include/m_mail.h @@ -0,0 +1,75 @@ +#ifndef M_MAIL_H +#define M_MAIL_H + +#include "ultra64.h" +#include "6B8A70.h" +#include "6DB420.h" +#include "unk.h" + +struct struct_func_8085CE18_jp_arg4; + +// TODO: move to a better header +typedef struct mMl_get_npcinfo_from_mail_name_arg0 { + /* 0x0 */ u16 unk_0; + /* 0x2 */ u16 unk_2; + /* 0x4 */ LandName unk_4; + /* 0xA */ u8 unk_A; + /* 0xB */ u8 unk_B; + /* 0xB */ u8 unk_C; +} mMl_get_npcinfo_from_mail_name_arg0; // size >= 0xC + +// MailName? +typedef struct mMl_unk_00 { + /* 0x00 */ PersonalID unk_00; + /* 0x10 */ u8 unk_10; +} mMl_unk_00; // size = 0x12 + +typedef struct mMl_unk_2A { + /* 0x00 */ UNK_TYPE1 unk_00[0x7A]; +} mMl_unk_2A; // size = 0x7A + +typedef struct MailHeaderCommon { + /* 0x00 */ s8 unk_00; + /* 0x00 */ u8 unk_01; + /* 0x02 */ u8 unk_02[10]; + /* 0x0C */ u8 unk_0C[16]; +} MailHeaderCommon; //size = 0x1C + +// MailBox? +typedef struct Mail { + /* 0x00 */ mMl_unk_00 unk_00; + /* 0x12 */ mMl_unk_00 unk_12; + /* 0x24 */ UNK_TYPE1 unk_24[0x2]; + /* 0x26 */ u8 unk_26; + /* 0x27 */ UNK_TYPE1 unk_27[0x1]; + /* 0x28 */ u8 unk_28; + /* 0x29 */ u8 unk_29; + /* 0x2A */ mMl_unk_2A unk_2A; +} Mail; // size = 0xA4 + +s32 mMl_strlen(const char* arg0, s32 size, char c); +s32 mMl_strlen2(s32* arg0, const char* arg1, s32 size, char c); +void mMl_strcpy_back(char* dst, const char* src, s32 size); +void mMl_clear_mail_header(Mail* mail); +void mMl_clear_mail(Mail* mail); +void mMl_clear_mail_box(Mail* mail, s32 arg1); +s32 mMl_check_not_used_mail(Mail* mail); +void mMl_copy_header_name(mMl_unk_00* arg0, mMl_unk_00* arg1); +void mMl_set_from_name(Mail* arg0, Mail* arg1); +void mMl_set_to_name(Mail* arg0, Mail* arg1); +void mMl_set_to_plname(Mail* arg0, Mail* arg1); +void mMl_set_playername(Mail* mail, PersonalID* arg1); +void mMl_init_mail(Mail* mail, PersonalID* arg1); +s32 mMl_chk_mail_free_space(Mail mail[], s32 arg1); +s32 mMl_use_mail_space(Mail mail[], s32 arg1, PersonalID* arg2); +s32 mMl_count_use_mail_space(Mail mail[], s32 arg1); +void mMl_copy_mail(Mail* dst, Mail* src); +void mMl_clear_mail_header_common(MailHeaderCommon* arg0); +void mMl_copy_mail_header_common(MailHeaderCommon* arg0, MailHeaderCommon* arg1); +void mMl_set_mail_name_npcinfo(mMl_unk_00* arg0, mMl_get_npcinfo_from_mail_name_arg0* arg1); +s32 mMl_get_npcinfo_from_mail_name(mMl_get_npcinfo_from_mail_name_arg0* arg0, mMl_unk_00* arg1); +s32 mMl_hunt_for_send_address(Mail* mail); +s32 mMl_check_send_mail(struct struct_func_8085CE18_jp_arg4* arg0); +s32 mMl_check_set_present_myself(Mail* mail); + +#endif diff --git a/include/m_npc.h b/include/m_npc.h index c566a70..8d83bff 100644 --- a/include/m_npc.h +++ b/include/m_npc.h @@ -5,6 +5,8 @@ #include "m_actor.h" #include "unk.h" +struct mMl_get_npcinfo_from_mail_name_arg0; + #define ANIMAL_NUM_MAX 15 /* Maximum number of villagers possible in town */ typedef struct mNpc_NpcList_c { @@ -108,7 +110,7 @@ void func_800A91DC_jp(void); // void func_800AA0B8_jp(); void func_800AA124_jp(void); // void func_800AA14C_jp(); -// void mNpc_GetLooks(); +s32 mNpc_GetLooks(u16 arg0); // void func_800AA218_jp(); // void func_800AA29C_jp(); // void func_800AA2F8_jp(); @@ -160,7 +162,7 @@ void mNpc_SetReturnAnimal(s32 arg0); // void func_800ACB54_jp(); // void func_800ACC38_jp(); // void func_800ACCAC_jp(); -// void mNpc_GetNpcWorldNameAnm(); +void mNpc_GetNpcWorldNameAnm(PlayerName* arg0, struct mMl_get_npcinfo_from_mail_name_arg0* arg1); // void func_800ACD74_jp(); // void func_800ACDF8_jp(); // void func_800ACE90_jp(); diff --git a/include/m_private.h b/include/m_private.h index 40d5b13..af2ad57 100644 --- a/include/m_private.h +++ b/include/m_private.h @@ -2,7 +2,9 @@ #define M_PRIVATE_H #include "ultra64.h" +#include "m_mail.h" #include "m_quest.h" +#include "unk.h" #define mPr_FOREIGN_MAP_COUNT 8 #define PLAYER_NUM 4 @@ -49,19 +51,22 @@ typedef struct PrivateInventory { } PrivateInventory; // size = 0x2C typedef struct Private_c { - /* 0x000 */ char unk000[0x10]; + /* 0x000 */ UNK_TYPE1 unk000[0x10]; /* 0x010 */ s8 gender; - /* 0x011 */ char unk011[0x3]; + /* 0x011 */ UNK_TYPE1 unk011[0x3]; /* 0x014 */ PrivateInventory inventory; /* 0x040 */ mQst_delivery_c deliveries[mPr_DELIVERY_QUEST_NUM]; /* delivery quests */ /* 0x25C */ mQst_errand_c errands[mPr_ERRAND_QUEST_NUM]; /* errand quests */ - /* 0x3EC */ char unk3EC[0x688]; + /* 0x3EC */ UNK_TYPE1 unk_3EC[0x2]; + /* 0x3EE */ MailHeaderCommon unk_3EE; + /* 0x40A */ Mail unk_40A[10]; + /* 0xA72 */ UNK_TYPE1 unk_A72[0x2]; /* 0xA74 */ u8 exists; - /* 0xA75 */ char unkA75[0x11]; + /* 0xA75 */ UNK_TYPE1 unkA75[0x11]; /* 0xA86 */ Private_Sub_A86 unk_A86; - /* 0xA90 */ char unkA8F[0xF8]; + /* 0xA90 */ UNK_TYPE1 unkA8F[0xF8]; /* 0xB88 */ mPr_map_info_c maps[mPr_FOREIGN_MAP_COUNT]; /* maps 'collected' for foreign towns */ - /* 0xBC8 */ char unkBC8[0x8]; + /* 0xBC8 */ UNK_TYPE1 unkBC8[0x8]; } Private_c; // size = 0xBD0 #endif diff --git a/include/m_submenu.h b/include/m_submenu.h index fcf3fe6..95d2b51 100644 --- a/include/m_submenu.h +++ b/include/m_submenu.h @@ -2,7 +2,7 @@ #define M_SUBMENU_H #include "ultra64.h" -#include "6BFE60.h" +#include "m_mail.h" #include "z64math.h" #include "libc/stdint.h" #include "other_types.h" @@ -84,7 +84,7 @@ typedef struct Submenu { /* 0x2C */ struct struct_8085E9B0* unk_2C; /* 0x30 */ SubmenuMoveFunc move; /* 0x34 */ SubmenuDrawFunc draw; - /* 0x38 */ mMl mail; + /* 0x38 */ Mail mail; /* 0xDC */ u8 unk_DC; /* 0xDD */ u8 unk_DD; /* 0xDE */ u8 unk_DE; diff --git a/include/unknown_structs.h b/include/unknown_structs.h index 1e18d21..d3de487 100644 --- a/include/unknown_structs.h +++ b/include/unknown_structs.h @@ -42,12 +42,19 @@ typedef struct Game_Play_unk_0110 { } Game_Play_unk_0110; // size >= 0x181C typedef struct struct_809AEFA4 { - /* 0x00 */ UNK_PTR unk_0; - /* 0x04 */ UNK_PTR unk_4; - /* 0x08 */ UNK_TYPE unk_8; - /* 0x0C */ UNK_PTR unk_C; + /* 0x00 */ UNK_PTR unk_00; + /* 0x04 */ UNK_PTR unk_04; + /* 0x08 */ UNK_TYPE unk_08; + /* 0x0C */ UNK_PTR unk_0C; /* 0x10 */ UNK_PTR unk_10; /* 0x14 */ UNK_PTR unk_14; } struct_809AEFA4; // size >= 0x18 +// Maybe same struct as mMl? +typedef struct struct_func_8085CE18_jp_arg4 { + /* 0x00 */ UNK_TYPE1 unk_00[0x24]; + /* 0x24 */ u16 unk_24; + /* 0x26 */ u8 unk_26; +} struct_func_8085CE18_jp_arg4; // size >= 0x28 + #endif |
