Skip to content

Commit 2c68e9a

Browse files
authored
Add full headers for dolsdk2004 (#409)
* Add full headers for dolsdk2004 * Add missing CARD_STAT_ANIM defines * Fix remaining build errors
1 parent d1250c7 commit 2c68e9a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

104 files changed

+8721
-418
lines changed

.vscode/c_cpp_properties.json

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,15 @@
77
"GAMECUBE"
88
],
99
"includePath": [
10-
"${workspaceFolder}/include/**",
11-
"${workspaceFolder}/src/**"
10+
"${workspaceFolder}/include",
11+
"${workspaceFolder}/include/bink",
12+
"${workspaceFolder}/include/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common/Include",
13+
"${workspaceFolder}/include/PowerPC_EABI_Support/MSL/MSL_C++/MSL_Common/Include",
14+
"${workspaceFolder}/include/inline",
15+
"${workspaceFolder}/include/rwsdk",
16+
"${workspaceFolder}/src/SB/Core/gc",
17+
"${workspaceFolder}/src/SB/Core/x",
18+
"${workspaceFolder}/src/SB/Game"
1219
],
1320
"cStandard": "c99",
1421
"cppStandard": "c++98",

configure.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,6 @@
242242
"-i include/bink",
243243
"-i include/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common/Include",
244244
"-i include/PowerPC_EABI_Support/MSL/MSL_C++/MSL_Common/Include",
245-
"-i include/dolphin",
246245
"-i include/inline",
247246
"-i include/rwsdk",
248247
"-i src/SB/Core/gc",

include/dolphin.h

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#ifndef _DOLPHIN_H_
2+
#define _DOLPHIN_H_
3+
4+
#include <dolphin/types.h>
5+
#include <dolphin/os.h>
6+
#include <dolphin/dsp.h>
7+
#include <dolphin/dvd.h>
8+
#include <dolphin/gx.h>
9+
#include <dolphin/hio.h>
10+
#include <dolphin/mtx.h>
11+
#include <dolphin/vi.h>
12+
#include <dolphin/card.h>
13+
#include <dolphin/perf.h>
14+
#include <dolphin/ar.h>
15+
#include <dolphin/base/PPCArch.h>
16+
#include <dolphin/db.h>
17+
#include <dolphin/pad.h>
18+
#include <dolphin/dtk.h>
19+
#include <dolphin/ai.h>
20+
#include <dolphin/demo.h>
21+
#include <dolphin/exi.h>
22+
#include <dolphin/si.h>
23+
24+
#endif

include/dolphin/G2D.h

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
#ifndef _DOLPHIN_G2D_H_
2+
#define _DOLPHIN_G2D_H_
3+
4+
#include <dolphin/gx.h>
5+
6+
#ifdef __cplusplus
7+
extern "C" {
8+
#endif
9+
10+
typedef enum G2DMatCtg {
11+
G2D_CTG_TEXTURE,
12+
G2D_CTG_RGB_DIRECT,
13+
G2D_CTG_RGBA_INDEX8,
14+
G2D_CTG_EMPTY,
15+
} G2DMatCtg;
16+
17+
typedef struct G2DSprite {
18+
u16 nTlcS; // "Top Left Corner"
19+
u16 nTlcT;
20+
u16 nWidth;
21+
u16 nHeight;
22+
GXTexObj* to;
23+
f32 rS0;
24+
f32 rT0;
25+
f32 rS1;
26+
f32 rT1;
27+
} G2DSprite;
28+
29+
typedef struct G2DPosOri {
30+
f32 rPosX;
31+
f32 rPosY;
32+
f32 rOriX;
33+
f32 rOriY;
34+
} G2DPosOri;
35+
36+
typedef struct G2DGlob {
37+
u16 nViewportTlcX;
38+
u16 nViewportTlcY;
39+
u16 nViewportWidth;
40+
u16 nViewportHeight;
41+
G2DPosOri poCam;
42+
f32 rWorldX;
43+
f32 rWorldY;
44+
f32 rHalfX;
45+
f32 rHalfY;
46+
} G2DGlob;
47+
48+
typedef struct G2DMatDesc {
49+
s32 nReserved;
50+
G2DMatCtg nCategory;
51+
GXColor* color;
52+
GXTexObj* to;
53+
u8* clut; // Color Look-Up Table
54+
} G2DMatDesc;
55+
56+
typedef struct G2DTileDesc {
57+
u8 nMaterial;
58+
u8 nS;
59+
u8 nT;
60+
u8 nCI; // Color Index
61+
u8 aUser[4];
62+
} G2DTileDesc;
63+
64+
typedef struct G2DLayer {
65+
void* map;
66+
s8 nHS;
67+
s8 nVS;
68+
s8 nBPI;
69+
s16 nTileWidth;
70+
s16 nTileHeight;
71+
s8 bWrap;
72+
u8 nNumMaterials;
73+
G2DTileDesc* tileDesc;
74+
G2DMatDesc* matDesc;
75+
} G2DLayer;
76+
77+
void G2DInitSprite(G2DSprite* sprite);
78+
void G2DDrawSprite(G2DSprite* sprite, G2DPosOri* po);
79+
void G2DDrawLayer(G2DLayer* layer, s8* aSortBuffer);
80+
void G2DSetCamera(G2DPosOri* po);
81+
void G2DInitWorld(u32 nWorldX, u32 nWorldY);
82+
void G2DSetViewport(u16 nLeft, u16 nTop, u16 nWidth, u16 nHeight);
83+
84+
#ifdef __cplusplus
85+
}
86+
#endif
87+
88+
#endif // _DOLPHIN_G2D_H_

