diff options
author | PikalaxALT <pikalaxalt@gmail.com> | 2018-12-01 11:24:05 -0500 |
---|---|---|
committer | PikalaxALT <pikalaxalt@gmail.com> | 2018-12-01 11:24:05 -0500 |
commit | 01aada9e93b5e132635feb214baa5d302c4f2154 (patch) | |
tree | 8ef21d501bd13b537104a53af8b5a86649f5cb02 /include | |
parent | b9a6cba30a3ee44ccb14548d198accd7f6bbfa8d (diff) |
merge mevent server and document mevent_server_helpers
Diffstat (limited to 'include')
-rw-r--r-- | include/link.h | 2 | ||||
-rw-r--r-- | include/mevent_server.h | 105 | ||||
-rw-r--r-- | include/util.h | 4 |
3 files changed, 85 insertions, 26 deletions
diff --git a/include/link.h b/include/link.h index 39873ec11..ef8776c64 100644 --- a/include/link.h +++ b/include/link.h @@ -169,7 +169,7 @@ void sub_8007E24(void); void sub_8007E4C(void); u8 GetMultiplayerId(void); u8 bitmask_all_link_players_but_self(void); -bool8 SendBlock(u8, void *, u16); +bool8 SendBlock(u8, const void *, u16); u8 GetBlockReceivedStatus(void); void ResetBlockReceivedFlags(void); void ResetBlockReceivedFlag(u8); diff --git a/include/mevent_server.h b/include/mevent_server.h index d2d7b0687..90cb5f35d 100644 --- a/include/mevent_server.h +++ b/include/mevent_server.h @@ -7,34 +7,93 @@ struct mevent_srv_sub { - s32 unk_00; - u8 unk_04; - u8 unk_05; - u16 unk_06; - u16 unk_08; - u16 unk_0A; - u16 unk_0C; - u16 unk_0E; - u16 unk_10; - u16 unk_12; - u16 unk_14; + s32 seqno; + u8 sendPlayerNo; + u8 recvPlayerNo; + u16 recvIdent; + u16 recvCounter; + u16 recvCRC; + u16 recvSize; + u16 sendIdent; + u16 sendCounter; + u16 sendCRC; + u16 sendSize; + void * recvBfr; + const void * sendBfr; + u32 (*recvFunc)(struct mevent_srv_sub *); + u32 (*sendFunc)(struct mevent_srv_sub *); +}; + +struct send_recv_header +{ + u16 ident; + u16 crc; + u16 size; +}; + +struct mevent_cmd_ish +{ + u32 instr; + u32 parameter; +}; + +struct mevent_srv_ish +{ + u32 unk_00; + u32 unk_04; + u32 mainseqno; + u32 unk_0C; + u32 cmdidx; + void * unk_14; void * unk_18; - void * unk_1C; - u32 (*unk_20)(struct mevent_srv_sub *); - u32 (*unk_24)(struct mevent_srv_sub *); + struct mevent_cmd_ish * cmdBuffer; + void * unk_20; + struct mevent_srv_sub unk_24; }; -struct send_recv_buff +struct mevent_cmd { - u16 unk0; - u16 unk2; - u16 unk4; + u32 instr; + bool32 flag; + void * parameter; }; -u32 sub_8144844(struct mevent_srv_sub * svr); -u32 sub_8144850(struct mevent_srv_sub * svr); -void sub_814485C(struct mevent_srv_sub * svr, u32 a1, u32 a2); -void sub_8144888(struct mevent_srv_sub * svr, u32 a1, void * a2, u32 size); -void sub_81448AC(struct mevent_srv_sub * svr, u32 a1, void * a2); +struct mevent_srv_common +{ + u32 unk_00; + u32 unk_04; + u32 mainseqno; + u32 cmdidx; + const struct mevent_cmd * cmdBuffer; + void * unk_14; + struct MEventBuffer_32E0_Sub * unk_18; + struct MEventBuffer_3120_Sub * unk_1C; + struct MEventStruct_Unk1442CC * unk_20; + void * unk_24; + u32 unk_28; + void * unk_2C; + u32 unk_30; + void * unk_34; + struct mevent_srv_sub unk_38; +}; + +u32 mevent_srv_sub_recv(struct mevent_srv_sub * svr); +u32 mevent_srv_sub_send(struct mevent_srv_sub * svr); +void mevent_srv_sub_init(struct mevent_srv_sub * svr, u32 sendPlayerNo, u32 recvPlayerNo); +void mevent_srv_sub_init_send(struct mevent_srv_sub * svr, u32 ident, const void * src, u32 size); +void mevent_srv_sub_init_recv(struct mevent_srv_sub * svr, u32 ident, void * dest); + +void sub_8144AEC(void); +u32 sub_8144B0C(u16 * a0); +void sub_8144B48(void); +void * sub_8144B58(void); +void sub_8144B64(u32 a0); +void sub_8144F1C(void); +void sub_8144F40(void); +u32 sub_8144F64(u16 * a0); + +extern const u8 gUnknown_84687E0[]; +extern const u8 gUnknown_8468B6C[]; +extern const u8 gUnknown_8468BCC[]; #endif //GUARD_MEVENT_SERVER_H diff --git a/include/util.h b/include/util.h index a22cc77fa..e0034d816 100644 --- a/include/util.h +++ b/include/util.h @@ -12,8 +12,8 @@ u8 CreateInvisibleSpriteWithCallback(void (*)(struct Sprite *)); void StoreWordInTwoHalfwords(u16 *, u32); void LoadWordFromTwoHalfwords(u16 *, u32 *); int CountTrailingZeroBits(u32 value); -u16 CalcCRC16(u8 *data, s32 length); -u16 CalcCRC16WithTable(u8 *data, u32 length); +u16 CalcCRC16(const u8 *data, s32 length); +u16 CalcCRC16WithTable(const u8 *data, u32 length); u32 CalcByteArraySum(const u8* data, u32 length); #endif // GUARD_UTIL_H |