some crash_screen matching

This commit is contained in:
farisawan-2000 2021-01-03 12:34:06 -05:00
parent 5730e4ca7d
commit faab866c8b
13 changed files with 99 additions and 324 deletions

View File

@ -174,6 +174,9 @@ softclean:
rm -rf build/us/src/
rm -rf build/us/asm/
# $(BUILD_DIR)/src/ovl0/ovl0_8.o: OPT_FLAGS += -framepointer
$(BUILD_DIR):
mkdir $(BUILD_DIR) $(addprefix $(BUILD_DIR)/,$(SRC_DIRS) $(ASM_DIRS))

View File

@ -63,7 +63,7 @@ glabel fatal_printf
/* 023D8C 8002318C 0C008A91 */ jal func_80022A44
/* 023D90 80023190 24050019 */ li $a1, 25
/* 023D94 80023194 8FA40028 */ lw $a0, 0x28($sp)
/* 023D98 80023198 0C008A96 */ jal func_80022A58
/* 023D98 80023198 0C008A96 */ jal crash_screen_vprint
/* 023D9C 8002319C 02202825 */ move $a1, $s1
/* 023DA0 800231A0 00002025 */ move $a0, $zero
/* 023DA4 800231A4 0C008892 */ jal func_80022248

View File

@ -1,54 +0,0 @@
glabel crash_screen_print
/* 022BA4 80021FA4 27BDFEC0 */ addiu $sp, $sp, -0x140
/* 022BA8 80021FA8 AFB2001C */ sw $s2, 0x1c($sp)
/* 022BAC 80021FAC AFA7014C */ sw $a3, 0x14c($sp)
/* 022BB0 80021FB0 00809025 */ move $s2, $a0
/* 022BB4 80021FB4 AFB50028 */ sw $s5, 0x28($sp)
/* 022BB8 80021FB8 AFB30020 */ sw $s3, 0x20($sp)
/* 022BBC 80021FBC 03A03825 */ move $a3, $sp
/* 022BC0 80021FC0 27B30034 */ addiu $s3, $sp, 0x34
/* 022BC4 80021FC4 00A0A825 */ move $s5, $a1
/* 022BC8 80021FC8 AFBF002C */ sw $ra, 0x2c($sp)
/* 022BCC 80021FCC 24E7014F */ addiu $a3, $a3, 0x14f
/* 022BD0 80021FD0 3C048002 */ lui $a0, %hi(D_80021F80) # $a0, 0x8002
/* 022BD4 80021FD4 2401FFFC */ li $at, -4
/* 022BD8 80021FD8 AFB40024 */ sw $s4, 0x24($sp)
/* 022BDC 80021FDC AFB10018 */ sw $s1, 0x18($sp)
/* 022BE0 80021FE0 AFB00014 */ sw $s0, 0x14($sp)
/* 022BE4 80021FE4 AFA60148 */ sw $a2, 0x148($sp)
/* 022BE8 80021FE8 00E13824 */ and $a3, $a3, $at
/* 022BEC 80021FEC 24841F80 */ addiu $a0, %lo(D_80021F80) # addiu $a0, $a0, 0x1f80
/* 022BF0 80021FF0 0C00CC9C */ jal _Printf
/* 022BF4 80021FF4 02602825 */ move $a1, $s3
/* 022BF8 80021FF8 18400013 */ blez $v0, .L80022048_ovl0
/* 022BFC 80021FFC 00408025 */ move $s0, $v0
/* 022C00 80022000 18400011 */ blez $v0, .L80022048_ovl0
/* 022C04 80022004 02608825 */ move $s1, $s3
/* 022C08 80022008 3C138004 */ lui $s3, %hi(crashScreenGlyphTable) # $s3, 0x8004
/* 022C0C 8002200C 2673F68C */ addiu $s3, %lo(crashScreenGlyphTable) # addiu $s3, $s3, -0x974
/* 022C10 80022010 241400FF */ li $s4, 255
.L80022014_ovl0:
/* 022C14 80022014 922E0000 */ lbu $t6, ($s1)
/* 022C18 80022018 02402025 */ move $a0, $s2
/* 022C1C 8002201C 31CF007F */ andi $t7, $t6, 0x7f
/* 022C20 80022020 026FC021 */ addu $t8, $s3, $t7
/* 022C24 80022024 93060000 */ lbu $a2, ($t8)
/* 022C28 80022028 50D40004 */ beql $a2, $s4, .L8002203C_ovl0
/* 022C2C 8002202C 2610FFFF */ addiu $s0, $s0, -1
/* 022C30 80022030 0C008780 */ jal crash_screen_draw_glyph
/* 022C34 80022034 02A02825 */ move $a1, $s5
/* 022C38 80022038 2610FFFF */ addiu $s0, $s0, -1
.L8002203C_ovl0:
/* 022C3C 8002203C 26310001 */ addiu $s1, $s1, 1
/* 022C40 80022040 1600FFF4 */ bnez $s0, .L80022014_ovl0
/* 022C44 80022044 26520006 */ addiu $s2, $s2, 6
.L80022048_ovl0:
/* 022C48 80022048 8FBF002C */ lw $ra, 0x2c($sp)
/* 022C4C 8002204C 8FB00014 */ lw $s0, 0x14($sp)
/* 022C50 80022050 8FB10018 */ lw $s1, 0x18($sp)
/* 022C54 80022054 8FB2001C */ lw $s2, 0x1c($sp)
/* 022C58 80022058 8FB30020 */ lw $s3, 0x20($sp)
/* 022C5C 8002205C 8FB40024 */ lw $s4, 0x24($sp)
/* 022C60 80022060 8FB50028 */ lw $s5, 0x28($sp)
/* 022C64 80022064 03E00008 */ jr $ra
/* 022C68 80022068 27BD0140 */ addiu $sp, $sp, 0x140

