From 02c26de5dc437129c09f61ebe62147ee24393f85 Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Wed, 2 Sep 2020 08:25:45 +1000 Subject: [PATCH] Decompile func0f000f94 --- src/game/dlights.c | 19 ++++++------------- src/include/game/dlights.h | 2 +- src/include/types.h | 2 ++ 3 files changed, 9 insertions(+), 14 deletions(-) diff --git a/src/game/dlights.c b/src/game/dlights.c index 87cfbdcac..3f0ae3c77 100644 --- a/src/game/dlights.c +++ b/src/game/dlights.c @@ -494,19 +494,12 @@ glabel func0f000f50 /* f000f90: 00000000 */ nop ); -GLOBAL_ASM( -glabel func0f000f94 -/* f000f94: 27bdffe8 */ addiu $sp,$sp,-24 -/* f000f98: afbf0014 */ sw $ra,0x14($sp) -/* f000f9c: 0fc0025f */ jal roomGetLight -/* f000fa0: 00000000 */ nop -/* f000fa4: 94420004 */ lhu $v0,0x4($v0) -/* f000fa8: 8fbf0014 */ lw $ra,0x14($sp) -/* f000fac: 27bd0018 */ addiu $sp,$sp,0x18 -/* f000fb0: 00027700 */ sll $t6,$v0,0x1c -/* f000fb4: 03e00008 */ jr $ra -/* f000fb8: 000e17c2 */ srl $v0,$t6,0x1f -); +bool func0f000f94(s32 roomnum, s32 lightnum) +{ + struct light *light = roomGetLight(roomnum, lightnum); + + return light->unk05_04; +} GLOBAL_ASM( glabel func0f000fbc diff --git a/src/include/game/dlights.h b/src/include/game/dlights.h index a6dee85db..79ec1bd05 100644 --- a/src/include/game/dlights.h +++ b/src/include/game/dlights.h @@ -14,7 +14,7 @@ u32 func0f000cc4(void); f32 func0f000dbc(s32 roomnum); u32 func0f000dfc(void); u32 func0f000f50(void); -u32 func0f000f94(void); +bool func0f000f94(s32 roomnum, s32 lightnum); u32 func0f000fbc(void); u32 func0f001000(void); u32 func0f0010d8(void); diff --git a/src/include/types.h b/src/include/types.h index fa5a96731..5bbd68917 100644 --- a/src/include/types.h +++ b/src/include/types.h @@ -6367,6 +6367,8 @@ struct light { /*0x05*/ u8 unk05_00 : 1; /*0x05*/ u8 healthy : 1; // just a guess based on context /*0x05*/ u8 on : 1; + /*0x05*/ u8 unk05_03 : 1; + /*0x05*/ u8 unk05_04 : 1; /*0x06*/ u16 unk06; /*0x08*/ u16 unk08; /*0x0a*/ s16 x1;