diff --git a/src/game/chr/chraicommands.c b/src/game/chr/chraicommands.c index ee526bd23..1f6e7a0e4 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_000000.h" #include "setup/setup_0160b0.h" #include "setup/setup_020df0.h" @@ -14298,21 +14299,14 @@ bool aiIfNotListening(void) /** * @cmd 0157 */ -GLOBAL_ASM( -glabel ai0157 -/* f05c16c: 3c05800a */ lui $a1,0x800a -/* f05c170: 24a59fc0 */ addiu $a1,$a1,-24640 -/* f05c174: 8ca40438 */ lw $a0,0x438($a1) -/* f05c178: 8cae0434 */ lw $t6,0x434($a1) -/* f05c17c: 3c018007 */ lui $at,0x8007 -/* f05c180: 24980003 */ addiu $t8,$a0,0x3 -/* f05c184: 01c41821 */ addu $v1,$t6,$a0 -/* f05c188: 906f0002 */ lbu $t7,0x2($v1) -/* f05c18c: 00001025 */ or $v0,$zero,$zero -/* f05c190: ac2f98d0 */ sw $t7,-0x6730($at) -/* f05c194: 03e00008 */ jr $ra -/* f05c198: acb80438 */ sw $t8,0x438($a1) -); +bool aiSetTintedGlassEnabled(void) +{ + u8 *cmd = g_Vars.ailist + g_Vars.aioffset; + g_TintedGlassEnabled = cmd[2]; + g_Vars.aioffset += 3; + + return false; +} /** * @cmd 0152 diff --git a/src/include/game/chr/chraicommands.h b/src/include/game/chr/chraicommands.h index 990663a0a..87ed5410b 100644 --- a/src/include/game/chr/chraicommands.h +++ b/src/include/game/chr/chraicommands.h @@ -331,7 +331,7 @@ /*0x014a*/ bool ai014a(void); /*0x014b*/ bool aiIfNotListening(void); /*0x0152*/ bool ai0152(void); -/*0x0157*/ bool ai0157(void); +/*0x0157*/ bool aiSetTintedGlassEnabled(void); /*0x015b*/ bool aiAudioPlayMusic(void); /*0x015c*/ bool aiAudioRestartMusic(void); /*0x0165*/ bool ai0165(void); diff --git a/src/include/setup/setup_000000.h b/src/include/setup/setup_000000.h index d9206302f..df8a26ed1 100644 --- a/src/include/setup/setup_000000.h +++ b/src/include/setup/setup_000000.h @@ -23,6 +23,7 @@ extern u16 g_CommandLengths[]; extern struct coord var0000f00c; +extern u32 g_TintedGlassEnabled; extern s32 g_AlarmActive; #endif diff --git a/src/setup/setup_000000.c b/src/setup/setup_000000.c index 6b5ec5e15..d21992471 100644 --- a/src/setup/setup_000000.c +++ b/src/setup/setup_000000.c @@ -14296,7 +14296,7 @@ bool (*command_pointers[])(void) = { /*0x0154*/ NULL, /*0x0155*/ NULL, /*0x0156*/ NULL, - /*0x0157*/ ai0157, + /*0x0157*/ aiSetTintedGlassEnabled, /*0x0158*/ NULL, /*0x0159*/ NULL, /*0x015a*/ NULL, @@ -14939,7 +14939,9 @@ u32 var0000f8e0 = 0x00000000; u32 var0000f8e4 = 0x00000000; u32 var0000f8e8 = 0x00000000; u32 var0000f8ec = 0x00000000; -u32 var0000f8f0 = 0x00000000; + +// f8f0 +u32 g_TintedGlassEnabled = 0; // f8f4 s32 g_AlarmActive = 0;