Identify and attempt decompile of aiIfTargetInRoom

This commit is contained in:
Ryan Dwyer 2019-11-08 23:35:21 +10:00
parent 6dbf724a98
commit 94c41195ff
4 changed files with 25 additions and 3 deletions

View File

@ -2693,7 +2693,7 @@ glabel ai005b
* @cmd 005c
*/
GLOBAL_ASM(
glabel ai005c
glabel aiIfTargetInRoom
/* f051468: 27bdffd8 */ addiu $sp,$sp,-40
/* f05146c: afb00018 */ sw $s0,0x18($sp)
/* f051470: 3c10800a */ lui $s0,0x800a
@ -2741,6 +2741,23 @@ glabel ai005c
/* f05150c: 00001025 */ or $v0,$zero,$zero
);
// Mismatch due to different temporary registers
//bool aiIfTargetInRoom(void)
//{
// u8 *cmd = g_Vars.ailist + g_Vars.aioffset;
// struct position *pos = chrGetTargetPosition(g_Vars.chrdata);
// s32 room_id = cmd[3] | (cmd[2] << 8);
// room_id = func0f0495d0(g_Vars.chrdata, room_id & 0xffff);
//
// if (room_id >= 0 && pos && room_id == pos->room) {
// g_Vars.aioffset = chraiGoToLabel(g_Vars.ailist, g_Vars.aioffset, cmd[4]);
// } else {
// g_Vars.aioffset += 5;
// }
//
// return false;
//}
/**
* @cmd 005d
*/

View File

@ -388,6 +388,11 @@
mkshort(room), \
label,
#define if_target_in_room(room, label) \
mkshort(0x005c), \
mkshort(room), \
label
#define if_chr_has_object(chr, object, label) \
mkshort(0x005d), \
chr, \

View File

@ -95,7 +95,7 @@
/*0x0059*/ bool aiIfDistanceFromTargetToPadLessThan(void);
/*0x005a*/ bool aiIfDistanceFromTargetToPadGreaterThan(void);
/*0x005b*/ bool ai005b(void);
/*0x005c*/ bool ai005c(void);
/*0x005c*/ bool aiIfTargetInRoom(void);
/*0x005d*/ bool aiIfChrHasObject(void);
/*0x005e*/ bool aiIfWeaponThrown(void);
/*0x005f*/ bool ai005f(void);

View File

@ -14045,7 +14045,7 @@ bool (*g_CommandPointers[])(void) = {
/*0x0059*/ aiIfDistanceFromTargetToPadLessThan,
/*0x005a*/ aiIfDistanceFromTargetToPadGreaterThan,
/*0x005b*/ ai005b,
/*0x005c*/ ai005c,
/*0x005c*/ aiIfTargetInRoom,
/*0x005d*/ aiIfChrHasObject,
/*0x005e*/ aiIfWeaponThrown,
/*0x005f*/ ai005f,