mirror of
https://github.com/encounter/xenoblade.git
synced 2026-03-30 11:43:34 -07:00
5e4e070175
DBInitInterrupts doesn't match with the GC 3.0 compiler for some reason, so it's included as asm/nonmatching for now.
37 lines
943 B
C
37 lines
943 B
C
#ifndef NDEV_EXI2A_DEBUGGER_DRIVER_H
|
|
#define NDEV_EXI2A_DEBUGGER_DRIVER_H
|
|
#include "RevoSDK/os/OSInterrupt.h"
|
|
#include "types.h"
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
void DBInitComm(u8**, OSInterruptHandler);
|
|
void DBInitInterrupts(void);
|
|
u32 DBQueryData(void);
|
|
BOOL DBRead(void*, u32);
|
|
BOOL DBWrite(const void*, u32);
|
|
void DBOpen(void);
|
|
void DBClose(void);
|
|
|
|
static inline BOOL __DBReadMailbox(u32* mailOut) {
|
|
return __DBEXIReadReg(0x34000200, mailOut, sizeof(*mailOut));
|
|
}
|
|
|
|
static inline BOOL __DBRead(u32 ofs, void* dest, u32 size) {
|
|
return __DBEXIReadRam(((ofs + 0xD10000) * 0x40) & 0x3FFFFF00, dest, size);
|
|
}
|
|
|
|
static inline BOOL __DBWriteMailbox(u32 mail) {
|
|
return __DBEXIWriteReg(0xB4000100, &mail, sizeof(mail));
|
|
}
|
|
|
|
static inline BOOL __DBWrite(u32 ofs, const void* src, u32 size) {
|
|
return __DBEXIWriteRam(
|
|
(((ofs + 0xD10000) * 0x40) & 0x3FFFFF00) | 0x80000000, src, size);
|
|
}
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
#endif |