Attempt to decompile aiRevokeControl

This commit is contained in:
Ryan Dwyer
2019-10-19 22:07:04 +10:00
parent 150a4af842
commit f058c55d4f
6 changed files with 43 additions and 10 deletions
+33 -3
View File
@@ -6,6 +6,7 @@
#include "game/game_0601b0.h"
#include "gvars/gvars.h"
#include "library/library.h"
#include "setup/setup_0160b0.h"
#include "setup/setup_020df0.h"
/**
@@ -7205,7 +7206,7 @@ glabel ai00bd
*/
bool aiShowCountdownTimer(void)
{
countdownTimerSetVisible(true, true);
countdownTimerSetVisible(1, true);
g_Vars.aioffset += 2;
return false;
@@ -7216,7 +7217,7 @@ bool aiShowCountdownTimer(void)
*/
bool aiHideCountdownTimer(void)
{
countdownTimerSetVisible(true, false);
countdownTimerSetVisible(1, false);
g_Vars.aioffset += 2;
return false;
@@ -9351,7 +9352,7 @@ bool ai00df(void)
* @cmd 00e0
*/
GLOBAL_ASM(
glabel ai00e0
glabel aiRevokeControl
/* f0574fc: 27bdffd0 */ addiu $sp,$sp,-48
/* f057500: afb00018 */ sw $s0,0x18($sp)
/* f057504: 3c10800a */ lui $s0,0x800a
@@ -9419,6 +9420,35 @@ glabel ai00e0
/* f0575f0: 27bd0030 */ addiu $sp,$sp,0x30
);
// Mismatch due to differing registers
//bool aiRevokeControl(void)
//{
// u8 *cmd = g_Vars.ailist + g_Vars.aioffset;
// struct chrdata *chr = chrFindById(g_Vars.chrdata, cmd[2]);
//
// if (chr && chr->pos && chr->pos->unk00 == 6) {
// u32 original_value = g_Vars.unk00028c;
// func0f12892c(func0f12897c(chr->pos));
// func0f0abc74(4, 0);
// func0f0a95ec(2, 0);
//
// if ((cmd[3] & 2) == 0) {
// func0f0dfa38(2);
// }
//
// if ((cmd[3] & 4) == 0) {
// countdownTimerSetVisible(16, false);
// }
//
// g_PlayersWithControl[g_Vars.unk00028c] = false;
// func0f12892c(original_value);
// }
//
// g_Vars.aioffset += 4;
//
// return false;
//}
/**
* @cmd 00e1
*/
+1 -1
View File
@@ -226,7 +226,7 @@
/*0x00dd*/ bool ai00dd(void);
/*0x00de*/ bool ai00de(void);
/*0x00df*/ bool ai00df(void);
/*0x00e0*/ bool ai00e0(void);
/*0x00e0*/ bool aiRevokeControl(void);
/*0x00e1*/ bool ai00e1(void);
/*0x00e2*/ bool ai00e2(void);
/*0x00e3*/ bool ai00e3(void);
+1 -1
View File
@@ -178,7 +178,7 @@ struct g_vars {
/*000280*/ u32 unk000280;
/*000284*/ struct gvars284 *unk000284;
/*000288*/ u32 unk000288;
/*00028c*/ u32 unk00028c;
/*00028c*/ u32 unk00028c; // suspected 0-3 to select one of the players
/*000290*/ u32 unk000290;
/*000294*/ s32 unk000294; // suspected 0-3 to indicate bond controller number
/*000298*/ s32 unk000298; // suspected 0-3 to indicate coop controller number
+2
View File
@@ -5,4 +5,6 @@
extern struct menu_dialog menudialog_18d78;
extern struct menu_dialog menudialog_18d90;
extern u32 g_PlayersWithControl[];
#endif
+1 -1
View File
@@ -14177,7 +14177,7 @@ bool (*command_pointers[])(void) = {
/*0x00dd*/ ai00dd,
/*0x00de*/ ai00de,
/*0x00df*/ ai00df,
/*0x00e0*/ ai00e0,
/*0x00e0*/ aiRevokeControl,
/*0x00e1*/ ai00e1,
/*0x00e2*/ ai00e2,
/*0x00e3*/ ai00e3,
+5 -4
View File
@@ -440,10 +440,11 @@ u32 var00016760 = 0x00000000;
u32 var00016764 = 0x00000000;
u32 var00016768 = 0x00000000;
u32 var0001676c = 0x00000000;
u32 var00016770 = 0x00000001;
u32 var00016774 = 0x00000001;
u32 var00016778 = 0x00000001;
u32 var0001677c = 0x00000001;
bool g_PlayersWithControl[] = {
true, true, true, true
};
u32 var00016780 = 0x00000000;
u32 var00016784 = 0x00000000;
u32 var00016788 = 0x001a001c;