Decompile aiSetRoomFlag

This commit is contained in:
Ryan Dwyer 2021-11-22 22:47:04 +10:00
parent 77a5151c33
commit 39df08f50d
6 changed files with 22 additions and 59 deletions

View File

@ -4360,7 +4360,7 @@ u8 func1032_unhide_guards_near_plane[] = {
u8 func1420_setup_portals[] = {
yield
configure_room_portals(0x0080)
set_room_flag(0x0080, ROOMFLAG_0800)
set_ailist(CHR_SELF, GAILIST_IDLE)
endlist
};

View File

@ -3026,12 +3026,12 @@ u8 func101f_check_one_basement_guard_remaining[] = {
*/
u8 func1420_setup_portals[] = {
yield
configure_room_portals(0x0050)
configure_room_portals(0x0052)
configure_room_portals(0x006c)
configure_room_portals(0x004d)
configure_room_portals(0x0065)
configure_room_portals(0x0059)
set_room_flag(0x0050, ROOMFLAG_0800)
set_room_flag(0x0052, ROOMFLAG_0800)
set_room_flag(0x006c, ROOMFLAG_0800)
set_room_flag(0x004d, ROOMFLAG_0800)
set_room_flag(0x0065, ROOMFLAG_0800)
set_room_flag(0x0059, ROOMFLAG_0800)
set_ailist(CHR_SELF, GAILIST_IDLE)
endlist
};

View File

@ -482,7 +482,7 @@ bool (*g_CommandPointers[])(void) = {
/*0x01d1*/ aiObjSetModelPartVisible,
/*0x01d2*/ aiChrEmitSparks,
/*0x01d3*/ aiSetDrCarollImages,
/*0x01d4*/ ai01d4,
/*0x01d4*/ aiSetRoomFlag,
/*0x01d5*/ aiShowCutsceneChrs,
/*0x01d6*/ aiConfigureEnvironment,
/*0x01d7*/ aiIfDistanceToTarget2LessThan,

View File

@ -12339,54 +12339,18 @@ bool aiSetDrCarollImages(void)
/**
* @cmd 01d4
*/
GLOBAL_ASM(
glabel ai01d4
/* f05f7b8: 3c07800a */ lui $a3,%hi(g_Vars)
/* f05f7bc: 24e79fc0 */ addiu $a3,$a3,%lo(g_Vars)
/* f05f7c0: 8cee0434 */ lw $t6,0x434($a3)
/* f05f7c4: 8cef0438 */ lw $t7,0x438($a3)
/* f05f7c8: 00001025 */ or $v0,$zero,$zero
/* f05f7cc: 01cf1821 */ addu $v1,$t6,$t7
/* f05f7d0: 90780002 */ lbu $t8,0x2($v1)
/* f05f7d4: 90680003 */ lbu $t0,0x3($v1)
/* f05f7d8: 906b0004 */ lbu $t3,0x4($v1)
/* f05f7dc: 0018ca00 */ sll $t9,$t8,0x8
/* f05f7e0: 03282025 */ or $a0,$t9,$t0
/* f05f7e4: 00044c00 */ sll $t1,$a0,0x10
/* f05f7e8: 00095403 */ sra $t2,$t1,0x10
/* f05f7ec: 000ac8c0 */ sll $t9,$t2,0x3
/* f05f7f0: 032ac821 */ addu $t9,$t9,$t2
/* f05f7f4: 3c18800a */ lui $t8,%hi(g_Rooms)
/* f05f7f8: 8f184928 */ lw $t8,%lo(g_Rooms)($t8)
/* f05f7fc: 0019c880 */ sll $t9,$t9,0x2
/* f05f800: 032ac823 */ subu $t9,$t9,$t2
/* f05f804: 0019c880 */ sll $t9,$t9,0x2
/* f05f808: 906d0005 */ lbu $t5,0x5($v1)
/* f05f80c: 03193021 */ addu $a2,$t8,$t9
/* f05f810: 94c80000 */ lhu $t0,0x0($a2)
/* f05f814: 000b6200 */ sll $t4,$t3,0x8
/* f05f818: 018d7825 */ or $t7,$t4,$t5
/* f05f81c: 010f4825 */ or $t1,$t0,$t7
/* f05f820: a4c90000 */ sh $t1,0x0($a2)
/* f05f824: 8cea0438 */ lw $t2,0x438($a3)
/* f05f828: 254b0006 */ addiu $t3,$t2,0x6
/* f05f82c: 03e00008 */ jr $ra
/* f05f830: aceb0438 */ sw $t3,0x438($a3)
);
bool aiSetRoomFlag(void)
{
u8 *cmd = g_Vars.ailist + g_Vars.aioffset;
s16 roomnum = cmd[3] | cmd[2] << 8;
s16 flag = cmd[5] | cmd[4] << 8;
//bool ai01d4(void)
//{
// u8 *cmd = g_Vars.ailist + g_Vars.aioffset;
// s16 room_id = cmd[3] | (cmd[2] << 8);
// u32 value = cmd[5] | (cmd[4] << 8);
//
// struct room *room = &g_Rooms[room_id];
// room->unk00 |= value;
//
// g_Vars.aioffset += 6;
//
// return false;
//}
g_Rooms[roomnum].flags |= flag;
g_Vars.aioffset += 6;
return false;
}
/**
* @cmd 01d5

View File

@ -4111,11 +4111,10 @@
left, \
right,
#define configure_room_portals(room) \
#define set_room_flag(room, flag) \
mkshort(0x01d4), \
mkshort(room), \
0x08, \
0x00,
mkshort(flag),
/**
* Shows or hides non-essential chrs.

View File

@ -432,7 +432,7 @@
/*0x01d1*/ bool aiObjSetModelPartVisible(void);
/*0x01d2*/ bool aiChrEmitSparks(void);
/*0x01d3*/ bool aiSetDrCarollImages(void);
/*0x01d4*/ bool ai01d4(void);
/*0x01d4*/ bool aiSetRoomFlag(void);
/*0x01d5*/ bool aiShowCutsceneChrs(void);
/*0x01d6*/ bool aiConfigureEnvironment(void);
/*0x01d7*/ bool aiIfDistanceToTarget2LessThan(void);