diff --git a/src/include/lib/rmon.h b/src/include/lib/rmon.h index 048fece9c..8891d9598 100644 --- a/src/include/lib/rmon.h +++ b/src/include/lib/rmon.h @@ -9,6 +9,6 @@ void rmon0002fa30(u32 *arg0, s32 arg1); void rmon0002fa38(s32 arg0); void rmon0002fa40(void); bool rmonIsDisabled(void); -void rmonPrint(const char *format, ...); +void rmonPrintf(const char *format, ...); #endif diff --git a/src/lib/crash.c b/src/lib/crash.c index 65d98dff8..8d1dce436 100644 --- a/src/lib/crash.c +++ b/src/lib/crash.c @@ -573,12 +573,12 @@ glabel func0000c694nb /* c6e0: 3c047005 */ lui $a0,0x7005 /* c6e4: 3c047005 */ lui $a0,0x7005 /* c6e8: 24843fd0 */ addiu $a0,$a0,0x3fd0 -/* c6ec: 0c00c47d */ jal rmonPrint +/* c6ec: 0c00c47d */ jal rmonPrintf /* c6f0: 00e02825 */ or $a1,$a3,$zero /* c6f4: 10000004 */ beqz $zero,.NB0000c708 /* c6f8: 8fbf0014 */ lw $ra,0x14($sp) .NB0000c6fc: -/* c6fc: 0c00c47d */ jal rmonPrint +/* c6fc: 0c00c47d */ jal rmonPrintf /* c700: 24843fd8 */ addiu $a0,$a0,0x3fd8 /* c704: 8fbf0014 */ lw $ra,0x14($sp) .NB0000c708: @@ -618,12 +618,12 @@ glabel func0000c714nb /* c760: 3c047005 */ lui $a0,0x7005 /* c764: 3c047005 */ lui $a0,0x7005 /* c768: 24843fdc */ addiu $a0,$a0,0x3fdc -/* c76c: 0c00c47d */ jal rmonPrint +/* c76c: 0c00c47d */ jal rmonPrintf /* c770: 00e02825 */ or $a1,$a3,$zero /* c774: 10000004 */ beqz $zero,.NB0000c788 /* c778: 8fbf0014 */ lw $ra,0x14($sp) .NB0000c77c: -/* c77c: 0c00c47d */ jal rmonPrint +/* c77c: 0c00c47d */ jal rmonPrintf /* c780: 24843fe4 */ addiu $a0,$a0,0x3fe4 /* c784: 8fbf0014 */ lw $ra,0x14($sp) .NB0000c788: @@ -643,7 +643,7 @@ glabel func0000c794nb /* c79c: 3c047005 */ lui $a0,0x7005 /* c7a0: 3c058009 */ lui $a1,0x8009 /* c7a4: 8ca5710c */ lw $a1,0x710c($a1) -/* c7a8: 0c00c47d */ jal rmonPrint +/* c7a8: 0c00c47d */ jal rmonPrintf /* c7ac: 24843fe8 */ addiu $a0,$a0,0x3fe8 /* c7b0: 8fbf0014 */ lw $ra,0x14($sp) /* c7b4: 27bd0018 */ addiu $sp,$sp,0x18 @@ -667,7 +667,7 @@ u32 crashGetStackEnd(u32 sp, s32 tid) u32 end; if (tid <= 0 || tid > 6U) { - rmonPrint("Bad tid\n"); + rmonPrintf("Bad tid\n"); return 0; } @@ -686,7 +686,7 @@ u32 crashGetStackStart(u32 sp, s32 tid) u32 start; if (tid <= 0 || tid > 6U) { - rmonPrint("Bad tid\n"); + rmonPrintf("Bad tid\n"); return 0; } @@ -711,32 +711,32 @@ bool crashIsDouble(f32 value) void crashPrintFloat(s32 index, f32 value) { if (crashIsDouble(value)) { - rmonPrint("%s%s%02d: % .7e ", "", "", index, (f64)value); + rmonPrintf("%s%s%02d: % .7e ", "", "", index, (f64)value); } else { u32 bits = *(u32 *)&value; - rmonPrint("%02d: I%d.%03d.%07d ", index, (bits & 0x80000000) >> 31, (bits & 0x7f800000) >> 23, bits & 0x7fffff); + rmonPrintf("%02d: I%d.%03d.%07d ", index, (bits & 0x80000000) >> 31, (bits & 0x7f800000) >> 23, bits & 0x7fffff); } } void crashPrint2Floats(s32 index, f32 value1, f32 value2) { crashPrintFloat(index, value1); - rmonPrint(" "); + rmonPrintf(" "); crashPrintFloat(index + 1, value2); - rmonPrint("\n"); + rmonPrintf("\n"); } void crashPrint3Floats(s32 index, f32 value1, f32 value2, f32 value3) { crashPrintFloat(index, value1); - rmonPrint(" "); + rmonPrintf(" "); crashPrintFloat(index + 1, value2); - rmonPrint(" "); + rmonPrintf(" "); crashPrintFloat(index + 2, value3); - rmonPrint("\n"); + rmonPrintf("\n"); } #if VERSION >= VERSION_NTSC_1_0 @@ -751,7 +751,7 @@ u32 crashGenerate(OSThread *thread, u32 *callstack, s32 *tracelen) __OSThreadContext *ctx = &thread->context; bool done; - rmonPrint("\n\nFAULT-\n"); + rmonPrintf("\n\nFAULT-\n"); if (!g_Vars.fourmeg2player) { // Print a stack trace in a dodgy way. @@ -759,21 +759,21 @@ u32 crashGenerate(OSThread *thread, u32 *callstack, s32 *tracelen) // values which could potentially be a return address, and prints them. u32 *stackend = (u32 *) crashGetStackEnd(ctx->sp, thread->id); u32 *sp; - rmonPrint("DodgyStackTrace: %08llx ", ctx->ra & 0xffffffff); + rmonPrintf("DodgyStackTrace: %08llx ", ctx->ra & 0xffffffff); sp = (u32 *) ctx->sp; while (sp < stackend) { if (crashIsReturnAddress((u32 *)*sp)) { - rmonPrint("%08x ", *sp); + rmonPrintf("%08x ", *sp); } sp++; } - rmonPrint(".\n"); + rmonPrintf(".\n"); } - rmonPrint("%H#@! Another Perfect Crash (tm)\n"); + rmonPrintf("%H#@! Another Perfect Crash (tm)\n"); if (!g_Vars.fourmeg2player) { // Print floating point registers @@ -791,32 +791,32 @@ u32 crashGenerate(OSThread *thread, u32 *callstack, s32 *tracelen) } // Print integer registers - rmonPrint("at 0x%016llx v0 0x%016llx v1 0x%016llx\n", ctx->at, ctx->v0, ctx->v1); - rmonPrint("a0 0x%016llx a1 0x%016llx a2 0x%016llx\n", ctx->a0, ctx->a1, ctx->a2); - rmonPrint("a3 0x%016llx t0 0x%016llx t1 0x%016llx\n", ctx->a3, ctx->t0, ctx->t1); - rmonPrint("t2 0x%016llx t3 0x%016llx t4 0x%016llx\n", ctx->t2, ctx->t3, ctx->t4); - rmonPrint("t5 0x%016llx t6 0x%016llx t7 0x%016llx\n", ctx->t5, ctx->t6, ctx->t7); - rmonPrint("s0 0x%016llx s1 0x%016llx s2 0x%016llx\n", ctx->s0, ctx->s1, ctx->s2); - rmonPrint("s3 0x%016llx s4 0x%016llx s5 0x%016llx\n", ctx->s3, ctx->s4, ctx->s5); - rmonPrint("s6 0x%016llx s7 0x%016llx t8 0x%016llx\n", ctx->s6, ctx->s7, ctx->t8); - rmonPrint("t9 0x%016llx gp 0x%016llx sp 0x%016llx\n", ctx->t9, ctx->gp, ctx->sp); - rmonPrint("s8 0x%016llx ra 0x%016llx\n", ctx->s8, ctx->ra); + rmonPrintf("at 0x%016llx v0 0x%016llx v1 0x%016llx\n", ctx->at, ctx->v0, ctx->v1); + rmonPrintf("a0 0x%016llx a1 0x%016llx a2 0x%016llx\n", ctx->a0, ctx->a1, ctx->a2); + rmonPrintf("a3 0x%016llx t0 0x%016llx t1 0x%016llx\n", ctx->a3, ctx->t0, ctx->t1); + rmonPrintf("t2 0x%016llx t3 0x%016llx t4 0x%016llx\n", ctx->t2, ctx->t3, ctx->t4); + rmonPrintf("t5 0x%016llx t6 0x%016llx t7 0x%016llx\n", ctx->t5, ctx->t6, ctx->t7); + rmonPrintf("s0 0x%016llx s1 0x%016llx s2 0x%016llx\n", ctx->s0, ctx->s1, ctx->s2); + rmonPrintf("s3 0x%016llx s4 0x%016llx s5 0x%016llx\n", ctx->s3, ctx->s4, ctx->s5); + rmonPrintf("s6 0x%016llx s7 0x%016llx t8 0x%016llx\n", ctx->s6, ctx->s7, ctx->t8); + rmonPrintf("t9 0x%016llx gp 0x%016llx sp 0x%016llx\n", ctx->t9, ctx->gp, ctx->sp); + rmonPrintf("s8 0x%016llx ra 0x%016llx\n", ctx->s8, ctx->ra); - rmonPrint("TID %d epc %08x caus %08x fp %08x badv %08x sr %08x\n", + rmonPrintf("TID %d epc %08x caus %08x fp %08x badv %08x sr %08x\n", thread->id, ctx->pc, ctx->cause, ctx->fpcsr, ctx->badvaddr, ctx->sr); // Print the address of the faulted instruction, along with the instruction // itself and the next three - presumably to help the developer locate it. - rmonPrint("dshex -a %08x %08x %08x %08x %08x\n", ctx->pc, + rmonPrintf("dshex -a %08x %08x %08x %08x %08x\n", ctx->pc, ((u32 *)ctx->pc)[0], ((u32 *)ctx->pc)[1], ((u32 *)ctx->pc)[2], ((u32 *)ctx->pc)[3]); crashPrintDescription(ctx->cause, "cause", g_CrashCauseDescriptions); - rmonPrint(" : "); + rmonPrintf(" : "); crashPrintDescription(ctx->fpcsr, "fpcsr", g_CrashFpcsrDescriptions); - rmonPrint("\n"); + rmonPrintf("\n"); // Print a proper stack trace i = 0; @@ -826,17 +826,17 @@ u32 crashGenerate(OSThread *thread, u32 *callstack, s32 *tracelen) stackstart = (u32 *) crashGetStackStart((u32)sp, thread->id); ptr = ctx->pc; *tracelen = 0; - rmonPrint("nearl: "); + rmonPrintf("nearl: "); while (!done) { sp = (u32 *) crashGetParentStackFrame((u32 *) ptr, &_libSegmentStart, (u32)sp, regs); - rmonPrint(" %08x ", ptr); + rmonPrintf(" %08x ", ptr); callstack[*tracelen] = ptr; *tracelen = *tracelen + 1; if (i == 4) { - rmonPrint("\n "); + rmonPrintf("\n "); } if (sp == NULL) { @@ -857,8 +857,8 @@ u32 crashGenerate(OSThread *thread, u32 *callstack, s32 *tracelen) i++; } - rmonPrint("\n"); - rmonPrint("\n"); + rmonPrintf("\n"); + rmonPrintf("\n"); return 0; } @@ -903,7 +903,7 @@ glabel crashGenerate /* ca7c: afb1002c */ sw $s1,0x2c($sp) /* ca80: afb00028 */ sw $s0,0x28($sp) /* ca84: afa500fc */ sw $a1,0xfc($sp) -/* ca88: 0c00c47d */ jal rmonPrint +/* ca88: 0c00c47d */ jal rmonPrintf /* ca8c: 24844050 */ addiu $a0,$a0,0x4050 /* ca90: 8fa200f8 */ lw $v0,0xf8($sp) /* ca94: 24530020 */ addiu $s3,$v0,0x20 @@ -917,7 +917,7 @@ glabel crashGenerate /* cab4: 00409025 */ or $s2,$v0,$zero /* cab8: 03203825 */ or $a3,$t9,$zero /* cabc: 2484405c */ addiu $a0,$a0,0x405c -/* cac0: 0c00c47d */ jal rmonPrint +/* cac0: 0c00c47d */ jal rmonPrintf /* cac4: 00003025 */ or $a2,$zero,$zero /* cac8: 8e7000d4 */ lw $s0,0xd4($s3) /* cacc: 0212082b */ sltu $at,$s0,$s2 @@ -929,7 +929,7 @@ glabel crashGenerate /* cae0: 8e040000 */ lw $a0,0x0($s0) /* cae4: 10400003 */ beqz $v0,.NB0000caf4 /* cae8: 02202025 */ or $a0,$s1,$zero -/* caec: 0c00c47d */ jal rmonPrint +/* caec: 0c00c47d */ jal rmonPrintf /* caf0: 8e050000 */ lw $a1,0x0($s0) .NB0000caf4: /* caf4: 26100004 */ addiu $s0,$s0,0x4 @@ -938,10 +938,10 @@ glabel crashGenerate /* cb00: 00000000 */ sll $zero,$zero,0x0 .NB0000cb04: /* cb04: 3c047005 */ lui $a0,0x7005 -/* cb08: 0c00c47d */ jal rmonPrint +/* cb08: 0c00c47d */ jal rmonPrintf /* cb0c: 24844080 */ addiu $a0,$a0,0x4080 /* cb10: 3c047005 */ lui $a0,0x7005 -/* cb14: 0c00c47d */ jal rmonPrint +/* cb14: 0c00c47d */ jal rmonPrintf /* cb18: 24844084 */ addiu $a0,$a0,0x4084 /* cb1c: 00002025 */ or $a0,$zero,$zero /* cb20: 8e650114 */ lw $a1,0x114($s3) @@ -1008,7 +1008,7 @@ glabel crashGenerate /* cc14: 3c047005 */ lui $a0,0x7005 /* cc18: 2484409c */ addiu $a0,$a0,0x409c /* cc1c: afad001c */ sw $t5,0x1c($sp) -/* cc20: 0c00c47d */ jal rmonPrint +/* cc20: 0c00c47d */ jal rmonPrintf /* cc24: afac0018 */ sw $t4,0x18($sp) /* cc28: 8e6e0020 */ lw $t6,0x20($s3) /* cc2c: 8e6f0024 */ lw $t7,0x24($s3) @@ -1021,7 +1021,7 @@ glabel crashGenerate /* cc48: 3c047005 */ lui $a0,0x7005 /* cc4c: 248440c4 */ addiu $a0,$a0,0x40c4 /* cc50: afb9001c */ sw $t9,0x1c($sp) -/* cc54: 0c00c47d */ jal rmonPrint +/* cc54: 0c00c47d */ jal rmonPrintf /* cc58: afb80018 */ sw $t8,0x18($sp) /* cc5c: 8e680038 */ lw $t0,0x38($s3) /* cc60: 8e69003c */ lw $t1,0x3c($s3) @@ -1034,7 +1034,7 @@ glabel crashGenerate /* cc7c: 3c047005 */ lui $a0,0x7005 /* cc80: 248440ec */ addiu $a0,$a0,0x40ec /* cc84: afab001c */ sw $t3,0x1c($sp) -/* cc88: 0c00c47d */ jal rmonPrint +/* cc88: 0c00c47d */ jal rmonPrintf /* cc8c: afaa0018 */ sw $t2,0x18($sp) /* cc90: 8e6c0050 */ lw $t4,0x50($s3) /* cc94: 8e6d0054 */ lw $t5,0x54($s3) @@ -1047,7 +1047,7 @@ glabel crashGenerate /* ccb0: 3c047005 */ lui $a0,0x7005 /* ccb4: 24844114 */ addiu $a0,$a0,0x4114 /* ccb8: afaf001c */ sw $t7,0x1c($sp) -/* ccbc: 0c00c47d */ jal rmonPrint +/* ccbc: 0c00c47d */ jal rmonPrintf /* ccc0: afae0018 */ sw $t6,0x18($sp) /* ccc4: 8e780068 */ lw $t8,0x68($s3) /* ccc8: 8e79006c */ lw $t9,0x6c($s3) @@ -1060,7 +1060,7 @@ glabel crashGenerate /* cce4: 3c047005 */ lui $a0,0x7005 /* cce8: 2484413c */ addiu $a0,$a0,0x413c /* ccec: afa9001c */ sw $t1,0x1c($sp) -/* ccf0: 0c00c47d */ jal rmonPrint +/* ccf0: 0c00c47d */ jal rmonPrintf /* ccf4: afa80018 */ sw $t0,0x18($sp) /* ccf8: 8e6a0080 */ lw $t2,0x80($s3) /* ccfc: 8e6b0084 */ lw $t3,0x84($s3) @@ -1073,7 +1073,7 @@ glabel crashGenerate /* cd18: 3c047005 */ lui $a0,0x7005 /* cd1c: 24844164 */ addiu $a0,$a0,0x4164 /* cd20: afad001c */ sw $t5,0x1c($sp) -/* cd24: 0c00c47d */ jal rmonPrint +/* cd24: 0c00c47d */ jal rmonPrintf /* cd28: afac0018 */ sw $t4,0x18($sp) /* cd2c: 8e6e0098 */ lw $t6,0x98($s3) /* cd30: 8e6f009c */ lw $t7,0x9c($s3) @@ -1086,7 +1086,7 @@ glabel crashGenerate /* cd4c: 3c047005 */ lui $a0,0x7005 /* cd50: 2484418c */ addiu $a0,$a0,0x418c /* cd54: afb9001c */ sw $t9,0x1c($sp) -/* cd58: 0c00c47d */ jal rmonPrint +/* cd58: 0c00c47d */ jal rmonPrintf /* cd5c: afb80018 */ sw $t8,0x18($sp) /* cd60: 8e6800b0 */ lw $t0,0xb0($s3) /* cd64: 8e6900b4 */ lw $t1,0xb4($s3) @@ -1099,7 +1099,7 @@ glabel crashGenerate /* cd80: 3c047005 */ lui $a0,0x7005 /* cd84: 248441b4 */ addiu $a0,$a0,0x41b4 /* cd88: afab001c */ sw $t3,0x1c($sp) -/* cd8c: 0c00c47d */ jal rmonPrint +/* cd8c: 0c00c47d */ jal rmonPrintf /* cd90: afaa0018 */ sw $t2,0x18($sp) /* cd94: 8e6c00c8 */ lw $t4,0xc8($s3) /* cd98: 8e6d00cc */ lw $t5,0xcc($s3) @@ -1112,7 +1112,7 @@ glabel crashGenerate /* cdb4: 3c047005 */ lui $a0,0x7005 /* cdb8: 248441dc */ addiu $a0,$a0,0x41dc /* cdbc: afaf001c */ sw $t7,0x1c($sp) -/* cdc0: 0c00c47d */ jal rmonPrint +/* cdc0: 0c00c47d */ jal rmonPrintf /* cdc4: afae0018 */ sw $t6,0x18($sp) /* cdc8: 8e7800e0 */ lw $t8,0xe0($s3) /* cdcc: 8e7900e4 */ lw $t9,0xe4($s3) @@ -1121,7 +1121,7 @@ glabel crashGenerate /* cdd8: 8e6700dc */ lw $a3,0xdc($s3) /* cddc: 24844204 */ addiu $a0,$a0,0x4204 /* cde0: afb80010 */ sw $t8,0x10($sp) -/* cde4: 0c00c47d */ jal rmonPrint +/* cde4: 0c00c47d */ jal rmonPrintf /* cde8: afb90014 */ sw $t9,0x14($sp) /* cdec: 8fa800f8 */ lw $t0,0xf8($sp) /* cdf0: 8e69010c */ lw $t1,0x10c($s3) @@ -1134,7 +1134,7 @@ glabel crashGenerate /* ce0c: 24844220 */ addiu $a0,$a0,0x4220 /* ce10: afaa0014 */ sw $t2,0x14($sp) /* ce14: 8e6b00f8 */ lw $t3,0xf8($s3) -/* ce18: 0c00c47d */ jal rmonPrint +/* ce18: 0c00c47d */ jal rmonPrintf /* ce1c: afab0018 */ sw $t3,0x18($sp) /* ce20: 8e6500fc */ lw $a1,0xfc($s3) /* ce24: 3c047005 */ lui $a0,0x7005 @@ -1145,7 +1145,7 @@ glabel crashGenerate /* ce38: afac0010 */ sw $t4,0x10($sp) /* ce3c: 8cad000c */ lw $t5,0xc($a1) /* ce40: 00a01025 */ or $v0,$a1,$zero -/* ce44: 0c00c47d */ jal rmonPrint +/* ce44: 0c00c47d */ jal rmonPrintf /* ce48: afad0014 */ sw $t5,0x14($sp) /* ce4c: 3c057005 */ lui $a1,0x7005 /* ce50: 3c068006 */ lui $a2,0x8006 @@ -1154,7 +1154,7 @@ glabel crashGenerate /* ce5c: 0c00342d */ jal crashPrintDescription /* ce60: 8e640100 */ lw $a0,0x100($s3) /* ce64: 3c047005 */ lui $a0,0x7005 -/* ce68: 0c00c47d */ jal rmonPrint +/* ce68: 0c00c47d */ jal rmonPrintf /* ce6c: 24844284 */ addiu $a0,$a0,0x4284 /* ce70: 3c057005 */ lui $a1,0x7005 /* ce74: 3c068006 */ lui $a2,0x8006 @@ -1163,7 +1163,7 @@ glabel crashGenerate /* ce80: 0c00342d */ jal crashPrintDescription /* ce84: 8e64010c */ lw $a0,0x10c($s3) /* ce88: 3c047005 */ lui $a0,0x7005 -/* ce8c: 0c00c47d */ jal rmonPrint +/* ce8c: 0c00c47d */ jal rmonPrintf /* ce90: 24844290 */ addiu $a0,$a0,0x4290 /* ce94: 8e6400d4 */ lw $a0,0xd4($s3) /* ce98: 8fb800f8 */ lw $t8,0xf8($sp) @@ -1180,7 +1180,7 @@ glabel crashGenerate /* cec4: 8e7000fc */ lw $s0,0xfc($s3) /* cec8: 3c047005 */ lui $a0,0x7005 /* cecc: ae800000 */ sw $zero,0x0($s4) -/* ced0: 0c00c47d */ jal rmonPrint +/* ced0: 0c00c47d */ jal rmonPrintf /* ced4: 24844294 */ addiu $a0,$a0,0x4294 .NB0000ced8: /* ced8: 3c057000 */ lui $a1,0x7000 @@ -1192,7 +1192,7 @@ glabel crashGenerate /* cef0: 3c047005 */ lui $a0,0x7005 /* cef4: 00408825 */ or $s1,$v0,$zero /* cef8: 2484429c */ addiu $a0,$a0,0x429c -/* cefc: 0c00c47d */ jal rmonPrint +/* cefc: 0c00c47d */ jal rmonPrintf /* cf00: 02002825 */ or $a1,$s0,$zero /* cf04: 8e890000 */ lw $t1,0x0($s4) /* cf08: 8fa800fc */ lw $t0,0xfc($sp) @@ -1205,7 +1205,7 @@ glabel crashGenerate /* cf24: 258d0001 */ addiu $t5,$t4,0x1 /* cf28: 16410003 */ bne $s2,$at,.NB0000cf38 /* cf2c: ae8d0000 */ sw $t5,0x0($s4) -/* cf30: 0c00c47d */ jal rmonPrint +/* cf30: 0c00c47d */ jal rmonPrintf /* cf34: 248442a4 */ addiu $a0,$a0,0x42a4 .NB0000cf38: /* cf38: 16200002 */ bnez $s1,.NB0000cf44 @@ -1299,10 +1299,10 @@ glabel crashGenerate /* d074: 24040044 */ addiu $a0,$zero,0x44 .NB0000d078: /* d078: 3c047005 */ lui $a0,0x7005 -/* d07c: 0c00c47d */ jal rmonPrint +/* d07c: 0c00c47d */ jal rmonPrintf /* d080: 248442b0 */ addiu $a0,$a0,0x42b0 /* d084: 3c047005 */ lui $a0,0x7005 -/* d088: 0c00c47d */ jal rmonPrint +/* d088: 0c00c47d */ jal rmonPrintf /* d08c: 248442b4 */ addiu $a0,$a0,0x42b4 /* d090: 8fbf003c */ lw $ra,0x3c($sp) /* d094: 8fb00028 */ lw $s0,0x28($sp) @@ -1321,23 +1321,23 @@ void crashPrintDescription(u32 mask, char *label, struct crashdescription *descr bool first = true; s32 i; - rmonPrint("%s <", label); + rmonPrintf("%s <", label); while (description->mask != 0) { if ((description->mask & mask) == description->value) { if (first) { first = false; } else { - rmonPrint(","); + rmonPrintf(","); } - rmonPrint("%s", description->text); + rmonPrintf("%s", description->text); } description++; } - rmonPrint(">"); + rmonPrintf(">"); } void crashPutChar(s32 x, s32 y, char c) diff --git a/src/lib/fault.c b/src/lib/fault.c index 67e32ca4c..4b4cee647 100644 --- a/src/lib/fault.c +++ b/src/lib/fault.c @@ -13,5 +13,5 @@ void faultCreateThread(void) void faultAssert(char *message, char *file, s32 line) { - rmonPrint("ASSERTION : %s, %d: (\"%s\")\n", file, line, message); + rmonPrintf("ASSERTION : %s, %d: (\"%s\")\n", file, line, message); } diff --git a/src/lib/mp3.c b/src/lib/mp3.c index e09e0b48d..80eeed87b 100644 --- a/src/lib/mp3.c +++ b/src/lib/mp3.c @@ -34,7 +34,7 @@ void mp3Init(ALHeap *heap) bzero(&g_Mp3Vars, sizeof(struct mp3vars)); #if VERSION < VERSION_NTSC_1_0 - rmonPrint("MPEG : RWI -> Allocating %d bytes for ASISTREAM from audio heap\n", 0x8480); + rmonPrintf("MPEG : RWI -> Allocating %d bytes for ASISTREAM from audio heap\n", 0x8480); #endif var8009c3f4 = alHeapAlloc(heap, 0x8480, 1); diff --git a/src/lib/mtx.c b/src/lib/mtx.c index 44b10df1e..5e2bbaabf 100644 --- a/src/lib/mtx.c +++ b/src/lib/mtx.c @@ -7,14 +7,6 @@ #include "data.h" #include "types.h" -#if VERSION < VERSION_NTSC_1_0 -const char var70055980nb[] = "("; -const char var70055984nb[] = "%s%s %9f"; -const char var70055990nb[] = ""; -const char var70055994nb[] = ""; -const char var70055998nb[] = " )\n"; -#endif - void mtx00016110(f32 mtx1[3][3], f32 mtx2[3][3]) { f32 mtx3[3][3]; @@ -830,66 +822,21 @@ void mtx4Align(f32 mtx[4][4], f32 angle, f32 x, f32 y, f32 z) } #if VERSION < VERSION_NTSC_1_0 -GLOBAL_ASM( -glabel mtx4Print -/* 18000: 27bdffb8 */ addiu $sp,$sp,-72 -/* 18004: afbe0040 */ sw $s8,0x40($sp) -/* 18008: afb40030 */ sw $s4,0x30($sp) -/* 1800c: afb3002c */ sw $s3,0x2c($sp) -/* 18010: afb20028 */ sw $s2,0x28($sp) -/* 18014: afb7003c */ sw $s7,0x3c($sp) -/* 18018: afb60038 */ sw $s6,0x38($sp) -/* 1801c: afb50034 */ sw $s5,0x34($sp) -/* 18020: 3c127005 */ lui $s2,0x7005 -/* 18024: 3c137005 */ lui $s3,0x7005 -/* 18028: 3c147005 */ lui $s4,0x7005 -/* 1802c: 3c1e7005 */ lui $s8,0x7005 -/* 18030: afbf0044 */ sw $ra,0x44($sp) -/* 18034: afb10024 */ sw $s1,0x24($sp) -/* 18038: afb00020 */ sw $s0,0x20($sp) -/* 1803c: 27de5980 */ addiu $s8,$s8,0x5980 -/* 18040: 26945994 */ addiu $s4,$s4,0x5994 -/* 18044: 26735990 */ addiu $s3,$s3,0x5990 -/* 18048: 26525984 */ addiu $s2,$s2,0x5984 -/* 1804c: 24150010 */ addiu $s5,$zero,0x10 -/* 18050: 0000b025 */ or $s6,$zero,$zero -/* 18054: 0080b825 */ or $s7,$a0,$zero -.NB00018058: -/* 18058: 0c00c47d */ jal rmonPrint -/* 1805c: 03c02025 */ or $a0,$s8,$zero -/* 18060: 00008025 */ or $s0,$zero,$zero -/* 18064: 02e08825 */ or $s1,$s7,$zero -.NB00018068: -/* 18068: c6240000 */ lwc1 $f4,0x0($s1) -/* 1806c: 02402025 */ or $a0,$s2,$zero -/* 18070: 02602825 */ or $a1,$s3,$zero -/* 18074: 460021a1 */ cvt.d.s $f6,$f4 -/* 18078: 02803025 */ or $a2,$s4,$zero -/* 1807c: 0c00c47d */ jal rmonPrint -/* 18080: f7a60010 */ sdc1 $f6,0x10($sp) -/* 18084: 26100004 */ addiu $s0,$s0,0x4 -/* 18088: 1615fff7 */ bne $s0,$s5,.NB00018068 -/* 1808c: 26310004 */ addiu $s1,$s1,0x4 -/* 18090: 3c047005 */ lui $a0,0x7005 -/* 18094: 0c00c47d */ jal rmonPrint -/* 18098: 24845998 */ addiu $a0,$a0,0x5998 -/* 1809c: 26d60001 */ addiu $s6,$s6,0x1 -/* 180a0: 24010004 */ addiu $at,$zero,0x4 -/* 180a4: 16c1ffec */ bne $s6,$at,.NB00018058 -/* 180a8: 26f70010 */ addiu $s7,$s7,0x10 -/* 180ac: 8fbf0044 */ lw $ra,0x44($sp) -/* 180b0: 8fb00020 */ lw $s0,0x20($sp) -/* 180b4: 8fb10024 */ lw $s1,0x24($sp) -/* 180b8: 8fb20028 */ lw $s2,0x28($sp) -/* 180bc: 8fb3002c */ lw $s3,0x2c($sp) -/* 180c0: 8fb40030 */ lw $s4,0x30($sp) -/* 180c4: 8fb50034 */ lw $s5,0x34($sp) -/* 180c8: 8fb60038 */ lw $s6,0x38($sp) -/* 180cc: 8fb7003c */ lw $s7,0x3c($sp) -/* 180d0: 8fbe0040 */ lw $s8,0x40($sp) -/* 180d4: 03e00008 */ jr $ra -/* 180d8: 27bd0048 */ addiu $sp,$sp,0x48 -); +void mtx4Print(f32 mtx[4][4]) +{ + s32 i; + s32 j; + + for (i = 0; i < 4; i++) { + rmonPrintf("("); + + for (j = 0; j < 4; j++) { + rmonPrintf("%s%s %9f", "", "", mtx[i][j]); + } + + rmonPrintf(" )\n"); + } +} #endif void mtx4LoadRotationFrom(f32 src[4][4], f32 dst[4][4]) diff --git a/src/lib/rmon.c b/src/lib/rmon.c index 9082023ae..0d149bd24 100644 --- a/src/lib/rmon.c +++ b/src/lib/rmon.c @@ -64,7 +64,7 @@ char *rmonProut(char *dst, const char *src, size_t count) return (char *) 1; } -void rmonPrint(const char *format, ...) +void rmonPrintf(const char *format, ...) { va_list ap; va_start(ap, format); diff --git a/src/lib/rzip.s b/src/lib/rzip.s index 6c34027ac..6d9c78f63 100644 --- a/src/lib/rzip.s +++ b/src/lib/rzip.s @@ -278,7 +278,7 @@ glabel rzipInflate sw $sp, 0x74($sp) sw $s8, 0x78($sp) addiu $sp, $sp, -0x18 - jal rmonPrint + jal rmonPrintf addiu $a0, $a0, %lo(errstr_unrecognised) addiu $sp, $sp, 0x18 lw $ra, 0x0($sp) @@ -351,7 +351,7 @@ glabel rzipInflate sw $sp, 0x74($sp) sw $s8, 0x78($sp) addiu $sp, $sp, -0x18 - jal rmonPrint + jal rmonPrintf addiu $a0, $a0, %lo(errstr_unrecognised) addiu $sp, $sp, 0x18 lw $ra, 0x0($sp) @@ -465,7 +465,7 @@ glabel rzipInflate sw $v0, 0x4($sp) lui $a0, %hi(errstr_inflatefailed) addiu $a0, $a0, %lo(errstr_inflatefailed) - jal rmonPrint + jal rmonPrintf lw $a1, 0x4($sp) addiu $sp, $sp, 0x18 lw $ra, 0x0($sp) @@ -897,7 +897,7 @@ glabel rzipInflateDynamic sw $sp, 0x74($sp) sw $s8, 0x78($sp) addiu $sp, $sp, -24 - jal rmonPrint + jal rmonPrintf addiu $a0, $a0, %lo(errstr_badlen) addiu $sp, $sp, 0x18 lw $ra, 0x0($sp) @@ -1401,7 +1401,7 @@ glabel rzipBuildHufts sw $s3, 0x4($sp) lui $a0, %hi(errstr_huftsoverflow) addiu $a0, $a0, %lo(errstr_huftsoverflow) - jal rmonPrint + jal rmonPrintf lw $a1, 0x4($sp) addiu $sp, $sp, 0x18 lw $ra, 0x0($sp) diff --git a/src/lib/ultra/io/pfsinitpak.c b/src/lib/ultra/io/pfsinitpak.c index 51224086b..db2c89bce 100644 --- a/src/lib/ultra/io/pfsinitpak.c +++ b/src/lib/ultra/io/pfsinitpak.c @@ -93,7 +93,7 @@ s32 osPfsInitPak(OSMesgQueue *queue, OSPfs *pfs, s32 channel) return ret; } - rmonPrint("pfsinitpak.c -> ret = %d\n", ret); + rmonPrintf("pfsinitpak.c -> ret = %d\n", ret); ret = osPfsChecker(pfs); pfs->status |= PFS_INITIALIZED; #endif