Decompile registerDangerousProp and unregisterDangerousProp

This commit is contained in:
Ryan Dwyer
2020-01-17 22:38:18 +10:00
parent 402d8cfb7e
commit 1796a832e1
5 changed files with 31 additions and 47 deletions
+22 -38
View File
@@ -42284,45 +42284,29 @@ glabel func0f043944
/* f043984: 00000000 */ sll $zero,$zero,0x0
);
GLOBAL_ASM(
glabel func0f043988
/* f043988: 3c03800a */ lui $v1,%hi(g_DangerousProps)
/* f04398c: 3c02800a */ lui $v0,%hi(var8009cc30)
/* f043990: 2442cc30 */ addiu $v0,$v0,%lo(var8009cc30)
/* f043994: 2463cc00 */ addiu $v1,$v1,%lo(g_DangerousProps)
/* f043998: 8c6e0000 */ lw $t6,0x0($v1)
.L0f04399c:
/* f04399c: 548e0004 */ bnel $a0,$t6,.L0f0439b0
/* f0439a0: 24630004 */ addiu $v1,$v1,0x4
/* f0439a4: 03e00008 */ jr $ra
/* f0439a8: ac600000 */ sw $zero,0x0($v1)
/* f0439ac: 24630004 */ addiu $v1,$v1,0x4
.L0f0439b0:
/* f0439b0: 5462fffa */ bnel $v1,$v0,.L0f04399c
/* f0439b4: 8c6e0000 */ lw $t6,0x0($v1)
/* f0439b8: 03e00008 */ jr $ra
/* f0439bc: 00000000 */ sll $zero,$zero,0x0
);
void unregisterDangerousProp(struct prop *prop)
{
s32 i;
GLOBAL_ASM(
glabel func0f0439c0
/* f0439c0: 3c03800a */ lui $v1,%hi(g_DangerousProps)
/* f0439c4: 3c02800a */ lui $v0,%hi(var8009cc30)
/* f0439c8: 2442cc30 */ addiu $v0,$v0,%lo(var8009cc30)
/* f0439cc: 2463cc00 */ addiu $v1,$v1,%lo(g_DangerousProps)
/* f0439d0: 8c6e0000 */ lw $t6,0x0($v1)
.L0f0439d4:
/* f0439d4: 55c00004 */ bnezl $t6,.L0f0439e8
/* f0439d8: 24630004 */ addiu $v1,$v1,0x4
/* f0439dc: 03e00008 */ jr $ra
/* f0439e0: ac640000 */ sw $a0,0x0($v1)
/* f0439e4: 24630004 */ addiu $v1,$v1,0x4
.L0f0439e8:
/* f0439e8: 5462fffa */ bnel $v1,$v0,.L0f0439d4
/* f0439ec: 8c6e0000 */ lw $t6,0x0($v1)
/* f0439f0: 03e00008 */ jr $ra
/* f0439f4: 00000000 */ sll $zero,$zero,0x0
);
for (i = 0; i != 12; i++) {
if (g_DangerousProps[i] == prop) {
g_DangerousProps[i] = NULL;
return;
}
}
}
void registerDangerousProp(struct prop *prop)
{
s32 i;
for (i = 0; i != 12; i++) {
if (g_DangerousProps[i] == NULL) {
g_DangerousProps[i] = prop;
return;
}
}
}
GLOBAL_ASM(
glabel func0f0439f8
+4 -4
View File
@@ -11895,7 +11895,7 @@ glabel func0f06f54c
/* f06f73c: 00797023 */ subu $t6,$v1,$t9
/* f06f740: 05c10393 */ bgez $t6,.L0f070590
/* f06f744: a5ee0062 */ sh $t6,0x62($t7)
/* f06f748: 0fc10e62 */ jal func0f043988
/* f06f748: 0fc10e62 */ jal unregisterDangerousProp
/* f06f74c: 8fa401b0 */ lw $a0,0x1b0($sp)
/* f06f750: 8fb801a8 */ lw $t8,0x1a8($sp)
/* f06f754: 24010002 */ addiu $at,$zero,0x2
@@ -12038,7 +12038,7 @@ glabel func0f06f54c
/* f06f93c: 8fa601b0 */ lw $a2,0x1b0($sp)
/* f06f940: 0fc0287e */ jal func0f00a1f8
/* f06f944: 24c40008 */ addiu $a0,$a2,0x8
/* f06f948: 0fc10e62 */ jal func0f043988
/* f06f948: 0fc10e62 */ jal unregisterDangerousProp
/* f06f94c: 8fa401b0 */ lw $a0,0x1b0($sp)
/* f06f950: 8e180040 */ lw $t8,0x40($s0)
/* f06f954: 3c0d800a */ lui $t5,%hi(g_Vars)
@@ -12511,7 +12511,7 @@ glabel func0f06f54c
/* f06ffdc: 8fa601b0 */ lw $a2,0x1b0($sp)
/* f06ffe0: 0fc0287e */ jal func0f00a1f8
/* f06ffe4: 24c40008 */ addiu $a0,$a2,0x8
/* f06ffe8: 0fc10e62 */ jal func0f043988
/* f06ffe8: 0fc10e62 */ jal unregisterDangerousProp
/* f06ffec: 8fa401b0 */ lw $a0,0x1b0($sp)
/* f06fff0: 8e0e0040 */ lw $t6,0x40($s0)
/* f06fff4: 3c0d800a */ lui $t5,%hi(g_Vars)
@@ -34497,7 +34497,7 @@ glabel func0f08307c
/* f083d7c: 84580062 */ lh $t8,0x62($v0)
/* f083d80: 07000003 */ bltz $t8,.L0f083d90
/* f083d84: 00000000 */ sll $zero,$zero,0x0
/* f083d88: 0fc10e70 */ jal func0f0439c0
/* f083d88: 0fc10e70 */ jal registerDangerousProp
/* f083d8c: 8fa40140 */ lw $a0,0x140($sp)
.L0f083d90:
/* f083d90: 10000002 */ beqz $zero,.L0f083d9c
+1 -1
View File
@@ -9173,7 +9173,7 @@ glabel func0f09ee18
.L0f09ef90:
/* f09ef90: 8ca40014 */ lw $a0,0x14($a1)
/* f09ef94: afa800b0 */ sw $t0,0xb0($sp)
/* f09ef98: 0fc10e70 */ jal func0f0439c0
/* f09ef98: 0fc10e70 */ jal registerDangerousProp
/* f09ef9c: afa500a4 */ sw $a1,0xa4($sp)
/* f09efa0: 8fa500a4 */ lw $a1,0xa4($sp)
/* f09efa4: 8fa800b0 */ lw $t0,0xb0($sp)
+2 -2
View File
@@ -1537,7 +1537,7 @@ glabel func0f129f54
/* f12a318: 86ac0028 */ lh $t4,0x28($s5)
/* f12a31c: 11f90004 */ beq $t7,$t9,.L0f12a330
/* f12a320: 02a02025 */ or $a0,$s5,$zero
/* f12a324: 0fc10e70 */ jal func0f0439c0
/* f12a324: 0fc10e70 */ jal registerDangerousProp
/* f12a328: afaa0158 */ sw $t2,0x158($sp)
/* f12a32c: 8faa0158 */ lw $t2,0x158($sp)
.L0f12a330:
@@ -3899,7 +3899,7 @@ glabel func0f12bbdc
/* f12c554: 24010001 */ addiu $at,$zero,0x1
/* f12c558: 51a10004 */ beql $t5,$at,.L0f12c56c
/* f12c55c: ae200000 */ sw $zero,0x0($s1)
/* f12c560: 0fc10e62 */ jal func0f043988
/* f12c560: 0fc10e62 */ jal unregisterDangerousProp
/* f12c564: 8e240000 */ lw $a0,0x0($s1)
/* f12c568: ae200000 */ sw $zero,0x0($s1)
.L0f12c56c:
+2 -2
View File
@@ -322,8 +322,8 @@ u32 func0f042a40(void);
u32 func0f042ffc(void);
u32 func0f0433e0(void);
u32 func0f043944(void);
u32 func0f043988(void);
u32 func0f0439c0(void);
void unregisterDangerousProp(struct prop *prop);
void registerDangerousProp(struct prop *prop);
u32 func0f0439f8(void);
bool chrDetectDangerousObject(struct chrdata *chr, u8 flags);
void func0f043f24(s32 arg0);