Decompile lightIsOn

This commit is contained in:
Ryan Dwyer
2020-09-02 18:13:05 +10:00
parent 02c26de5dc
commit 189a4499f9
3 changed files with 14 additions and 24 deletions
+12 -22
View File
@@ -501,28 +501,18 @@ bool func0f000f94(s32 roomnum, s32 lightnum)
return light->unk05_04;
}
GLOBAL_ASM(
glabel func0f000fbc
/* f000fbc: 27bdffe8 */ addiu $sp,$sp,-24
/* f000fc0: 10800009 */ beqz $a0,.L0f000fe8
/* f000fc4: afbf0014 */ sw $ra,0x14($sp)
/* f000fc8: 0fc0025f */ jal roomGetLight
/* f000fcc: 00000000 */ nop
/* f000fd0: 944e0004 */ lhu $t6,0x4($v0)
/* f000fd4: 000ec680 */ sll $t8,$t6,0x1a
/* f000fd8: 07030004 */ bgezl $t8,.L0f000fec
/* f000fdc: 00001825 */ or $v1,$zero,$zero
/* f000fe0: 10000002 */ b .L0f000fec
/* f000fe4: 24030001 */ addiu $v1,$zero,0x1
.L0f000fe8:
/* f000fe8: 00001825 */ or $v1,$zero,$zero
.L0f000fec:
/* f000fec: 8fbf0014 */ lw $ra,0x14($sp)
/* f000ff0: 27bd0018 */ addiu $sp,$sp,0x18
/* f000ff4: 00601025 */ or $v0,$v1,$zero
/* f000ff8: 03e00008 */ jr $ra
/* f000ffc: 00000000 */ nop
);
bool lightIsOn(s32 roomnum, s32 lightnum)
{
bool on;
if (roomnum && roomGetLight(roomnum, lightnum)->on) {
on = true;
} else {
on = false;
}
return on;
}
GLOBAL_ASM(
glabel func0f001000
+1 -1
View File
@@ -1403,7 +1403,7 @@ glabel func0f13d568
/* f13d864: 018d7021 */ addu $t6,$t4,$t5
/* f13d868: 8dcf0014 */ lw $t7,0x14($t6)
/* f13d86c: 85f80010 */ lh $t8,0x10($t7)
/* f13d870: 0fc003ef */ jal func0f000fbc
/* f13d870: 0fc003ef */ jal lightIsOn
/* f13d874: 02382823 */ subu $a1,$s1,$t8
/* f13d878: 10400200 */ beqz $v0,.L0f13e07c
/* f13d87c: 3c013f80 */ lui $at,0x3f80
+1 -1
View File
@@ -15,7 +15,7 @@ f32 func0f000dbc(s32 roomnum);
u32 func0f000dfc(void);
u32 func0f000f50(void);
bool func0f000f94(s32 roomnum, s32 lightnum);
u32 func0f000fbc(void);
bool lightIsOn(s32 roomnum, s32 lightnum);
u32 func0f001000(void);
u32 func0f0010d8(void);
u32 func0f001138(void);