diff --git a/asm/non_matchings/unknown_07B870/func_8007AE0C.s b/asm/non_matchings/unknown_07B870/func_8007AE0C.s deleted file mode 100644 index 15802143..00000000 --- a/asm/non_matchings/unknown_07B870/func_8007AE0C.s +++ /dev/null @@ -1,9 +0,0 @@ -glabel func_8007AE0C -/* 07BA0C 8007AE0C 3C028012 */ lui $v0, %hi(D_80126378) # $v0, 0x8012 -/* 07BA10 8007AE10 24426378 */ addiu $v0, %lo(D_80126378) # addiu $v0, $v0, 0x6378 -/* 07BA14 8007AE14 8C4E0000 */ lw $t6, ($v0) -/* 07BA18 8007AE18 00000000 */ nop -/* 07BA1C 8007AE1C 01C47825 */ or $t7, $t6, $a0 -/* 07BA20 8007AE20 03E00008 */ jr $ra -/* 07BA24 8007AE24 AC4F0000 */ sw $t7, ($v0) - diff --git a/asm/non_matchings/unknown_07B870/func_8007AE28.s b/asm/non_matchings/unknown_07B870/func_8007AE28.s deleted file mode 100644 index 79a6bf56..00000000 --- a/asm/non_matchings/unknown_07B870/func_8007AE28.s +++ /dev/null @@ -1,24 +0,0 @@ -glabel func_8007AE28 -/* 07BA28 8007AE28 3C028012 */ lui $v0, %hi(D_80126378) # $v0, 0x8012 -/* 07BA2C 8007AE2C 24426378 */ addiu $v0, %lo(D_80126378) # addiu $v0, $v0, 0x6378 -/* 07BA30 8007AE30 8C4E0000 */ lw $t6, ($v0) -/* 07BA34 8007AE34 00807827 */ not $t7, $a0 -/* 07BA38 8007AE38 01CFC024 */ and $t8, $t6, $t7 -/* 07BA3C 8007AE3C 03E00008 */ jr $ra -/* 07BA40 8007AE40 AC580000 */ sw $t8, ($v0) - -/* 07BA44 8007AE44 3C028012 */ lui $v0, %hi(D_80126338) # $v0, 0x8012 -/* 07BA48 8007AE48 8C426338 */ lw $v0, %lo(D_80126338)($v0) -/* 07BA4C 8007AE4C 03E00008 */ jr $ra -/* 07BA50 8007AE50 00000000 */ nop - -/* 07BA54 8007AE54 3C028012 */ lui $v0, %hi(D_8012633C) # $v0, 0x8012 -/* 07BA58 8007AE58 8C42633C */ lw $v0, %lo(D_8012633C)($v0) -/* 07BA5C 8007AE5C 03E00008 */ jr $ra -/* 07BA60 8007AE60 00000000 */ nop - -/* 07BA64 8007AE64 3C028012 */ lui $v0, %hi(D_80126354) # $v0, 0x8012 -/* 07BA68 8007AE68 8C426354 */ lw $v0, %lo(D_80126354)($v0) -/* 07BA6C 8007AE6C 03E00008 */ jr $ra -/* 07BA70 8007AE70 00000000 */ nop - diff --git a/asm/non_matchings/unknown_07B870/func_8007B43C.s b/asm/non_matchings/unknown_07B870/func_8007B43C.s deleted file mode 100644 index 2e495634..00000000 --- a/asm/non_matchings/unknown_07B870/func_8007B43C.s +++ /dev/null @@ -1,8 +0,0 @@ -glabel func_8007B43C -/* 07C03C 8007B43C 24020001 */ li $v0, 1 -/* 07C040 8007B440 3C018012 */ lui $at, %hi(D_80126384) # $at, 0x8012 -/* 07C044 8007B444 A4226384 */ sh $v0, %lo(D_80126384)($at) -/* 07C048 8007B448 3C018012 */ lui $at, 0x8012 -/* 07C04C 8007B44C 03E00008 */ jr $ra -/* 07C050 8007B450 A4226382 */ sh $v0, 0x6382($at) - diff --git a/asm/non_matchings/unknown_07B870/func_8007B454.s b/asm/non_matchings/unknown_07B870/func_8007B454.s deleted file mode 100644 index d313214a..00000000 --- a/asm/non_matchings/unknown_07B870/func_8007B454.s +++ /dev/null @@ -1,8 +0,0 @@ -glabel func_8007B454 -/* 07C054 8007B454 3C018012 */ lui $at, %hi(D_80126384) # $at, 0x8012 -/* 07C058 8007B458 A4206384 */ sh $zero, %lo(D_80126384)($at) -/* 07C05C 8007B45C 3C018012 */ lui $at, 0x8012 -/* 07C060 8007B460 240E0001 */ li $t6, 1 -/* 07C064 8007B464 03E00008 */ jr $ra -/* 07C068 8007B468 A42E6382 */ sh $t6, 0x6382($at) - diff --git a/asm/non_matchings/unknown_07B870/func_8007BF1C.s b/asm/non_matchings/unknown_07B870/func_8007BF1C.s deleted file mode 100644 index 78eb55db..00000000 --- a/asm/non_matchings/unknown_07B870/func_8007BF1C.s +++ /dev/null @@ -1,8 +0,0 @@ -glabel func_8007BF1C -/* 07CB1C 8007BF1C 3C01800E */ lui $at, %hi(D_800DE7C4) # $at, 0x800e -/* 07CB20 8007BF20 AC24E7C4 */ sw $a0, %lo(D_800DE7C4)($at) -/* 07CB24 8007BF24 3C018012 */ lui $at, 0x8012 -/* 07CB28 8007BF28 240E0001 */ li $t6, 1 -/* 07CB2C 8007BF2C 03E00008 */ jr $ra -/* 07CB30 8007BF30 A42E6382 */ sh $t6, 0x6382($at) - diff --git a/src/mips1/unknown_07B870.c b/src/mips1/unknown_07B870.c index 9e5fdc1b..7787034e 100644 --- a/src/mips1/unknown_07B870.c +++ b/src/mips1/unknown_07B870.c @@ -4,20 +4,64 @@ #include "types.h" #include "macros.h" +extern s32 D_800DE7C4; +extern s32 D_80126338; +extern s32 D_8012633C; +extern s32 D_80126354; +extern s32 D_80126378; +extern s16 D_80126382; +extern s16 D_80126384; + GLOBAL_ASM("asm/non_matchings/unknown_07B870/func_8007AC70.s") -GLOBAL_ASM("asm/non_matchings/unknown_07B870/func_8007AE0C.s") -GLOBAL_ASM("asm/non_matchings/unknown_07B870/func_8007AE28.s") + +void func_8007AE0C(s32 arg0) { + D_80126378 |= arg0; +} + +void func_8007AE28(s32 arg0) { + D_80126378 &= ~arg0; +} + +/* Unused? */ +s32 func_8007AE44(void) { + return D_80126338; +} + +/* Unused? */ +s32 func_8007AE54(void) { + return D_8012633C; +} + +/* Unused? */ +s32 func_8007AE64(void) { + return D_80126354; +} + GLOBAL_ASM("asm/non_matchings/unknown_07B870/func_8007AE74.s") GLOBAL_ASM("asm/non_matchings/unknown_07B870/func_8007B2BC.s") GLOBAL_ASM("asm/non_matchings/unknown_07B870/func_8007B374.s") GLOBAL_ASM("asm/non_matchings/unknown_07B870/func_8007B3D0.s") -GLOBAL_ASM("asm/non_matchings/unknown_07B870/func_8007B43C.s") -GLOBAL_ASM("asm/non_matchings/unknown_07B870/func_8007B454.s") + +void func_8007B43C(void) { + D_80126384 = 1; + D_80126382 = 1; +} + +void func_8007B454(void) { + D_80126384 = 0; + D_80126382 = 1; +} + GLOBAL_ASM("asm/non_matchings/unknown_07B870/func_8007B46C.s") GLOBAL_ASM("asm/non_matchings/unknown_07B870/func_8007B4C8.s") GLOBAL_ASM("asm/non_matchings/unknown_07B870/func_8007B4E8.s") GLOBAL_ASM("asm/non_matchings/unknown_07B870/func_8007BA5C.s") -GLOBAL_ASM("asm/non_matchings/unknown_07B870/func_8007BF1C.s") + +void func_8007BF1C(s32 arg0) { + D_800DE7C4 = arg0; + D_80126382 = 1; +} + GLOBAL_ASM("asm/non_matchings/unknown_07B870/func_8007BF34.s") GLOBAL_ASM("asm/non_matchings/unknown_07B870/func_8007C12C.s") GLOBAL_ASM("asm/non_matchings/unknown_07B870/func_8007C57C.s")