NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches
NWC24MsgObj.h
1#ifndef RVL_SDK_NWC24_MSG_OBJ_H
2#define RVL_SDK_NWC24_MSG_OBJ_H
3#include <types.h>
4
5#include <revolution/NWC24/NWC24Types.h>
6#include <revolution/NWC24/NWC24Utils.h>
7#ifdef __cplusplus
8extern "C" {
9#endif
10
11#define NWC24_MSG_RECIPIENT_MAX 8
12#define NWC24_MSG_ATTACHMENT_MAX 2
13
14// Forward declarations
15typedef struct RFLCharData RFLCharData;
16
17typedef enum {
18 NWC24_MSGTYPE_RVL_MENU_SHARED,
19
20 NWC24_MSGTYPE_RVL,
21 NWC24_MSGTYPE_RVL_APP = NWC24_MSGTYPE_RVL,
22
23 NWC24_MSGTYPE_RVL_MENU,
24
25 NWC24_MSGTYPE_RVL_HIDDEN,
26 NWC24_MSGTYPE_RVL_APP_HIDDEN = NWC24_MSGTYPE_RVL_HIDDEN,
27
28 NWC24_MSGTYPE_PUBLIC
29} NWC24MsgType;
30
31typedef struct NWC24MsgObj {
32 u32 id; // at 0x0
33 u32 flags; // at 0x4
34 u32 length; // at 0x8
35 u32 appId; // at 0xC
36 char UNK_0x10[0x4];
37 u32 tag; // at 0x14
38 u32 ledPattern; // at 0x18
39 u64 fromId; // at 0x20
40 u32 WORD_0x28;
41 u32 WORD_0x2C;
42 NWC24Data DATA_0x30;
43 NWC24Data DATA_0x38;
44 NWC24Data subject; // at 0x40
45 NWC24Data text; // at 0x48
46 NWC24Data DATA_0x50;
47 NWC24Data DATA_0x58;
48 NWC24Charset charset; // at 0x60
49 NWC24Encoding encoding; // at 0x64
50 NWC24Data attached[NWC24_MSG_ATTACHMENT_MAX]; // at 0x68
51 u32 attachedSize[NWC24_MSG_ATTACHMENT_MAX]; // at 0x78
52 NWC24MIMEType attachedType[NWC24_MSG_ATTACHMENT_MAX]; // at 0x80
53 union {
54 u64 toIds[NWC24_MSG_RECIPIENT_MAX];
55 NWC24Data toAddrs[NWC24_MSG_RECIPIENT_MAX];
56 }; // at 0x88
57 u8 numTo; // at 0xC8
58 u8 numAttached; // at 0xC9
59 u16 groupId; // at 0xCA
60 union {
61 struct {
62 u32 noreply : 1;
63 u32 unknown : 7;
64 u32 delay : 8;
65 u32 regdate : 16;
66 };
67
68 u32 raw;
69 } mb; // at 0xCC
70 NWC24Data DATA_0xD0;
71 NWC24Data face; // at 0xD8
72 NWC24Data alt; // at 0xE0
73 char UNK_0xE8[0x100 - 0xE8];
75
76NWC24Err NWC24InitMsgObj(NWC24MsgObj* msg, NWC24MsgType type);
77NWC24Err NWC24SetMsgToId(NWC24MsgObj* msg, u64 id);
78NWC24Err NWC24SetMsgText(NWC24MsgObj* msg, const char* text, u32 len,
79 NWC24Charset charset, NWC24Encoding encoding);
80NWC24Err NWC24SetMsgFaceData(NWC24MsgObj* msg, const RFLCharData* data);
81NWC24Err NWC24SetMsgAltName(NWC24MsgObj* msg, const wchar_t* name, u32 len);
82NWC24Err NWC24SetMsgMBNoReply(NWC24MsgObj* msg, BOOL enable);
83NWC24Err NWC24SetMsgMBRegDate(NWC24MsgObj* msg, u16 year, u8 month, u8 day);
84
85#ifdef __cplusplus
86}
87#endif
88#endif