Twilight Princess
Decompilation of The Legend of Zelda: Twilight Princess
Loading...
Searching...
No Matches
JHIMccBuf.h
Go to the documentation of this file.
1#ifndef JORMCCBUF_H_H
2#define JORMCCBUF_H_H
3
6
7class JHIMccBuf {
8public:
9 JHIMccBuf(u16 channel, u16, u32);
10
11 void setHeaderToBuf(u32 data, u32 position, u16 size);
12 u32 setDataToBuf(void* pData, u16 size);
13 int readData(u32 position, u32* pOutData);
14 int readDataFromBuf(void* pBuf, u32 size);
15
16 int JHIRead(u32 channel, u32 offset, void* buffer, u32 size);
17 int JHIWrite(u32 channel, u32 offset, void* buffer, u32 size);
18
19 int JHIMCCWrite(u32 channel, u32 offset, void* buffer, u32 size);
20 int JHIMCCRead(u32 channel, u32 offset, void* buffer, u32 size);
21
22 virtual ~JHIMccBuf();
23 virtual void initInstance(u16 channel, u16, u32);
24 virtual void init();
25 virtual void initBuf();
26 virtual void enablePort() { mPortEnabled = true; }
27 virtual void disablePort() { mPortEnabled = false; }
28 virtual bool isPort() { return mPortEnabled; }
29
30 static u8* mTempBuf;
31 static u16 mRefCount;
32
33 /* 0x04 */ u32 mTag;
34 /* 0x08 */ u16 field_0x8;
35 /* 0x0A */ u16 field_0xa;
36 /* 0x0C */ u16 field_0xc;
37 /* 0x0E */ u16 mChannel;
38 /* 0x10 */ u16 field_0x10;
39 /* 0x14 */ int mReadOffset;
40 /* 0x18 */ int mWriteOffset;
41 /* 0x1C */ int field_0x1c;
42 /* 0x20 */ u32 field_0x20;
43 /* 0x24 */ u32 mBeginPos;
44 /* 0x28 */ u32 mEndPos;
45 /* 0x2C */ bool mPortEnabled;
46};
47
48class JHIMccBufReader : public JHIMccBuf {
49public:
50 JHIMccBufReader(u16 channel, u16, u32);
51 virtual ~JHIMccBufReader();
52
53 u32 available();
54 int readBegin();
55 int read(void* pBuf);
56 void readEnd();
57};
58
59class JHIMccBufWriter : public JHIMccBuf {
60public:
61 JHIMccBufWriter(u16 channel, u16, u32);
62 virtual ~JHIMccBufWriter();
63
64 int writeBegin();
65 int write(void* pBuf, u32 size);
66 void writeEnd();
67};
68
73
74void JHIReport(const char* fmt, ...);
75void JHIHalt(const char* fmt, ...);
76
77#endif /* JORMCCBUF_H_H */
void JHIHalt(const char *fmt,...)
Definition JHIMccBuf.cpp:12
void JHIReport(const char *fmt,...)
Definition JHIMccBuf.cpp:10
static OSTime buffer
Definition ai.c:202
T cLib_calcTimer(T *value)
Definition c_lib.h:79
Definition JHIMccBuf.h:48
void readEnd()
Definition JHIMccBuf.cpp:340
u32 available()
Definition JHIMccBuf.cpp:264
int readBegin()
Definition JHIMccBuf.cpp:288
virtual ~JHIMccBufReader()
Definition JHIMccBuf.cpp:262
int read(void *pBuf)
Definition JHIMccBuf.cpp:305
Definition JHIMccBuf.h:59
void writeEnd()
Definition JHIMccBuf.cpp:445
int writeBegin()
Definition JHIMccBuf.cpp:357
virtual ~JHIMccBufWriter()
Definition JHIMccBuf.cpp:355
int write(void *pBuf, u32 size)
Definition JHIMccBuf.cpp:391
Definition JHIMccBuf.h:7
u16 field_0x8
Definition JHIMccBuf.h:34
void setHeaderToBuf(u32 data, u32 position, u16 size)
Definition JHIMccBuf.cpp:72
virtual void enablePort()
Definition JHIMccBuf.h:26
u32 mTag
Definition JHIMccBuf.h:33
virtual void initInstance(u16 channel, u16, u32)
Definition JHIMccBuf.cpp:22
int JHIMCCRead(u32 channel, u32 offset, void *buffer, u32 size)
Definition JHIMccBuf.cpp:241
virtual ~JHIMccBuf()
Definition JHIMccBuf.cpp:65
int mReadOffset
Definition JHIMccBuf.h:39
virtual void initBuf()
Definition JHIMccBuf.cpp:51
u16 field_0xc
Definition JHIMccBuf.h:36
int JHIWrite(u32 channel, u32 offset, void *buffer, u32 size)
Definition JHIMccBuf.cpp:200
u32 mEndPos
Definition JHIMccBuf.h:44
int JHIRead(u32 channel, u32 offset, void *buffer, u32 size)
Definition JHIMccBuf.cpp:157
virtual bool isPort()
Definition JHIMccBuf.h:28
int readDataFromBuf(void *pBuf, u32 size)
Definition JHIMccBuf.cpp:124
u32 field_0x20
Definition JHIMccBuf.h:42
static u8 * mTempBuf
Definition JHIMccBuf.h:30
int mWriteOffset
Definition JHIMccBuf.h:40
virtual void init()
Definition JHIMccBuf.cpp:36
static u16 mRefCount
Definition JHIMccBuf.h:31
u16 mChannel
Definition JHIMccBuf.h:37
u32 mBeginPos
Definition JHIMccBuf.h:43
bool mPortEnabled
Definition JHIMccBuf.h:45
virtual void disablePort()
Definition JHIMccBuf.h:27
int JHIMCCWrite(u32 channel, u32 offset, void *buffer, u32 size)
Definition JHIMccBuf.cpp:250
u16 field_0xa
Definition JHIMccBuf.h:35
u16 field_0x10
Definition JHIMccBuf.h:38
u32 setDataToBuf(void *pData, u16 size)
Definition JHIMccBuf.cpp:85
int field_0x1c
Definition JHIMccBuf.h:41
int readData(u32 position, u32 *pOutData)
Definition JHIMccBuf.cpp:109
Definition JHIMccBuf.h:69
JHIMccBufWriter * mp_writer
Definition JHIMccBuf.h:71
JHIMccBufReader * mp_reader
Definition JHIMccBuf.h:70
unsigned long u32
Definition types.h:10
unsigned short u16
Definition types.h:9
unsigned char u8
Definition types.h:8