mirror of
https://github.com/izzy2lost/Diddy-Kong-Racing.git
synced 2026-06-19 01:16:26 -07:00
c: osPiGetCmdQueue
This commit is contained in:
@@ -2,13 +2,10 @@
|
||||
/* RAM_POS: 0x800D4590 */
|
||||
|
||||
#include "types.h"
|
||||
//#include "macros.h"
|
||||
|
||||
#define PHYS_TO_K1(x) ((u32)(x)|0xA0000000) /* physical to kseg1 */
|
||||
#define IO_READ(addr) (*(vu32 *)PHYS_TO_K1(addr))
|
||||
|
||||
//GLOBAL_ASM("lib/asm/non_matchings/unknown_0D5190/__osSiRawReadIo.s")
|
||||
|
||||
s32 __osSiRawReadIo(u32 devAddr, u32 *data)
|
||||
{
|
||||
if (__osSiDeviceBusy())
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
|
||||
/* The comment below is needed for this file to be picked up by generate_ld */
|
||||
/* RAM_POS: 0x800D36A0 */
|
||||
|
||||
#include "libultra_internal.h"
|
||||
|
||||
extern OSThread* __osRunningThread;
|
||||
|
||||
s32 osJamMesg(OSMesgQueue *mq, OSMesg msg, s32 flag)
|
||||
{
|
||||
register u32 saveMask = __osDisableInt();
|
||||
while (mq->validCount >= mq->msgCount)
|
||||
{
|
||||
if (flag == OS_MESG_BLOCK)
|
||||
{
|
||||
__osRunningThread->state = OS_STATE_WAITING;
|
||||
__osEnqueueAndYield(&mq->fullqueue);
|
||||
}
|
||||
else
|
||||
{
|
||||
__osRestoreInt(saveMask);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
mq->first = (mq->first + mq->msgCount - 1) % mq->msgCount;
|
||||
mq->msg[mq->first] = msg;
|
||||
mq->validCount++;
|
||||
if (mq->mtqueue->next != NULL)
|
||||
{
|
||||
osStartThread(__osPopThread(&mq->mtqueue));
|
||||
}
|
||||
__osRestoreInt(saveMask);
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
/* The comment below is needed for this file to be picked up by generate_ld */
|
||||
/* RAM_POS: 0x800D37F0 */
|
||||
|
||||
#include "libultra_internal.h"
|
||||
|
||||
extern OSDevMgr __osPiDevMgr;
|
||||
|
||||
OSMesgQueue *osPiGetCmdQueue(void)
|
||||
{
|
||||
if (!__osPiDevMgr.active)
|
||||
return NULL;
|
||||
return __osPiDevMgr.cmdQueue;
|
||||
}
|
||||
@@ -5,8 +5,3 @@
|
||||
#include "macros.h"
|
||||
|
||||
GLOBAL_ASM("lib/asm/non_matchings/unknown_0D4270/func_800D3670.s")
|
||||
GLOBAL_ASM("lib/asm/non_matchings/unknown_0D4270/osJamMesg.s")
|
||||
GLOBAL_ASM("lib/asm/non_matchings/unknown_0D4270/osPiGetCmdQueue.s")
|
||||
GLOBAL_ASM("lib/asm/non_matchings/unknown_0D4270/func_800D3820.s")
|
||||
GLOBAL_ASM("lib/asm/non_matchings/unknown_0D4270/_Putfld.s")
|
||||
GLOBAL_ASM("lib/asm/non_matchings/unknown_0D4270/_Printf.s")
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
/* The comment below is needed for this file to be picked up by generate_ld */
|
||||
/* RAM_POS: 0x800D3820 */
|
||||
|
||||
#include "types.h"
|
||||
#include "macros.h"
|
||||
|
||||
GLOBAL_ASM("lib/asm/non_matchings/unknown_0D43F0/func_800D3820.s")
|
||||
GLOBAL_ASM("lib/asm/non_matchings/unknown_0D43F0/_Putfld.s")
|
||||
GLOBAL_ASM("lib/asm/non_matchings/unknown_0D43F0/_Printf.s")
|
||||
Reference in New Issue
Block a user