Decompile func0f0009c0

This commit is contained in:
Ryan Dwyer 2020-09-01 23:37:09 +10:00
parent 03c0d4ae09
commit a4edd253ac
3 changed files with 19 additions and 28 deletions

View File

@ -111,31 +111,20 @@ struct light *roomGetLight(s32 roomnum, s32 lightnum)
return (struct light *)&g_LightsFileData[(g_Rooms[roomnum].lightindex + lightnum) * 0x22];
}
GLOBAL_ASM(
glabel func0f0009c0
/* f0009c0: 000478c0 */ sll $t7,$a0,0x3
/* f0009c4: 01e47821 */ addu $t7,$t7,$a0
/* f0009c8: 3c0e800a */ lui $t6,%hi(g_Rooms)
/* f0009cc: 8dce4928 */ lw $t6,%lo(g_Rooms)($t6)
/* f0009d0: 000f7880 */ sll $t7,$t7,0x2
/* f0009d4: 01e47823 */ subu $t7,$t7,$a0
/* f0009d8: 000f7880 */ sll $t7,$t7,0x2
/* f0009dc: 01cf1021 */ addu $v0,$t6,$t7
/* f0009e0: 9058004b */ lbu $t8,0x4b($v0)
/* f0009e4: 84590052 */ lh $t9,0x52($v0)
/* f0009e8: 03191821 */ addu $v1,$t8,$t9
/* f0009ec: 28610100 */ slti $at,$v1,0x100
/* f0009f0: 14200002 */ bnez $at,.L0f0009fc
/* f0009f4: 00000000 */ nop
/* f0009f8: 240300ff */ addiu $v1,$zero,0xff
.L0f0009fc:
/* f0009fc: 04610002 */ bgez $v1,.L0f000a08
/* f000a00: 00000000 */ nop
/* f000a04: 00001825 */ or $v1,$zero,$zero
.L0f000a08:
/* f000a08: 03e00008 */ jr $ra
/* f000a0c: 306200ff */ andi $v0,$v1,0xff
);
u8 func0f0009c0(s32 roomnum)
{
s32 value = g_Rooms[roomnum].unk52 + g_Rooms[roomnum].unk4b;
if (value > 255) {
value = 255;
}
if (value < 0) {
value = 0;
}
return value;
}
GLOBAL_ASM(
glabel func0f000a10

View File

@ -5,7 +5,7 @@
u32 func0f000920(void);
struct light *roomGetLight(s32 roomnum, s32 lightnum);
u32 func0f0009c0(void);
u8 func0f0009c0(s32 roomnum);
u32 func0f000a10(void);
u32 func0f000b24(void);
u8 roomGetBrightness(s32 room);

View File

@ -3394,12 +3394,14 @@ struct room {
/*0x3c*/ u32 unk3c;
/*0x40*/ u32 unk40;
/*0x44*/ u32 unk44;
/*0x48*/ u32 unk48;
/*0x48*/ u16 unk48;
/*0x4a*/ u8 unk4a;
/*0x4b*/ u8 unk4b;
/*0x4c*/ u8 unk4c;
/*0x4d*/ u8 unk4d;
/*0x4e*/ struct roombitfield bitfield;
/*0x50*/ s16 brightness;
/*0x52*/ u16 unk52;
/*0x52*/ s16 unk52;
/*0x54*/ u16 unk54;
/*0x58*/ u32 unk58;
/*0x5c*/ u32 unk5c;