Decompile aiSetDodgeRating

This commit is contained in:
Ryan Dwyer 2019-10-19 15:16:29 +10:00
parent e1784bfa1b
commit d6d9101483
3 changed files with 59 additions and 41 deletions

View File

@ -5539,7 +5539,7 @@ glabel ai010e
*/
bool aiSetReactionSpeed(void)
{
s8 *cmd = g_Vars.ailist + g_Vars.aioffset;
s8 *cmd = (s8 *)g_Vars.ailist + g_Vars.aioffset;
g_Vars.chrdata->speedrating = cmd[2];
g_Vars.aioffset += 3;
@ -5552,7 +5552,7 @@ bool aiSetReactionSpeed(void)
*/
bool aiSetRecoverySpeed(void)
{
s8 *cmd = g_Vars.ailist + g_Vars.aioffset;
s8 *cmd = (s8 *)g_Vars.ailist + g_Vars.aioffset;
g_Vars.chrdata->arghrating = cmd[2];
g_Vars.aioffset += 3;
@ -5565,7 +5565,7 @@ bool aiSetRecoverySpeed(void)
*/
bool aiSetAccuracy(void)
{
s8 *cmd = g_Vars.ailist + g_Vars.aioffset;
s8 *cmd = (s8 *)g_Vars.ailist + g_Vars.aioffset;
g_Vars.chrdata->accuracyrating = cmd[2];
g_Vars.aioffset += 3;
@ -5576,42 +5576,60 @@ bool aiSetAccuracy(void)
/**
* @cmd 01c6
*/
GLOBAL_ASM(
glabel ai01c6
/* f053c70: 3c04800a */ lui $a0,0x800a
/* f053c74: 24849fc0 */ addiu $a0,$a0,-24640
/* f053c78: 8c8e0434 */ lw $t6,0x434($a0)
/* f053c7c: 8c8f0438 */ lw $t7,0x438($a0)
/* f053c80: 24010001 */ addiu $at,$zero,0x1
/* f053c84: 01cf1021 */ addu $v0,$t6,$t7
/* f053c88: 80430002 */ lb $v1,0x2($v0)
/* f053c8c: 14600005 */ bnez $v1,.L0f053ca4
/* f053c90: 00000000 */ sll $zero,$zero,0x0
/* f053c94: 80580003 */ lb $t8,0x3($v0)
/* f053c98: 8c990424 */ lw $t9,0x424($a0)
/* f053c9c: 1000000d */ beqz $zero,.L0f053cd4
/* f053ca0: a338035e */ sb $t8,0x35e($t9)
.L0f053ca4:
/* f053ca4: 54610006 */ bnel $v1,$at,.L0f053cc0
/* f053ca8: 804a0003 */ lb $t2,0x3($v0)
/* f053cac: 80480003 */ lb $t0,0x3($v0)
/* f053cb0: 8c890424 */ lw $t1,0x424($a0)
/* f053cb4: 10000007 */ beqz $zero,.L0f053cd4
/* f053cb8: a128035f */ sb $t0,0x35f($t1)
/* f053cbc: 804a0003 */ lb $t2,0x3($v0)
.L0f053cc0:
/* f053cc0: 8c8b0424 */ lw $t3,0x424($a0)
/* f053cc4: a16a035e */ sb $t2,0x35e($t3)
/* f053cc8: 8c8d0424 */ lw $t5,0x424($a0)
/* f053ccc: 804c0003 */ lb $t4,0x3($v0)
/* f053cd0: a1ac035f */ sb $t4,0x35f($t5)
.L0f053cd4:
/* f053cd4: 8c8e0438 */ lw $t6,0x438($a0)
/* f053cd8: 00001025 */ or $v0,$zero,$zero
/* f053cdc: 25cf0004 */ addiu $t7,$t6,0x4
/* f053ce0: 03e00008 */ jr $ra
/* f053ce4: ac8f0438 */ sw $t7,0x438($a0)
);
//GLOBAL_ASM(
//glabel ai01c6
///* f053c70: 3c04800a */ lui $a0,0x800a
///* f053c74: 24849fc0 */ addiu $a0,$a0,-24640
///* f053c78: 8c8e0434 */ lw $t6,0x434($a0)
///* f053c7c: 8c8f0438 */ lw $t7,0x438($a0)
///* f053c80: 24010001 */ addiu $at,$zero,0x1
///* f053c84: 01cf1021 */ addu $v0,$t6,$t7
///* f053c88: 80430002 */ lb $v1,0x2($v0)
///* f053c8c: 14600005 */ bnez $v1,.L0f053ca4
///* f053c90: 00000000 */ sll $zero,$zero,0x0
///* f053c94: 80580003 */ lb $t8,0x3($v0)
///* f053c98: 8c990424 */ lw $t9,0x424($a0)
///* f053c9c: 1000000d */ beqz $zero,.L0f053cd4
///* f053ca0: a338035e */ sb $t8,0x35e($t9)
//.L0f053ca4:
///* f053ca4: 54610006 */ bnel $v1,$at,.L0f053cc0
///* f053ca8: 804a0003 */ lb $t2,0x3($v0)
///* f053cac: 80480003 */ lb $t0,0x3($v0)
///* f053cb0: 8c890424 */ lw $t1,0x424($a0)
///* f053cb4: 10000007 */ beqz $zero,.L0f053cd4
///* f053cb8: a128035f */ sb $t0,0x35f($t1)
///* f053cbc: 804a0003 */ lb $t2,0x3($v0)
//.L0f053cc0:
///* f053cc0: 8c8b0424 */ lw $t3,0x424($a0)
///* f053cc4: a16a035e */ sb $t2,0x35e($t3)
///* f053cc8: 8c8d0424 */ lw $t5,0x424($a0)
///* f053ccc: 804c0003 */ lb $t4,0x3($v0)
///* f053cd0: a1ac035f */ sb $t4,0x35f($t5)
//.L0f053cd4:
///* f053cd4: 8c8e0438 */ lw $t6,0x438($a0)
///* f053cd8: 00001025 */ or $v0,$zero,$zero
///* f053cdc: 25cf0004 */ addiu $t7,$t6,0x4
///* f053ce0: 03e00008 */ jr $ra
///* f053ce4: ac8f0438 */ sw $t7,0x438($a0)
//);
bool aiSetDodgeRating(void)
{
s8 *cmd = (s8 *)g_Vars.ailist + g_Vars.aioffset;
if (cmd[2] == 0) {
g_Vars.chrdata->dodgerating = cmd[3];
} else if (cmd[2] == 1) {
g_Vars.chrdata->maxdodgerating = cmd[3];
} else {
g_Vars.chrdata->dodgerating = cmd[3];
g_Vars.chrdata->maxdodgerating = cmd[3];
}
g_Vars.aioffset += 4;
return false;
}
/**
* @cmd 01c7

View File

@ -417,7 +417,7 @@
/*0x01c3*/ bool aiSetDarkRoomList(void);
/*0x01c4*/ bool aiSetPlayerDeadList(void);
/*0x01c5*/ bool ai01c5(void);
/*0x01c6*/ bool ai01c6(void);
/*0x01c6*/ bool aiSetDodgeRating(void);
/*0x01c7*/ bool ai01c7(void);
/*0x01c8*/ bool ai01c8(void);
/*0x01c9*/ bool ai01c9(void);

View File

@ -14407,7 +14407,7 @@ bool (*command_pointers[])(void) = {
/*0x01c3*/ aiSetDarkRoomList,
/*0x01c4*/ aiSetPlayerDeadList,
/*0x01c5*/ ai01c5,
/*0x01c6*/ ai01c6,
/*0x01c6*/ aiSetDodgeRating,
/*0x01c7*/ ai01c7,
/*0x01c8*/ ai01c8,
/*0x01c9*/ ai01c9,