mirror of
https://github.com/n64decomp/sm64
synced 2026-05-14 18:18:11 +00:00
27 lines
639 B
C
27 lines
639 B
C
#if defined(VERSION_SH) || defined(VERSION_CN)
|
|
|
|
#include "PR/os_internal.h"
|
|
#include "piint.h"
|
|
|
|
s32 osEPiStartDma(OSPiHandle *pihandle, OSIoMesg *mb, s32 direction) {
|
|
register s32 ret;
|
|
|
|
if (!__osPiDevMgr.active) {
|
|
return -1;
|
|
}
|
|
mb->piHandle = pihandle;
|
|
if (direction == OS_READ) {
|
|
mb->hdr.type = OS_MESG_TYPE_EDMAREAD;
|
|
} else {
|
|
mb->hdr.type = OS_MESG_TYPE_EDMAWRITE;
|
|
}
|
|
if (mb->hdr.pri == OS_MESG_PRI_HIGH) {
|
|
ret = osJamMesg(osPiGetCmdQueue(), mb, OS_MESG_NOBLOCK);
|
|
} else {
|
|
ret = osSendMesg(osPiGetCmdQueue(), mb, OS_MESG_NOBLOCK);
|
|
}
|
|
return ret;
|
|
}
|
|
|
|
#endif
|