Attempt to decompile osAiSetNextBuffer

This commit is contained in:
Ryan Dwyer 2021-01-30 10:26:33 +10:00
parent 5c7193c4a3
commit ecb623d6d0
4 changed files with 30 additions and 3 deletions

View File

@ -68,6 +68,7 @@ $(B_DIR)/lib/ultra/gu/ortho.o: LOOPUNROLL :=
$(B_DIR)/lib/ultra/libc/ll.o: MIPSISET := -mips3 -o32
$(B_DIR)/lib/ultra/libc/llcvt.o: MIPSISET := -mips3 -o32
$(B_DIR)/lib/ultra/io/aisetnextbuf.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/si.o: OPT_LVL := -O1

View File

@ -3,6 +3,6 @@
#include <ultra64.h>
#include "types.h"
u32 func00051ec0(void);
u32 __osAiDeviceBusy(void);
#endif

View File

@ -1,7 +1,7 @@
#include <ultra64.h>
GLOBAL_ASM(
glabel func00051ec0
glabel __osAiDeviceBusy
/* 51ec0: 3c0ea450 */ lui $t6,0xa450
/* 51ec4: 8dc4000c */ lw $a0,0xc($t6)
/* 51ec8: 3c018000 */ lui $at,0x8000

View File

@ -28,7 +28,7 @@ glabel osAiSetNextBuffer
/* 4e414: 3c018006 */ lui $at,%hi(var80060990)
/* 4e418: a0200990 */ sb $zero,%lo(var80060990)($at)
.L0004e41c:
/* 4e41c: 0c0147b0 */ jal func00051ec0
/* 4e41c: 0c0147b0 */ jal __osAiDeviceBusy
/* 4e420: 00000000 */ nop
/* 4e424: 10400003 */ beqz $v0,.L0004e434
/* 4e428: 00000000 */ nop
@ -52,3 +52,29 @@ glabel osAiSetNextBuffer
/* 4e468: 00000000 */ nop
/* 4e46c: 00000000 */ nop
);
// Mismatch: Needs data relocation
//s32 osAiSetNextBuffer(void *bufPtr, u32 size)
//{
// static u8 hdwrBugFlag = 0;
// char *bptr = bufPtr;
//
// if (hdwrBugFlag != 0) {
// bptr -= 0x2000;
// }
//
// if ((((u32)bufPtr + size) & 0x1fff) == 0) {
// hdwrBugFlag = 1;
// } else {
// hdwrBugFlag = 0;
// }
//
// if (__osAiDeviceBusy()) {
// return -1;
// }
//
// IO_WRITE(AI_DRAM_ADDR_REG, osVirtualToPhysical(bptr));
// IO_WRITE(AI_LEN_REG, size);
//
// return 0;
//}