Twilight Princess
Decompilation of The Legend of Zelda: Twilight Princess
Loading...
Searching...
No Matches
JHIComm.h
Go to the documentation of this file.
1#ifndef JHICOMM_H
2#define JHICOMM_H
3
5
7public:
8 void init();
9 void init(JHICommonMem*, u32, u32, u32);
10 int load();
11
13
15 /* 0x04 */ u32 field_0x4;
16 /* 0x08 */ u32 m_msgBufSize;
17 /* 0x0C */ u32 field_0xc;
18 /* 0x10 */ u32 field_0x10;
19 /* 0x14 */ u32 field_0x14;
20 /* 0x18 */ u32 field_0x18;
21 /* 0x1C */ u32 field_0x1c;
22 /* 0x20 */ u32 field_0x20;
23 /* 0x24 */ u32 field_0x24;
24 /* 0x28 */ u32 m_alignment;
25 /* 0x2C */ u32 field_0x2c;
26};
27
29public:
30 struct Header : public JHICommBufHeader {
31 int load();
32 int getRemSize();
33 void updatePutAdrs();
34 u32 getWritebleSize() const;
35 void alignPutAdrs();
36 void addPutAdrs(int);
37 u32 getPutAdrs() const;
38
39 /* 0x30 */ u8 field_0x30;
40 /* 0x31 */ u8 field_0x31;
41 /* 0x32 */ u8 field_0x32;
42 /* 0x33 */ u8 field_0x33;
43 /* 0x34 */ u32 field_0x34;
44 };
45
46 JHICommBufWriter(u32, u32, u32 alignment);
47 int writeBegin();
48 void writeEnd();
49 int write(void*, int);
50
51 void init() { m_header.init(); }
52
53 /* 0x00 */ Header m_header;
55};
56
58public:
59 struct Header : public JHICommBufHeader {
60 void updateGetAdrs();
61 u32 getReadableSize() const;
62 void addGetAdrs(int);
63 u32 getGetAdrs() const;
64 void alignGetAdrs();
65 int getContSize();
66
67 int load() {
68 int result = JHICommBufHeader::load();
69 if (!result) {
71 }
72 return result;
73 }
74
75 /* 0x30 */ u32 field_0x30;
76 };
77
78 JHICommBufReader(u32, u32, u32 alignment);
79 int readBegin();
80 void readEnd();
81 int read(void*, int);
82
84 void init() { m_header.init(); }
85
87 if (m_header.load()) {
88 return 0xFFFFFFFF;
89 } else {
91 }
92 }
93
94 /* 0x00 */ Header m_header;
96};
97
98struct JHICmnMem {
100 int sendCont(const void* param_0, int param_1) { return mp_writeBuf->write((void*)param_0, param_1); }
104
105 void setBuf(JHICommBufReader* pReader, JHICommBufWriter* pWriter) {
106 mp_readBuf = pReader;
107 mp_writeBuf = pWriter;
108 }
109
110 void initBuffers() {
111 mp_readBuf->init();
112 mp_writeBuf->init();
113 }
114
115 int receive(void* param_1, int param_2) {
116 int result = 0;
117 result = mp_readBuf->read(param_1, param_2);
119 return result;
120 }
121
124 /* 0x8 */ u8 field_0x8;
125};
126
131
132#endif /* JHICOMM_H */
Definition JHIComm.h:6
u32 field_0x10
Definition JHIComm.h:18
u32 field_0x20
Definition JHIComm.h:22
u32 field_0x2c
Definition JHIComm.h:25
u32 field_0x1c
Definition JHIComm.h:21
u32 field_0xc
Definition JHIComm.h:17
void init()
Definition JHIComm.cpp:7
JHICommonMem * mp_memBuffer
Definition JHIComm.h:14
u32 m_alignment
Definition JHIComm.h:24
u32 field_0x14
Definition JHIComm.h:19
int load()
Definition JHIComm.cpp:41
u32 field_0x4
Definition JHIComm.h:15
u32 m_msgBufSize
Definition JHIComm.h:16
u32 getMsgBufSize()
Definition JHIComm.h:12
u32 field_0x24
Definition JHIComm.h:23
u32 field_0x18
Definition JHIComm.h:20
Definition JHIComm.h:57
JHICommBufReader(u32, u32, u32 alignment)
Definition JHIComm.cpp:53
void readEnd()
Definition JHIComm.cpp:79
void init()
Definition JHIComm.h:84
u32 getMsgBufSize()
Definition JHIComm.h:83
JHIMemBuf * mp_memBuffer
Definition JHIComm.h:95
Header m_header
Definition JHIComm.h:94
u32 available()
Definition JHIComm.h:86
int readBegin()
Definition JHIComm.cpp:75
int read(void *, int)
Definition JHIComm.cpp:83
Definition JHIComm.h:28
int write(void *, int)
Definition JHIComm.cpp:229
JHICommBufWriter(u32, u32, u32 alignment)
Definition JHIComm.cpp:159
JHIMemBuf * mp_memBuffer
Definition JHIComm.h:54
void init()
Definition JHIComm.h:51
Header m_header
Definition JHIComm.h:53
int writeBegin()
Definition JHIComm.cpp:214
void writeEnd()
Definition JHIComm.cpp:225
Definition JHICommonMem.h:50
Definition JHICommonMem.h:66
unsigned long u32
Definition types.h:12
unsigned char u8
Definition types.h:8
Definition JHIComm.h:98
void sendEnd()
Definition JHIComm.h:101
JHICommBufReader * mp_readBuf
Definition JHIComm.h:122
JHICommBufWriter * mp_writeBuf
Definition JHIComm.h:123
u32 sendBegin()
Definition JHIComm.h:99
void initBuffers()
Definition JHIComm.h:110
u8 field_0x8
Definition JHIComm.h:124
int sendCont(const void *param_0, int param_1)
Definition JHIComm.h:100
void setBuf(JHICommBufReader *pReader, JHICommBufWriter *pWriter)
Definition JHIComm.h:105
u32 available()
Definition JHIComm.h:102
u32 getMaxReaderableSize()
Definition JHIComm.h:103
int receive(void *param_1, int param_2)
Definition JHIComm.h:115
Definition JHIComm.h:59
u32 getGetAdrs() const
Definition JHIComm.cpp:143
void updateGetAdrs()
Definition JHIComm.cpp:58
int getContSize()
Definition JHIComm.cpp:151
u32 getReadableSize() const
Definition JHIComm.cpp:64
u32 field_0x30
Definition JHIComm.h:75
void addGetAdrs(int)
Definition JHIComm.cpp:136
void alignGetAdrs()
Definition JHIComm.cpp:147
int load()
Definition JHIComm.h:67
Definition JHIComm.h:30
u8 field_0x33
Definition JHIComm.h:42
void addPutAdrs(int)
Definition JHIComm.cpp:289
u32 field_0x34
Definition JHIComm.h:43
int getRemSize()
Definition JHIComm.cpp:183
void alignPutAdrs()
Definition JHIComm.cpp:300
int load()
Definition JHIComm.cpp:164
u32 getWritebleSize() const
Definition JHIComm.cpp:201
u8 field_0x32
Definition JHIComm.h:41
u32 getPutAdrs() const
Definition JHIComm.cpp:296
u8 field_0x31
Definition JHIComm.h:40
u8 field_0x30
Definition JHIComm.h:39
void updatePutAdrs()
Definition JHIComm.cpp:187
Definition JHIComm.h:127
JHICommBufReader * mp_reader
Definition JHIComm.h:128
JHICommBufWriter * mp_writer
Definition JHIComm.h:129