mirror of
https://github.com/izzy2lost/Diddy-Kong-Racing.git
synced 2026-06-19 01:16:26 -07:00
c: osPiStartDma
This commit is contained in:
@@ -179,6 +179,8 @@ $(BUILD_DIR)/lib/src/osSetTimer.o: OPT_FLAGS := -O1
|
||||
$(BUILD_DIR)/lib/src/osTimer.o: OPT_FLAGS := -O1
|
||||
$(BUILD_DIR)/lib/src/osViBlack.o: OPT_FLAGS := -O1
|
||||
$(BUILD_DIR)/lib/src/osViSwapBuffer.o : OPT_FLAGS := -O1
|
||||
$(BUILD_DIR)/lib/src/osPiStartDma.o : OPT_FLAGS := -O1
|
||||
|
||||
|
||||
|
||||
######################## Targets #############################
|
||||
|
||||
+11
-2
@@ -60,11 +60,20 @@ typedef struct {
|
||||
/*0x08*/ void *dramAddr;
|
||||
/*0x0C*/ uintptr_t devAddr;
|
||||
/*0x10*/ size_t size;
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
OSPiHandle *piHandle; // from the official definition
|
||||
#endif
|
||||
} OSIoMesg;
|
||||
|
||||
typedef struct {
|
||||
s32 active; /* Status flag */
|
||||
OSThread *thread; /* Calling thread */
|
||||
OSMesgQueue *cmdQueue; /* Command queue */
|
||||
OSMesgQueue *evtQueue; /* Event queue */
|
||||
OSMesgQueue *acsQueue; /* Access queue */
|
||||
/* Raw DMA routine */
|
||||
s32 (*dma)(s32, u32, void *, u32);
|
||||
s32 (*edma)(OSPiHandle *, s32, u32, void *, u32);
|
||||
} OSDevMgr;
|
||||
|
||||
/* Definitions */
|
||||
|
||||
#define OS_READ 0 // device -> RDRAM
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
/* The comment below is needed for this file to be picked up by generate_ld */
|
||||
/* RAM_POS: 0x800C8F80 */
|
||||
|
||||
#include "types.h"
|
||||
#include "macros.h"
|
||||
#include "libultra_internal.h"
|
||||
|
||||
//GLOBAL_ASM("lib/asm/non_matchings/unknown_0C9B80/osPiStartDma.s")
|
||||
|
||||
extern OSDevMgr D_800E3740; //__osPiDevMgr;
|
||||
|
||||
s32 osPiStartDma(OSIoMesg *mb, s32 priority, s32 direction, u32 devAddr, void *dramAddr, u32 size, OSMesgQueue *mq)
|
||||
{
|
||||
register s32 ret;
|
||||
if (!D_800E3740.active)
|
||||
return -1;
|
||||
if (direction == OS_READ)
|
||||
mb->hdr.type = 11;
|
||||
else
|
||||
mb->hdr.type = 12;
|
||||
mb->hdr.pri = priority;
|
||||
mb->hdr.retQueue = mq;
|
||||
mb->dramAddr = dramAddr;
|
||||
mb->devAddr = devAddr;
|
||||
mb->size = size;
|
||||
mb->piHandle = NULL;
|
||||
if (priority == OS_MESG_PRI_HIGH)
|
||||
{
|
||||
ret = osJamMesg(osPiGetCmdQueue(), (OSMesg)mb, OS_MESG_NOBLOCK);
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = osSendMesg(osPiGetCmdQueue(), (OSMesg)mb, OS_MESG_NOBLOCK);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
/* The comment below is needed for this file to be picked up by generate_ld */
|
||||
/* RAM_POS: 0x800C8F80 */
|
||||
|
||||
#include "types.h"
|
||||
#include "macros.h"
|
||||
#include "libultra_internal.h"
|
||||
|
||||
GLOBAL_ASM("lib/asm/non_matchings/unknown_0C9B80/osPiStartDma.s")
|
||||
Reference in New Issue
Block a user