diff --git a/src/game/chr/chraicommands.c b/src/game/chr/chraicommands.c index 9424bc589..41df4758f 100644 --- a/src/game/chr/chraicommands.c +++ b/src/game/chr/chraicommands.c @@ -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 */ diff --git a/src/include/game/chr/chraicommands.h b/src/include/game/chr/chraicommands.h index 099e89338..9759dcc0d 100644 --- a/src/include/game/chr/chraicommands.h +++ b/src/include/game/chr/chraicommands.h @@ -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); diff --git a/src/include/gvars/gvars.h b/src/include/gvars/gvars.h index a246cf849..76c6cbe91 100644 --- a/src/include/gvars/gvars.h +++ b/src/include/gvars/gvars.h @@ -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 diff --git a/src/include/setup/setup_0160b0.h b/src/include/setup/setup_0160b0.h index bac474202..57bfc9ba1 100644 --- a/src/include/setup/setup_0160b0.h +++ b/src/include/setup/setup_0160b0.h @@ -5,4 +5,6 @@ extern struct menu_dialog menudialog_18d78; extern struct menu_dialog menudialog_18d90; +extern u32 g_PlayersWithControl[]; + #endif diff --git a/src/setup/setup_000000.c b/src/setup/setup_000000.c index de109e96b..7cbf0c0d5 100644 --- a/src/setup/setup_000000.c +++ b/src/setup/setup_000000.c @@ -14177,7 +14177,7 @@ bool (*command_pointers[])(void) = { /*0x00dd*/ ai00dd, /*0x00de*/ ai00de, /*0x00df*/ ai00df, - /*0x00e0*/ ai00e0, + /*0x00e0*/ aiRevokeControl, /*0x00e1*/ ai00e1, /*0x00e2*/ ai00e2, /*0x00e3*/ ai00e3, diff --git a/src/setup/setup_0160b0.c b/src/setup/setup_0160b0.c index 6789ddab3..dedf52fba 100644 --- a/src/setup/setup_0160b0.c +++ b/src/setup/setup_0160b0.c @@ -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;