Shipwright/soh/src/libultra/io/epidma.c
M4xw 39cc86c260 git subrepo clone https://github.com/HarbourMasters/soh.git
subrepo:
  subdir:   "soh"
  merged:   "ba904bbd0"
upstream:
  origin:   "https://github.com/HarbourMasters/soh.git"
  branch:   "master"
  commit:   "ba904bbd0"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2022-03-22 02:51:23 +01:00

26 lines
546 B
C

#include "global.h"
#include "ultra64/internal.h"
s32 osEPiStartDma(OSPiHandle* handle, OSIoMesg* mb, s32 direction) {
s32 ret;
if (!__osPiDevMgr.initialized) {
return -1;
}
mb->piHandle = handle;
if (direction == OS_READ) {
mb->hdr.type = 0xF;
} else {
mb->hdr.type = 0x10;
}
if (mb->hdr.pri == 1) {
ret = osJamMesg(osPiGetCmdQueue(), (OSMesg)mb, OS_MESG_NOBLOCK);
} else {
ret = osSendMesg(osPiGetCmdQueue(), (OSMesg)mb, OS_MESG_NOBLOCK);
}
return ret;
}