include/dolphin/ai.h

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
#ifndef _DOLPHIN_AI_H_
2+
#define _DOLPHIN_AI_H_
3+
4+
#include <dolphin/types.h>
5+
6+
#ifdef __cplusplus
7+
extern "C" {
8+
#endif
9+
10+
typedef void (*AISCallback)(u32 count);
11+
typedef void (*AIDCallback)();
12+
13+
#define AI_STREAM_START 1
14+
#define AI_STREAM_STOP 0
15+
16+
#define AI_SAMPLERATE_32KHZ 0
17+
#define AI_SAMPLERATE_48KHZ 1
18+
19+
AIDCallback AIRegisterDMACallback(AIDCallback callback);
20+
void AIInitDMA(u32 start_addr, u32 length);
21+
BOOL AIGetDMAEnableFlag(void);
22+
void AIStartDMA(void);
23+
void AIStopDMA(void);
24+
u32 AIGetDMABytesLeft(void);
25+
u32 AIGetDMAStartAddr(void);
26+
u32 AIGetDMALength(void);
27+
BOOL AICheckInit(void);
28+
AISCallback AIRegisterStreamCallback(AISCallback callback);
29+
u32 AIGetStreamSampleCount(void);
30+
void AIResetStreamSampleCount(void);
31+
void AISetStreamTrigger(u32 trigger);
32+
u32 AIGetStreamTrigger(void);
33+
void AISetStreamPlayState(u32 state);
34+
u32 AIGetStreamPlayState(void);
35+
void AISetDSPSampleRate(u32 rate);
36+
u32 AIGetDSPSampleRate(void);
37+
void AISetStreamSampleRate(u32 rate);
38+
u32 AIGetStreamSampleRate(void);
39+
void AISetStreamVolLeft(u8 vol);
40+
u8 AIGetStreamVolLeft(void);
41+
void AISetStreamVolRight(u8 vol);
42+
u8 AIGetStreamVolRight(void);
43+
void AIInit(u8* stack);
44+
void AIReset(void);
45+
46+
#ifdef __cplusplus
47+
}
48+
#endif
49+
50+
#endif

include/dolphin/am.h

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#ifndef _DOLPHIN_AM_H_
2+
#define _DOLPHIN_AM_H_
3+
4+
#include <dolphin/types.h>
5+
6+
#ifdef __cplusplus
7+
extern "C" {
8+
#endif
9+
10+
typedef void (*AMCallback)(char* path);
11+
12+
void* AMLoadFile(char* path, u32* length);
13+
u32 AMPush(char* path);
14+
u32 AMPushData(void* buffer, u32 length);
15+
void AMPop(void);
16+
u32 AMGetZeroBuffer(void);
17+
u32 AMGetReadStatus(void);
18+
u32 AMGetFreeSize(void);
19+
u32 AMGetStackPointer(void);
20+
void AMInit(u32 aramBase, u32 aramBytes);
21+
22+
#ifdef __cplusplus
23+
}
24+
#endif
25+
26+
#endif

