diff --git a/asm/non_matchings/unknown_0B8920/func_800B8B8C.s b/asm/non_matchings/unknown_0B8920/func_800B8B8C.s deleted file mode 100644 index 592767bb..00000000 --- a/asm/non_matchings/unknown_0B8920/func_800B8B8C.s +++ /dev/null @@ -1,34 +0,0 @@ -glabel func_800B8B8C -/* 0B978C 800B8B8C 3C01800E */ lui $at, %hi(D_800E30DC) # $at, 0x800e -/* 0B9790 800B8B90 3C048013 */ lui $a0, %hi(D_8012A0D8) # $a0, 0x8013 -/* 0B9794 800B8B94 3C058013 */ lui $a1, %hi(D_8012A0DC) # $a1, 0x8013 -/* 0B9798 800B8B98 AC2030DC */ sw $zero, %lo(D_800E30DC)($at) -/* 0B979C 800B8B9C 24A5A0DC */ addiu $a1, %lo(D_8012A0DC) # addiu $a1, $a1, -0x5f24 -/* 0B97A0 800B8BA0 2484A0D8 */ addiu $a0, %lo(D_8012A0D8) # addiu $a0, $a0, -0x5f28 -/* 0B97A4 800B8BA4 8C8E0000 */ lw $t6, ($a0) -/* 0B97A8 800B8BA8 8CAF0000 */ lw $t7, ($a1) -/* 0B97AC 800B8BAC 3C06800E */ lui $a2, %hi(D_800E30D4) # $a2, 0x800e -/* 0B97B0 800B8BB0 01CF0019 */ multu $t6, $t7 -/* 0B97B4 800B8BB4 24C630D4 */ addiu $a2, %lo(D_800E30D4) # addiu $a2, $a2, 0x30d4 -/* 0B97B8 800B8BB8 00001025 */ move $v0, $zero -/* 0B97BC 800B8BBC 00001825 */ move $v1, $zero -/* 0B97C0 800B8BC0 0000C012 */ mflo $t8 -/* 0B97C4 800B8BC4 1B00000D */ blez $t8, .L800B8BFC -/* 0B97C8 800B8BC8 00000000 */ nop -.L800B8BCC: -/* 0B97CC 800B8BCC 8CD90000 */ lw $t9, ($a2) -/* 0B97D0 800B8BD0 24420001 */ addiu $v0, $v0, 1 -/* 0B97D4 800B8BD4 03234021 */ addu $t0, $t9, $v1 -/* 0B97D8 800B8BD8 AD000000 */ sw $zero, ($t0) -/* 0B97DC 800B8BDC 8CAA0000 */ lw $t2, ($a1) -/* 0B97E0 800B8BE0 8C890000 */ lw $t1, ($a0) -/* 0B97E4 800B8BE4 24630004 */ addiu $v1, $v1, 4 -/* 0B97E8 800B8BE8 012A0019 */ multu $t1, $t2 -/* 0B97EC 800B8BEC 00005812 */ mflo $t3 -/* 0B97F0 800B8BF0 004B082A */ slt $at, $v0, $t3 -/* 0B97F4 800B8BF4 1420FFF5 */ bnez $at, .L800B8BCC -/* 0B97F8 800B8BF8 00000000 */ nop -.L800B8BFC: -/* 0B97FC 800B8BFC 03E00008 */ jr $ra -/* 0B9800 800B8C00 00000000 */ nop - diff --git a/asm/non_matchings/unknown_0B8920/func_800BBDDC.s b/asm/non_matchings/unknown_0B8920/func_800BBDDC.s deleted file mode 100644 index 0f86e915..00000000 --- a/asm/non_matchings/unknown_0B8920/func_800BBDDC.s +++ /dev/null @@ -1,13 +0,0 @@ -glabel func_800BBDDC -/* 0BC9DC 800BBDDC 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 0BC9E0 800BBDE0 AFBF0014 */ sw $ra, 0x14($sp) -/* 0BC9E4 800BBDE4 0C02EF82 */ jal func_800BBE08 -/* 0BC9E8 800BBDE8 AFA40018 */ sw $a0, 0x18($sp) -/* 0BC9EC 800BBDEC 8FA40018 */ lw $a0, 0x18($sp) -/* 0BC9F0 800BBDF0 0C02EFDE */ jal func_800BBF78 -/* 0BC9F4 800BBDF4 00000000 */ nop -/* 0BC9F8 800BBDF8 8FBF0014 */ lw $ra, 0x14($sp) -/* 0BC9FC 800BBDFC 27BD0018 */ addiu $sp, $sp, 0x18 -/* 0BCA00 800BBE00 03E00008 */ jr $ra -/* 0BCA04 800BBE04 00000000 */ nop - diff --git a/asm/non_matchings/unknown_0B8920/func_800C0170.s b/asm/non_matchings/unknown_0B8920/func_800C0170.s deleted file mode 100644 index 27874465..00000000 --- a/asm/non_matchings/unknown_0B8920/func_800C0170.s +++ /dev/null @@ -1,6 +0,0 @@ -glabel func_800C0170 -/* 0C0D70 800C0170 240E0001 */ li $t6, 1 -/* 0C0D74 800C0174 3C01800E */ lui $at, 0x800e -/* 0C0D78 800C0178 03E00008 */ jr $ra -/* 0C0D7C 800C017C AC2E31A0 */ sw $t6, 0x31a0($at) - diff --git a/asm/non_matchings/unknown_0B8920/func_800C0180.s b/asm/non_matchings/unknown_0B8920/func_800C0180.s deleted file mode 100644 index b3b48dad..00000000 --- a/asm/non_matchings/unknown_0B8920/func_800C0180.s +++ /dev/null @@ -1,5 +0,0 @@ -glabel func_800C0180 -/* 0C0D80 800C0180 3C01800E */ lui $at, 0x800e -/* 0C0D84 800C0184 03E00008 */ jr $ra -/* 0C0D88 800C0188 AC2031A0 */ sw $zero, 0x31a0($at) - diff --git a/asm/non_matchings/unknown_0B8920/func_800C2AB4.s b/asm/non_matchings/unknown_0B8920/func_800C2AB4.s deleted file mode 100644 index df659d17..00000000 --- a/asm/non_matchings/unknown_0B8920/func_800C2AB4.s +++ /dev/null @@ -1,18 +0,0 @@ -glabel func_800C2AB4 -/* 0C36B4 800C2AB4 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 0C36B8 800C2AB8 3C048013 */ lui $a0, %hi(D_8012A7C8) # $a0, 0x8013 -/* 0C36BC 800C2ABC AFBF0014 */ sw $ra, 0x14($sp) -/* 0C36C0 800C2AC0 8C84A7C8 */ lw $a0, %lo(D_8012A7C8)($a0) -/* 0C36C4 800C2AC4 0C01C450 */ jal func_80071140 -/* 0C36C8 800C2AC8 00000000 */ nop -/* 0C36CC 800C2ACC 3C018013 */ lui $at, %hi(D_8012A7B6) # $at, 0x8013 -/* 0C36D0 800C2AD0 A420A7B6 */ sh $zero, %lo(D_8012A7B6)($at) -/* 0C36D4 800C2AD4 0C031588 */ jal func_800C5620 -/* 0C36D8 800C2AD8 24040006 */ li $a0, 6 -/* 0C36DC 800C2ADC 0C031525 */ jal func_800C5494 -/* 0C36E0 800C2AE0 24040006 */ li $a0, 6 -/* 0C36E4 800C2AE4 8FBF0014 */ lw $ra, 0x14($sp) -/* 0C36E8 800C2AE8 27BD0018 */ addiu $sp, $sp, 0x18 -/* 0C36EC 800C2AEC 03E00008 */ jr $ra -/* 0C36F0 800C2AF0 00000000 */ nop - diff --git a/asm/non_matchings/unknown_0B8920/func_800C2AF4.s b/asm/non_matchings/unknown_0B8920/func_800C2AF4.s deleted file mode 100644 index fd6ed2c1..00000000 --- a/asm/non_matchings/unknown_0B8920/func_800C2AF4.s +++ /dev/null @@ -1,5 +0,0 @@ -glabel func_800C2AF4 -/* 0C36F4 800C2AF4 3C01800E */ lui $at, 0x800e -/* 0C36F8 800C2AF8 03E00008 */ jr $ra -/* 0C36FC 800C2AFC AC243680 */ sw $a0, 0x3680($at) - diff --git a/asm/non_matchings/unknown_0B8920/func_800C3140.s b/asm/non_matchings/unknown_0B8920/func_800C3140.s deleted file mode 100644 index 50f10bdb..00000000 --- a/asm/non_matchings/unknown_0B8920/func_800C3140.s +++ /dev/null @@ -1,5 +0,0 @@ -glabel func_800C3140 -/* 0C3D40 800C3140 3C01800E */ lui $at, 0x800e -/* 0C3D44 800C3144 03E00008 */ jr $ra -/* 0C3D48 800C3148 A4243674 */ sh $a0, 0x3674($at) - diff --git a/asm/non_matchings/unknown_0B8920/func_800C314C.s b/asm/non_matchings/unknown_0B8920/func_800C314C.s deleted file mode 100644 index d721be7b..00000000 --- a/asm/non_matchings/unknown_0B8920/func_800C314C.s +++ /dev/null @@ -1,5 +0,0 @@ -glabel func_800C314C -/* 0C3D4C 800C314C 3C01800E */ lui $at, 0x800e -/* 0C3D50 800C3150 03E00008 */ jr $ra -/* 0C3D54 800C3154 AC203678 */ sw $zero, 0x3678($at) - diff --git a/asm/non_matchings/unknown_0B8920/func_800C4164.s b/asm/non_matchings/unknown_0B8920/func_800C4164.s deleted file mode 100644 index aaa43610..00000000 --- a/asm/non_matchings/unknown_0B8920/func_800C4164.s +++ /dev/null @@ -1,5 +0,0 @@ -glabel func_800C4164 -/* 0C4D64 800C4164 3C018013 */ lui $at, 0x8013 -/* 0C4D68 800C4168 03E00008 */ jr $ra -/* 0C4D6C 800C416C AC24A7F0 */ sw $a0, -0x5810($at) - diff --git a/asm/non_matchings/unknown_0B8920/func_800C61DC.s b/asm/non_matchings/unknown_0B8920/func_800C61DC.s deleted file mode 100644 index 4649ec6d..00000000 --- a/asm/non_matchings/unknown_0B8920/func_800C61DC.s +++ /dev/null @@ -1,17 +0,0 @@ -glabel func_800C61DC -/* 0C6DDC 800C61DC 00A03025 */ move $a2, $a1 -/* 0C6DE0 800C61E0 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 0C6DE4 800C61E4 3C05800E */ lui $a1, %hi(D_800E3764) # $a1, 0x800e -/* 0C6DE8 800C61E8 AFBF0014 */ sw $ra, 0x14($sp) -/* 0C6DEC 800C61EC 8CA53764 */ lw $a1, %lo(D_800E3764)($a1) -/* 0C6DF0 800C61F0 0C01DB9A */ jal func_80076E68 -/* 0C6DF4 800C61F4 24070008 */ li $a3, 8 -/* 0C6DF8 800C61F8 3C04800E */ lui $a0, %hi(D_800E3764) # $a0, 0x800e -/* 0C6DFC 800C61FC 8C843764 */ lw $a0, %lo(D_800E3764)($a0) -/* 0C6E00 800C6200 0C03186B */ jal byteswap32 -/* 0C6E04 800C6204 00000000 */ nop -/* 0C6E08 800C6208 8FBF0014 */ lw $ra, 0x14($sp) -/* 0C6E0C 800C620C 27BD0018 */ addiu $sp, $sp, 0x18 -/* 0C6E10 800C6210 03E00008 */ jr $ra -/* 0C6E14 800C6214 00000000 */ nop - diff --git a/src/mips1/unknown_0B8920.c b/src/mips1/unknown_0B8920.c index 8914c18e..5cb903d3 100644 --- a/src/mips1/unknown_0B8920.c +++ b/src/mips1/unknown_0B8920.c @@ -4,18 +4,6 @@ #include "types.h" #include "macros.h" -extern s32 D_800E3760; -extern s32 D_800E3764; -extern s32 D_800E3768; -extern s32 D_800E376C; -extern s32 D_8012AAD8; -extern s32 D_8012AAD4; -extern s32 D_8012AAD0; - -s32 func_80070C9C(s32 arg0, s32 arg1); -void func_80071140(s32* arg0); -void func_8007B2BC(s32* arg0); - extern s32* D_800E3040; extern s32* D_800E3044; extern s32* D_800E3048; @@ -25,11 +13,34 @@ extern s32* D_800E3080; extern s32* D_800E30D0; extern s32* D_800E30D4; extern s32* D_800E30D8; +extern s32 D_800E30DC; extern s32* D_800E3178; extern s32* D_800E3184; extern s32* D_800E3188; extern s32* D_800E3190; extern s32* D_800E3194; +extern s32 D_800E31A0; +extern s16 D_800E3674; +extern s32 D_800E3678; +extern s32 D_800E3680; +extern u8* D_800E3760; +extern u8* D_800E3764; +extern s32 D_800E3768; +extern s32 D_800E376C; +extern s32 D_8012A0D8; +extern s32 D_8012A0DC; +extern u16 D_8012A7B6; +extern s32* D_8012A7C8; +extern s32 D_8012A7F0; +extern s32 D_8012AAD8; +extern s32 D_8012AAD4; +extern s32 D_8012AAD0; + +u8* func_80070C9C(s32 arg0, s32 arg1); +void func_80071140(s32* arg0); +void func_8007B2BC(s32* arg0); +void func_800C5494(s32 arg0); +void func_800C5620(s32 arg0); void func_800B7D20(void) { if (D_800E3040 != NULL) { @@ -81,7 +92,22 @@ void func_800B7D20(void) { GLOBAL_ASM("asm/non_matchings/unknown_0B8920/func_800B7EB4.s") GLOBAL_ASM("asm/non_matchings/unknown_0B8920/func_800B8134.s") GLOBAL_ASM("asm/non_matchings/unknown_0B8920/func_800B82B4.s") -GLOBAL_ASM("asm/non_matchings/unknown_0B8920/func_800B8B8C.s") + +void func_800B8B8C(void) { + s32 temp_v0; + s32 phi_v0; + s32 i; + + D_800E30DC = 0; + phi_v0 = 0; + + for(i = 0; i < D_8012A0D8 * D_8012A0DC; i++) { + temp_v0 = phi_v0 + 1; + D_800E30D4[i] = 0; + phi_v0 = temp_v0; + } +} + GLOBAL_ASM("asm/non_matchings/unknown_0B8920/func_800B8C04.s") GLOBAL_ASM("asm/non_matchings/unknown_0B8920/func_800B9228.s") GLOBAL_ASM("asm/non_matchings/unknown_0B8920/func_800B92F4.s") @@ -91,7 +117,16 @@ GLOBAL_ASM("asm/non_matchings/unknown_0B8920/func_800BA288.s") GLOBAL_ASM("asm/non_matchings/unknown_0B8920/func_800BA4B8.s") GLOBAL_ASM("asm/non_matchings/unknown_0B8920/func_800BA8E4.s") GLOBAL_ASM("asm/non_matchings/unknown_0B8920/func_800BB2F4.s") -GLOBAL_ASM("asm/non_matchings/unknown_0B8920/func_800BBDDC.s") + +//GLOBAL_ASM("asm/non_matchings/unknown_0B8920/func_800BBDDC.s") +void func_800BBE08(void); +void func_800BBF78(s32 arg0); + +void func_800BBDDC(s32 arg0) { + func_800BBE08(); + func_800BBF78(arg0); +} + GLOBAL_ASM("asm/non_matchings/unknown_0B8920/func_800BBE08.s") GLOBAL_ASM("asm/non_matchings/unknown_0B8920/func_800BBF78.s") GLOBAL_ASM("asm/non_matchings/unknown_0B8920/func_800BC6C8.s") @@ -105,8 +140,15 @@ GLOBAL_ASM("asm/non_matchings/unknown_0B8920/func_800BF524.s") GLOBAL_ASM("asm/non_matchings/unknown_0B8920/func_800BF634.s") GLOBAL_ASM("asm/non_matchings/unknown_0B8920/func_800BFE98.s") GLOBAL_ASM("asm/non_matchings/unknown_0B8920/func_800BFFDC.s") -GLOBAL_ASM("asm/non_matchings/unknown_0B8920/func_800C0170.s") -GLOBAL_ASM("asm/non_matchings/unknown_0B8920/func_800C0180.s") + +void func_800C0170(void) { + D_800E31A0 = 1; +} + +void func_800C0180(void) { + D_800E31A0 = 0; +} + GLOBAL_ASM("asm/non_matchings/unknown_0B8920/func_800C018C.s") GLOBAL_ASM("asm/non_matchings/unknown_0B8920/func_800C01D8.s") GLOBAL_ASM("asm/non_matchings/unknown_0B8920/func_800C0494.s") @@ -128,15 +170,33 @@ GLOBAL_ASM("asm/non_matchings/unknown_0B8920/func_800C2640.s") GLOBAL_ASM("asm/non_matchings/unknown_0B8920/func_800C27A0.s") GLOBAL_ASM("asm/non_matchings/unknown_0B8920/func_800C28E8.s") GLOBAL_ASM("asm/non_matchings/unknown_0B8920/func_800C29F0.s") -GLOBAL_ASM("asm/non_matchings/unknown_0B8920/func_800C2AB4.s") -GLOBAL_ASM("asm/non_matchings/unknown_0B8920/func_800C2AF4.s") + +void func_800C2AB4(void) { + func_80071140(D_8012A7C8); + D_8012A7B6 = (u16)0; + func_800C5620(6); + func_800C5494(6); +} + + +void func_800C2AF4(s32 arg0) { + D_800E3680 = arg0; +} + GLOBAL_ASM("asm/non_matchings/unknown_0B8920/func_800C2B00.s") GLOBAL_ASM("asm/non_matchings/unknown_0B8920/func_800C2D6C.s") GLOBAL_ASM("asm/non_matchings/unknown_0B8920/func_800C2F1C.s") GLOBAL_ASM("asm/non_matchings/unknown_0B8920/func_800C3048.s") GLOBAL_ASM("asm/non_matchings/unknown_0B8920/func_800C30CC.s") -GLOBAL_ASM("asm/non_matchings/unknown_0B8920/func_800C3140.s") -GLOBAL_ASM("asm/non_matchings/unknown_0B8920/func_800C314C.s") + +void func_800C3140(s32 arg0) { + D_800E3674 = arg0; +} + +void func_800C314C(void) { + D_800E3678 = 0; +} + GLOBAL_ASM("asm/non_matchings/unknown_0B8920/func_800C3158.s") GLOBAL_ASM("asm/non_matchings/unknown_0B8920/func_800C31EC.s") GLOBAL_ASM("asm/non_matchings/unknown_0B8920/func_800C3400.s") @@ -144,7 +204,11 @@ GLOBAL_ASM("asm/non_matchings/unknown_0B8920/func_800C3440.s") GLOBAL_ASM("asm/non_matchings/unknown_0B8920/func_800C3564.s") GLOBAL_ASM("asm/non_matchings/unknown_0B8920/func_800C38B4.s") GLOBAL_ASM("asm/non_matchings/unknown_0B8920/func_800C3C00.s") -GLOBAL_ASM("asm/non_matchings/unknown_0B8920/func_800C4164.s") + +void func_800C4164(s32 arg0) { + D_8012A7F0 = arg0; +} + GLOBAL_ASM("asm/non_matchings/unknown_0B8920/func_800C4170.s") GLOBAL_ASM("asm/non_matchings/unknown_0B8920/func_800C422C.s") GLOBAL_ASM("asm/non_matchings/unknown_0B8920/func_800C42EC.s") @@ -185,8 +249,10 @@ s32 byteswap32(u8* arg0) { return value; } - -GLOBAL_ASM("asm/non_matchings/unknown_0B8920/func_800C61DC.s") +s32 func_800C61DC(s32 arg0, s32 arg1) { + func_80076E68(arg0, D_800E3764, arg1, 8); + return byteswap32(D_800E3764); +} s32 func_800C68C0(void);