mirror of
https://github.com/ACreTeam/ac-decomp
synced 2026-08-21 13:36:52 -04:00
Migrate to dtk-template
Co-authored-by: NWPlayer123 <NWPlayer123@users.noreply.github.com>
This commit is contained in:
+48
-43
@@ -14,54 +14,57 @@ extern "C" {
|
||||
typedef void (*GBATransferCallback)(s32 chan);
|
||||
|
||||
typedef struct GBASecParam {
|
||||
u8 readbuf[4];
|
||||
s32 paletteColor;
|
||||
s32 paletteSpeed;
|
||||
s32 length;
|
||||
u32* out;
|
||||
u8 _padding0[12];
|
||||
u32 keyA;
|
||||
s32 keyB;
|
||||
u8 _padding1[24];
|
||||
// total size: 0x40
|
||||
u8 readbuf[4]; // offset 0x0, size 0x4
|
||||
s32 paletteColor; // offset 0x4, size 0x4
|
||||
s32 paletteSpeed; // offset 0x8, size 0x4
|
||||
s32 length; // offset 0xC, size 0x4
|
||||
u32* out; // offset 0x10, size 0x4
|
||||
u8 _padding0[12]; // offset 0x14, size 0xC
|
||||
u32 keyA; // offset 0x20, size 0x4
|
||||
s32 keyB; // offset 0x24, size 0x4
|
||||
u8 _padding1[24]; // offset 0x28, size 0x18
|
||||
} GBASecParam;
|
||||
|
||||
typedef struct GBABootInfo {
|
||||
s32 paletteColor;
|
||||
s32 paletteSpeed;
|
||||
u8* programp;
|
||||
s32 length;
|
||||
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;
|
||||
s32 keyB;
|
||||
u32 initialCode;
|
||||
int realLength;
|
||||
// total size: 0x68
|
||||
s32 paletteColor; // offset 0x0, size 0x4
|
||||
s32 paletteSpeed; // offset 0x4, size 0x4
|
||||
u8* programp; // offset 0x8, size 0x4
|
||||
s32 length; // offset 0xC, size 0x4
|
||||
u8* status; // offset 0x10, size 0x4
|
||||
GBACallback callback; // offset 0x14, size 0x4
|
||||
u8 readbuf[4]; // offset 0x18, size 0x4
|
||||
u8 writebuf[4]; // offset 0x1C, size 0x4
|
||||
int i; // offset 0x20, size 0x4
|
||||
OSTick start; // offset 0x24, size 0x4
|
||||
OSTime begin; // offset 0x28, size 0x8
|
||||
BOOL firstXfer; // offset 0x30, size 0x4
|
||||
int curOffset; // offset 0x34, size 0x4
|
||||
u32 crc; // offset 0x38, size 0x4
|
||||
u32 dummyWord[7]; // offset 0x3C, size 0x1C
|
||||
u32 keyA; // offset 0x58, size 0x4
|
||||
s32 keyB; // offset 0x5C, size 0x4
|
||||
u32 initialCode; // offset 0x60, size 0x4
|
||||
int realLength; // offset 0x64, size 0x4
|
||||
} GBABootInfo;
|
||||
|
||||
typedef struct GBAControl {
|
||||
u8 output[5];
|
||||
u8 input[5];
|
||||
s32 outputBytes;
|
||||
s32 inputBytes;
|
||||
u8* status;
|
||||
u8* ptr;
|
||||
GBACallback callback;
|
||||
s32 ret;
|
||||
OSThreadQueue threadQueue;
|
||||
OSTime delay;
|
||||
GBATransferCallback proc;
|
||||
GBABootInfo bootInfo;
|
||||
DSPTaskInfo task;
|
||||
GBASecParam* param;
|
||||
// total size: 0x100
|
||||
u8 output[5]; // offset 0x0, size 0x5
|
||||
u8 input[5]; // offset 0x5, size 0x5
|
||||
u32 outputBytes; // offset 0xC, size 0x4
|
||||
u32 inputBytes; // offset 0x10, size 0x4
|
||||
u8* status; // offset 0x14, size 0x4
|
||||
void* ptr; // offset 0x18, size 0x4
|
||||
GBACallback callback; // offset 0x1C, size 0x4
|
||||
s32 ret; // offset 0x20, size 0x4
|
||||
OSThreadQueue threadQueue; // offset 0x24, size 0x8
|
||||
OSTime delay; // offset 0x30, size 0x8
|
||||
GBATransferCallback proc; // offset 0x38, size 0x4
|
||||
GBABootInfo bootInfo; // offset 0x40, size 0x68
|
||||
DSPTaskInfo task; // offset 0xA8, size 0x50
|
||||
GBASecParam * param; // offset 0xF8, size 0x4
|
||||
} GBAControl;
|
||||
|
||||
extern GBAControl __GBA[4];
|
||||
@@ -71,7 +74,9 @@ void __GBAHandler(s32 chan, u32 error, OSContext* context);
|
||||
void __GBASyncCallback(s32 chan, s32 ret);
|
||||
s32 __GBASync(s32 chan);
|
||||
OSTime __GBASetDelay(s32 chan, OSTime delay);
|
||||
s32 __GBATransfer(s32 chan, s32 w1, s32 w2, GBATransferCallback callback);
|
||||
s32 __GBATransfer(s32 chan, u32 outputBytes, u32 inputBytes, GBATransferCallback proc);
|
||||
void __GBAX01(s32 chan, s32 ret);
|
||||
void __GBAX02(s32 chan, u8* readbuf);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
+6
-3
@@ -13,7 +13,7 @@ extern "C" {
|
||||
#define GBA_CHAN3 3
|
||||
#define GBA_MAX_CHAN 4
|
||||
|
||||
#define GBA_ALL_KEY_MASK 0x03ff
|
||||
#define GBA_ALL_KEY_MASK 0x03FF
|
||||
#define GBA_A_BUTTON 0x0001
|
||||
#define GBA_B_BUTTON 0x0002
|
||||
#define GBA_SELECT_BUTTON 0x0004
|
||||
@@ -25,7 +25,7 @@ extern "C" {
|
||||
#define GBA_R_BUTTON 0x0100
|
||||
#define GBA_L_BUTTON 0x0200
|
||||
|
||||
#define GBA_JSTAT_MASK 0x3a
|
||||
#define GBA_JSTAT_MASK 0x3A
|
||||
#define GBA_JSTAT_FLAGS_SHIFT 4
|
||||
#define GBA_JSTAT_FLAGS_MASK 0x30
|
||||
#define GBA_JSTAT_PSF1 0x20
|
||||
@@ -41,9 +41,11 @@ extern "C" {
|
||||
|
||||
#define GBA_JOYBOOT_PROGRAM_SIZE_MAX 0x40000
|
||||
|
||||
#define GBA_JOYBOOT_BOOTPARAM_OFFSET 0xc8
|
||||
#define GBA_JOYBOOT_BOOTPARAM_OFFSET 0xC8
|
||||
#define GBA_JOYBOOT_BOOTPARAM_SIZE 0x18
|
||||
|
||||
typedef void (*GBACallback)(s32 chan, s32 ret);
|
||||
|
||||
void GBAInit(void);
|
||||
s32 GBAGetStatus(s32 chan, u8* status);
|
||||
s32 GBAGetStatusAsync(s32 chan, u8* status, GBACallback callback);
|
||||
@@ -58,6 +60,7 @@ s32 GBAJoyBoot(s32 chan, s32 palette_color, s32 palette_speed, u8* programp, s32
|
||||
u8* status);
|
||||
s32 GBAJoyBootAsync(s32 chan, s32 palette_color, s32 palette_speed, u8* programp, s32 length,
|
||||
u8* status, GBACallback callback);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user