View File

@ -1,35 +0,0 @@
glabel func_80022248
/* 022E48 80022248 27BDFFD8 */ addiu $sp, $sp, -0x28
/* 022E4C 8002224C AFB20020 */ sw $s2, 0x20($sp)
/* 022E50 80022250 AFB1001C */ sw $s1, 0x1c($sp)
/* 022E54 80022254 AFB00018 */ sw $s0, 0x18($sp)
/* 022E58 80022258 3C128005 */ lui $s2, %hi(D_80048F20) # $s2, 0x8005
/* 022E5C 8002225C 00A08025 */ move $s0, $a1
/* 022E60 80022260 00808825 */ move $s1, $a0
/* 022E64 80022264 AFBF0024 */ sw $ra, 0x24($sp)
/* 022E68 80022268 26528F20 */ addiu $s2, %lo(D_80048F20) # addiu $s2, $s2, -0x70e0
.L8002226C_ovl0:
/* 022E6C 8002226C 0C00881B */ jal crash_screen_sleep
/* 022E70 80022270 24040010 */ li $a0, 16
/* 022E74 80022274 0C001193 */ jal func_8000464C
/* 022E78 80022278 00000000 */ nop
/* 022E7C 8002227C 52000008 */ beql $s0, $zero, .L800222A0_ovl0
/* 022E80 80022280 964E0000 */ lhu $t6, ($s2)
/* 022E84 80022284 0C00E46C */ jal osViGetCurrentFramebuffer
/* 022E88 80022288 00000000 */ nop
/* 022E8C 8002228C 50500004 */ beql $v0, $s0, .L800222A0_ovl0
/* 022E90 80022290 964E0000 */ lhu $t6, ($s2)
/* 022E94 80022294 10000005 */ b .L800222AC_ovl0
/* 022E98 80022298 24020001 */ li $v0, 1
/* 022E9C 8002229C 964E0000 */ lhu $t6, ($s2)
.L800222A0_ovl0:
/* 022EA0 800222A0 162EFFF2 */ bne $s1, $t6, .L8002226C_ovl0
/* 022EA4 800222A4 00000000 */ nop
/* 022EA8 800222A8 00001025 */ move $v0, $zero
.L800222AC_ovl0:
/* 022EAC 800222AC 8FBF0024 */ lw $ra, 0x24($sp)
/* 022EB0 800222B0 8FB00018 */ lw $s0, 0x18($sp)
/* 022EB4 800222B4 8FB1001C */ lw $s1, 0x1c($sp)
/* 022EB8 800222B8 8FB20020 */ lw $s2, 0x20($sp)
/* 022EBC 800222BC 03E00008 */ jr $ra
/* 022EC0 800222C0 27BD0028 */ addiu $sp, $sp, 0x28

View File

