mirror of
https://github.com/zeldaret/oot
synced 2026-06-17 23:21:20 -04:00
21750d5aee
* osgetactivequeue ok * osspdevicebusy ok * osGetCurrFaultedThread ok * osSpRawStartDma OK * __osSpSetPc and osViGetCurrentFramebuffer OK * sinf, sins, and sptask OK * coss OK * cosf OK * ran format.sh * Updated PR to use ultratypes * osContStartQuery OK * ran format.sh * Updated PR to fix issues * Made suggested changes
18 lines
477 B
C
18 lines
477 B
C
#include <ultra64.h>
|
|
#include <global.h>
|
|
#include <ultra64/hardware.h>
|
|
|
|
s32 __osSpRawStartDma(s32 direction, u32 devAddr, void* dramAddr, u32 size) {
|
|
if (__osSpDeviceBusy()) {
|
|
return -1;
|
|
}
|
|
HW_REG(SP_MEM_ADDR_REG, u32) = devAddr;
|
|
HW_REG(SP_DRAM_ADDR_REG, u32) = osVirtualToPhysical(dramAddr);
|
|
if (direction == OS_READ) {
|
|
HW_REG(SP_WR_LEN_REG, u32) = size - 1;
|
|
} else {
|
|
HW_REG(SP_RD_LEN_REG, u32) = size - 1;
|
|
}
|
|
return 0;
|
|
}
|