Decompile crashPrint

This commit is contained in:
Ryan Dwyer 2021-03-16 00:17:57 +10:00
parent 882a60e6e3
commit dd9ab4f674
3 changed files with 19 additions and 23 deletions

View File

@ -6,6 +6,6 @@
void rmonproc();
bool rmonIsDisabled(void);
void crashPrint(char *format, ...);
void crashPrint(const char *format, ...);
#endif

View File

@ -0,0 +1,8 @@
#ifndef _IN_LIB_LIBC_XPRINTF_H
#define _IN_LIB_LIBC_XPRINTF_H
#include <ultra64.h>
typedef char *outfun(char*, const char*, size_t);
int _Printf(outfun prout, char *arg, const char *fmt, va_list args);
#endif

View File

@ -2,6 +2,7 @@
#include "constants.h"
#include "bss.h"
#include "lib/lib_0c000.h"
#include "lib/libc/xprintf.h"
#include "data.h"
#include "types.h"
@ -50,6 +51,8 @@ void func0002fa40(void)
// empty
}
char *func0002fa48(char *dst, const char *src, size_t count);
GLOBAL_ASM(
glabel func0002fa48
/* 2fa48: 27bdffd8 */ addiu $sp,$sp,-40
@ -79,25 +82,10 @@ glabel func0002fa48
/* 2faa0: 24020001 */ addiu $v0,$zero,0x1
);
GLOBAL_ASM(
glabel crashPrint
/* 2faa4: 27bdffe0 */ addiu $sp,$sp,-32
/* 2faa8: afa40020 */ sw $a0,0x20($sp)
/* 2faac: afbf0014 */ sw $ra,0x14($sp)
/* 2fab0: afa50024 */ sw $a1,0x24($sp)
/* 2fab4: afa60028 */ sw $a2,0x28($sp)
/* 2fab8: afa7002c */ sw $a3,0x2c($sp)
/* 2fabc: 3c047003 */ lui $a0,%hi(func0002fa48)
/* 2fac0: 2484fa48 */ addiu $a0,$a0,%lo(func0002fa48)
/* 2fac4: 27a70024 */ addiu $a3,$sp,0x24
/* 2fac8: 8fa60020 */ lw $a2,0x20($sp)
/* 2facc: 0c013b40 */ jal _Printf
/* 2fad0: 00002825 */ or $a1,$zero,$zero
/* 2fad4: 8fbf0014 */ lw $ra,0x14($sp)
/* 2fad8: 27bd0020 */ addiu $sp,$sp,0x20
/* 2fadc: 03e00008 */ jr $ra
/* 2fae0: 00000000 */ nop
/* 2fae4: 00000000 */ nop
/* 2fae8: 00000000 */ nop
/* 2faec: 00000000 */ nop
);
void crashPrint(const char *format, ...)
{
va_list ap;
va_start(ap, format);
_Printf(func0002fa48, NULL, format, ap);
}