prime/include/dolphin/GBAPriv.h

81 lines
1.4 KiB
C
Raw Normal View History

2022-10-16 00:58:24 +00:00
#ifndef _DOLPHIN_GBAPRIV
#define _DOLPHIN_GBAPRIV
#include "types.h"
#include <dolphin/gba.h>
#include <dolphin/os.h>
#include <dolphin/dsp.h>
2022-10-16 00:58:24 +00:00
#ifdef __cplusplus
extern "C" {
#endif
2022-10-16 05:53:55 +00:00
typedef void (*GBATransferCallback)(s32 chan);
2022-10-16 00:58:24 +00:00
typedef struct GBASecParams {
u8 readbuf[4];
s32 paletteColor;
s32 paletteSpeed;
s32 length;
u32* out;
u8 _padding0[12];
u32 keyA;
s32 keyB;
u8 _padding1[24];
2022-10-16 00:58:24 +00:00
} GBASecParams;
typedef struct GBABootInfo {
s32 paletteColor;
s32 paletteSpeed;
u8* programp;
s32 length;
2022-10-16 00:58:24 +00:00
u8* status;
GBACallback callback;
u8 readbuf[4];
u8 writebuf[4];
int i;
OSTick start;
OSTime begin;
int firstXfer;
int curOffset;
u32 crc;
u32 dummyWord[7];
u32 keyA;
u32 keyB;
u32 initialCode;
int realLength;
} GBABootInfo;
typedef struct GBAControl {
u8 output[5];
u8 input[5];
s32 outputBytes;
s32 inputBytes;
u8* status;
u8* ptr;
GBACallback callback;
s32 ret;
OSThreadQueue threadQueue;
2022-10-16 02:14:54 +00:00
OSTime delay;
GBATransferCallback proc;
GBABootInfo bootInfo;
DSPTaskInfo task;
2022-10-16 00:58:24 +00:00
GBASecParams* param;
} GBAControl;
2022-10-16 00:58:24 +00:00
extern GBAControl __GBA[4];
2022-10-16 00:58:24 +00:00
extern BOOL __GBAReset;
void __GBAHandler(s32 chan, u32 error, OSContext* context);
2022-10-16 00:58:24 +00:00
void __GBASyncCallback(s32 chan, s32 ret);
s32 __GBASync(s32 chan);
2022-10-16 02:14:54 +00:00
OSTime __GBASetDelay(s32 chan, OSTime delay);
2022-10-16 05:53:55 +00:00
s32 __GBATransfer(s32 chan, s32 w1, s32 w2, GBATransferCallback callback);
2022-10-16 00:58:24 +00:00
#ifdef __cplusplus
}
#endif
#endif // _DOLPHIN_GBAPRIV