sm64

A Super Mario 64 decompilation
Log | Files | Refs | README | LICENSE

epidma.c (639B)


      1 #if defined(VERSION_SH) || defined(VERSION_CN)
      2 
      3 #include "PR/os_internal.h"
      4 #include "piint.h"
      5 
      6 s32 osEPiStartDma(OSPiHandle *pihandle, OSIoMesg *mb, s32 direction) {
      7     register s32 ret;
      8 
      9     if (!__osPiDevMgr.active) {
     10         return -1;
     11     }
     12     mb->piHandle = pihandle;
     13     if (direction == OS_READ) {
     14         mb->hdr.type = OS_MESG_TYPE_EDMAREAD;
     15     } else {
     16         mb->hdr.type = OS_MESG_TYPE_EDMAWRITE;
     17     }
     18     if (mb->hdr.pri == OS_MESG_PRI_HIGH) {
     19         ret = osJamMesg(osPiGetCmdQueue(), mb, OS_MESG_NOBLOCK);
     20     } else {
     21         ret = osSendMesg(osPiGetCmdQueue(), mb, OS_MESG_NOBLOCK);
     22     }
     23     return ret;
     24 }
     25 
     26 #endif