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>
|
2023-02-13 02:37:08 +00:00
|
|
|
#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);
|
|
|
|
|
2023-03-30 02:27:34 +00:00
|
|
|
typedef struct GBASecParam {
|
2023-02-13 02:37:08 +00:00
|
|
|
u8 readbuf[4];
|
|
|
|
s32 paletteColor;
|
|
|
|
s32 paletteSpeed;
|
|
|
|
s32 length;
|
|
|
|
u32* out;
|
|
|
|
u8 _padding0[12];
|
|
|
|
u32 keyA;
|
|
|
|
s32 keyB;
|
|
|
|
u8 _padding1[24];
|
2023-03-30 02:27:34 +00:00
|
|
|
} GBASecParam;
|
2022-10-16 00:58:24 +00:00
|
|
|
|
2023-02-13 02:37:08 +00:00
|
|
|
typedef struct GBABootInfo {
|
|
|
|
s32 paletteColor;
|
|
|
|
s32 paletteSpeed;
|
|
|
|
u8* programp;
|
|
|
|
s32 length;
|
2022-10-16 00:58:24 +00:00
|
|
|
u8* status;
|
|
|
|
GBACallback callback;
|
2023-02-13 02:37:08 +00:00
|
|
|
u8 readbuf[4];
|
|
|
|
u8 writebuf[4];
|
|
|
|
int i;
|
|
|
|
OSTick start;
|
|
|
|
OSTime begin;
|
|
|
|
int firstXfer;
|
|
|
|
int curOffset;
|
|
|
|
u32 crc;
|
|
|
|
u32 dummyWord[7];
|
|
|
|
u32 keyA;
|
2023-02-13 18:07:42 +00:00
|
|
|
s32 keyB;
|
2023-02-13 02:37:08 +00:00
|
|
|
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;
|
2023-02-13 02:37:08 +00:00
|
|
|
GBATransferCallback proc;
|
|
|
|
GBABootInfo bootInfo;
|
|
|
|
DSPTaskInfo task;
|
2023-03-30 02:27:34 +00:00
|
|
|
GBASecParam* param;
|
2023-02-13 02:37:08 +00:00
|
|
|
} GBAControl;
|
2022-10-16 00:58:24 +00:00
|
|
|
|
2023-02-13 02:37:08 +00:00
|
|
|
extern GBAControl __GBA[4];
|
2022-10-16 00:58:24 +00:00
|
|
|
extern BOOL __GBAReset;
|
|
|
|
|
2023-02-13 02:37:08 +00:00
|
|
|
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
|