Attempt to decompile __osSyncPutChars

This commit is contained in:
Ryan Dwyer 2022-03-19 22:21:12 +10:00
parent 8d209d59c2
commit c55031e0c2
2 changed files with 30 additions and 3 deletions

View File

@ -1,9 +1,6 @@
#include <ultra64.h>
#include "lib/mtx.h"
u32 var8005e6e0nb = 0;
u32 var8005e6e4nb = 1;
void func00004f60nb(u32 arg0, u32 arg1, u32 arg2, u32 arg3)
{
u32 foo;

View File

@ -2,6 +2,9 @@
#include <rdb.h>
#include <R4300.h>
unsigned int __osRdbSendMessage = 0;
unsigned int __osRdbWriteOK = 1;
GLOBAL_ASM(
glabel __osSyncPutChars
/* 4100: 27bdffc8 */ addiu $sp,$sp,-56
@ -70,3 +73,30 @@ glabel __osSyncPutChars
/* 41e4: 03e00008 */ jr $ra
/* 41e8: 00000000 */ sll $zero,$zero,0x0
);
//void __osSyncPutChars(int type, int length, const char *buf)
//{
// rdbPacket packet;
// int i;
// u32 mask;
//
// packet.type = type;
// packet.length = length;
//
// for (i = 0; i < length; i++) {
// packet.buf[i] = buf[i];
// }
//
// while (!__osAtomicDec(&__osRdbWriteOK));
//
// mask = __osDisableInt();
//
// *(u32 *)RDB_BASE_REG = *(u32 *)&packet;
//
// while (!(__osGetCause() & CAUSE_IP6));
//
// *(u32 *)RDB_READ_INTR_REG = 0;
//
// __osRdbWriteOK++;
// __osRestoreInt(mask);
//}