Decompile osPiGetCmdQueue

This commit is contained in:
Ryan Dwyer 2021-01-26 23:30:20 +10:00
parent 2a933aa362
commit 3f8a924a05
5 changed files with 23 additions and 24 deletions

View File

@ -66,6 +66,7 @@ $(B_DIR)/lib/libc/llcvt.o: MIPSISET := -mips3 -o32
$(B_DIR)/lib/libc/ll.o: OPT_LVL := -O1
$(B_DIR)/lib/libc/llcvt.o: OPT_LVL := -O1
$(B_DIR)/lib/ultra/io/dpctr.o: OPT_LVL := -O1
$(B_DIR)/lib/ultra/io/pigetcmdq.o: OPT_LVL := -O1
$(B_DIR)/lib/ultra/io/sp.o: OPT_LVL := -O1
$(B_DIR)/lib/ultra/io/spsetpc.o: OPT_LVL := -O1
$(B_DIR)/lib/ultra/io/sptaskyielded.o: OPT_LVL := -O1

View File

@ -3020,13 +3020,7 @@ u32 var8005cef0 = 0x00000000;
u32 var8005cef4 = 0x00000000;
u32 var8005cef8 = 0x00000000;
u32 var8005cefc = 0x00000000;
u32 __osPiDevMgr = 0x00000000;
u32 var8005cf04 = 0x00000000;
u32 var8005cf08 = 0x00000000;
u32 var8005cf0c = 0x00000000;
u32 var8005cf10 = 0x00000000;
u32 var8005cf14 = 0x00000000;
u32 var8005cf18 = 0x00000000;
OSDevMgr __osPiDevMgr = {0};
u32 var8005cf1c = 0x00000000;
u32 __osCurrentHandle = (u32) &var800902a0;
u32 var8005cf24 = (u32) &var80090318;

View File

@ -64,6 +64,17 @@ typedef struct
//OSPiHandle *piHandle; //from the official definition
} 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

View File

@ -52,7 +52,7 @@ extern OSMesg var8005cea8;
extern s8 var8005ced0;
extern u32 __osViDevMgr;
extern u32 var8005cefc;
extern u32 __osPiDevMgr;
extern OSDevMgr __osPiDevMgr;
extern u32 var8005cf30;
extern u32 var8005cf60;
extern u32 osViClock;

View File

@ -1,18 +1,11 @@
#include <libultra_internal.h>
#include "game/data/data_000000.h"
GLOBAL_ASM(
glabel osPiGetCmdQueue
/* 52040: 3c0e8006 */ lui $t6,%hi(__osPiDevMgr)
/* 52044: 8dcecf00 */ lw $t6,%lo(__osPiDevMgr)($t6)
/* 52048: 15c00003 */ bnez $t6,.L00052058
/* 5204c: 00000000 */ nop
/* 52050: 03e00008 */ jr $ra
/* 52054: 00001025 */ or $v0,$zero,$zero
.L00052058:
/* 52058: 3c028006 */ lui $v0,%hi(__osPiDevMgr+0x8)
/* 5205c: 8c42cf08 */ lw $v0,%lo(__osPiDevMgr+0x8)($v0)
/* 52060: 03e00008 */ jr $ra
/* 52064: 00000000 */ nop
/* 52068: 00000000 */ nop
/* 5206c: 00000000 */ nop
);
OSMesgQueue *osPiGetCmdQueue(void)
{
if (!__osPiDevMgr.active) {
return NULL;
}
return __osPiDevMgr.cmdQueue;
}