@ -1,83 +0,0 @@
glabel func_80022A58
/* 023658 80022A58 27BDFEB0 */ addiu $sp, $sp, -0x150
/* 02365C 80022A5C AFB00018 */ sw $s0, 0x18($sp)
/* 023660 80022A60 00803025 */ move $a2, $a0
/* 023664 80022A64 27B00048 */ addiu $s0, $sp, 0x48
/* 023668 80022A68 AFBF003C */ sw $ra, 0x3c($sp)
/* 02366C 80022A6C 00A03825 */ move $a3, $a1
/* 023670 80022A70 3C048002 */ lui $a0, %hi(D_80021F80) # $a0, 0x8002
/* 023674 80022A74 AFBE0038 */ sw $fp, 0x38($sp)
/* 023678 80022A78 AFB70034 */ sw $s7, 0x34($sp)
/* 02367C 80022A7C AFB60030 */ sw $s6, 0x30($sp)
/* 023680 80022A80 AFB5002C */ sw $s5, 0x2c($sp)
/* 023684 80022A84 AFB40028 */ sw $s4, 0x28($sp)
/* 023688 80022A88 AFB30024 */ sw $s3, 0x24($sp)
/* 02368C 80022A8C AFB20020 */ sw $s2, 0x20($sp)
/* 023690 80022A90 AFB1001C */ sw $s1, 0x1c($sp)
/* 023694 80022A94 24841F80 */ addiu $a0, %lo(D_80021F80) # addiu $a0, $a0, 0x1f80
/* 023698 80022A98 0C00CC9C */ jal _Printf
/* 02369C 80022A9C 02002825 */ move $a1, $s0
/* 0236A0 80022AA0 1840002B */ blez $v0, .L80022B50_ovl0
/* 0236A4 80022AA4 00409825 */ move $s3, $v0
/* 0236A8 80022AA8 18400029 */ blez $v0, .L80022B50_ovl0
/* 0236AC 80022AAC 0200A025 */ move $s4, $s0
/* 0236B0 80022AB0 3C168004 */ lui $s6, %hi(crashScreenGlyphTable) # $s6, 0x8004
/* 0236B4 80022AB4 3C128004 */ lui $s2, %hi(D_8003F86C) # $s2, 0x8004
/* 0236B8 80022AB8 3C118004 */ lui $s1, %hi(D_8003F870) # $s1, 0x8004
/* 0236BC 80022ABC 2631F870 */ addiu $s1, %lo(D_8003F870) # addiu $s1, $s1, -0x790
/* 0236C0 80022AC0 2652F86C */ addiu $s2, %lo(D_8003F86C) # addiu $s2, $s2, -0x794
/* 0236C4 80022AC4 26D6F68C */ addiu $s6, %lo(crashScreenGlyphTable) # addiu $s6, $s6, -0x974
/* 0236C8 80022AC8 241E00FF */ li $fp, 255
/* 0236CC 80022ACC 2417000A */ li $s7, 10
/* 0236D0 80022AD0 2415001E */ li $s5, 30
.L80022AD4_ovl0:
/* 0236D4 80022AD4 92820000 */ lbu $v0, ($s4)
/* 0236D8 80022AD8 304E007F */ andi $t6, $v0, 0x7f
/* 0236DC 80022ADC 02CE7821 */ addu $t7, $s6, $t6
/* 0236E0 80022AE0 16E20006 */ bne $s7, $v0, .L80022AFC_ovl0
/* 0236E4 80022AE4 91E60000 */ lbu $a2, ($t7)
/* 0236E8 80022AE8 8E380000 */ lw $t8, ($s1)
/* 0236EC 80022AEC AE550000 */ sw $s5, ($s2)
/* 0236F0 80022AF0 2719000A */ addiu $t9, $t8, 0xa
/* 0236F4 80022AF4 10000013 */ b .L80022B44_ovl0
/* 0236F8 80022AF8 AE390000 */ sw $t9, ($s1)
.L80022AFC_ovl0:
/* 0236FC 80022AFC 10DE0005 */ beq $a2, $fp, .L80022B14_ovl0
/* 023700 80022B00 8E500000 */ lw $s0, ($s2)
/* 023704 80022B04 02002025 */ move $a0, $s0
/* 023708 80022B08 0C008780 */ jal crash_screen_draw_glyph
/* 02370C 80022B0C 8E250000 */ lw $a1, ($s1)
/* 023710 80022B10 8E500000 */ lw $s0, ($s2)
.L80022B14_ovl0:
/* 023714 80022B14 26080006 */ addiu $t0, $s0, 6
/* 023718 80022B18 AE480000 */ sw $t0, ($s2)
/* 02371C 80022B1C 3C0A8005 */ lui $t2, %hi(gCurrScreenWidth) # $t2, 0x8005
/* 023720 80022B20 8D4AA508 */ lw $t2, %lo(gCurrScreenWidth)($t2)
/* 023724 80022B24 254BFFE2 */ addiu $t3, $t2, -0x1e
/* 023728 80022B28 0168082A */ slt $at, $t3, $t0
/* 02372C 80022B2C 50200006 */ beql $at, $zero, .L80022B48_ovl0
/* 023730 80022B30 2673FFFF */ addiu $s3, $s3, -1
/* 023734 80022B34 8E2C0000 */ lw $t4, ($s1)
/* 023738 80022B38 AE550000 */ sw $s5, ($s2)
/* 02373C 80022B3C 258D000A */ addiu $t5, $t4, 0xa
/* 023740 80022B40 AE2D0000 */ sw $t5, ($s1)
.L80022B44_ovl0:
/* 023744 80022B44 2673FFFF */ addiu $s3, $s3, -1
.L80022B48_ovl0:
/* 023748 80022B48 1660FFE2 */ bnez $s3, .L80022AD4_ovl0
/* 02374C 80022B4C 26940001 */ addiu $s4, $s4, 1
.L80022B50_ovl0:
/* 023750 80022B50 0C00E328 */ jal osWritebackDCacheAll
/* 023754 80022B54 00000000 */ nop
/* 023758 80022B58 8FBF003C */ lw $ra, 0x3c($sp)
/* 02375C 80022B5C 8FB00018 */ lw $s0, 0x18($sp)
/* 023760 80022B60 8FB1001C */ lw $s1, 0x1c($sp)
/* 023764 80022B64 8FB20020 */ lw $s2, 0x20($sp)
/* 023768 80022B68 8FB30024 */ lw $s3, 0x24($sp)
/* 02376C 80022B6C 8FB40028 */ lw $s4, 0x28($sp)
/* 023770 80022B70 8FB5002C */ lw $s5, 0x2c($sp)
/* 023774 80022B74 8FB60030 */ lw $s6, 0x30($sp)
/* 023778 80022B78 8FB70034 */ lw $s7, 0x34($sp)
/* 02377C 80022B7C 8FBE0038 */ lw $fp, 0x38($sp)
/* 023780 80022B80 03E00008 */ jr $ra
/* 023784 80022B84 27BD0150 */ addiu $sp, $sp, 0x150

