Twilight Princess
Decompilation of The Legend of Zelda: Twilight Princess
Loading...
Searching...
No Matches
GDBase.h
Go to the documentation of this file.
1#ifndef GDBASE_H
2#define GDBASE_H
3
4#include "dolphin/gx.h"
5
6#ifdef __cplusplus
7extern "C" {
8#endif
9
10typedef struct GDLObj {
11 /* 0x0 */ u8* start;
12 /* 0x4 */ u32 length;
13 /* 0x8 */ u8* ptr;
14 /* 0xC */ u8* end;
15} GDLObj; // Size: 0x10
16
17extern GDLObj* __GDCurrentDL;
18
20
21void GDInitGDLObj(GDLObj*, u8*, u32);
22void GDFlushCurrToMem();
23void GDPadCurr32();
24void GDOverflowed(void);
25
26static inline void __GDWrite(u8 data) {
28}
29
30static inline void GDSetCurrent(GDLObj* obj) {
32}
33
35 return (u32)(obj->ptr - obj->start);
36}
37
38static inline u8* GDGetCurrPointer() {
39 return __GDCurrentDL->ptr;
40}
41
42static inline s32 GDGetCurrOffset() {
44}
45
46static inline void GDSetCurrOffset(s32 offs) {
48}
49
50static inline void GDAdvCurrOffset(s32 offs) {
52}
53
54static inline void GDOverflowCheck(u32 len) {
57 }
58}
59
60static inline void GDWrite_u32(u32 v) {
62 __GDWrite((v >> 24) & 0xff);
63 __GDWrite((v >> 16) & 0xff);
64 __GDWrite((v >> 8) & 0xff);
65 __GDWrite((v >> 0) & 0xff);
66}
67
68static inline void GDWrite_u16(u16 v) {
70 __GDWrite(v >> 8);
71 __GDWrite(v & 0xff);
72}
73
74static inline void GDWrite_u8(u8 v) {
76 __GDWrite(v);
77}
78
79static inline void GDWriteCPCmd(u8 addr, u32 v) {
80 GDWrite_u8(8);
81 GDWrite_u8(addr);
83}
84
85static inline void GDWriteXFCmd(u16 addr, u32 v) {
86 GDWrite_u8(0x10);
87 GDWrite_u16(0);
88 GDWrite_u16(addr);
90}
91
92#ifdef __cplusplus
93};
94#endif
95
96#endif /* GDBASE_H */
void GDInitGDLObj(GDLObj *, u8 *, u32)
Definition GDBase.c:9
GDLObj * __GDCurrentDL
Definition GDBase.c:18
static void __GDWrite(u8 data)
Definition GDBase.h:26
static u8 * GDGetCurrPointer()
Definition GDBase.h:38
static void GDSetCurrent(GDLObj *obj)
Definition GDBase.h:30
static void GDAdvCurrOffset(s32 offs)
Definition GDBase.h:50
static void GDWrite_u32(u32 v)
Definition GDBase.h:60
static void GDWrite_u8(u8 v)
Definition GDBase.h:74
static void GDOverflowCheck(u32 len)
Definition GDBase.h:54
void(* GDOverflowCallback)(void)
Definition GDBase.h:19
static void GDWrite_u16(u16 v)
Definition GDBase.h:68
void GDOverflowed(void)
Definition GDBase.c:41
static void GDWriteXFCmd(u16 addr, u32 v)
Definition GDBase.h:85
static void GDWriteCPCmd(u8 addr, u32 v)
Definition GDBase.h:79
void GDPadCurr32()
Definition GDBase.c:30
static u32 GDGetGDLObjOffset(GDLObj *obj)
Definition GDBase.h:34
void GDFlushCurrToMem()
Definition GDBase.c:25
static void GDSetCurrOffset(s32 offs)
Definition GDBase.h:46
static s32 GDGetCurrOffset()
Definition GDBase.h:42
T cLib_calcTimer(T *value)
Definition c_lib.h:74
static u16 data[4]
Definition d_vibration.cpp:114
double v
Definition e_pow.c:163
Definition GDBase.h:10
u8 * start
Definition GDBase.h:11
u8 * end
Definition GDBase.h:14
u32 length
Definition GDBase.h:12
u8 * ptr
Definition GDBase.h:13
unsigned long u32
Definition types.h:10
unsigned short u16
Definition types.h:9
signed long s32
Definition types.h:6
unsigned char u8
Definition types.h:8