Twilight Princess
Decompilation of The Legend of Zelda: Twilight Princess
Loading...
Searching...
No Matches
JOREntry.h
Go to the documentation of this file.
1#ifndef JORENTRY_H
2#define JORENTRY_H
3
5#include <dolphin/os.h>
6
7template<typename T, int I>
8class JHIpvector {
9public:
10 JHIpvector() { m_size = 0; }
11
12 s32 size() const { return m_size; }
13 T get(u32 i) const { return m_vector[i]; }
14
16 if (m_size >= I) {
17 return 0;
18 }
19
20 m_vector[m_size++] = p;
21 return 1;
22 }
23
24 /* 0x00 */ T m_vector[I];
25 /* 0x28 */ s32 m_size;
26};
27
28template<typename T>
30public:
35
36 T& getRefPort() { return port; }
37
38 void addTag(JHITag<T>* pTag) {
39 pTag->mp_data = this;
40 field_0xc.push_back(pTag);
41 }
42
43 JHITag<T>* find(u32 param_1) {
44 for (u32 i = 0; i < field_0xc.size(); i++) {
45 JHITag<T>* tag = field_0xc.get(i);
46 if (tag->m_tag == param_1) {
47 return tag;
48 }
49 }
50 return NULL;
51 }
52
54 u32 r29 = port.available();
55 while (true) {
56 if (!field_0x10040) {
57 if (r29 < 8) {
58 return;
59 }
60 port.receive(&field_0x10038, 8);
61 r29 -= 8;
64 field_0x10040 = 1;
66 if (field_0x1003c > port.getMaxReaderableSize()) {
67 port.initBuffers();
68 OSReport("JHostIO::ERROR: JHIComportManager: invalid datasize ( port.initialized )\n");
69 } else if (!r27) {
70 OSReport("JHostIO::ERROR: JHIComportManager: invalid tag message\n");
71 }
72 }
73 if (!field_0x10040) {
74 continue;
75 }
76
77 if (r29 < field_0x1003c) {
78 return;
79 }
80 u32 r26 = port.receive(field_0x38, field_0x1003c);
81 r29 -= r26;
83 field_0x10040 = 0;
84 if (r28) {
86 }
87 }
88 }
89
91 if (instance == NULL) {
93 }
94
95 return instance;
96 }
97
99
101
102 /* 0x00000 */ T port;
103 /* 0x0000C */ JHIpvector<JHITag<T>*, 10> field_0xc;
104 /* 0x00038 */ char field_0x38[0x10000];
105 /* 0x10038 */ u32 field_0x10038;
106 /* 0x1003C */ u32 field_0x1003c;
107 /* 0x10040 */ u8 field_0x10040;
108 /* 0x10041 */ u8 field_0x10041;
109};
110
111void JORInit();
112
113#endif /* JORENTRY_H */
u32 JHIntohl(u32 v)
Definition JHICommonMem.h:14
void JORInit()
Definition JOREntry.cpp:7
Definition JOREntry.h:29
void dispatchMessage()
Definition JOREntry.h:53
static JHIComPortManager< T > * getInstance()
Definition JOREntry.h:98
u32 field_0x10038
Definition JOREntry.h:105
JHITag< T > * find(u32 param_1)
Definition JOREntry.h:43
JHIpvector< JHITag< T > *, 10 > field_0xc
Definition JOREntry.h:103
JHIComPortManager()
Definition JOREntry.h:31
static JHIComPortManager< T > * create()
Definition JOREntry.h:90
T & getRefPort()
Definition JOREntry.h:36
char field_0x38[0x10000]
Definition JOREntry.h:104
u8 field_0x10040
Definition JOREntry.h:107
void addTag(JHITag< T > *pTag)
Definition JOREntry.h:38
T port
Definition JOREntry.h:102
u32 field_0x1003c
Definition JOREntry.h:106
u8 field_0x10041
Definition JOREntry.h:108
static JHIComPortManager< T > * instance
Definition JOREntry.h:100
Definition JOREntry.h:8
s32 push_back(T p)
Definition JOREntry.h:15
s32 size() const
Definition JOREntry.h:12
T get(u32 i) const
Definition JOREntry.h:13
T m_vector[I]
Definition JOREntry.h:24
JHIpvector()
Definition JOREntry.h:10
s32 m_size
Definition JOREntry.h:25
void OSReport(const char *msg,...)
Definition OSError.c:12
p
Definition e_acos.c:103
int i
Definition e_log.c:92
unsigned long u32
Definition types.h:12
signed long s32
Definition types.h:11
unsigned char u8
Definition types.h:8
Definition JHICommonMem.h:21
u32 m_tag
Definition JHICommonMem.h:44
virtual void receive(const char *, s32)
Definition JHICommonMem.h:42
JHIComPortManager< T > * mp_data
Definition JHICommonMem.h:45