View File

@ -1,16 +0,0 @@
glabel func_80022B88
/* 023788 80022B88 27BDFFE0 */ addiu $sp, $sp, -0x20
/* 02378C 80022B8C AFA50024 */ sw $a1, 0x24($sp)
/* 023790 80022B90 03A02825 */ move $a1, $sp
/* 023794 80022B94 AFBF0014 */ sw $ra, 0x14($sp)
/* 023798 80022B98 24A50027 */ addiu $a1, $a1, 0x27
/* 02379C 80022B9C 2401FFFC */ li $at, -4
/* 0237A0 80022BA0 AFA40020 */ sw $a0, 0x20($sp)
/* 0237A4 80022BA4 AFA60028 */ sw $a2, 0x28($sp)
/* 0237A8 80022BA8 AFA7002C */ sw $a3, 0x2c($sp)
/* 0237AC 80022BAC 0C008A96 */ jal func_80022A58
/* 0237B0 80022BB0 00A12824 */ and $a1, $a1, $at
/* 0237B4 80022BB4 8FBF0014 */ lw $ra, 0x14($sp)
/* 0237B8 80022BB8 27BD0020 */ addiu $sp, $sp, 0x20
/* 0237BC 80022BBC 03E00008 */ jr $ra
/* 0237C0 80022BC0 00000000 */ nop

View File

@ -1,7 +1,7 @@
#ifndef STDARG_H
#define STDARG_H
// When not building with IDO, use the builtin vaarg macros for portability.
/* When not building with IDO, use the builtin vaarg macros for portability. */
#ifndef __sgi
#define va_list __builtin_va_list
#define va_start __builtin_va_start

View File