include/dolphin/amc/AmcExi2Comm.h

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
#ifndef _DOLPHIN_AMC_AMCEXI2COMM_H_
2+
#define _DOLPHIN_AMC_AMCEXI2COMM_H_
3+
4+
#include <dolphin/os.h>
5+
#include <dolphin/amc/AmcTypes.h>
6+
7+
#ifdef __cplusplus
8+
extern "C" {
9+
#endif
10+
11+
typedef enum
12+
{
13+
AMC_EXI_NO_ERROR = 0,
14+
AMC_EXI_UNSELECTED,
15+
} AmcExiError;
16+
17+
// ---------------------------------------------------------------------------
18+
//
19+
// void EXI2_Init( volatile unsigned char **inputPendingPtrRef,
20+
// EXICallback monitorCallback );
21+
//
22+
// Description: Initialize the EXI2 driver (without interrupts). The
23+
// parameter 'inputPendingPtrref' is a flag showing whether input
24+
// is waiting in the EXI2 buffer and 'monitorCallback' is a
25+
// pointer to a callback function that is invoked at the end of
26+
// the EXI2 ISR.
27+
//
28+
// ---------------------------------------------------------------------------
29+
void EXI2_Init(volatile unsigned char **inputPendingPtrRef, EXICallback monitorCallback);
30+
31+
// ---------------------------------------------------------------------------
32+
//
33+
// void EXI2_EnableInterrupts( void );
34+
//
35+
// Description: Enable EXI2 interrupts. This function must be called to use
36+
// interrupts on the EXI2 interface. Call this function only
37+
// after EXI2_Init() has been invoked.
38+
//
39+
// ---------------------------------------------------------------------------
40+
void EXI2_EnableInterrupts( void );
41+
42+
43+
44+
// ---------------------------------------------------------------------------
45+
//
46+
// int EXI2_Poll( void );
47+
//
48+
// Description: Returns the number of bytes waiting to be read in the EXI2
49+
// buffer.
50+
//
51+
// ---------------------------------------------------------------------------
52+
int EXI2_Poll( void );
53+
54+
55+
56+
// ---------------------------------------------------------------------------
57+
//
58+
// AmcExiError EXI2_ReadN( void *bytes, unsigned long length );
59+
//
60+
// Description: Read length bytes and return in bytes[] array.
61+
//
62+
// Returns: One of AMC_EXI_*.
63+
//
64+
// ---------------------------------------------------------------------------
65+
AmcExiError EXI2_ReadN( void *bytes, unsigned long length);
66+
67+
68+
69+
// ---------------------------------------------------------------------------
70+
//
71+
// AmcExiError EXI2_WriteN( const void *bytes, unsigned long length );
72+
//
73+
// Description: Write length bytes stored in bytes[] array.
74+
//
75+
// Returns: One of AMC_EXI_*.
76+
//
77+
// ---------------------------------------------------------------------------
78+
AmcExiError EXI2_WriteN( const void *bytes, unsigned long length);
79+
80+
81+
82+
// ---------------------------------------------------------------------------
83+
//
84+
// void EXI2_Reserve( void );
85+
//
86+
// Description: Disable non-monitor communications over the EXI2 port.
87+
// This function must be called before the monitor takes
88+
// control of the processor.
89+
//
90+
// ---------------------------------------------------------------------------
91+
void EXI2_Reserve( void );
92+
93+
94+
95+
// ---------------------------------------------------------------------------
96+
//
97+
// void EXI2_Unreserve( void );
98+
//
99+
// Description: Re-enable non-monitor communications over the EXI2 port.
100+
// This function must be called just before the monitor
101+
// gives control of the processor back to the application.
102+
//
103+
// ---------------------------------------------------------------------------
104+
void EXI2_Unreserve( void );
105+
106+
107+
108+
// ---------------------------------------------------------------------------
109+
//
110+
// AmcExiError EXI2_GetStatusReg( u16* pu16StatusReg );
111+
//
112+
// Description: Read and store the value of the status register into
113+
// *pu16StatusReg.
114+
//
115+
// Returns: One of AMC_EXI_*.
116+
// ---------------------------------------------------------------------------
117+
AmcExiError EXI2_GetStatusReg( u16* pu16StatusReg );
118+
119+
#ifdef __cplusplus
120+
}
121+
#endif
122+
123+
#endif

include/dolphin/amc/AmcTypes.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#ifndef _INCLUDE_DOLPHIN_AMCTYPES_H_
2+
#define _INCLUDE_DOLPHIN_AMCTYPES_H_
3+
4+
#include <dolphin/os.h>
5+
6+
// EXI callback function pointer type
7+
typedef void (*EXICallback)(s32 chan, OSContext* context);
8+
9+
#endif

0 commit comments

Comments
 (0)