2022-10-09 05:13:17 +00:00
|
|
|
#ifndef _DOLPHIN_AR
|
|
|
|
#define _DOLPHIN_AR
|
2022-09-13 04:26:54 +00:00
|
|
|
|
|
|
|
#include "types.h"
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2022-12-21 02:09:34 +00:00
|
|
|
#define AR_STACK_INDEX_ENTRY_SIZE sizeof(u32)
|
|
|
|
|
|
|
|
#define ARAM_DIR_MRAM_TO_ARAM 0x00
|
|
|
|
#define ARAM_DIR_ARAM_TO_MRAM 0x01
|
|
|
|
|
|
|
|
#define AR_CLEAR_INTERNAL_ALL 0x00
|
|
|
|
#define AR_CLEAR_INTERNAL_USER 0x01
|
|
|
|
#define AR_CLEAR_EXPANSION 0x02
|
|
|
|
|
|
|
|
typedef void (*ARCallback)(void);
|
|
|
|
|
|
|
|
ARCallback ARRegisterDMACallback(ARCallback callback);
|
|
|
|
u32 ARGetDMAStatus(void);
|
|
|
|
void ARStartDMA(u32 type, u32 mainmem_addr, u32 aram_addr, u32 length);
|
2022-09-13 04:26:54 +00:00
|
|
|
u32 ARInit(u32* stack_index_addr, u32 num_entries);
|
2022-12-21 02:09:34 +00:00
|
|
|
u32 ARGetBaseAddress(void);
|
|
|
|
BOOL ARCheckInit(void);
|
|
|
|
void ARReset(void);
|
2022-09-13 04:26:54 +00:00
|
|
|
u32 ARAlloc(u32 length);
|
2022-12-21 02:09:34 +00:00
|
|
|
u32 ARFree(u32* length);
|
|
|
|
u32 ARGetSize(void);
|
|
|
|
u32 ARGetInternalSize(void);
|
|
|
|
void ARSetSize(void);
|
|
|
|
void ARClear(u32 flag);
|
|
|
|
|
|
|
|
void __ARClearInterrupt(void);
|
|
|
|
u16 __ARGetInterruptStatus(void);
|
|
|
|
|
|
|
|
#define ARStartDMARead(mmem, aram, len) ARStartDMA(ARAM_DIR_ARAM_TO_MRAM, mmem, aram, len)
|
|
|
|
#define ARStartDMAWrite(mmem, aram, len) ARStartDMA(ARAM_DIR_MRAM_TO_ARAM, mmem, aram, len)
|
2022-09-13 04:26:54 +00:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2022-10-09 05:13:17 +00:00
|
|
|
#endif // _DOLPHIN_AR
|