@ -2,6 +2,8 @@
#include <macros.h>
#include "ovl0_8.h"
#define ALIGN8(val) (((u32)(val) + 3) & ~0x3)
u32 D_8003F3C0 = 0x00000000;
u32 D_8003F3C4 = 0x00000000;
u32 D_8003F3C8 = 0x00000003;
@ -90,7 +92,7 @@ const char *D_8003F854[] = {
D_80040EF4, D_80040F00,
};
u32 D_8003F86C = 0x0000001E;
s32 D_8003F86C = 0x0000001E;
u32 D_8003F870 = 0x00000019;
#ifdef MIPS_TO_C
@ -378,7 +380,7 @@ GLOBAL_ASM("asm/non_matchings/ovl0/ovl0_8/func_80021D34.s")
extern u16 *osViGetCurrentFramebuffer(void);
extern u32 gCurrScreenWidth;
extern s32 gCurrScreenWidth;
#ifdef MIPS_TO_C
void crash_screen_draw_glyph(s32 x, s32 y, s32 glyph) {
const u32 *data;
@ -486,18 +488,18 @@ char *write_to_buf(char *buffer, const char *data, size_t size) {
}
#include "libc/stdarg.h"
// something's screwy with this func
#ifdef MIPS_TO_C
void crash_screen_print(s32 x, s32 y, const char *fmt, ...) {
char *ptr;
u8 *ptr;
u32 glyph;
s32 size;
char buf[0x100];
u8 buf[0x100];
va_list args;
va_start(args, fmt);
size = _Printf(write_to_buf, buf, fmt, args);
size = _Printf(write_to_buf, buf, fmt, (va_list)ALIGN8(args));
if (size > 0) {
ptr = buf;
@ -519,10 +521,6 @@ void crash_screen_print(s32 x, s32 y, const char *fmt, ...) {
va_end(args);
}
#else
GLOBAL_ASM("asm/non_matchings/ovl0/ovl0_8/func_80021FA4.s")
#endif
void crash_screen_sleep(s32 ms) {
u64 cycles = ms * 1000LL * 3000LL / 64ULL;
@ -563,20 +561,19 @@ void crash_screen_print_fpcsr(u32 fpcsr) {
}
extern u16 D_80048F20;
#ifdef MIPS_TO_C
u8 func_80022248(s32 arg0, s32 arg1) {
while (arg0 != D_80048F20) {
u8 func_80022248(u32 arg0, s32 arg1) {
do {
crash_screen_sleep(0x10);
func_8000464C();
if (arg1 != 0 && osViGetCurrentFramebuffer() != arg1) {
if (arg1 != 0 && (u32)osViGetCurrentFramebuffer() != arg1) {
return 1;
}
}
while (arg0 != D_80048F20);
return 0;
}
#else
GLOBAL_ASM("asm/non_matchings/ovl0/ovl0_8/func_80022248.s")
#endif
#ifdef MIPS_TO_C
// generated by mips_to_c commit e0e006e8858ba357d1dcb4dc64f038b7df278aa6
@ -747,63 +744,43 @@ GLOBAL_ASM("asm/non_matchings/ovl0/ovl0_8/func_80022A44.s")
#endif
// another crash_screen_print type func?
#ifdef MIPS_TO_C
// generated by mips_to_c commit e0e006e8858ba357d1dcb4dc64f038b7df278aa6
void func_80022A58(s32 arg0, ? arg1) {
? sp48;
s32 temp_s3;
s32 temp_t0;
s32 temp_v0;
u8 temp_a2;
u8 temp_v0_2;
? *phi_s4;
s32 phi_s3;
void crash_screen_vprint(const char *fmt, va_list args) {
u32 glyph;
s32 size;
u8 buf[256];
u8 *ptr;
temp_v0 = _Printf(&D_80021F80, &sp48, arg0, arg1);
if (temp_v0 > 0) {
if (temp_v0 > 0) {
phi_s4 = &sp48;
phi_s3 = temp_v0;
loop_3:
temp_v0_2 = *phi_s4;
temp_a2 = *(&crashScreenGlyphTable + (temp_v0_2 & 0x7F));
if (0xA == temp_v0_2) {
size = _Printf(write_to_buf, buf, fmt, args);
if (size > 0) {
ptr = buf;
while (size > 0) {
glyph = crashScreenGlyphTable[*ptr & 0x7F];
if (*ptr == '\n') {
D_8003F86C = 0x1E;
D_8003F870 = D_8003F870 + 0xA;
D_8003F870 += 0xA;
} else {
if (temp_a2 != 0xFF) {
crash_screen_draw_glyph(D_8003F86C, D_8003F870, temp_a2);
if (glyph != 0xFF) {
crash_screen_draw_glyph(D_8003F86C, D_8003F870, glyph);
}
temp_t0 = D_8003F86C + 6;
D_8003F86C = temp_t0;
if ((gCurrScreenWidth - 0x1E) < temp_t0) {
if ((gCurrScreenWidth - 0x1E) < (D_8003F86C += 6)) {
D_8003F86C = 0x1E;
D_8003F870 = D_8003F870 + 0xA;
D_8003F870 += 0xA;
}
}
temp_s3 = phi_s3 - 1;
phi_s4 = phi_s4 + 1;
phi_s3 = temp_s3;
if (temp_s3 != 0) {
goto loop_3;
}
ptr++;
size--;
}
}
osWritebackDCacheAll();
}
#else
GLOBAL_ASM("asm/non_matchings/ovl0/ovl0_8/func_80022A58.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c
void func_80022B88(const char *fmt, ...) {
func_80022A58((s32) (sp + 0x27) & -4);
va_list args;
va_start(args, fmt);
crash_screen_vprint(fmt, (va_list)ALIGN8(args));
}
#else
GLOBAL_ASM("asm/non_matchings/ovl0/ovl0_8/func_80022B88.s")
#endif
extern OSThread *(*D_80096EF8)(void);
@ -973,7 +950,7 @@ loop_1:
temp_s0 = osViGetCurrentFramebuffer();
crash_screen_draw_rect(0x19, 0x14, 0x10E, 0x19);
func_80022A44(0x1E, 0x19);
func_80022A58(arg0, (sp + 0x2F) & -4);
crash_screen_vprint(arg0, (sp + 0x2F) & -4);
if (func_80022248(0, temp_s0) != 0) {
goto loop_1;
}

View File

@ -661,6 +661,7 @@ extern u32 D_800D6B94;
extern u32 D_800D6B90;
extern s32 D_800D6BA8;
extern u32 D_800D71E8;
void func_80154D60_ovl1(u32, u32);
#ifdef MIPS_TO_C
//generated by mips_to_c commit e0e006e8858ba357d1dcb4dc64f038b7df278aa6
@ -694,7 +695,7 @@ void func_800A377C(s32 arg0) {
load_overlay(1);
func_800A2C80_ovl1();
func_800A3058_ovl1();
while (1) {
while (TRUE) {
func_800A2C80_ovl1();
// temp_t7 = D_800BE4F0 - 1;
// if (temp_t7 >= 0x22) {
@ -818,9 +819,8 @@ void func_800A377C(s32 arg0) {
func_800A2D68_ovl1();
func_8015531C_ovl1();
if (D_800D6B78 == 0) {
temp_t3_2 = D_800D6B9C;
D_800BE530 = temp_t3_2;
D_800BE504 = temp_t3_2;
D_800BE504 = //D_800D6B9C;
D_800BE530 = D_800D6B9C;
D_800BE4F0 = 0xF;
} else {
D_800BE4F0 = 0xB;
@ -880,11 +880,9 @@ void func_800A377C(s32 arg0) {
func_800A3230_ovl1();
goto block_77;
case 3: // switch 2
temp_v0_2 = D_800D6B94;
temp_v1 = D_800D6B9C + 1;
if ((temp_v0_2 == temp_v1) && (D_800D6B90 == (D_800D6B98 + 1))) {
D_800D6B9C = temp_v1;
D_800D6B94 = temp_v0_2 + 1;
if ((D_800D6B94 == D_800D6B9C + 1) && (D_800D6B90 == (D_800D6B98 + 1))) {
D_800D6B9C++;
D_800D6B94++;
func_800B9C50_ovl1(D_800D6B88);
D_800D6B80 = 1;
}
@ -905,9 +903,8 @@ void func_800A377C(s32 arg0) {
switch (D_800BE500) {
default: // switch 3
case 0: // switch 3
temp_v0_3 = D_800D6B90;
if ((temp_v0_3 == (D_800D6B98 + 1)) && (temp_v0_3 < 7)) {
D_800D6B90 = temp_v0_3 + 1;
if ((D_800D6B90 == (D_800D6B98 + 1)) && (D_800D6B90 < 7)) {
D_800D6B90++;
D_800D6B94 = 1;
D_800D6B7C = 1;
func_800B9C50_ovl1(D_800D6B88);
@ -925,9 +922,8 @@ void func_800A377C(s32 arg0) {
if (func_800A6B64_ovl1() == 0) {
D_800BE4F0 = 0xB;
} else {
temp_v0_4 = D_800D6B90;
if ((temp_v0_4 == (D_800D6B98 + 1)) && (temp_v0_4 < 7)) {
D_800D6B90 = temp_v0_4 + 1;
if ((D_800D6B90 == (D_800D6B98 + 1)) && (D_800D6B90 < 7)) {
D_800D6B90++;
D_800D6B94 = 1;
func_800B9D60_ovl1(D_800D6B88, 5);
}
@ -954,8 +950,7 @@ void func_800A377C(s32 arg0) {
}
}
case 7: // switch 2
temp_v0_5 = D_800D6B90;
if ((temp_v0_5 == (D_800D6B98 + 1)) && (temp_v0_5 < 8)) {
if ((D_800D6B90 == (D_800D6B98 + 1)) && (D_800D6B90 < 8)) {
D_800D6B90 = 8;
D_800D6B94 = 1;
func_800B9D60_ovl1(D_800D6B88, 6);
@ -2153,42 +2148,28 @@ loop_1:
GLOBAL_ASM("asm/non_matchings/ovl1/ovl1_1/func_800A57C8.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit e0e006e8858ba357d1dcb4dc64f038b7df278aa6
Gfx *func_800A58E4(s32 arg0) {
Gfx *temp_a2;
Gfx *temp_a2_2;
Gfx *temp_a3;
Gfx *temp_t0;
Gfx *temp_t1;
Gfx *temp_t2;
Gfx *temp_v0;
Gfx *temp_v0_2;
temp_a2 = gDisplayListHeads[1];
temp_v0_2 = temp_a2 + 8;
temp_a2->words.w0 = 0xE7000000;
temp_a2->words.w1 = 0;
temp_v0_2->words.w1 = 0x504340;
temp_v0_2->words.w0 = 0xE200001C;
temp_t0 = temp_v0_2 + 8;
temp_t0->words.w0 = 0xFA000000;
temp_t0->words.w1 = (((D_800D6B28 << 0x18) | ((D_800D6B29 & 0xFF) << 0x10)) | ((D_800D6B2A & 0xFF) << 8)) | (D_800D6B2F & 0xFF);
temp_t1 = temp_t0 + 8;
temp_t1->words.w1 = 0xFFFDF6FB;
temp_t1->words.w0 = 0xFCFFFFFF;
temp_t2 = temp_t1 + 8;
temp_t2->words.w0 = (((D_800D6B3C & 0x3FF) << 0xE) | 0xF6000000) | ((D_800D6B40 & 0x3FF) * 4);
temp_a2_2 = temp_t2 + 8;
temp_t2->words.w1 = ((D_800D6B34 & 0x3FF) << 0xE) | ((D_800D6B38 & 0x3FF) * 4);
temp_a3 = temp_a2_2 + 8;
temp_a2_2->words.w1 = 0;
temp_a2_2->words.w0 = 0xE7000000;
temp_a3->words.w1 = 0x5049D8;
temp_a3->words.w0 = 0xE200001C;
temp_v0 = temp_a3 + 8;
gDisplayListHeads[1] = temp_v0;
return temp_v0;
extern u32 D_800D6B3C, D_800D6B40, D_800D6B34, D_800D6B38;
extern u8 D_800D6B28, D_800D6B29, D_800D6B2A, D_800D6B2B;
#include <PR/gbi.h>
extern Gfx *gDisplayListHeads[];
#ifdef MIPS_TO_C
void func_800A58E4(s32 arg0) {
gDPPipeSync(gDisplayListHeads[1]++);
gDPSetRenderMode(gDisplayListHeads[1]++, G_RM_CLD_SURF, G_RM_CLD_SURF2);
// gDPSetRenderMode(gDisplayListHeads[1]++, G_RM_NOOP, G_RM_NOOP2);
gDPSetPrimColor(gDisplayListHeads[1]++, 0, 0, D_800D6B28, D_800D6B29, D_800D6B2A, D_800D6B2B);
gDPSetCombineMode(gDisplayListHeads[1]++, G_CC_PRIMITIVE, G_CC_PRIMITIVE);
gDPFillRectangle(gDisplayListHeads[1]++, D_800D6B34, D_800D6B38, D_800D6B3C, D_800D6B40);
// temp_a2_2 = temp_t2 + 8;
// temp_t2->words.w0 = (((D_800D6B3C & 0x3FF) << 0xE) | 0xF6000000) | ((D_800D6B40 & 0x3FF) * 4);
// temp_t2->words.w1 = ((D_800D6B34 & 0x3FF) << 0xE) | ((D_800D6B38 & 0x3FF) * 4);
gDPPipeSync(gDisplayListHeads[1]++);
gDPSetRenderMode(gDisplayListHeads[1]++, G_RM_AA_ZB_XLU_SURF, G_RM_AA_ZB_XLU_SURF2);
}
#else
GLOBAL_ASM("asm/non_matchings/ovl1/ovl1_1/func_800A58E4.s")

View File

@ -303,7 +303,7 @@ GLOBAL_ASM("asm/non_matchings/ovl1/ovl1_9/func_800B8C08.s")
extern void calc_file_checksum(u32 fileNum);
extern u8 D_800D5150[]; // TODO: get correct type for this
// init_save_file_maybe
#ifdef MIPS_TO_C
#ifdef MIPS_TO_C
void init_save_file_maybe(u32 fileNum) {
s32 i;
s32 unused1;
@ -321,14 +321,14 @@ void init_save_file_maybe(u32 fileNum) {
gSaveBuffer1.files[fileNum].data16 = 0;
gSaveBuffer1.files[fileNum].data17 = 0;
gSaveBuffer1.files[fileNum].hundredYardHopRecord = 0x5DC; // 31 seconds
gSaveBuffer1.files[fileNum].bumperCropBumpRecord = 0xA;
gSaveBuffer1.files[fileNum].bumperCropBumpRecord = 10;
gSaveBuffer1.files[fileNum].checkerBoardChaseRecord = 0x960;
for (i = 0; i < 6; i++) {
gSaveBuffer1.files[fileNum].data38[i] = 0;
}
for (i = 0; i != 6; i++) {
for (i = 0; i < 6; i++) {
gSaveBuffer1.files[fileNum].shards[i] = 0;
}
@ -342,8 +342,8 @@ void init_save_file_maybe(u32 fileNum) {
verify_save(fileNum);
calc_file_checksum(fileNum);
func_80004D34_ovl1(D_800D5150[fileNum], &gSaveBuffer1.files[fileNum], 0x58);
func_80004D34_ovl1(D_800D5150[fileNum], &gSaveBuffer1.files[fileNum], 0x58);
func_80004D34(D_800D5150[fileNum], &gSaveBuffer1.files[fileNum], 0x58);
func_80004D34(D_800D5150[fileNum], &gSaveBuffer1.files[fileNum], 0x58);
gSaveBuffer2 = gSaveBuffer1;
}

25
test.c
View File

@ -1,11 +1,16 @@
#include "libc/stdarg.h"
840 | D_800BE510 = D_800BE53C;
| ^~~~~~~~~~
859 | temp_v0_2 = D_800D6B94;
| ^~~~~~~~~~
861 | if ((temp_v0_2 == temp_v1) && (D_800D6B90 == (D_800D6B98 + 1))) {
| ^~~~~~~~~~
912 | if (D_800D6BA8 == 0x64) {
| ^~~~~~~~~~
964 | func_80154D60_ovl1(D_800D71E8, 0x15);
| ^~~~~~~~~~
void crash_screen_vprint(va_list args) {
}
void func_80022B88(const char *fmt, ...) {
va_list args;
va_start(args, fmt);
crash_screen_vprint(args);
}
int main(void) {
func_80022B88("tr%d\n", 4);
}

View File

@ -357,7 +357,7 @@ asm/non_matchings/ovl0/ovl0_8/func_80022248.s
asm/non_matchings/ovl0/ovl0_8/func_800222C4.s
asm/non_matchings/ovl0/ovl0_8/func_80022A38.s
asm/non_matchings/ovl0/ovl0_8/func_80022A44.s
asm/non_matchings/ovl0/ovl0_8/func_80022A58.s
asm/non_matchings/ovl0/ovl0_8/crash_screen_vprint.s
asm/non_matchings/ovl0/ovl0_8/func_80022B88.s
asm/non_matchings/ovl0/ovl0_8/func_80022BC4.s
asm/non_matchings/ovl0/ovl0_8/func_80022D98.s

View File

@ -663,14 +663,13 @@ func_8000B688 = 0x8000B688;
D_80021764 = 0x80021764;
D_80021F80 = 0x80021F80;
crash_screen_draw_glyph = 0x80021E00;
crash_screen_print = 0x80021FA4;
crash_screen_sleep = 0x8002206C;
func_8000464C = 0x8000464C;
crash_screen_draw_rect = 0x80021D34;
func_80022248 = 0x80022248;
crash_screen_print_fpcsr = 0x800221BC;
crash_screen_print_float_reg = 0x80022134;
func_80022A58 = 0x80022A58;
crash_screen_vprint = 0x80022A58;
D_80096ED8 = 0x80096ED8;
get_crashed_thread = 0x800229CC;
func_800222C4 = 0x800222C4;
@ -937,7 +936,6 @@ func_800A194C_ovl1 = 0x800A194C;
func_800A1F30_ovl1 = 0x800A1F30;
func_800A2080_ovl1 = 0x800A2080;
func_8000BE90 = 0x8000BE90;
func_80022B88 = 0x80022B88;
func_800A28C0_ovl1 = 0x800A28C0;
set_hard_rng_seed = 0x80018A94;
func_80002B88_ovl1 = 0x80002B88;
@ -1261,7 +1259,6 @@ D_800D6C16 = 0x800D6C16;
D_800D6C17 = 0x800D6C17;
func_800B94FC_ovl1 = 0x800B94FC;
random_soft_s32_range = 0x80018A44;
init_save_file_maybe = 0x800B8C34;
func_800047F0_ovl1 = 0x800047F0;
func_800047B0_ovl1 = 0x800047B0;
func_800047D0_ovl1 = 0x800047D0;