diff --git a/.vscode/settings.json b/.vscode/settings.json index e0eac220..f9c5ca86 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -134,7 +134,9 @@ "ast_meteo.h": "c", "ast_font_3d.h": "c", "ast_vs_menu.h": "c", - "sf64mesg.h": "c" + "sf64mesg.h": "c", + "sf64audio_external.h": "c", + "audioseq_cmd.h": "c" }, "C_Cpp_Runner.msvcBatchPath": "" } \ No newline at end of file diff --git a/Makefile b/Makefile index efb8e7b9..b0149d18 100644 --- a/Makefile +++ b/Makefile @@ -142,10 +142,10 @@ TORCH := tools/Torch/cmake-build-release/torch # Prefer clang as C preprocessor if installed on the system ifneq (,$(call find-command,clang)) CPP := clang - CPPFLAGS := -E -P -x c -Wno-trigraphs -D_LANGUAGE_ASSEMBLY + CPPFLAGS := -E -P -x c -Wno-trigraphs -Wmissing-prototypes -Wstrict-prototypes -D_LANGUAGE_ASSEMBLY else CPP := cpp - CPPFLAGS := -P -Wno-trigraphs -D_LANGUAGE_ASSEMBLY + CPPFLAGS := -P -Wno-trigraphs -Wmissing-prototypes -Wstrict-prototypes -D_LANGUAGE_ASSEMBLY endif ASM_PROC_FLAGS := --input-enc=utf-8 --output-enc=euc-jp --convert-statics=global-with-filename diff --git a/assets/yaml/us/ast_andross.yaml b/assets/yaml/us/ast_andross.yaml index bb080985..1ec4aa7d 100644 --- a/assets/yaml/us/ast_andross.yaml +++ b/assets/yaml/us/ast_andross.yaml @@ -9,7 +9,9 @@ - '#include "sf64object.h"' - '#include "structs.h"' - '#include "sf64level.h"' + - '#include "sf64audio_external.h"' - '#include "sf64mesg.h"' + D_ANDROSS_C000000: {type: TEXTURE, ctype: u8, format: IA8, width: 96, height: 28, offset: 0xC000000, symbol: D_ANDROSS_C000000} diff --git a/assets/yaml/us/ast_aquas.yaml b/assets/yaml/us/ast_aquas.yaml index 60bf7c80..51e98546 100644 --- a/assets/yaml/us/ast_aquas.yaml +++ b/assets/yaml/us/ast_aquas.yaml @@ -9,6 +9,7 @@ - '#include "sf64object.h"' - '#include "structs.h"' - '#include "sf64level.h"' + - '#include "sf64audio_external.h"' - '#include "sf64mesg.h"' D_AQ_6000000: diff --git a/assets/yaml/us/ast_area_6.yaml b/assets/yaml/us/ast_area_6.yaml index 0cdda545..bca6b106 100644 --- a/assets/yaml/us/ast_area_6.yaml +++ b/assets/yaml/us/ast_area_6.yaml @@ -9,6 +9,7 @@ - '#include "sf64object.h"' - '#include "structs.h"' - '#include "sf64level.h"' + - '#include "sf64audio_external.h"' - '#include "sf64mesg.h"' D_A6_6000000: { type: TEXTURE, ctype: u8, format: IA8, width: 104, height: 28, offset: 0x6000000, symbol: D_A6_6000000 } diff --git a/assets/yaml/us/ast_bolse.yaml b/assets/yaml/us/ast_bolse.yaml index d4613401..50fda4e1 100644 --- a/assets/yaml/us/ast_bolse.yaml +++ b/assets/yaml/us/ast_bolse.yaml @@ -9,6 +9,7 @@ - '#include "sf64object.h"' - '#include "structs.h"' - '#include "sf64level.h"' + - '#include "sf64audio_external.h"' - '#include "sf64mesg.h"' # Bolse Defense Outpost D_BO_6000000: diff --git a/assets/yaml/us/ast_corneria.yaml b/assets/yaml/us/ast_corneria.yaml index da00c5af..0d4620cd 100644 --- a/assets/yaml/us/ast_corneria.yaml +++ b/assets/yaml/us/ast_corneria.yaml @@ -9,6 +9,7 @@ - '#include "sf64object.h"' - '#include "structs.h"' - '#include "sf64level.h"' + - '#include "sf64audio_external.h"' - '#include "sf64mesg.h"' # Corneria diff --git a/assets/yaml/us/ast_fortuna.yaml b/assets/yaml/us/ast_fortuna.yaml index 0176cb7a..6eac2f96 100644 --- a/assets/yaml/us/ast_fortuna.yaml +++ b/assets/yaml/us/ast_fortuna.yaml @@ -8,6 +8,7 @@ - '#include "gfx.h"' - '#include "sf64object.h"' - '#include "sf64level.h"' + - '#include "sf64audio_external.h"' - '#include "structs.h"' # Fortuna diff --git a/assets/yaml/us/ast_katina.yaml b/assets/yaml/us/ast_katina.yaml index 8c7ac9fd..efb8dde8 100644 --- a/assets/yaml/us/ast_katina.yaml +++ b/assets/yaml/us/ast_katina.yaml @@ -8,6 +8,7 @@ - '#include "gfx.h"' - '#include "sf64object.h"' - '#include "sf64level.h"' + - '#include "sf64audio_external.h"' - '#include "structs.h"' # Katina diff --git a/assets/yaml/us/ast_macbeth.yaml b/assets/yaml/us/ast_macbeth.yaml index cfca0b5c..9845ffaa 100644 --- a/assets/yaml/us/ast_macbeth.yaml +++ b/assets/yaml/us/ast_macbeth.yaml @@ -9,6 +9,7 @@ - '#include "sf64object.h"' - '#include "structs.h"' - '#include "sf64level.h"' + - '#include "sf64audio_external.h"' - '#include "sf64mesg.h"' D_MA_6000000: diff --git a/assets/yaml/us/ast_meteo.yaml b/assets/yaml/us/ast_meteo.yaml index 2438785a..07285072 100644 --- a/assets/yaml/us/ast_meteo.yaml +++ b/assets/yaml/us/ast_meteo.yaml @@ -9,6 +9,7 @@ - '#include "sf64object.h"' - '#include "structs.h"' - '#include "sf64level.h"' + - '#include "sf64audio_external.h"' - '#include "sf64mesg.h"' # Meteo # Asteroid Field diff --git a/assets/yaml/us/ast_sector_x.yaml b/assets/yaml/us/ast_sector_x.yaml index 9368c695..04430e98 100644 --- a/assets/yaml/us/ast_sector_x.yaml +++ b/assets/yaml/us/ast_sector_x.yaml @@ -9,6 +9,7 @@ - '#include "sf64object.h"' - '#include "structs.h"' - '#include "sf64level.h"' + - '#include "sf64audio_external.h"' - '#include "sf64mesg.h"' D_SX_6000000: diff --git a/assets/yaml/us/ast_sector_y.yaml b/assets/yaml/us/ast_sector_y.yaml index 1c960f15..96661beb 100644 --- a/assets/yaml/us/ast_sector_y.yaml +++ b/assets/yaml/us/ast_sector_y.yaml @@ -9,6 +9,7 @@ - '#include "sf64object.h"' - '#include "structs.h"' - '#include "sf64level.h"' + - '#include "sf64audio_external.h"' - '#include "sf64mesg.h"' - '#include "sf64mesg.h"' diff --git a/assets/yaml/us/ast_sector_z.yaml b/assets/yaml/us/ast_sector_z.yaml index e5f1cf18..130a17c3 100644 --- a/assets/yaml/us/ast_sector_z.yaml +++ b/assets/yaml/us/ast_sector_z.yaml @@ -9,6 +9,7 @@ - '#include "sf64object.h"' - '#include "structs.h"' - '#include "sf64level.h"' + - '#include "sf64audio_external.h"' - '#include "sf64mesg.h"' # Sector Z: Combat Zone diff --git a/assets/yaml/us/ast_solar.yaml b/assets/yaml/us/ast_solar.yaml index dc1a21e0..835e03f5 100644 --- a/assets/yaml/us/ast_solar.yaml +++ b/assets/yaml/us/ast_solar.yaml @@ -9,6 +9,7 @@ - '#include "sf64object.h"' - '#include "structs.h"' - '#include "sf64level.h"' + - '#include "sf64audio_external.h"' - '#include "sf64mesg.h"' D_SO_6000000: diff --git a/assets/yaml/us/ast_titania.yaml b/assets/yaml/us/ast_titania.yaml index 051a4bff..3650f19b 100644 --- a/assets/yaml/us/ast_titania.yaml +++ b/assets/yaml/us/ast_titania.yaml @@ -9,6 +9,7 @@ - '#include "sf64object.h"' - '#include "structs.h"' - '#include "sf64level.h"' + - '#include "sf64audio_external.h"' - '#include "sf64mesg.h"' D_TI_6000000: diff --git a/assets/yaml/us/ast_training.yaml b/assets/yaml/us/ast_training.yaml index a05776c5..63938977 100644 --- a/assets/yaml/us/ast_training.yaml +++ b/assets/yaml/us/ast_training.yaml @@ -9,6 +9,7 @@ - '#include "sf64object.h"' - '#include "structs.h"' - '#include "sf64level.h"' + - '#include "sf64audio_external.h"' - '#include "sf64mesg.h"' D_TR_6000000: diff --git a/assets/yaml/us/ast_venom_1.yaml b/assets/yaml/us/ast_venom_1.yaml index 80a26529..a9d31f5e 100644 --- a/assets/yaml/us/ast_venom_1.yaml +++ b/assets/yaml/us/ast_venom_1.yaml @@ -8,6 +8,7 @@ - '#include "gfx.h"' - '#include "sf64object.h"' - '#include "sf64level.h"' + - '#include "sf64audio_external.h"' - '#include "structs.h"' - '#include "sf64mesg.h"' diff --git a/assets/yaml/us/ast_venom_2.yaml b/assets/yaml/us/ast_venom_2.yaml index 2d6ff062..04ee9f9d 100644 --- a/assets/yaml/us/ast_venom_2.yaml +++ b/assets/yaml/us/ast_venom_2.yaml @@ -8,6 +8,7 @@ - '#include "gfx.h"' - '#include "sf64object.h"' - '#include "sf64level.h"' + - '#include "sf64audio_external.h"' - '#include "structs.h"' D_VE2_6000000: diff --git a/assets/yaml/us/ast_versus.yaml b/assets/yaml/us/ast_versus.yaml index 4c94c08a..edc77d54 100644 --- a/assets/yaml/us/ast_versus.yaml +++ b/assets/yaml/us/ast_versus.yaml @@ -9,6 +9,7 @@ - '#include "sf64object.h"' - '#include "structs.h"' - '#include "sf64level.h"' + - '#include "sf64audio_external.h"' - '#include "sf64mesg.h"' D_versus_3000000: diff --git a/assets/yaml/us/ast_zoness.yaml b/assets/yaml/us/ast_zoness.yaml index 257f8697..26bd8f3c 100644 --- a/assets/yaml/us/ast_zoness.yaml +++ b/assets/yaml/us/ast_zoness.yaml @@ -9,6 +9,7 @@ - '#include "sf64object.h"' - '#include "structs.h"' - '#include "sf64level.h"' + - '#include "sf64audio_external.h"' - '#include "sf64mesg.h"' D_ZO_6000000: { type: TEXTURE, ctype: u8, format: IA8, width: 112, height: 28, offset: 0x6000000, symbol: D_ZO_6000000} diff --git a/config.yml b/config.yml index f4444753..9d3ff553 100644 --- a/config.yml +++ b/config.yml @@ -15,4 +15,5 @@ f7475fb11e7e6830f82883412638e8390791ab87: enums: - include/sf64object.h - include/sf64level.h - - include/sf64mesg.h \ No newline at end of file + - include/sf64mesg.h + - include/sf64audio_external.h \ No newline at end of file diff --git a/include/context.h b/include/context.h index c1de8618..3b1063b4 100644 --- a/include/context.h +++ b/include/context.h @@ -35,8 +35,8 @@ extern f32 gCsCamEyeZ; extern f32 gCsCamAtX; extern f32 gCsCamAtY; extern f32 gCsCamAtZ; -extern Vec3f D_ctx_801779D8; -extern Vec3f D_ctx_801779E8; +extern Vec3f gPlayerCamEye; +extern Vec3f gPlayerCamAt; extern bool gExpertMode; extern s32 D_ctx_80177A10[10]; extern f32 D_ctx_80177A48[10]; @@ -57,7 +57,7 @@ extern s32 D_ctx_80177C38[6]; extern s32 D_ctx_80177C58[6]; extern u8 gSoundMode; extern s32 gVolumeSettings[3]; -extern u16 D_ctx_80177C90; +extern u16 gBgmSeqId; extern u8 gLevelType; extern s32 D_ctx_80177CA0; extern UNK_TYPE F_80177CA8; @@ -91,7 +91,6 @@ extern s32 gRadioState; extern s32 D_ctx_801782A4; extern s32 D_Timer_801782AC; extern s32 D_Timer_801782B4; -// extern s32 D_ctx_801782B8; extern s32 D_ctx_801782C0; extern s32 D_ctx_801782C8; extern s32 D_ctx_801782D0; @@ -124,8 +123,8 @@ extern s32 D_ctx_8017837C; extern u32 D_ctx_80178380[4]; // player alphas extern s32 D_ctx_80178390[4]; // player reds extern s32 D_ctx_801783A0[4]; // player greens -extern s32 D_ctx_801783B0[4]; // player alphas -extern UNK_TYPE D_ctx_801783C0[4]; +extern s32 D_ctx_801783B0[4]; // player blues +extern s32 D_ctx_801783C0[4]; extern f32 D_ctx_801783D0; // something x translate extern f32 D_ctx_801783D4; // something y translate extern s32 gFogNear; //near @@ -149,8 +148,8 @@ extern f32 D_ctx_80178448; extern f32 D_ctx_80178450[3]; extern f32 D_ctx_80178460[3]; extern f32 D_ctx_80178470[3]; -extern f32 D_ctx_8017847C; -extern s32 D_ctx_80178480; +extern f32 gCameraShakeY; +extern s32 gCameraShake; extern s32 D_ctx_80178484; extern bool D_ctx_80178488; extern UNK_TYPE F_8017848C; @@ -213,21 +212,21 @@ extern s32 gLight2B; extern s32 D_ctx_80178570; // Color32 light color 2 modifier? extern s32 D_ctx_80178574; extern s32 D_ctx_80178578; -extern s32 D_80161A70; // Color32? -extern s32 D_80161A74; -extern s32 D_80161A78; -extern s32 D_80161A7C; -extern s32 D_80161A80; -extern s32 D_80161A84; -extern s32 D_80161A88; -extern s32 D_80161A8C; +extern s32 D_ctx_80161A70; // Color32? +extern s32 D_ctx_80161A74; +extern s32 D_ctx_80161A78; +extern s32 D_ctx_80161A7C; +extern s32 D_ctx_80161A80; +extern s32 D_ctx_80161A84; +extern s32 D_ctx_80161A88; +extern s32 D_ctx_80161A8C; extern u8 gGoldRingCount[4]; -extern u8 D_80161A94[4]; +extern u8 D_ctx_80161A94[4]; extern s32 gHitCount; extern s32 gSavedHitCount; extern s16 gLifeCount[4]; extern LaserStrength gLaserStrength[4]; -extern s32 D_80161AB8; +extern s32 D_ctx_80161AB8; extern UNK_TYPE F_80161AC0[16]; extern Object_80 gObjects80[50]; extern Object_4C gObjects4C[40]; diff --git a/include/fox_option.h b/include/fox_option.h index 69e4afb6..51877be6 100644 --- a/include/fox_option.h +++ b/include/fox_option.h @@ -201,7 +201,7 @@ void Option_8019BE7C(f32, f32, f32, f32 *, f32 *, f32 *); void Option_8019BF34(void); void Option_8019C04C(void); void Option_DrawCardLabel(OptionTexture arg0); -bool Option_8019C418(s32* arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5, s32 arg6, s32 arg7, UnkStruct_D_menu_801B9250* arg8); +bool Option_8019C418(s32* arg0, s32 arg1, bool arg2, s32 arg3, s32 arg4, s32 arg5, s32 arg6, s32 arg7, UnkStruct_D_menu_801B9250* arg8); s32 Option_8019C5A0(s32*); bool Option_8019C66C(f32* arg0, f32 arg1, f32 arg2, UnkStruct_D_menu_801B9250* arg3); void Option_8019C824(f32*); diff --git a/include/functions.h b/include/functions.h index f8721107..41678dcd 100644 --- a/include/functions.h +++ b/include/functions.h @@ -29,8 +29,8 @@ void func_360_8002F69C(Actor*); void func_360_8002FC00(Actor*); void func_360_8003088C(Actor*); bool func_360_80031900(Actor*); -void func_360_800319AC(Actor* this); -void func_360_80035448(Actor* actor); +void ActorAllRange_Update(Actor* this); +void ActorAllRange_Draw(Actor* actor); //fox_beam void func_beam_80038140(PlayerShot* shot); @@ -53,12 +53,12 @@ void func_bg_80042D38(void); // fox_boss void func_boss_80042EC0(Boss* boss); -void func_boss_80042FAC(Boss* boss); -void func_boss_80042FB8(Boss* boss); -void func_boss_80042FC4(Boss* boss); -void func_boss_80042FD0(Boss* boss); -void func_boss_80042FDC(Boss* boss); -void func_boss_80042FE8(Boss* boss); +void Boss299_Init(Boss* boss); +void Boss299_Update(Boss* boss); +void Boss299_Draw(Boss* boss); +void Boss300_Init(Boss* boss); +void Boss300_Update(Boss* boss); +void Boss300_Draw(Boss* boss); void func_boss_800430DC(f32, f32, f32, f32, f32, f32, f32, f32, f32, f32, s32, s32); void func_boss_8004319C(Player* player, f32 arg1, f32 arg2, f32 arg3); @@ -102,17 +102,17 @@ void func_edata_800596B0(Actor*); // fox_edisplay void Graphics_SetScaleMtx(f32); void func_edisplay_80059850(Object_4C*); -void func_edisplay_800598E8(Actor*); -void func_edisplay_80059A24(Actor*); -void func_edisplay_80059AEC(Object_80*); +void Actor201_Draw(Actor*); +void Actor202_Draw(Actor*); +void Obj39_Draw(Object_80*); void func_edisplay_80059B20(Object_80*); -void func_edisplay_80059BBC(Object_80*); -void func_edisplay_80059BF0(Actor*); +void Obj42_Draw(Object_80*); +void Actor196_Draw(Actor*); void func_edisplay_80059C34(Object_4C*); void func_edisplay_80059C40(Object_4C*); -void func_edisplay_80059F68(Item*); -void func_edisplay_80059FDC(Item*); -void func_edisplay_8005A094(Actor*); +void func_edisplay_80059F68(Object_80*); +void func_edisplay_80059FDC(Object_80*); +void Actor189_Draw(Actor*); void func_edisplay_8005ADAC(Actor*); void func_edisplay_8005B1E8(Actor*, s32); void func_edisplay_8005B388(Actor*); @@ -122,14 +122,14 @@ void func_edisplay_8005B7CC(Actor*); void func_edisplay_8005B848(Actor*); void func_edisplay_8005B9A4(Actor*); void func_edisplay_8005BA30(Actor*); -void func_edisplay_8005C5F0(Item*); -void func_edisplay_8005C900(Item*); -void func_edisplay_8005C9C0(Item*); -void func_edisplay_8005CA80(Item*); -void func_edisplay_8005CB44(Item*); -void func_edisplay_8005CC9C(Item*); -void func_edisplay_8005CDA8(Item*); -void func_edisplay_8005F030(f32*); +void ItemCheckpoint_Draw(Item*); +void ItemSilverRing_Draw(Item*); +void ItemSilverStar_Draw(Item*); +void ItemGoldRing_Draw(Item*); +void ItemBomb_Draw(Item*); +void ItemLasers_Draw(Item*); +void ItemMeteoWarp_Draw(Item*); +void Object_ClampSfxSource(f32*); void func_edisplay_8005F0E8(f32*, Vec3f*); void func_edisplay_8005F1EC(f32*); void func_edisplay_8005F290(f32*, Vec3f*); @@ -137,10 +137,10 @@ void func_edisplay_8005F670(Vec3f*); bool func_edisplay_8005F9DC(Vec3f*); // fox_enmy -void func_edisplay_80060714(s32 ); -void func_edisplay_8006089C(u8 ); +void Object_Draw(s32 ); +void Effect_Draw(u8 ); void TexturedLine_Draw(void); -void func_edisplay_80060D94(s32); +void TexturedLine_DrawPath(s32); void func_enmy_80060F30(f32* , u32 , s32 ); void Object_Kill(Object*, f32*); bool func_enmy_80060FE4(Vec3f*, f32); @@ -179,22 +179,22 @@ void func_enmy_80066EA8(Object_80*); void func_enmy_80066EF0(Item*); void func_enmy_800671D0(Item*); void func_enmy_800674B4(f32, f32, f32, f32, f32, f32, f32, f32); -void func_enmy_8006753C(Actor*); -void func_enmy_80067874(Actor*); +void ActorSupplies_Update(Actor*); +void ActorSupplies_Draw(Actor*); void func_enmy_80067A40(void); -void func_enmy_80067B1C(Item*); -void func_enmy_80067BEC(Item*); -void func_enmy_80067F6C(Item*); -void func_enmy_80068020(Item*); -void func_enmy_800685D8(Item*); -void func_enmy_800685F8(Item*); -void func_enmy_80068618(Item*); -void func_enmy_80068688(Item*); -void func_enmy_80068914(Item*); +void Item1up_Update(Item*); +void ItemPickup_Update(Item*); +void ItemLasers_Update(Item*); +void ItemSupplyRing_Update(Item*); +void ItemSilverStar_Update(Item*); +void ItemGoldRing_Update(Item*); +void ItemWingRepair_Update(Item*); +void ItemMeteoWarp_Update(Item*); +void ItemCheckpoint_Update(Item*); void func_enmy_80068C48(Item*); void func_enmy_80068C88(Item*); void func_enmy_80068FE0(Object_4C*); -void func_enmy_800690D0(s32, ObjectId); +void Object_Dying(s32, ObjectId); void func_enmy_80069924(Effect*); void func_enmy_800693E8(Actor*); void func_enmy_80069658(Boss*); @@ -212,31 +212,31 @@ void TexturedLine_UpdateAll(void); void Object_UpdateAll(void); //fox_enmy2 -void func_enmy2_8006A96C(Actor*); -void func_enmy2_8006A978(Actor*); -void func_enmy2_8006AA98(Object_80*); -void func_enmy2_8006AC08(Actor*); -void func_enmy2_8006AD18(Actor*); -void func_enmy2_8006B094(Actor*); -void func_enmy2_8006B0A0(Actor*); -void func_enmy2_8006B74C(Actor*); -void func_enmy2_8006B95C(Object_80*); -void func_enmy2_8006BB78(Actor*); -void func_enmy2_8006C008(Actor*); -void func_enmy2_8006D350(Object_80*); +void Actor237_Update(Actor*); +void Actor237_Draw(Actor*); +void Obj54_Update(Object_80*); +void Actor201_Update(Actor*); +void Actor202_Update(Actor*); +void Actor194_Update(Actor*); +void Actor194_Init(Actor*); +void Actor194_Draw(Actor*); +void Obj42_Update(Object_80*); +void Actor196_Update(Actor*); +void Actor189_Update(Actor*); +void Obj39_Update(Object_80*); void func_enmy2_8006ECBC(PlayerShotId, PlayerShot*, s32, f32, f32, f32, f32, f32, f32, f32, f32, f32); void func_enmy2_8006EEFC(s32, f32, f32, f32, f32, f32, f32, f32, f32, f32); void func_enmy2_8006EFA0(s32 unk0E4, f32 xPos, f32 yPos, f32 zPos, f32 arg4, f32 arg5, f32 arg6, f32 xRot, f32 yRot, f32 zRot); -void func_enmy2_8006F0D8(f32 xPos, f32 yPos, f32 zPos, f32 arg3); -void func_enmy2_8006F254(Actor*); -void func_enmy2_80072594(Actor*); -s32 func_enmy2_80074F90(Object_80*); -void func_enmy2_80074FF0(Actor*); +void ActorEvent_8006F0D8(f32 xPos, f32 yPos, f32 zPos, f32 arg3); +void ActorEvent_8006F254(Actor*); +void ActorEvent_Update(Actor*); +s32 Obj111_Draw(Object_80*); +void ActorEvent_Draw(Actor*); void func_enmy2_800763A4(Actor*); -void func_enmy2_8007717C(Actor*); -void func_enmy2_800771CC(Actor*); -void func_enmy2_80077218(Actor*); +void ActorEvent_Dying(Actor*); +void Actor234_Update(Actor*); +void Actor234_Draw(Actor*); // fox_effect s32 func_effect_80081B24(f32 xPos, f32 yPos, f32 zPos, f32 scale2); @@ -416,9 +416,9 @@ bool func_hud_8009092C(Actor*); void func_hud_800907C4(Boss*); bool func_hud_800915FC(Actor*); bool func_hud_800924E0(Actor*); -bool func_hud_800927A0(Actor*); -void func_hud_80092D48(Actor*); -void func_hud_80092EC0(Actor* actor); + +void ActorTeamBoss_Init(Actor*); +void ActorTeamBoss_Update(Actor* actor); void func_hud_80093164(Actor*); void func_hud_800935E8(Player*); void func_hud_800953A0(Actor*, s32); @@ -470,7 +470,7 @@ void func_play_800B2130(Player*); void func_play_800B2574(Player*); void func_play_800B56BC(Player*); void func_play_800B5D30(Player*, s32); -void func_play_800B5FBC(Player*, s32 , s32 ); +void func_play_800B5FBC(Player*, s32 , bool ); void func_play_800B63BC(Player*, s32); void func_play_800B6848(Player*, s32 ); void func_play_800B6BFC(Player*, s32 ); diff --git a/include/gfx.h b/include/gfx.h index c6a0f440..5702f65f 100644 --- a/include/gfx.h +++ b/include/gfx.h @@ -3,6 +3,7 @@ #include "libultra/ultra64.h" #include "sf64math.h" +#include "libc/stdbool.h" #define SCREEN_WIDTH 320 #define SCREEN_HEIGHT 240 @@ -72,7 +73,7 @@ typedef union { u16 array[SCREEN_HEIGHT][SCREEN_WIDTH]; } FrameBuffer; // size = 0x25800 -typedef s32 (*OverrideLimbDraw)(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* this); +typedef bool (*OverrideLimbDraw)(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* this); typedef void (*PostLimbDraw)(s32, Vec3f*, void*); typedef struct { diff --git a/include/i1.h b/include/i1.h index 4bd560d2..608abcc8 100644 --- a/include/i1.h +++ b/include/i1.h @@ -49,21 +49,21 @@ void Venom1_801934D0(Actor*); void Venom1_80193540(Object_80*); void Venom1_80194398(Boss*); void Venom1_801985E4(Boss*); -void Training_80198968(Item*); +void Training_ItemRing_Update(Item*); void OvlI1_CallFunction(s32, void*); void Corneria_80187530(Object_80*); void Corneria_8018753C(Object_80*); -void Corneria_801878D8(Boss *); +void Corneria_Boss292_Init(Boss *); void Corneria_8018B0B4(Actor *); -void Corneria_8018BE7C(Boss *); +void Corneria_Boss293_Init(Boss *); void Corneria_8018ED78(Boss*); void Venom1_801924A8(Object_80* ); void Venom1_8019250C(Actor *); void Venom1_80192CB0(Actor *); void Venom1_80192EA4(Actor *); void Venom1_801933B4(Actor *); -void Venom1_801935CC(Boss *); +void Venom1_Boss319_Init(Boss *); void Venom1_80198310(Boss *); void Venom1_80198594(Boss *); void Training_801988E0(void); diff --git a/include/i2.h b/include/i2.h index 7e6dfd2a..c4f43be6 100644 --- a/include/i2.h +++ b/include/i2.h @@ -16,7 +16,7 @@ void SectorX_80194728(Player*); void OvlI2_CallFunction(s32, void*); void Meteo_80187B08(Actor *); -void Meteo_80188A40(Boss *); +void Meteo_Boss297_Init(Boss *); void Meteo_8018CCF8(Actor *); void Meteo_8018756C(Actor*); diff --git a/include/i3.h b/include/i3.h index f978e6b4..261519fc 100644 --- a/include/i3.h +++ b/include/i3.h @@ -19,7 +19,7 @@ void Aquas_801AB9B0(Player*); void Aquas_801BE0F0(Actor*); void OvlI3_CallFunction(s32, void*); -void Area6_80187754(Boss *); +void Area6_BossA6_Init(Boss *); void Area6_80187944(Boss*); void Area6_8018C54C(Boss*); void Area6_8018DF74(Player *player); @@ -45,7 +45,7 @@ void Zoness_80192834(Actor* actor); void Zoness_80192C18(Actor* actor); void Zoness_80192E64(Actor* actor); void Zoness_80193240(Actor* actor); -void Zoness_801932AC(Boss* bossZO); +void Zoness_BossZo_Init(Boss* bossZO); void Zoness_801949DC(Boss* bossZO); void Zoness_80194A84(Boss* bossZO); void Zoness_8019969C(Actor* actor); @@ -69,7 +69,7 @@ void Zoness_8019C454(Actor* actor); void Zoness_8019C83C(Actor* actor); void Zoness_8019CBEC(Actor* actor); void Zoness_8019CE58(Actor* actor); -void Zoness_8019D060(Actor* actor); +void Zoness_Actor247_Init(Actor* actor); void Zoness_8019D15C(Actor* actor); void Zoness_8019D3C4(Actor* actor); void Zoness_8019D428(Player* player); @@ -111,7 +111,7 @@ void Aquas_801AFA5C(Actor*); void Aquas_801B099C(Actor*); void Aquas_801B0B60(Actor*); void Aquas_801B0EC0(Actor*); -void Aquas_801B10F8(Boss*); +void Aquas_BossAq_Init(Boss*); void Aquas_801B134C(Boss*); void Aquas_801B4D84(Boss*); void Aquas_801B504C(Actor*); diff --git a/include/i4.h b/include/i4.h index cce7fc58..1034e586 100644 --- a/include/i4.h +++ b/include/i4.h @@ -26,7 +26,7 @@ void Fortuna_8018BA2C(void); void Bolse_8018C158(Actor*); void Bolse_80191ED8(void); void Bolse_80192264(void); -void Katina_80193CA4(Boss *); +void Katina_Boss316_Init(Boss *); void Katina_80198594(Actor*); void Katina_80198930(void); void SectorZ_80199900(Actor *, s32); diff --git a/include/i5.h b/include/i5.h index 2d2ebdb7..4a4fe28a 100644 --- a/include/i5.h +++ b/include/i5.h @@ -30,14 +30,14 @@ void Titania_80188F30(void); void Titania_80189B80(Actor *); void Titania_8018ADC4(Actor *); void Titania_8018B720(Actor *); -void Titania_8018B96C(Actor *); +void Titania_Actor231_Init(Actor *); void Titania_8018BFB0(Actor *); void Titania_8018E3B0(Actor *); void Titania_8018E3CC(Actor *); void Titania_8018E5E8(Actor *); void Titania_8018EFF0(Object_4C *); void Titania_8018F0D8(Object_80 *); -void Titania_8018FA48(Boss *); +void Titania_Boss306_Init(Boss *); void Titania_801990DC(Boss *); void Macbeth_80199920(void); void Macbeth_80199F8C(Actor *); @@ -57,8 +57,8 @@ s32 Ground_801B6E20(f32, f32, f32 *, f32 *, f32 *); void Macbeth_801AD144(PlayerShot*); void Titania_80189120(f32, f32, f32, f32, f32); bool Macbeth_801A3C20(f32); -s32 Macbeth_801A3300(Player*, f32, f32); -s32 Macbeth_801A3790(Player*, f32, f32); +bool Macbeth_801A3300(Player*, f32, f32); +bool Macbeth_801A3790(Player*, f32, f32); void Titania_80188F60(Effect*); void Titania_80188FA8(Effect*); diff --git a/include/i6.h b/include/i6.h index 774f9a2d..aac0db72 100644 --- a/include/i6.h +++ b/include/i6.h @@ -30,13 +30,13 @@ void Andross_801888F4(Actor *); void Andross_80189214(void); void Andross_8018BDD8(void); void Andross_8018C390(Player*); -void Andross_8018D16C(Boss *); +void Andross_Boss320_Init(Boss *); void Andross_801961AC(void); void Venom2_80196314(Actor*); void Venom2_80196968(void); -void SectorY_80197CC4(Boss *); -void SectorY_801A3BD4(Actor*); -void SectorY_801A4CB0(Actor*); +void SectorY_Boss314_Init(Boss *); +void SectorY_Actor204_Update(Actor*); +void SectorY_Actor204_Draw(Actor*); void Turret_801A5AD4(Player*); void Turret_801A5FC0(Player*); void Turret_801A6164(Player *); diff --git a/include/libc/stdbool.h b/include/libc/stdbool.h index 3df6f660..f3225b8a 100644 --- a/include/libc/stdbool.h +++ b/include/libc/stdbool.h @@ -1,11 +1,13 @@ #ifndef LIBC_STDBOOL_H #define LIBC_STDBOOL_H +#include "PR/ultratypes.h" + #define __bool_true_false_are_defined 1 #ifndef __cplusplus -#define bool s32 +typedef int bool; #define false 0 #define true 1 diff --git a/include/prevent_context_reordering.h b/include/prevent_context_reordering.h index 6aee0559..3dbec6b7 100644 --- a/include/prevent_context_reordering.h +++ b/include/prevent_context_reordering.h @@ -10,19 +10,19 @@ extern int Dummyhalf; // struct Dummy5 {int x;}; // struct Dummy6 {int x;}; // struct Dummy7 {int x;}; -struct Dummy8 {int x;}; -struct Dummy9 {int x;}; -struct Dummy10 {int x;}; -struct Dummy11 {int x;}; -struct Dummy12 {int x;}; -struct Dummy13 {int x;}; -struct Dummy14 {int x;}; -struct Dummy15 {int x;}; -struct Dummy16 {int x;}; -struct Dummy17 {int x;}; -struct Dummy18 {int x;}; -struct Dummy19 {int x;}; -struct Dummy20 {int x;}; +// struct Dummy8 {int x;}; +// struct Dummy9 {int x;}; +// struct Dummy10 {int x;}; +// struct Dummy11 {int x;}; +// struct Dummy12 {int x;}; +// struct Dummy13 {int x;}; +// struct Dummy14 {int x;}; +// struct Dummy15 {int x;}; +// struct Dummy16 {int x;}; +// struct Dummy17 {int x;}; +// struct Dummy18 {int x;}; +// struct Dummy19 {int x;}; +// struct Dummy20 {int x;}; struct Dummy21 {int x;}; struct Dummy22 {int x;}; struct Dummy23 {int x;}; diff --git a/include/sf64audio_external.h b/include/sf64audio_external.h index 817fd98f..23ae1fba 100644 --- a/include/sf64audio_external.h +++ b/include/sf64audio_external.h @@ -14,79 +14,79 @@ typedef enum { /* 3 */ SOUNDMODE_MONO } SoundMode; -typedef enum { - SEQ_ID_0, - SEQ_ID_1, - SEQ_ID_2, - SEQ_ID_3, - SEQ_ID_4, - SEQ_ID_5, - SEQ_ID_6, - SEQ_ID_7, - SEQ_ID_8, - SEQ_ID_9, - SEQ_ID_10, - SEQ_ID_11, - SEQ_ID_12, - SEQ_ID_13, - SEQ_ID_14, - SEQ_ID_15, - SEQ_ID_16, - SEQ_ID_17, - SEQ_ID_18, - SEQ_ID_19, - SEQ_ID_20, - SEQ_ID_21, - SEQ_ID_22, - SEQ_ID_23, - SEQ_ID_24, - SEQ_ID_25, - SEQ_ID_26, - SEQ_ID_27, - SEQ_ID_28, - SEQ_ID_29, - SEQ_ID_30, - SEQ_ID_31, - SEQ_ID_32, - SEQ_ID_33, - SEQ_ID_34, - SEQ_ID_35, - SEQ_ID_36, - SEQ_ID_37, - SEQ_ID_38, - SEQ_ID_39, - SEQ_ID_40, - SEQ_ID_41, - SEQ_ID_42, - SEQ_ID_43, - SEQ_ID_44, - SEQ_ID_45, - SEQ_ID_46, - SEQ_ID_47, - SEQ_ID_48, - SEQ_ID_49, - SEQ_ID_50, - SEQ_ID_51, - SEQ_ID_52, - SEQ_ID_53, - SEQ_ID_54, - SEQ_ID_55, - SEQ_ID_56, - SEQ_ID_57, - SEQ_ID_58, - SEQ_ID_59, - SEQ_ID_60, - SEQ_ID_61, - SEQ_ID_62, - SEQ_ID_63, - SEQ_ID_64, - SEQ_ID_65, - SEQ_ID_66, - SEQ_ID_67, - SEQ_ID_68, - SEQ_ID_69, +typedef enum BgmSeqIds { + /* 0 */ SEQ_ID_SFX, + /* 1 */ SEQ_ID_VOICE, + /* 2 */ SEQ_ID_CORNERIA, + /* 3 */ SEQ_ID_METEO, + /* 4 */ SEQ_ID_TITANIA, + /* 5 */ SEQ_ID_SECTOR_X, + /* 6 */ SEQ_ID_ZONESS, + /* 7 */ SEQ_ID_AREA_6, + /* 8 */ SEQ_ID_VENOM_1, + /* 9 */ SEQ_ID_SECTOR_Y, + /* 10 */ SEQ_ID_FORTUNA, + /* 11 */ SEQ_ID_SOLAR, + /* 12 */ SEQ_ID_BOLSE, + /* 13 */ SEQ_ID_KATINA, + /* 14 */ SEQ_ID_AQUAS, + /* 15 */ SEQ_ID_SECTOR_Z, + /* 16 */ SEQ_ID_MACBETH, + /* 17 */ SEQ_ID_ANDROSS, + /* 18 */ SEQ_ID_CO_BOSS_1, + /* 19 */ SEQ_ID_ME_BOSS, + /* 20 */ SEQ_ID_TI_BOSS, + /* 21 */ SEQ_ID_SX_BOSS, + /* 22 */ SEQ_ID_ZO_BOSS, + /* 23 */ SEQ_ID_A6_BOSS, + /* 24 */ SEQ_ID_VE_BOSS, + /* 25 */ SEQ_ID_SY_BOSS, + /* 26 */ SEQ_ID_UNK_26, + /* 27 */ SEQ_ID_SO_BOSS, + /* 28 */ SEQ_ID_BO_BOSS, + /* 29 */ SEQ_ID_KA_BOSS, + /* 30 */ SEQ_ID_AQ_BOSS, + /* 31 */ SEQ_ID_SZ_BOSS, + /* 32 */ SEQ_ID_MA_BOSS, + /* 33 */ SEQ_ID_AND_BOSS, + /* 34 */ SEQ_ID_TITLE, + /* 35 */ SEQ_ID_OPENING, + /* 36 */ SEQ_ID_MENU, + /* 37 */ SEQ_ID_CO_INTRO, + /* 38 */ SEQ_ID_GOOD_END, + /* 39 */ SEQ_ID_DEATH, + /* 40 */ SEQ_ID_GAME_OVER, + /* 41 */ SEQ_ID_UNK_41, + /* 42 */ SEQ_ID_ENDING, + /* 43 */ SEQ_ID_STAR_WOLF, + /* 44 */ SEQ_ID_INTRO_44, + /* 45 */ SEQ_ID_INTRO_45, + /* 46 */ SEQ_ID_VERSUS, + /* 47 */ SEQ_ID_VS_HURRY, + /* 48 */ SEQ_ID_CO_BOSS_2, + /* 49 */ SEQ_ID_BAD_END, + /* 50 */ SEQ_ID_ME_INTRO, + /* 51 */ SEQ_ID_INTRO_51, + /* 52 */ SEQ_ID_UNK_52, + /* 53 */ SEQ_ID_UNK_53, + /* 54 */ SEQ_ID_KATT, + /* 55 */ SEQ_ID_BILL, + /* 56 */ SEQ_ID_VS_MENU, + /* 57 */ SEQ_ID_UNK_57, + /* 58 */ SEQ_ID_WARP_ZONE, + /* 59 */ SEQ_ID_UNK_59, + /* 60 */ SEQ_ID_WORLD_MAP, + /* 61 */ SEQ_ID_AND_BRAIN, + /* 62 */ SEQ_ID_TO_ANDROSS, + /* 63 */ SEQ_ID_TRAINING, + /* 64 */ SEQ_ID_VE_CLEAR, + /* 65 */ SEQ_ID_BOSS_RESUME, + /* 66 */ SEQ_ID_MAX, + /* -1 */ SEQ_ID_NONE = 0xFFFF, } BgmSeqIds; +#define SEQ_FLAG 0x8000 + extern f32 gDefaultSfxSource[]; extern f32 gDefaultMod; extern s8 gDefaultReverb; @@ -118,8 +118,8 @@ void func_8001D0B4(f32* sfxSource, u32 sfxId, f32 freqMod); void func_8001D10C(f32* sfxSource, u32 sfxId); void func_8001D15C(u8 arg0); void func_8001D1C8(u8 arg0, u8 arg1); -void func_8001D2FC(f32* sfxSource, u16 arg1); -void func_8001D3A0(f32* sfxSource, u16 arg1); +void Audio_PlayEventSfx(f32* sfxSource, u16 arg1); +void Audio_StopEventSfx(f32* sfxSource, u16 arg1); void Audio_SetBaseSfxReverb(s8 reverb); void Audio_SetBgmParam(s8 bgmParam); void Audio_PlaySequence(u8 seqPlayId, u16 seqId, u8 fadeinTime, u8 bgmParam); @@ -129,7 +129,7 @@ void func_8001D638(u8 arg0); void func_8001D6DC(u8 arg0); void func_8001D8A8(u8 audioType, u8 volume); void Audio_PlaySoundTest(u8 enable); -void Audio_PlaySequenceDistorted(u8 seqPlayId, u16 seqId, u16 distortion, u8 duration, u8 unused); +void Audio_PlaySequenceDistorted(u8 seqPlayId, u16 seqId, u16 distortion, u8 fadeinTime, u8 unused); void Audio_PlaySoundTestTrack(u8 trackNumber); void Audio_FadeOutAll(u8 fadeoutTime); void Audio_KillAllSfx(void); diff --git a/include/sf64audio_provisional.h b/include/sf64audio_provisional.h index 5f4b5e0a..48d96686 100644 --- a/include/sf64audio_provisional.h +++ b/include/sf64audio_provisional.h @@ -7,6 +7,7 @@ #define SF64_AUDIO_H #include "PR/ultratypes.h" +#include "sf64audio_external.h" typedef void (*AudioCustomUpdateFunction)(void); @@ -28,7 +29,7 @@ typedef void (*AudioCustomUpdateFunction)(void); // Also known as "Pulses Per Quarter Note" or "Tatums Per Beat" #define SEQTICKS_PER_BEAT 48 -#define IS_SEQUENCE_CHANNEL_VALID(ptr) ((u32) (ptr) != (u32) &gAudioCtx.sequenceChannelNone) +#define IS_SEQUENCE_CHANNEL_VALID(ptr) ((u32) (ptr) != (u32) &gSeqChannelNone) #define SEQ_NUM_CHANNELS 16 #define SEQ_IO_VAL_NONE -1 @@ -56,7 +57,7 @@ typedef void (*AudioCustomUpdateFunction)(void); // Both left and right channels #define DMEM_2CH_SIZE (2 * DMEM_1CH_SIZE) -#define AIBUF_LEN (88 * SAMPLES_PER_FRAME) // number of samples +#define AIBUF_LEN (170 * SAMPLES_PER_FRAME) // number of samples #define AIBUF_SIZE (AIBUF_LEN * SAMPLE_SIZE) // number of bytes // Filter sizes @@ -69,13 +70,6 @@ typedef void (*AudioCustomUpdateFunction)(void); #define AUDIO_RELOCATED_ADDRESS_START K0BASE -typedef enum { - /* 0 */ SOUNDMODE_STEREO, - /* 1 */ SOUNDMODE_HEADSET, - /* 2 */ SOUNDMODE_SURROUND, - /* 3 */ SOUNDMODE_MONO -} SoundMode; - typedef enum { /* 0 */ ADSR_STATE_DISABLED, /* 1 */ ADSR_STATE_INITIAL, @@ -859,20 +853,18 @@ typedef struct { } SampleBankRelocInfo; // size = 0x18 typedef struct { - /* 0x0 */ u8 type; - /* 0x1 */ u8 unk_1; - /* 0x2 */ u16 unk_2; - /* 0x4 */ u8 unk_4; - /* 0x5 */ u8 unk_5; - /* 0x6 */ u8 unk_6; - /* 0x8 */ u16 unk_8; + /* 0x0 */ u8 opCode; + /* 0x1 */ u8 seqPlayId; + /* 0x2 */ u16 seqId; + /* 0x5 */ u16 fadeoutTime; + /* 0x6 */ u8 bgmParam; + /* 0x8 */ u16 timer; } PlaylistCmd; // size:0xA typedef struct { - /* 0x0 */ u16 unk_0; + /* 0x0 */ u16 seqId; /* 0x2 */ u16 unk_2; - /* 0x4 */ u8 unk_4; - /* 0x5 */ u8 unk_5; + /* 0x4 */ u8 bgmParam; } SoundTestTrack; // size: 0x6 typedef struct { @@ -1018,182 +1010,75 @@ typedef struct { ((bit4)<<27)|((bit5)<<23)|((bit6)<<23)|((bit8)<<23)|((bit9)<<22)|\ ((bit10)<<21)|((bit11)<<20)|((bit12)<<19)|((bit13)<<18)) +// audio_synthesis void func_80008780(f32 *, s32, f32 *); -void func_80009A2C(s32 updateIndex, s32 noteIndex); -void func_80009AAC(s32 updateIndex); -Acmd* func_8000A700(s32 noteIndex, NoteSubEu* noteSub, NoteSynthesisState* synthState, s16* aiBuf, s32 aiBufLen, Acmd* aList, s32 updateIndex); -Acmd* func_8000A25C(s16* aiBuf, s32 aiBufLen, Acmd* aList, s32 updateIndex); -Acmd* func_800098DC(Acmd* aList, u16 dmem, u16 startPos, s32 size, s32 reverbIndex); -Acmd* func_80009984(Acmd* aList, u16 dmem, u16 startPos, s32 size, s32 reverbIndex); Acmd* func_80009B64(Acmd* aList, s32* cmdCount, s16* aiBufStart, s32 aiBufLen); -Acmd* func_80009D78(Acmd* aList, s32 aiBufLen, s16 reverbIndex, s16 updateIndex); -Acmd* func_8000A128(Acmd* aList, s16 reverbIndex, s16 updateIndex); -Acmd* func_8000B3F0(Acmd* aList, NoteSubEu* noteSub, NoteSynthesisState* synthState, s32 numSamplesToLoad); -Acmd* func_8000B480(Acmd* aList, NoteSynthesisState* synthState, s32 size, u16 pitch, u16 inpDmem, u32 resampleFlags); -Acmd* func_8000B51C(Acmd* aList, NoteSubEu* noteSub, NoteSynthesisState* synthState, s32 aiBufLen, u16 dmemSrc, s32 delaySide, s32 flags); -Acmd* func_8000B98C(Acmd* aList, NoteSubEu* noteSub, NoteSynthesisState* synthState, s32 size, s32 flags, s32 delaySide); -void func_80013400(SequenceChannel* channel, s32 updateVolume); +// audio_effects void func_800135A8(SequencePlayer* seqplayer); -f32 func_80013708(Portamento* portamento); -s16 func_800137DC(VibratoState* vibrato); -f32 func_80013820(VibratoState* vibrato); void func_80013A18(Note* note); void func_80013A84(Note* note); void func_80013B6C(AdsrState* adsr, EnvelopePoint* envelope, s16* arg2); f32 func_80013B90(AdsrState* adsr); -void AudioHeap_ResetLoadStatus(void); +// audio_heap void AudioHeap_DiscardFont(s32 fontId); -void AudioHeap_DiscardSequence(s32 seqId); -void* AudioHeap_AllocZeroed(AudioAllocPool* pool, u32 size); void* AudioHeap_Alloc(AudioAllocPool* pool, u32 size); void AudioHeap_InitPool(AudioAllocPool* pool, void* ramAddr, u32 size); -void AudioHeap_InitPersistentCache(AudioPersistentCache* persistent); -void AudioHeap_InitTemporaryCache(AudioTemporaryCache* temporary); -void AudioHeap_ResetPool(AudioAllocPool* pool); void AudioHeap_InitMainPools(s32 initPoolSize); -void AudioHeap_InitSessionPools(AudioSessionPoolSplit* split); -void AudioHeap_InitCachePools(AudioCachePoolSplit* split); -void AudioHeap_InitPersistentPoolsAndCaches(AudioCommonPoolSplit* split); -void AudioHeap_InitTemporaryPoolsAndCaches(AudioCommonPoolSplit* split); void* AudioHeap_AllocCached(s32 tableType, s32 size, s32 cache, s32 id); s32 AudioHeap_SearchCaches(s32 tableType, s32 cache, s32 id); -void* AudioHeap_SearchRegularCaches(s32 tableType, s32 cache, s32 id); -void func_8000CAF4(f32 p, f32 q, u16* out); -void AudioHeap_UpdateReverbs(void); -void AudioHeap_ClearCurrentAiBuffer(void); s32 AudioHeap_ResetStep(void); -void AudioHeap_Init(void); void* AudioHeap_SearchPermanentCache(s32 tableType, s32 id); u8* AudioHeap_AllocPermanent(s32 tableType, s32 id, u32 size); void* AudioHeap_AllocTemporarySampleCache(s32 size, s32 fontId, s32 sampleAddr, s8 medium); void* AudioHeap_AllocPersistentSampleCache(s32 size, s32 fontId, s32 sampleAddr, s8 medium); -void* AudioHeap_AllocPersistentSampleCache_2(u32 size, s32 fontId, s32 sampleAddr, s8 medium); -void AudioHeap_InitSampleCaches(u32 persistentSampleCacheSize, u32 temporarySampleCacheSize); -SampleCacheEntry* AudioHeap_AllocTemporarySampleCacheEntry(s32 size); -void AudioHeap_DiscardSampleCacheEntry(SampleCacheEntry* entry); -void AudioHeap_UnapplySampleCache(SampleCacheEntry* entry, Sample* sample); -SampleCacheEntry* AudioHeap_AllocPersistentSampleCacheEntry(u32 size); -void AudioHeap_DiscardSampleCaches(void); - +// audio_load void AudioLoad_DecreaseSampleDmaTtls(void); +void AudioLoad_ProcessLoads(s32 resetStatus); +void AudioLoad_SyncInitSeqPlayer(s32 playerIdx, s32 seqId, s32 arg2); void* AudioLoad_DmaSampleData(u32 devAddr, u32 size, u32 arg2, u8* dmaIndexRef, s32 medium); void AudioLoad_InitSampleDmaBuffers(s32 numNotes); -void AudioLoad_InitTable(AudioTable* table, u8* romAddr, u16 unkMediumParam); -void* AudioLoad_SyncLoadSeqFonts(s32 seqId, u32* outFontId); void AudioLoad_SyncLoadSeqParts(s32 seqId, s32 flags); -s32 AudioLoad_SyncLoadSample(Sample* sample, s32 fontId); s32 AudioLoad_SyncLoadInstrument(s32 fontId, s32 instId, s32 drumId); void AudioLoad_AsyncLoadSampleBank(s32 sampleBankId, s32 nChunks, s32 retData, OSMesgQueue* retQueue); void AudioLoad_AsyncLoadSeq(s32 seqId, s32 nChunks, s32 retData, OSMesgQueue* retQueue); u8* AudioLoad_GetFontsForSequence(s32 seqId, u32* outNumFonts); void AudioLoad_DiscardSeqFonts(s32 seqId); -s32 AudioLoad_DiscardFont(s32 fontId); -void AudioLoad_SyncInitSeqPlayer(s32 playerIdx, s32 seqId, s32 arg2); -void AudioLoad_SyncInitSeqPlayerInternal(s32 playerIdx, s32 seqId, s32 arg2); -void* AudioLoad_SyncLoadSeq(s32 seqId); -void* AudioLoad_SyncLoadSampleBank(u32 sampleBankId, s32* outMedium); -void* AudioLoad_SyncLoadFont(s32 fontId); -void* AudioLoad_SyncLoad(u32 tableType, u32 id, s32* didAllocate); -s32 AudioLoad_GetLoadTableIndex(s32 tableType, u32 entryId); -void* AudioLoad_SearchCaches(s32 tableType, s32 id); -AudioTable* AudioLoad_GetLoadTable(s32 tableType); -void AudioLoad_RelocateFont(s32 fontId, u32 fontBaseAddr, void* relocData); -void AudioLoad_SyncDma(u32 devAddr, u8* ramAddr, u32 size, s32 medium); -void AudioLoad_SyncDmaUnkMedium(u32 devAddr, u8* ramAddr, u32 size, s32 unkMediumParam); -s32 AudioLoad_Dma(OSIoMesg* mesg, u32 priority, s32 direction, u32 devAddr, void* ramAddr, u32 size, OSMesgQueue* retQueue, s32 medium, const char* dmaType); -s32 func_8000FC7C(u32 unkMediumParam, u32* addrPtr); -void func_8000FC8C(s32 unkParam2, u32 addr, u8* ramAddr, u32 size); -void AudioLoad_SyncLoadSimple(u32 tableType, u32 id); -void* AudioLoad_AsyncLoadInner(s32 tableType, s32 id, s32 nChunks, s32 retData, OSMesgQueue* retQueue); -void AudioLoad_ProcessLoads(s32 resetStatus); -void AudioLoad_Init(void); s32 AudioLoad_SlowLoadSample(s32 fontId, u8 instId, s8* status); -Sample* AudioLoad_GetFontSample(s32 fontId, s32 instId); -void AudioLoad_Stub_10800(void); -void AudioLoad_FinishSlowLoad(AudioSlowLoad* slowLoad); -void AudioLoad_ProcessSlowLoads(s32 resetStatus); -void AudioLoad_DmaSlowCopy(AudioSlowLoad* slowLoad, s32 size); -void AudioLoad_DmaSlowCopyUnkMedium(u32 devAddr, u8* ramAddr, u32 size, s32 unkMediumParam); -AudioAsyncLoad* AudioLoad_StartAsyncLoad(u32 devAddr, u8* ramAddr, u32 size, s32 medium, s32 nChunks, OSMesgQueue* retQueue, u32 retMesg); -void AudioLoad_ProcessAsyncLoads(s32 resetStatus); -void AudioLoad_ProcessAsyncLoad(AudioAsyncLoad* asyncLoad, s32 resetStatus); -void AudioLoad_AsyncDma(AudioAsyncLoad* asyncLoad, u32 size); -void AudioLoad_AsyncDmaUnkMedium(u32 devAddr, u8* ramAddr, u32 size, s32 unkMediumParam); -void AudioLoad_RelocateSample(TunedSample* tSample, u32 fontDataAddr, SampleBankRelocInfo* relocInfo); -s32 AudioLoad_RelocateFontAndPreloadSamples(s32 fontId, u32 fontDataAddr, SampleBankRelocInfo* relocData, s32 isAsync); -s32 AudioLoad_ProcessSamplePreloads(s32 resetStatus); -s32 AudioLoad_AddToSampleSet(Sample* sample, s32 numSamples, Sample** sampleSet); -s32 AudioLoad_GetSamplesForFont(s32 fontId, Sample** sampleSet); - -void func_80011890(Note* note, NoteAttributes* noteAttr); -void func_80011C58(Note* note, f32); +// audio_playback TunedSample* func_80011D10(Instrument* instrument, s32 arg1); Instrument* Audio_GetInstrument(s32, s32); Drum* Audio_GetDrum(s32, s32); -void func_80011EB8(Note* note); void func_80011F4C(Note* note); void func_80011FA8(void); -void func_80012438(SequenceLayer* layer, s32); void func_8001266C(SequenceLayer* layer); -void func_8001268C(SequenceLayer* layer); -s32 func_800126AC(Note* note, SequenceLayer* layer, s32); void func_800127B0(Note* note, SequenceLayer* layer); -void func_80012854(AudioListItem* item); void func_80012864(NotePool* pool); void func_800128B4(void); void func_80012964(NotePool* pool); void func_80012AC4(NotePool* pool, s32); -void func_80012C00(AudioListItem* item1, AudioListItem* item2); void func_80012C40(Note* note); -Note* func_80012C6C(AudioListItem* item, s32); -void func_80012CEC(Note* note, SequenceLayer* layer); -void func_80012E28(Note* note, SequenceLayer* layer); -void func_80012E5C(Note* note, SequenceLayer* layer); -Note *func_80012E88(NotePool* pool, SequenceLayer* layer); -Note *func_80012ED4(NotePool* pool, SequenceLayer* layer); -Note *func_80012F24(NotePool* pool, SequenceLayer* layer); Note *func_8001301C(SequenceLayer* layer); void func_800132E8(void); - -void func_80013EA0(SequenceChannel* channel); -s32 func_80013FC4(SequenceChannel* channel, s32 arg1); -void func_800140D0(SequenceLayer* layer); -void func_8001410C(SequenceChannel* channel, s32 arg1); +// audio_seqplayer void func_8001415C(SequenceChannel* channel); -SequenceChannel* func_800141C8(void); -void func_80014244(SequencePlayer* seqPlayer, u16 arg1); -void func_80014370(SequencePlayer* seqPlayer, u16 arg1); -void func_80014440(SequencePlayer* seqPlayer, u8 arg1, u8* arg2); void func_800144E4(SequencePlayer* seqPlayer); void func_800145BC(AudioListItem* list, AudioListItem* item); void* func_800145FC(AudioListItem* list); -void func_8001463C(void); -u8 func_800146C0(SeqScriptState* state); -s16 func_800146D4(SeqScriptState* state); -u16 func_80014704(SeqScriptState* state); -void func_80014748(SequenceLayer* layer); -u8 func_800152C0(SequenceChannel* channel, u8 arg1, Instrument** instrument, AdsrSettings* adsrSettings); -void func_80015330(SequenceChannel* channel, u8 arg1); -// void func_800153C4(SequenceChannel* channel, u8 arg1); -void func_800153E8(SequenceChannel* channel); -void func_80015FD4(SequencePlayer* seqPlayer); void func_8001678C(s32 arg0); void func_80016804(s32 arg0); void func_800168BC(void); - -SPTask* AudioThread_CreateTask(void); +// audio_thread void AudioThread_ScheduleProcessCmds(void); u32 AudioThread_GetAsyncLoadStatus(u32 *); u8* AudioThread_GetFontsForSequence(s32 seqId, u32* outNumFonts); s32 func_8001ED34(void); void AudioThread_ResetAudioHeap(s32); -void AudioThread_PreNMIReset(void); void AudioThread_Init(void); extern AudioTable gSampleBankTableInit; @@ -1204,60 +1089,6 @@ extern AudioTable gSoundFontTableInit; // extern AudioTableEntry gSoundFontTableInitEntries[]; extern u8 gSeqFontTableInit[]; -extern u8 gSamplesPerWavePeriod[4]; - -extern u8 gChannelsPerBank[5][5]; -extern u8 gUsedChannelsPerBank[5][5]; -extern u8 gSfxRequestWriteIndex; -extern u8 gSfxRequestReadIndex; -extern u8 gSfxChannelLayout; -extern u16 D_800C5D24; -extern f32 gDefaultSfxSource[3]; -extern f32 gDefaultMod; -extern s8 gDefaultReverb; -extern s32 gAudioFrameCounter; -extern u8 gSeqCmdWritePos; -extern u8 gSeqCmdReadPos; -extern u8 gStartSeqDisabled; -extern u8 gSoundModeList[4]; -extern u8 sNewAudioSpecId; -extern u8 D_800C5D58; - -// file split? - -extern s8 sBaseReverb; -extern s8 sAudioSpecReverb; -extern u8 sVolumeSettings[3]; -extern u8 D_800C5D6C[29][7]; -extern s8 D_800C5E38[29]; -extern u32 D_800C5E58[5]; - -// file split? - -extern u8 D_800C5E70; -extern f32 gSfxFreqMod; -extern f32 gSfxVolMod; -extern u8 gPlaylistIndex; -extern s32 gPlaylistTimer; -extern u8 gPlaylistCmdIndex; -extern u32 D_800C5E88[]; -extern SoundTestTrack D_800C5EE4[]; -extern PlaylistCmd gPlaylists[][100]; - -// file split? - -extern f32 D_800C7380; -extern u32 sNextVoiceId; -extern u32 sCurrentVoiceId; -extern u8 sSetNextVoiceId; -extern u8 D_800C7390; -extern u8 sMuteBgmForVoice; -extern s32 D_800C7398[32]; -extern f32 D_800C7418; -extern f32 D_800C741C[32]; -extern f32 D_800C749C[13]; - - extern AudioSpec gAudioSpecs[]; extern s16 gSeqTicksPerBeat; extern s32 gAudioHeapSize; @@ -1267,66 +1098,6 @@ extern u16 gSequenceMedium; extern u16 gSoundFontMedium; extern u16 gSampleBankMedium; - - -// extern u8 gThreadCmdWritePos; -// extern u8 gThreadCmdReadPos; -extern OSMesgQueue* gAudioTaskStartQueue; -extern OSMesgQueue* gThreadCmdProcQueue; -extern OSMesgQueue* gAudioUnkQueue; -extern OSMesgQueue* gAudioResetQueue; -extern s32 gMaxAbiCmdCnt; -extern SPTask* gWaitingAudioTask; -extern s32 D_800C7C70; -extern u8 gCurCmdReadPos; -extern u8 gThreadCmdQueueFinished; - -extern s32 D_80145D40; -extern f32 D_80145D48[256]; -extern f32 D_80146148[256]; -extern f32 D_80146548[515]; -extern f32 D_80146D54; -extern f32 D_80146D58; -extern f32 D_80146D5C; -extern f32 D_80146D60; -extern f32 D_80146D64; -extern f32 D_80146D68; -extern f32 D_80146D6C; -extern f32 D_80146D70; - -extern s32 D_80146D80; - -extern AudioSlowLoadBuffer gSlowLoads; - - - -extern SfxRequest gSfxRequests[256]; -extern SfxBankEntry gSfxBanks[5][20]; -extern u8 gSfxBankListEnd[5]; -extern u8 gSfxBankFreeListStart[5]; -extern u8 gSfxBankUnused[5]; -extern ActiveSfx gActiveSfx[5][8]; -extern u8 gCurSfxPlayerChannelIndex; -extern u8 gSfxBankMuted[5]; -extern Modulation gSfxVolumeMods[5]; -extern f32 D_80149AD8[256]; -extern f32 D_80149ED8[256]; -extern f32 D_8014A2D8[384]; -extern f32 D_8014A8D8[32]; -extern u8 D_8014A958[32]; -extern SeqRequest gSeqRequests[4][5]; -extern u8 gNumSeqRequests[4]; -extern s32 gAudioSeqCmds[256]; -extern ActiveSequence gActiveSequences[4]; -extern u16 gDelayedSeqCmdFlags; -extern DelayedSeqCmd gDelayedSeqCmds[16]; -extern SfxChannelState gSfxChannelState[16]; -extern PlayerNoiseModulation gPlayerNoise[4]; -extern f32 D_8014BA10[4]; -extern u8 D_8014BA20[4]; -extern u8 D_8014BA24[4]; -extern s32 D_8014BA28[4]; - extern u64 gAudioContextStart[]; extern SynthesisReverb gSynthReverbs[4]; extern u8 sAudioContextPad10[0x10]; // 0x10 @@ -1343,9 +1114,9 @@ extern u8 gAudioContextPad20[0x20]; // 0x20 extern AudioAllocPool gCachePool; extern AudioAllocPool gPersistentCommonPool; extern AudioAllocPool gTemporaryCommonPool; -extern AudioCache gSeqCache; // seqCache -extern AudioCache gFontCache; // fontCache -extern AudioCache gSampleBankCache; // sampleBankCache +extern AudioCache gSeqCache; +extern AudioCache gFontCache; +extern AudioCache gSampleBankCache; extern PermanentCache gPermanentPool; extern AudioSampleCache gPersistentSampleCache; // 0x4 @@ -1425,31 +1196,12 @@ extern s32 gRefreshRate; extern s16* gAiBuffers[3]; extern s16 gAiBuffLengths[3]; extern u32 gAudioRandom; -extern UNK_TYPE D_80155D88; +extern u32 D_80155D88; extern volatile u32 gResetTimer; extern u64 gAudioContextEnd[]; - - - -extern OSMesgQueue sAudioTaskStartQueue; -extern OSMesgQueue sThreadCmdProcQueue; -extern OSMesgQueue sAudioUnkQueue; -extern OSMesgQueue sAudioResetQueue; -extern AudioCmd gThreadCmdBuffer[256]; -extern OSMesg sAudioTaskStartMsg[1]; -extern OSMesg sThreadCmdProcMsg[4]; -extern OSMesg sAudioUnkMsg[1]; -extern OSMesg sAudioResetMsg[1]; - // wave_samples -extern s16 gSawtoothWaveSample[]; -extern s16 gTriangleWaveSample[]; -extern s16 gSineWaveSample[]; -extern s16 gSquareWaveSample[]; -extern s16 gWhiteNoiseSample[]; -extern s16 gUnkSample[]; extern s16* gWaveSamples[]; // note_data @@ -1467,78 +1219,4 @@ extern f32 gHeadsetPanVolume[]; extern f32 gStereoPanVolume[]; extern f32 gDefaultPanVolume[]; -typedef enum { - SEQ_ID_0, - SEQ_ID_1, - SEQ_ID_2, - SEQ_ID_3, - SEQ_ID_4, - SEQ_ID_5, - SEQ_ID_6, - SEQ_ID_7, - SEQ_ID_8, - SEQ_ID_9, - SEQ_ID_10, - SEQ_ID_11, - SEQ_ID_12, - SEQ_ID_13, - SEQ_ID_14, - SEQ_ID_15, - SEQ_ID_16, - SEQ_ID_17, - SEQ_ID_18, - SEQ_ID_19, - SEQ_ID_20, - SEQ_ID_21, - SEQ_ID_22, - SEQ_ID_23, - SEQ_ID_24, - SEQ_ID_25, - SEQ_ID_26, - SEQ_ID_27, - SEQ_ID_28, - SEQ_ID_29, - SEQ_ID_30, - SEQ_ID_31, - SEQ_ID_32, - SEQ_ID_33, - SEQ_ID_34, - SEQ_ID_35, - SEQ_ID_36, - SEQ_ID_37, - SEQ_ID_38, - SEQ_ID_39, - SEQ_ID_40, - SEQ_ID_41, - SEQ_ID_42, - SEQ_ID_43, - SEQ_ID_44, - SEQ_ID_45, - SEQ_ID_46, - SEQ_ID_47, - SEQ_ID_48, - SEQ_ID_49, - SEQ_ID_50, - SEQ_ID_51, - SEQ_ID_52, - SEQ_ID_53, - SEQ_ID_54, - SEQ_ID_55, - SEQ_ID_56, - SEQ_ID_57, - SEQ_ID_58, - SEQ_ID_59, - SEQ_ID_60, - SEQ_ID_61, - SEQ_ID_62, - SEQ_ID_63, - SEQ_ID_64, - SEQ_ID_65, - SEQ_ID_66, - SEQ_ID_67, - SEQ_ID_68, - SEQ_ID_69, -} BgmSeqIds; - - #endif diff --git a/include/sf64level.h b/include/sf64level.h index d744cd7c..02a39496 100644 --- a/include/sf64level.h +++ b/include/sf64level.h @@ -115,78 +115,113 @@ typedef enum VsStage { /* 2 */ VS_STAGE_SECTOR_Z, } VsStage; -#define EVENT_CMD(opcode, arg1, arg2) ((((opcode) & 0x7F) << 9) | ((arg1) & 0x1FF)), (arg2) +#define EV_OPC(opcode) (((opcode) & 0x7F) << 9) +#define EV_OPC_MASK(cmd) ((cmd) & (0x7F << 9)) +#define EVENT_CMD(opcode, arg1, arg2) (EV_OPC(opcode) | ((s16) (arg1) & 0x1FF)), (arg2) + +#define EV_ZMODE(zmode) (((zmode) & 3) << 7) +#define EV_ZMODE_MASK(cmd) ((cmd) & (3 << 7)) + #define EVENT_PLAY_MSG(rcid, msg) EVENT_CMD(EVOP_PLAY_MSG, rcid, msg) #define EVENT_STOP_SCRIPT() EVENT_CMD(EVOP_STOP_SCRIPT, 0, 0) #define EVENT_MAKE_TEXLINE(color) EVENT_CMD(EVOP_MAKE_TEXLINE, 0, color) #define EVENT_STOP_TEXLINE() EVENT_CMD(EVOP_STOP_TEXLINE, 0, 0) -#define EVENT_INIT_ACTOR(health, info) EVENT_CMD(EVOP_INIT_ACTOR, health, info) -#define EVENT_SET_SPEED(speed, time, flag1, flag2) EVENT_CMD(EVOP_SET_SPEED, (((flag1) & 1) << 8) | (((flag2) & 1) << 7) | ((speed) & 0x7F), time) -#define EVENT_SET_ACCEL(speedTarget, time, flag1, flag2) EVENT_CMD(EVOP_SET_ACCEL, (((flag1) & 1) << 8) | (((flag2) & 1) << 7) | ((speedTarget) & 0x7F), time) +#define EVENT_INIT_ACTOR(info, health) EVENT_CMD(EVOP_INIT_ACTOR, health, info) +#define EVENT_SET_SPEED(speed, zmode, time) EVENT_CMD(EVOP_SET_SPEED, EV_ZMODE(zmode) | ((speed) & 0x7F), time) +#define EVENT_SET_ACCEL(speedTarget, zmode, time) EVENT_CMD(EVOP_SET_ACCEL, EV_ZMODE(zmode) | ((speedTarget) & 0x7F), time) #define EVENT_SET_ROTATE() EVENT_CMD(EVOP_SET_ROTATE, 0, 0) #define EVENT_STOP_ROTATE() EVENT_CMD(EVOP_STOP_ROTATE, 0, 0) -#define EVENT_BRANCH(cond, cmd) EVENT_CMD(EVOP_BRANCH, cmd, cond) +#define EVENT_SET_TRIGGER(cond, cmd) EVENT_CMD(EVOP_SET_TRIGGER, cmd, cond) +#define EVENT_CLEAR_TRIGGER(cmd) EVENT_SET_TRIGGER(EVC_NONE, cmd) #define EVENT_LOOP(cmd, count) EVENT_CMD(EVOP_LOOP, cmd, count) +#define EVENT_SET_GROUND(type) EVENT_CMD(EVOP_SET_GROUND, 0, type) +#define EVENT_DROP_ITEM(item) EVENT_CMD(EVOP_DROP_ITEM, 0, item) +#define EVENT_ADD_TO_GROUP(num, flags) EVENT_CMD(EVOP_ADD_TO_GROUP, flags, num) +#define EVENT_SET_REVERB(reverb) EVENT_CMD(EVOP_SET_REVERB, 0, reverb) +#define EVENT_STOP_BGM() EVENT_CMD(EVOP_STOP_BGM, 0, 0) +#define EVENT_SET_ACTION(action) EVENT_CMD(EVOP_SET_ACTION, 0, action) +#define EVENT_RESTORE_TEAM(teammate) EVENT_CMD(EVOP_RESTORE_TEAM, 0, teammate) +#define EVENT_PLAY_SFX(sfx) EVENT_CMD(EVOP_PLAY_SFX, 0, sfx) +#define EVENT_STOP_SFX(sfx) EVENT_CMD(EVOP_STOP_SFX, 0, sfx) +#define EVENT_SET_CALL(duration, voiceParam) EVENT_CMD(EVOP_SET_CALL, voiceParam, duration) +#define EVENT_ROT_PLUS_X(rot, rotVel) EVENT_CMD(EVOP_ROT_PLUS_X, rotVel * 10, rot) +#define EVENT_ROT_MINUS_X(rot, rotVel) EVENT_CMD(EVOP_ROT_MINUS_X, rotVel * 10, rot) +#define EVENT_ROT_PLUS_Y(rot, rotVel) EVENT_CMD(EVOP_ROT_PLUS_Y, rotVel * 10, rot) +#define EVENT_ROT_MINUS_Y(rot, rotVel) EVENT_CMD(EVOP_ROT_MINUS_Y, rotVel * 10, rot) +#define EVENT_ROT_PLUS_Z(rot, rotVel) EVENT_CMD(EVOP_ROT_PLUS_Z, rotVel * 10, rot) +#define EVENT_ROT_MINUS_Z(rot, rotVel) EVENT_CMD(EVOP_ROT_MINUS_Z, rotVel * 10, rot) +#define EVENT_F4_PLUS_X(rot, rotVel) EVENT_CMD(EVOP_F4_PLUS_X, rotVel * 10, rot) +#define EVENT_F4_MINUS_X(rot, rotVel) EVENT_CMD(EVOP_F4_MINUS_X, rotVel * 10, rot) +#define EVENT_F4_PLUS_Y(rot, rotVel) EVENT_CMD(EVOP_F4_PLUS_Y, rotVel * 10, rot) +#define EVENT_F4_MINUS_Y(rot, rotVel) EVENT_CMD(EVOP_F4_MINUS_Y, rotVel * 10, rot) +#define EVENT_SET_BASE_ZVEL(zvel) EVENT_CMD(EVOP_SET_BASE_ZVEL, 0, zvel) + +typedef enum EventModeZ { + EMZ_REST, + EMZ_RELATIVE, + EMZ_PLAYER, + EMZ_3, +} EventModeZ; typedef enum EventOpcode { /* 0 */ EVOP_SET_SPEED, /* 1 */ EVOP_SET_ACCEL, - /* 2 */ EVOP_2, - /* 3 */ EVOP_3, - /* 4 */ EVOP_4, - /* 8 */ EVOP_8 = 8, - /* 9 */ EVOP_9, - /* 10 */ EVOP_10, - /* 11 */ EVOP_11, - /* 12 */ EVOP_12, - /* 16 */ EVOP_16 = 16, - /* 17 */ EVOP_17, - /* 18 */ EVOP_18, - /* 19 */ EVOP_19, - /* 20 */ EVOP_20, - /* 21 */ EVOP_21, + /* 2 */ EVOP_SET_BASE_ZVEL, + /* 3 */ EVOP_SET_TO_IWORK_9, + /* 4 */ EVOP_SET_IWORK_13, + /* 8 */ EVOP_CLEAR_IWORK_13 = 8, + /* 9 */ EVOP_F4_PLUS_X, + /* 10 */ EVOP_F4_MINUS_X, + /* 11 */ EVOP_F4_PLUS_Y, + /* 12 */ EVOP_F4_MINUS_Y, + /* 16 */ EVOP_ROT_PLUS_X = 16, + /* 17 */ EVOP_ROT_MINUS_X, + /* 18 */ EVOP_ROT_PLUS_Y, + /* 19 */ EVOP_ROT_MINUS_Y, + /* 20 */ EVOP_ROT_PLUS_Z, + /* 21 */ EVOP_ROT_MINUS_Z, /* 24 */ EVOP_SET_ROTATE = 24, /* 25 */ EVOP_STOP_ROTATE, - /* 40 */ EVOP_40 = 40, - /* 41 */ EVOP_41, - /* 42 */ EVOP_42, - /* 43 */ EVOP_43, - /* 44 */ EVOP_44, - /* 45 */ EVOP_45, - /* 46 */ EVOP_46, - /* 47 */ EVOP_47, - /* 48 */ EVOP_48, - /* 56 */ EVOP_56 = 56, - /* 57 */ EVOP_57, - /* 58 */ EVOP_58, - /* 59 */ EVOP_59, - /* 96 */ EVOP_BRANCH = 96, + /* 40 */ EVOP_SET_STATE_6 = 40, + /* 41 */ EVOP_SET_STATE_7, + /* 42 */ EVOP_SET_STATE_8, + /* 43 */ EVOP_SET_STATE_9, + /* 44 */ EVOP_SET_STATE_13, + /* 45 */ EVOP_SET_IWORK_1_TO_IWORK_12, + /* 46 */ EVOP_SET_STATE_14, + /* 47 */ EVOP_SET_STATE_15, + /* 48 */ EVOP_SET_STATE_1, + /* 56 */ EVOP_SET_CALL = 56, + /* 57 */ EVOP_RESTORE_TEAM, + /* 58 */ EVOP_PLAY_SFX, + /* 59 */ EVOP_STOP_SFX, + /* 96 */ EVOP_SET_TRIGGER = 96, /* 104 */ EVOP_INIT_ACTOR = 104, - /* 105 */ EVOP_105, - /* 112 */ EVOP_112 = 112, - /* 113 */ EVOP_113, - /* 116 */ EVOP_116 = 116, - /* 118 */ EVOP_118 = 118, - /* 119 */ EVOP_119, - /* 120 */ EVOP_PLAY_MSG, // play message. arg1 is portrait, arg2 is message ID - /* 121 */ EVOP_121, - /* 122 */ EVOP_122, + /* 105 */ EVOP_SET_IWORK_12, + /* 112 */ EVOP_SET_ACTION = 112, + /* 113 */ EVOP_ADD_TO_GROUP, + /* 116 */ EVOP_DROP_ITEM = 116, + /* 118 */ EVOP_SET_REVERB = 118, + /* 119 */ EVOP_SET_GROUND, + /* 120 */ EVOP_PLAY_MSG, + /* 121 */ EVOP_DAMAGE_TEAM, + /* 122 */ EVOP_STOP_BGM, /* 124 */ EVOP_MAKE_TEXLINE = 124, /* 125 */ EVOP_STOP_TEXLINE, /* 126 */ EVOP_LOOP, - /* 127 */ EVOP_STOP_SCRIPT, // stop script + /* 127 */ EVOP_STOP_SCRIPT, } EventOpcode; typedef enum EventCondition { - /* 0 */ EVC_0, + /* 0 */ EVC_NONE, /* 1 */ EVC_1, - /* 2 */ EVC_2, - /* 3 */ EVC_3, - /* 4 */ EVC_4, - /* 5 */ EVC_5, - /* 6 */ EVC_6, - /* 7 */ EVC_7, - /* 8 */ EVC_8, + /* 2 */ EVC_TEAM_COUNT_3, + /* 3 */ EVC_TEAM_COUNT_2, + /* 4 */ EVC_TEAM_COUNT_1, + /* 5 */ EVC_TEAM_COUNT_0, + /* 6 */ EVC_FALCO_ACTIVE, + /* 7 */ EVC_PEPPY_ACTIVE, + /* 8 */ EVC_SLIPPY_ACTIVE, /* 9 */ EVC_9, /* 10 */ EVC_10, /* 11 */ EVC_11, @@ -203,20 +238,20 @@ typedef enum EventCondition { /* 22 */ EVC_22, /* 23 */ EVC_23, /* 24 */ EVC_24, - /* 25 */ EVC_25, - /* 26 */ EVC_26, - /* 27 */ EVC_27, - /* 28 */ EVC_28, - /* 29 */ EVC_29, + /* 25 */ EVC_HEALTH_100p, + /* 26 */ EVC_HEALTH_75p, + /* 27 */ EVC_HEALTH_50p, + /* 28 */ EVC_HEALTH_25p, + /* 29 */ EVC_HEALTH_0p, /* 30 */ EVC_30, /* 31 */ EVC_31, /* 32 */ EVC_32, /* 33 */ EVC_33, /* 34 */ EVC_34, - /* 35 */ EVC_35, - /* 36 */ EVC_36, - /* 37 */ EVC_37, - /* 38 */ EVC_38, + /* 35 */ EVC_SINGLE_LASER, + /* 36 */ EVC_TWIN_LASER, + /* 37 */ EVC_HYPER_LASER, + /* 38 */ EVC_UNK3_LASER, /* 39 */ EVC_39, /* 40 */ EVC_40, /* 41 */ EVC_41, @@ -225,32 +260,215 @@ typedef enum EventCondition { /* 44 */ EVC_44, /* 45 */ EVC_45, /* 46 */ EVC_46, - /* 47 */ EVC_47, - /* 48 */ EVC_48, - /* 49 */ EVC_49, - /* 50 */ EVC_50, - /* 51 */ EVC_51, - /* 52 */ EVC_52, - /* 53 */ EVC_53, - /* 54 */ EVC_54, - /* 55 */ EVC_55, - /* 56 */ EVC_56, - /* 57 */ EVC_57, - /* 58 */ EVC_58, - /* 59 */ EVC_59, - /* 60 */ EVC_60, - /* 61 */ EVC_61, + /* 47 */ EVC_PRESS_CRIGHT, + /* 48 */ EVC_WING_BROKEN, + /* 49 */ EVC_ME_CLEAR, + /* 50 */ EVC_FO_CLEAR, + /* 51 */ EVC_SX_CLEAR, + /* 52 */ EVC_TI_CLEAR, + /* 53 */ EVC_BO_CLEAR, + /* 54 */ EVC_SY_CLEAR, + /* 55 */ EVC_KA_CLEAR, + /* 56 */ EVC_SO_CLEAR, + /* 57 */ EVC_MA_CLEAR, + /* 58 */ EVC_AQ_CLEAR, + /* 59 */ EVC_ZO_CLEAR, + /* 60 */ EVC_SZ_CLEAR, + /* 61 */ EVC_A6_CLEAR, /* 62 */ EVC_62, /* 63 */ EVC_63, /* 64 */ EVC_64, - /* 65 */ EVC_65, - /* 66 */ EVC_66, - /* 67 */ EVC_67, + /* 65 */ EVC_30_HITS, + /* 66 */ EVC_80_HITS, + /* 67 */ EVC_EXPERT_MODE, /* 68 */ EVC_68, /* 69 */ EVC_69, /* 100 */ EVC_100=100, } EventCondition; +typedef enum EventState { + /* 0 */ EVSTATE_0, + /* 1 */ EVSTATE_1, + /* 2 */ EVSTATE_F4_PLUS_X, + /* 3 */ EVSTATE_F4_MINUS_X, + /* 4 */ EVSTATE_F4_PLUS_Y, + /* 5 */ EVSTATE_F4_MINUS_Y, + /* 6 */ EVSTATE_6, + /* 7 */ EVSTATE_7, + /* 8 */ EVSTATE_8, + /* 9 */ EVSTATE_9, + /* 10 */ EVSTATE_10, + /* 11 */ EVSTATE_11, + /* 12 */ EVSTATE_TEAM_RETREAT, + /* 13 */ EVSTATE_13, + /* 14 */ EVSTATE_14, + /* 15 */ EVSTATE_15, + /* 200 */ EVSTATE_SCRIPT_END = 200, + /* 1000 */ EVSTATE_1000 = 1000, +} EventState; + +typedef enum EventAction { + /* 0 */ EVACT_0, + /* 1 */ EVACT_1, + /* 2 */ EVACT_2, + /* 3 */ EVACT_3, + /* 4 */ EVACT_4, + /* 5 */ EVACT_5, + /* 6 */ EVACT_6, + /* 7 */ EVACT_7, + /* 8 */ EVACT_8, + /* 9 */ EVACT_9, + /* 10 */ EVACT_10, + /* 11 */ EVACT_11, + /* 12 */ EVACT_12, + /* 13 */ EVACT_13, + /* 14 */ EVACT_14, + /* 15 */ EVACT_15, + /* 16 */ EVACT_16, + /* 17 */ EVACT_17, + /* 18 */ EVACT_18, + /* 19 */ EVACT_19, +} EventAction; + +typedef enum EventActorInfo { + /* 0 */ EINFO_0, + /* 1 */ EINFO_1, + /* 2 */ EINFO_2, + /* 3 */ EINFO_3, + /* 4 */ EINFO_4, + /* 5 */ EINFO_5, + /* 6 */ EINFO_6, + /* 7 */ EINFO_7, + /* 8 */ EINFO_8, + /* 9 */ EINFO_9, + /* 10 */ EINFO_10, + /* 11 */ EINFO_11, + /* 12 */ EINFO_12, + /* 13 */ EINFO_13, + /* 14 */ EINFO_14, + /* 15 */ EINFO_15, + /* 16 */ EINFO_16, + /* 17 */ EINFO_17, + /* 18 */ EINFO_18, + /* 19 */ EINFO_19, + /* 20 */ EINFO_20, + /* 21 */ EINFO_21, + /* 22 */ EINFO_22, + /* 23 */ EINFO_23, + /* 24 */ EINFO_24, + /* 25 */ EINFO_25, + /* 26 */ EINFO_26, + /* 27 */ EINFO_27, + /* 28 */ EINFO_28, + /* 29 */ EINFO_29, + /* 30 */ EINFO_30, + /* 31 */ EINFO_31, + /* 32 */ EINFO_32, + /* 33 */ EINFO_33, + /* 34 */ EINFO_34, + /* 35 */ EINFO_35, + /* 36 */ EINFO_36, + /* 37 */ EINFO_37, + /* 38 */ EINFO_38, + /* 39 */ EINFO_39, + /* 40 */ EINFO_40, + /* 41 */ EINFO_41, + /* 42 */ EINFO_42, + /* 43 */ EINFO_43, + /* 44 */ EINFO_44, + /* 45 */ EINFO_45, + /* 46 */ EINFO_46, + /* 47 */ EINFO_47, + /* 48 */ EINFO_48, + /* 49 */ EINFO_49, + /* 50 */ EINFO_50, + /* 51 */ EINFO_51, + /* 52 */ EINFO_52, + /* 53 */ EINFO_53, + /* 54 */ EINFO_54, + /* 55 */ EINFO_55, + /* 56 */ EINFO_56, + /* 57 */ EINFO_57, + /* 58 */ EINFO_58, + /* 59 */ EINFO_59, + /* 60 */ EINFO_60, + /* 61 */ EINFO_61, + /* 62 */ EINFO_62, + /* 63 */ EINFO_63, + /* 64 */ EINFO_64, + /* 65 */ EINFO_65, + /* 66 */ EINFO_66, + /* 67 */ EINFO_67, + /* 68 */ EINFO_68, + /* 69 */ EINFO_69, + /* 70 */ EINFO_70, + /* 71 */ EINFO_71, + /* 72 */ EINFO_72, + /* 73 */ EINFO_73, + /* 74 */ EINFO_74, + /* 75 */ EINFO_75, + /* 76 */ EINFO_76, + /* 77 */ EINFO_77, + /* 78 */ EINFO_78, + /* 79 */ EINFO_79, + /* 80 */ EINFO_80, + /* 81 */ EINFO_81, + /* 82 */ EINFO_82, + /* 83 */ EINFO_83, + /* 84 */ EINFO_84, + /* 85 */ EINFO_85, + /* 86 */ EINFO_86, + /* 87 */ EINFO_87, + /* 88 */ EINFO_88, + /* 89 */ EINFO_89, + /* 90 */ EINFO_90, + /* 91 */ EINFO_91, + /* 92 */ EINFO_92, + /* 93 */ EINFO_93, + /* 94 */ EINFO_94, + /* 95 */ EINFO_95, + /* 96 */ EINFO_96, + /* 97 */ EINFO_97, + /* 98 */ EINFO_98, + /* 99 */ EINFO_99, + /* 100 */ EINFO_100, + /* 101 */ EINFO_101, + /* 102 */ EINFO_102, + /* 103 */ EINFO_103, + /* 104 */ EINFO_104, + /* 105 */ EINFO_105, + /* 106 */ EINFO_106, + /* 107 */ EINFO_107, + /* 200 */ EINFO_200 = 200, + /* 300 */ EINFO_300 = 300, +} EventActorInfo; + +typedef enum EventSfx { + /* 0 */ EVSFX_0, + /* 1 */ EVSFX_1, + /* 2 */ EVSFX_2, + /* 3 */ EVSFX_3, + /* 4 */ EVSFX_4, + /* 5 */ EVSFX_5, + /* 6 */ EVSFX_6, + /* 7 */ EVSFX_7, + /* 8 */ EVSFX_8, + /* 9 */ EVSFX_9, + /* 10 */ EVSFX_10, + /* 11 */ EVSFX_11, + /* 12 */ EVSFX_12, + /* 13 */ EVSFX_13, + /* 14 */ EVSFX_14, + /* 15 */ EVSFX_15, + /* 16 */ EVSFX_16, + /* 17 */ EVSFX_17, + /* 18 */ EVSFX_18, + /* 19 */ EVSFX_19, + /* 20 */ EVSFX_20, + /* 21 */ EVSFX_21, + /* 22 */ EVSFX_22, +} EventSfx; + typedef enum TexLineColor { /* 0 */ TXLC_WHITE, /* 1 */ TXLC_LIGHT_BLUE, @@ -260,4 +478,40 @@ typedef enum TexLineColor { /* 5 */ TXLC_YELLOW, } TexLineColor; +typedef enum GroundType { + /* 0 */ GROUNDTYPE_GRASS, + /* 1 */ GROUNDTYPE_ROCK, + /* 2 */ GROUNDTYPE_WATER, +} GroundType; + +typedef enum ItemDrop { + /* 0 */ DROP_NONE, + /* 1 */ DROP_SILVER_RING, + /* 2 */ DROP_SILVER_RING_50p, + /* 3 */ DROP_SILVER_RING_33p, + /* 4 */ DROP_SILVER_RING_25p, + /* 5 */ DROP_BOMB, + /* 6 */ DROP_BOMB_50p, + /* 7 */ DROP_BOMB_33p, + /* 8 */ DROP_BOMB_25p, + /* 9 */ DROP_LASERS, + /* 10 */ DROP_LASERS_50p, + /* 11 */ DROP_LASERS_33p, + /* 12 */ DROP_LASERS_25p, + /* 13 */ DROP_1UP, + /* 14 */ DROP_GOLD_RING_1, + /* 15 */ DROP_GOLD_RING_2, + /* 16 */ DROP_GOLD_RING_3, + /* 17 */ DROP_GOLD_RING_4, + /* 18 */ DROP_GOLD_RING_GROUP, + /* 19 */ DROP_LASERS_GROUP, + /* 20 */ DROP_BOMB_GROUP, + /* 21 */ DROP_SILVER_RING_GROUP, + /* 22 */ DROP_SILVER_RING_10p, + /* 23 */ DROP_WING_REPAIR, + /* 24 */ DROP_TEAM_MESG, + /* 25 */ DROP_SILVER_STAR, + /* 26 */ DROP_MAX, +} ItemDrop; + #endif diff --git a/include/sf64object.h b/include/sf64object.h index 443168e8..c69e7ecd 100644 --- a/include/sf64object.h +++ b/include/sf64object.h @@ -44,7 +44,7 @@ typedef enum { /* 0 */ COL1_0, // OBJ_ACTOR_180 /* 1 */ COL1_1, // OBJ_80_39 /* 2 */ COL1_2, - /* 3 */ COL1_3, // OBJ_UNK_1000 + /* 3 */ COL1_3, // ACTOR_EVENT_ID /* 4 */ COL1_4, // OBJ_BOSS_308 /* 5 */ COL1_5, // OBJ_80_149 /* 6 */ COL1_6, // OBJ_80_150 @@ -134,7 +134,8 @@ typedef struct { typedef struct { /* 0x00 */ Object obj; /* 0x1C */ ObjectInfo info; - /* 0x40 */ char unk40[0x8]; + /* 0x40 */ u8 unk_40; + /* 0x41 */ char unk_41[7]; /* 0x48 */ f32 sfxSource[3]; /* 0x54 */ f32 unk_54; } Object_58; // size = 0x58 @@ -249,7 +250,7 @@ typedef struct { /* 0x000 */ Object obj; /* 0x01C */ ObjectInfo info; /* 0x040 */ s32 index; - /* 0x044 */ u8 unk_044; + /* 0x044 */ u8 itemDrop; /* 0x046 */ s16 unk_046; /* 0x048 */ s16 unk_048; /* 0x04A */ s16 unk_04A; @@ -485,13 +486,13 @@ typedef enum ObjectId { /* 194 */ OBJ_ACTOR_194, /* 195 */ OBJ_ACTOR_195, /* 196 */ OBJ_ACTOR_196, - /* 197 */ OBJ_ACTOR_197, - /* 198 */ OBJ_ACTOR_198, + /* 197 */ OBJ_ACTOR_ALLRANGE, + /* 198 */ OBJ_ACTOR_TEAM_BOSS, /* 199 */ OBJ_ACTOR_199, - /* 200 */ OBJ_ACTOR_200, + /* 200 */ OBJ_ACTOR_EVENT, /* 201 */ OBJ_ACTOR_201, /* 202 */ OBJ_ACTOR_202, - /* 203 */ OBJ_ACTOR_203, + /* 203 */ OBJ_ACTOR_SLIPPY_SX, /* 204 */ OBJ_ACTOR_204, /* 205 */ OBJ_ACTOR_205, /* 206 */ OBJ_ACTOR_206, @@ -579,7 +580,7 @@ typedef enum ObjectId { /* 288 */ OBJ_ACTOR_288, /* 289 */ OBJ_ACTOR_289, /* 290 */ OBJ_ACTOR_290, - /* 291 */ OBJ_ACTOR_291, + /* 291 */ OBJ_ACTOR_SUPPLIES, /* 292 */ OBJ_BOSS_292, /* 293 */ OBJ_BOSS_293, /* 294 */ OBJ_BOSS_294, @@ -688,18 +689,34 @@ typedef enum ObjectId { /* 397 */ OBJ_EFFECT_397, /* 398 */ OBJ_EFFECT_398, /* 399 */ OBJ_EFFECT_399, - /* 400 */ OBJ_ID_MAX, + /* 400 */ OBJ_UNK_400, + /* 401 */ OBJ_UNK_401, + /* 402 */ OBJ_UNK_402, + /* 403 */ OBJ_UNK_403, + /* 404 */ OBJ_UNK_404, + /* 405 */ OBJ_UNK_405, + /* 406 */ OBJ_UNK_406, + /* 407 */ OBJ_ID_MAX, } ObjectId; -#define OBJ_UNK_400 400 -#define OBJ_UNK_401 401 -#define OBJ_UNK_402 402 -#define OBJ_UNK_403 403 -#define OBJ_UNK_404 404 -#define OBJ_UNK_405 405 -#define OBJ_UNK_406 406 +#define ACTOR_EVENT_ID 1000 -#define OBJ_UNK_1000 1000 +typedef enum AllRangeAi { + /* 0 */ AI360_FOX, + /* 1 */ AI360_FALCO, + /* 2 */ AI360_SLIPPY, + /* 3 */ AI360_PEPPY, + /* 4 */ AI360_WOLF, + /* 5 */ AI360_LEON, + /* 6 */ AI360_PIGMA, + /* 7 */ AI360_ANDREW, + /* 8 */ AI360_KATT, + /* 9 */ AI360_BILL, + /* 10 */ AI360_10, + /* 100 */ AI360_GREAT_FOX = 100, + /* 200 */ AI360_MISSILE = 200, + /* 200 */ AI360_EVENT_HANDLER = 1000, +} AllRangeAi; Actor* func_game_800A3608(ObjectId); diff --git a/include/sf64player.h b/include/sf64player.h index 9daa12ff..2817e56e 100644 --- a/include/sf64player.h +++ b/include/sf64player.h @@ -251,7 +251,7 @@ typedef struct Player { /* 0x21C */ s32 unk_21C; /* 0x220 */ s32 timer_220; /* 0x224 */ s32 timer_224; - /* 0x228 */ s32 unk_228; + /* 0x228 */ s32 flags_228; /* 0x22C */ s32 unk_22C; /* 0x230 */ s32 unk_230; /* 0x234 */ s32 unk_234; diff --git a/include/variables.h b/include/variables.h index 9ed05f22..372884fd 100644 --- a/include/variables.h +++ b/include/variables.h @@ -159,7 +159,7 @@ extern s32 D_hud_8016170C; extern s32 D_hud_80161710; extern s32 gTotalHits; // 0x80161714 gTotalGameScore extern f32 D_hud_80161720[3]; -extern s32 D_hud_8016172C; +extern s32 gDisplayedHitCount; extern s32 D_hud_80161730; extern s32 gShowBossHealth; // 0x80161734 @@ -168,8 +168,8 @@ extern u8 D_play_80161A50; extern f32 D_play_80161A54; extern s32 D_play_80161A58; extern s32 D_play_80161A5C; -extern u16 D_play_Timer_80161A60; -extern u16 D_play_80161A62; +extern u16 gScreenFlashTimer; +extern u16 gDropHitCountItem; //fox_radio extern u16** D_radio_80178720; diff --git a/linker_scripts/us/symbol_addrs_audio.txt b/linker_scripts/us/symbol_addrs_audio.txt index 55b4a144..865e8cb1 100644 --- a/linker_scripts/us/symbol_addrs_audio.txt +++ b/linker_scripts/us/symbol_addrs_audio.txt @@ -7,22 +7,22 @@ gSoundFontTableInitEntries = 0x800C3AA0; gSeqFontTableInit = 0x800C3CB0; // data -gSamplesPerWavePeriod = 0x800C57E8; // size:4 +sSamplesPerWavePeriod = 0x800C57E8; // size:4 -gChannelsPerBank = 0x800C5CE0; //type:u8 size:0x1C -gUsedChannelsPerBank = 0x800C5CFC; //type:u8 size:0x1C -gSfxRequestWriteIndex = 0x800C5D18; -gSfxRequestReadIndex = 0x800C5D1C; -gSfxChannelLayout = 0x800C5D20; -D_800C5D24 = 0x800C5D24; +sChannelsPerBank = 0x800C5CE0; //type:u8 size:0x1C +sUsedChannelsPerBank = 0x800C5CFC; //type:u8 size:0x1C +sSfxRequestWriteIndex = 0x800C5D18; +sSfxRequestReadIndex = 0x800C5D1C; +sSfxChannelLayout = 0x800C5D20; +sChannelMuteFlags = 0x800C5D24; gDefaultSfxSource = 0x800C5D28; gDefaultMod = 0x800C5D34; gDefaultReverb = 0x800C5D3C; -gAudioFrameCounter = 0x800C5D40; -gSeqCmdWritePos = 0x800C5D44; -gSeqCmdReadPos = 0x800C5D48; -gStartSeqDisabled = 0x800C5D4C; -gSoundModeList = 0x800C5D50; +sAudioFrameCounter = 0x800C5D40; +sSeqCmdWritePos = 0x800C5D44; +sSeqCmdReadPos = 0x800C5D48; +sStartSeqDisabled = 0x800C5D4C; +sSoundModeList = 0x800C5D50; sNewAudioSpecId = 0x800C5D54; D_800C5D58 = 0x800C5D58; @@ -34,14 +34,14 @@ D_800C5E38 = 0x800C5E38; D_800C5E58 = 0x800C5E58; D_800C5E70 = 0x800C5E70; -gSfxFreqMod = 0x800C5E74; -gSfxVolMod = 0x800C5E78; -gPlaylistIndex = 0x800C5E7C; -gPlaylistTimer = 0x800C5E80; -gPlaylistCmdIndex = 0x800C5E84; +sSfxFreqMod = 0x800C5E74; +sSfxVolMod = 0x800C5E78; +sPlaylistIndex = 0x800C5E7C; +sPlaylistTimer = 0x800C5E80; +sPlaylistCmdIndex = 0x800C5E84; D_800C5E88 = 0x800C5E88; -D_800C5EE4 = 0x800C5EE4; -gPlaylists = 0x800C5FF4; //type:u16 size:5000 +sSoundTestTracks = 0x800C5EE4; +sPlaylists = 0x800C5FF4; //type:u16 size:5000 D_800C7380 = 0x800C7380; D_800C7384 = 0x800C7384; @@ -93,28 +93,28 @@ D_80146D80 = 0x80146D80; gSlowLoads = 0x80146D90; // size:0xC4 -gSfxRequests = 0x80146E60; -gSfxBanks = 0x80148660; //size:0x12C0 -gSfxBankListEnd = 0x80149920; -gSfxBankFreeListStart = 0x80149928; -gSfxBankUnused = 0x80149930; -gActiveSfx = 0x80149938; -gCurSfxPlayerChannelIndex = 0x80149A78; -gSfxBankMuted = 0x80149A7C; -gSfxVolumeMods = 0x80149A88; +sSfxRequests = 0x80146E60; +sSfxBanks = 0x80148660; //size:0x12C0 +sSfxBankListEnd = 0x80149920; +sSfxBankFreeListStart = 0x80149928; +sSfxBankUnused = 0x80149930; +sActiveSfx = 0x80149938; +sCurSfxPlayerChannelIndex = 0x80149A78; +sSfxBankMuted = 0x80149A7C; +sSfxVolumeMods = 0x80149A88; D_80149AD8 = 0x80149AD8; D_80149ED8 = 0x80149ED8; D_8014A2D8 = 0x8014A2D8; D_8014A8D8 = 0x8014A8D8; D_8014A958 = 0x8014A958; -gSeqRequests = 0x8014A978; -gNumSeqRequests = 0x8014A9A0; -gAudioSeqCmds = 0x8014A9A8; -gActiveSequences = 0x8014ADA8; //size:0x960 -gDelayedSeqCmdFlags = 0x8014B708; -gDelayedSeqCmds = 0x8014B710; -gSfxChannelState = 0x8014B790; -gPlayerNoise = 0x8014B850; +sSeqRequests = 0x8014A978; +sNumSeqRequests = 0x8014A9A0; +sAudioSeqCmds = 0x8014A9A8; +sActiveSequences = 0x8014ADA8; //size:0x960 +sDelayedSeqCmdFlags = 0x8014B708; +sDelayedSeqCmds = 0x8014B710; +sSfxChannelState = 0x8014B790; +sPlayerNoise = 0x8014B850; D_8014BA10 = 0x8014BA10; D_8014BA20 = 0x8014BA20; D_8014BA24 = 0x8014BA24; @@ -480,8 +480,8 @@ func_8001D0B4 = 0x8001D0B4; func_8001D10C = 0x8001D10C; func_8001D15C = 0x8001D15C; func_8001D1C8 = 0x8001D1C8; -func_8001D2FC = 0x8001D2FC; -func_8001D3A0 = 0x8001D3A0; +Audio_PlayEventSfx = 0x8001D2FC; +Audio_StopEventSfx = 0x8001D3A0; Audio_SetBaseSfxReverb = 0x8001D400; Audio_SetBgmParam = 0x8001D410; Audio_PlaySequence = 0x8001D444; diff --git a/linker_scripts/us/symbol_addrs_engine.txt b/linker_scripts/us/symbol_addrs_engine.txt index f0d08cb3..b937f0b4 100644 --- a/linker_scripts/us/symbol_addrs_engine.txt +++ b/linker_scripts/us/symbol_addrs_engine.txt @@ -170,14 +170,14 @@ func_edisplay_800597C0 = 0x800597C0; Graphics_SetScaleMtx = 0x8005980C; func_edisplay_80059850 = 0x80059850; func_edisplay_800598DC = 0x800598DC; -func_edisplay_800598E8 = 0x800598E8; +Actor201_Draw = 0x800598E8; func_edisplay_800599A4 = 0x800599A4; -func_edisplay_80059A24 = 0x80059A24; -func_edisplay_80059AEC = 0x80059AEC; +Actor202_Draw = 0x80059A24; +Obj39_Draw = 0x80059AEC; func_edisplay_80059B20 = 0x80059B20; func_edisplay_80059BB0 = 0x80059BB0; -func_edisplay_80059BBC = 0x80059BBC; -func_edisplay_80059BF0 = 0x80059BF0; +Obj42_Draw = 0x80059BBC; +Actor196_Draw = 0x80059BF0; func_edisplay_80059C28 = 0x80059C28; func_edisplay_80059C34 = 0x80059C34; func_edisplay_80059C40 = 0x80059C40; @@ -186,7 +186,7 @@ func_edisplay_80059FDC = 0x80059FDC; func_edisplay_8005A010 = 0x8005A010; func_edisplay_8005A07C = 0x8005A07C; func_edisplay_8005A088 = 0x8005A088; -func_edisplay_8005A094 = 0x8005A094; +Actor189_Draw = 0x8005A094; func_edisplay_8005ADAC = 0x8005ADAC; func_edisplay_8005B1E8 = 0x8005B1E8; func_edisplay_8005B388 = 0x8005B388; @@ -198,27 +198,27 @@ func_edisplay_8005B9A4 = 0x8005B9A4; func_edisplay_8005BA30 = 0x8005BA30; func_edisplay_8005BAAC = 0x8005BAAC; func_edisplay_8005BAB4 = 0x8005BAB4; -func_edisplay_8005C5F0 = 0x8005C5F0; -func_edisplay_8005C900 = 0x8005C900; -func_edisplay_8005C9C0 = 0x8005C9C0; -func_edisplay_8005CA80 = 0x8005CA80; -func_edisplay_8005CB44 = 0x8005CB44; -func_edisplay_8005CC9C = 0x8005CC9C; -func_edisplay_8005CDA8 = 0x8005CDA8; +ItemCheckpoint_Draw = 0x8005C5F0; +ItemSilverRing_Draw = 0x8005C900; +ItemSilverStar_Draw = 0x8005C9C0; +ItemGoldRing_Draw = 0x8005CA80; +ItemBomb_Draw = 0x8005CB44; +ItemLasers_Draw = 0x8005CC9C; +ItemMeteoWarp_Draw = 0x8005CDA8; func_edisplay_8005D008 = 0x8005D008; func_edisplay_8005D1F0 = 0x8005D1F0; func_edisplay_8005D3CC = 0x8005D3CC; Object_80_Draw = 0x8005D654; Object_4C_Draw = 0x8005D8B8; -Actor_Draw2 = 0x8005D954; -Actor_Draw1 = 0x8005DBC0; +Actor_DrawOnRails = 0x8005D954; +Actor_DrawAllRange = 0x8005DBC0; Boss_Draw = 0x8005E1B8; -Effect_Draw1 = 0x8005E454; -Effect_Draw2 = 0x8005E538; +Effect_DrawOnRails = 0x8005E454; +Effect_DrawAllRange = 0x8005E538; Item_Draw = 0x8005E7B8; func_edisplay_8005EA24 = 0x8005EA24; func_edisplay_8005ECD8 = 0x8005ECD8; -func_edisplay_8005F030 = 0x8005F030; +Object_ClampSfxSource = 0x8005F030; func_edisplay_8005F0E8 = 0x8005F0E8; func_edisplay_8005F1EC = 0x8005F1EC; func_edisplay_8005F290 = 0x8005F290; @@ -226,11 +226,11 @@ Object_58_Draw = 0x8005F2F4; func_edisplay_8005F670 = 0x8005F670; func_edisplay_8005F9DC = 0x8005F9DC; Object_DrawAll = 0x8005FB70; -func_edisplay_8006046C = 0x8006046C; -func_edisplay_80060714 = 0x80060714; -func_edisplay_8006089C = 0x8006089C; +Effect_DrawAll = 0x8006046C; +Object_Draw = 0x80060714; +Effect_Draw = 0x8006089C; TexturedLine_Draw = 0x80060968; -func_edisplay_80060D94 = 0x80060D94; +TexturedLine_DrawPath = 0x80060D94; // fox_effect BonusText_Display = 0x80077240; @@ -315,22 +315,22 @@ func_enmy_80066EF0 = 0x80066EF0; func_enmy_800671D0 = 0x800671D0; func_enmy_80067348 = 0x80067348; func_enmy_800674B4 = 0x800674B4; -func_enmy_8006753C = 0x8006753C; -func_enmy_80067874 = 0x80067874; +ActorSupplies_Update = 0x8006753C; +ActorSupplies_Draw = 0x80067874; func_enmy_80067A40 = 0x80067A40; -func_enmy_80067B1C = 0x80067B1C; -func_enmy_80067BEC = 0x80067BEC; -func_enmy_80067F6C = 0x80067F6C; -func_enmy_80068020 = 0x80068020; -func_enmy_800685D8 = 0x800685D8; -func_enmy_800685F8 = 0x800685F8; -func_enmy_80068618 = 0x80068618; -func_enmy_80068688 = 0x80068688; -func_enmy_80068914 = 0x80068914; +Item1up_Update = 0x80067B1C; +ItemPickup_Update = 0x80067BEC; +ItemLasers_Update = 0x80067F6C; +ItemSupplyRing_Update = 0x80068020; +ItemSilverStar_Update = 0x800685D8; +ItemGoldRing_Update = 0x800685F8; +ItemWingRepair_Update = 0x80068618; +ItemMeteoWarp_Update = 0x80068688; +ItemCheckpoint_Update = 0x80068914; func_enmy_80068C48 = 0x80068C48; func_enmy_80068C88 = 0x80068C88; func_enmy_80068FE0 = 0x80068FE0; -func_enmy_800690D0 = 0x800690D0; +Object_Dying = 0x800690D0; func_enmy_800693E8 = 0x800693E8; func_enmy_80069658 = 0x80069658; func_enmy_800696F8 = 0x800696F8; @@ -368,10 +368,10 @@ D_game_80161A40 = 0x80161A40; D_game_80161A44 = 0x80161A44; D_game_800D2860 = 0x800D2860; D_game_800D2870 = 0x800D2870; -D_game_800D2874 = 0x800D2874; -D_game_800D2884 = 0x800D2884; -D_game_800D2894 = 0x800D2894; -D_game_800D28A4 = 0x800D28A4; +sVsCameraULx = 0x800D2874; +sVsCameraLRx = 0x800D2884; +sVsCameraULy = 0x800D2894; +sVsCameraLRy = 0x800D28A4; sOverlaySetups = 0x800D28B4; Game_Initialize = 0x800A18B0; @@ -400,27 +400,27 @@ D_800D1AEC = 0x800D1AEC; //type:s32 size:0x1B0 D_play_80161A50 = 0x80161A50; D_play_80161A54 = 0x80161A54; D_play_80161A5C = 0x80161A5C; -D_play_Timer_80161A60 = 0x80161A60; -D_play_80161A62 = 0x80161A62; +gScreenFlashTimer = 0x80161A60; +gDropHitCountItem = 0x80161A62; D_play_80161A64 = 0x80161A64; sEnvSettings = 0x80161A68; D_play_800D2F68 = 0x800D2F68; //type:u8 // fox_context -D_80161A70 = 0x80161A70; -D_80161A74 = 0x80161A74; -D_80161A78 = 0x80161A78; -D_80161A7C = 0x80161A7C; -D_80161A80 = 0x80161A80; -D_80161A84 = 0x80161A84; -D_80161A88 = 0x80161A88; -D_80161A8C = 0x80161A8C; +D_ctx_80161A70 = 0x80161A70; +D_ctx_80161A74 = 0x80161A74; +D_ctx_80161A78 = 0x80161A78; +D_ctx_80161A7C = 0x80161A7C; +D_ctx_80161A80 = 0x80161A80; +D_ctx_80161A84 = 0x80161A84; +D_ctx_80161A88 = 0x80161A88; +D_ctx_80161A8C = 0x80161A8C; gGoldRingCount = 0x80161A90; gHitCount = 0x80161A98; gSavedHitCount = 0x80161A9C; gLifeCount = 0x80161AA0; gLaserStrength = 0x80161AA8;//size:0x10 -D_80161AB8 = 0x80161AB8; +D_ctx_80161AB8 = 0x80161AB8; gObjects80 = 0x80161B00; //size:0x1900 gObjects4C = 0x80163400; //size:0xBE0 gActors = 0x80163FE0; //size:0xB130 @@ -489,8 +489,8 @@ D_ctx_801779A8 = 0x801779A8; gCsCamAtY = 0x801779B8; gCsCamAtZ = 0x801779C0; gChargeTimers = 0x801779C8; -D_ctx_801779D8 = 0x801779D8; -D_ctx_801779E8 = 0x801779E8; +gPlayerCamEye = 0x801779D8; +gPlayerCamAt = 0x801779E8; gExpertMode = 0x801779F8; D_Timer_80177A00 = 0x80177A00; D_ctx_80177A10 = 0x80177A10;//size:0x28 @@ -523,7 +523,7 @@ D_ctx_80177C50 = 0x80177C50; D_ctx_80177C58 = 0x80177C58; gSoundMode = 0x80177C74; gVolumeSettings = 0x80177C80; -D_ctx_80177C90 = 0x80177C90; +gBgmSeqId = 0x80177C90; D_ctx_80177C94 = 0x80177C94; gLevelType = 0x80177C98; D_ctx_80177C9C = 0x80177C9C; @@ -619,8 +619,8 @@ D_ctx_80178430 = 0x80178430; D_ctx_80178440 = 0x80178440; D_ctx_80178444 = 0x80178444; D_ctx_80178448 = 0x80178448; -D_ctx_8017847C = 0x8017847C; -D_ctx_80178480 = 0x80178480; +gCameraShakeY = 0x8017847C; +gCameraShake = 0x80178480; D_ctx_80178488 = 0x80178488; D_ctx_801784A4 = 0x801784A4; D_ctx_801784AC = 0x801784AC; diff --git a/linker_scripts/us/symbol_addrs_overlays.txt b/linker_scripts/us/symbol_addrs_overlays.txt index d8b357c7..26f3c499 100644 --- a/linker_scripts/us/symbol_addrs_overlays.txt +++ b/linker_scripts/us/symbol_addrs_overlays.txt @@ -1,13 +1,13 @@ Corneria_8018ED78 = 0x8018ED78;//segment:ovl_i1 Corneria_8018EE84 = 0x8018EE84;//segment:ovl_i1 Corneria_8018B0B4 = 0x8018B0B4;//segment:ovl_i1 -Corneria_801878D8 = 0x801878D8;//segment:ovl_i1 -Corneria_8018BE7C = 0x8018BE7C;//segment:ovl_i1 +Corneria_Boss292_Init = 0x801878D8;//segment:ovl_i1 +Corneria_Boss293_Init = 0x8018BE7C;//segment:ovl_i1 Venom1_8019250C = 0x8019250C;//segment:ovl_i1 Venom1_80192CB0 = 0x80192CB0;//segment:ovl_i1 Venom1_80192EA4 = 0x80192EA4;//segment:ovl_i1 Venom1_801933B4 = 0x801933B4;//segment:ovl_i1 -Venom1_801935CC = 0x801935CC;//segment:ovl_i1 +Venom1_Boss319_Init = 0x801935CC;//segment:ovl_i1 Venom1_80194398 = 0x80194398;//segment:ovl_i1 Venom1_801920F0 = 0x801920F0;//segment:ovl_i1 D_i1_8019A04C = 0x8019A04C; // size:0xC type:s16 segment:ovl_i1 @@ -21,7 +21,7 @@ D_i1_8019A500 = 0x8019A500; // segment:ovl_i1 type:s16 size:0x44 D_i1_8019B838 = 0x8019B838; // segment:ovl_i1 size:0x880 Meteo_80187B08 = 0x80187B08;//segment:ovl_i2 -Meteo_80188A40 = 0x80188A40;//segment:ovl_i2 +Meteo_Boss297_Init = 0x80188A40;//segment:ovl_i2 D_i2_80195D70 = 0x80195D70;//segment:ovl_i2 D_i4_8019F168 = 0x8019F168; // type:Vec3f segment:ovl_i4 D_i4_8019F18C = 0x8019F18C; // type:f32 size:0xC segment:ovl_i4 @@ -57,7 +57,7 @@ D_menu_801AF274 = 0x801AF274; // type:f32 size:0x18 force_migration:True segment Area6_801875E4 = 0x801875E4;//segment:ovl_i3 Area6_80187704 = 0x80187704;//segment:ovl_i3 -Area6_80187754 = 0x80187754;//segment:ovl_i3 +Area6_BossA6_Init = 0x80187754;//segment:ovl_i3 Area6_80187944 = 0x80187944;//segment:ovl_i3 Area6_8018A1B0 = 0x8018A1B0;//segment:ovl_i3 Area6_8018A2C4 = 0x8018A2C4;//segment:ovl_i3 @@ -69,7 +69,7 @@ Area6_8018C54C = 0x8018C54C;//segment:ovl_i3 Zoness_801900FC = 0x801900FC;//segment:ovl_i3 Zoness_801915A4 = 0x801915A4;//segment:ovl_i3 Zoness_80191BB8 = 0x80191BB8;//segment:ovl_i3 -Zoness_801932AC = 0x801932AC;//segment:ovl_i3 +Zoness_BossZo_Init = 0x801932AC;//segment:ovl_i3 Zoness_80193908 = 0x80193908;//segment:ovl_i3 Zoness_80193A98 = 0x80193A98;//segment:ovl_i3 Zoness_80193CC8 = 0x80193CC8;//segment:ovl_i3 @@ -88,7 +88,7 @@ Zoness_8019962C = 0x8019962C;//segment:ovl_i3 Zoness_8019B1F0 = 0x8019B1F0;//segment:ovl_i3 Zoness_8019B810 = 0x8019B810;//segment:ovl_i3 Zoness_8019C200 = 0x8019C200;//segment:ovl_i3 -Zoness_8019D060 = 0x8019D060;//segment:ovl_i3 +Zoness_Actor247_Init = 0x8019D060;//segment:ovl_i3 Solar_801A7930 = 0x801A7930;//segment:ovl_i3 Aquas_801A9448 = 0x801A9448;//segment:ovl_i3 Aquas_801A94EC = 0x801A94EC;//segment:ovl_i3 @@ -101,7 +101,7 @@ Aquas_801AFA5C = 0x801AFA5C;//segment:ovl_i3 Aquas_801B0F88 = 0x801B0F88;//segment:ovl_i3 Aquas_801B0FCC = 0x801B0FCC;//segment:ovl_i3 Aquas_801B1008 = 0x801B1008;//segment:ovl_i3 -Aquas_801B10F8 = 0x801B10F8;//segment:ovl_i3 +Aquas_BossAq_Init = 0x801B10F8;//segment:ovl_i3 Aquas_801B134C = 0x801B134C;//segment:ovl_i3 Aquas_801B6344 = 0x801B6344;//segment:ovl_i3 Aquas_801B638C = 0x801B638C;//segment:ovl_i3 @@ -155,7 +155,7 @@ D_i3_801C2768 = 0x801C2768; //segment:ovl_i3 size:0x38 D_i3_801C27A0 = 0x801C27A0; //segment:ovl_i3 size:0x20 Katina_80198594 = 0x80198594;//segment:ovl_i4 -Katina_80193CA4 = 0x80193CA4;//segment:ovl_i4 +Katina_Boss316_Init = 0x80193CA4;//segment:ovl_i4 SectorZ_80199C60 = 0x80199C60;//segment:ovl_i4 SectorZ_80199900 = 0x80199900;//segment:ovl_i4 D_i4_801A03C0 = 0x801A03C0;//segment:ovl_i4 @@ -170,13 +170,13 @@ Titania_801990DC = 0x801990DC;//segment:ovl_i5 Ground_801B6AEC = 0x801B6AEC;//segment:ovl_i5 Titania_80189B80 = 0x80189B80;//segment:ovl_i5 Titania_8018ADC4 = 0x8018ADC4;//segment:ovl_i5 -Titania_8018B96C = 0x8018B96C;//segment:ovl_i5 +Titania_Actor231_Init = 0x8018B96C;//segment:ovl_i5 Titania_8018BFB0 = 0x8018BFB0;//segment:ovl_i5 Titania_8018E3CC = 0x8018E3CC;//segment:ovl_i5 Titania_8018E5E8 = 0x8018E5E8;//segment:ovl_i5 Titania_8018EFF0 = 0x8018EFF0;//segment:ovl_i5 Titania_8018F0D8 = 0x8018F0D8;//segment:ovl_i5 -Titania_8018FA48 = 0x8018FA48;//segment:ovl_i5 +Titania_Boss306_Init = 0x8018FA48;//segment:ovl_i5 Macbeth_80199F8C = 0x80199F8C;//segment:ovl_i5 Titania_80193B30 = 0x80193B30;//segment:ovl_i5 Titania_80193DF0 = 0x80193DF0;//segment:ovl_i5 @@ -211,8 +211,8 @@ D_i5_801B814C = 0x801B814C;//size:0x14 segment:ovl_i5 D_i5_801B7630 = 0x801B7630;//size:0x24 segment:ovl_i5 Andross_801888F4 = 0x801888F4; //segment:ovl_i6 -SectorY_80197CC4 = 0x80197CC4; //segment:ovl_i6 -Andross_8018D16C = 0x8018D16C; //segment:ovl_i6 +SectorY_Boss314_Init = 0x80197CC4; //segment:ovl_i6 +Andross_Boss320_Init = 0x8018D16C; //segment:ovl_i6 D_i6_801A68B0 = 0x801A68B0;//size:0x48 type:Vec3f segment:ovl_i6 D_i6_801A68F8 = 0x801A68F8;//size:0xC type:f32 segment:ovl_i6 D_i6_801A7F30 = 0x801A7F30; //segment:ovl_i6 diff --git a/src/audio/audio_context.c b/src/audio/audio_context.c index bbf2cd76..347238e5 100644 --- a/src/audio/audio_context.c +++ b/src/audio/audio_context.c @@ -99,7 +99,7 @@ s32 gRefreshRate; s16* gAiBuffers[3]; s16 gAiBuffLengths[3]; u32 gAudioRandom; -UNK_TYPE D_80155D88; +u32 D_80155D88; volatile u32 gResetTimer; u64 gAudioContextEnd[2]; diff --git a/src/audio/audio_effects.c b/src/audio/audio_effects.c index 4c6c1b85..652686c7 100644 --- a/src/audio/audio_effects.c +++ b/src/audio/audio_effects.c @@ -64,7 +64,7 @@ void func_800135A8(SequencePlayer* seqplayer) { seqplayer->appliedFadeVolume = seqplayer->fadeVolume * seqplayer->fadeVolumeMod; } for (i = 0; i < 16; i++) { - if ((((u32) seqplayer->channels[i] != (u32) &gSeqChannelNone) == 1) && (seqplayer->channels[i]->enabled == 1)) { + if ((IS_SEQUENCE_CHANNEL_VALID(seqplayer->channels[i]) == 1) && (seqplayer->channels[i]->enabled == 1)) { func_80013400(seqplayer->channels[i], seqplayer->recalculateVolume); } } @@ -88,7 +88,7 @@ s16 func_800137DC(VibratoState* vibrato) { s32 index; vibrato->time += (s32) vibrato->rate; - index = (vibrato->time >> 0xA) & 0x3F; + index = (vibrato->time >> 10) & 0x3F; return vibrato->curve[index] >> 8; } diff --git a/src/audio/audio_general.c b/src/audio/audio_general.c index 44fa0751..ff1247ba 100644 --- a/src/audio/audio_general.c +++ b/src/audio/audio_general.c @@ -5,12 +5,13 @@ #include "audioseq_cmd.h" void func_8001D0B4(f32* sfxSource, u32 sfxId, f32 freqMod); -void func_8001DD40(void); s32 Audio_GetCurrentVoice(void); void Audio_PlaySequence(u8, u16, u8, u8); void Audio_PlayFanfare(u16, u8, u8, u8); -void func_8001D6DC(u8); void Audio_PlaySequenceDistorted(u8, u16, u16, u8, u8); + +void func_8001DD40(void); +void func_8001D6DC(u8); void func_8001DE1C(u8); static const char devstr1[] = "preload start (%d): "; @@ -35,52 +36,52 @@ static const char devstr19[] = "SetVolumeBallnce %d %d\n"; static const char devstr20[] = "START HANDLE : %d (old:%d)\n"; static const char devstr21[] = "All Sound Fade Out time:%d\n"; -SfxRequest gSfxRequests[256]; -SfxBankEntry gSfxBanks[5][20]; -u8 gSfxBankListEnd[5]; -u8 gSfxBankFreeListStart[5]; -u8 gSfxBankUnused[5]; -ActiveSfx gActiveSfx[5][8]; -u8 gCurSfxPlayerChannelIndex; -u8 gSfxBankMuted[5]; -Modulation gSfxVolumeMods[5]; +SfxRequest sSfxRequests[256]; +SfxBankEntry sSfxBanks[5][20]; +u8 sSfxBankListEnd[5]; +u8 sSfxBankFreeListStart[5]; +u8 sSfxBankUnused[5]; +ActiveSfx sActiveSfx[5][8]; +u8 sCurSfxPlayerChannelIndex; +u8 sSfxBankMuted[5]; +Modulation sSfxVolumeMods[5]; f32 D_80149AD8[256]; f32 D_80149ED8[256]; f32 D_8014A2D8[384]; f32 D_8014A8D8[32]; u8 D_8014A958[32]; -SeqRequest gSeqRequests[4][5]; -u8 gNumSeqRequests[4]; -s32 gAudioSeqCmds[256]; -ActiveSequence gActiveSequences[4]; -u16 gDelayedSeqCmdFlags; -DelayedSeqCmd gDelayedSeqCmds[16]; -SfxChannelState gSfxChannelState[16]; -PlayerNoiseModulation gPlayerNoise[4]; +SeqRequest sSeqRequests[4][5]; +u8 sNumSeqRequests[4]; +s32 sAudioSeqCmds[256]; +ActiveSequence sActiveSequences[4]; +u16 sDelayedSeqCmdFlags; +DelayedSeqCmd sDelayedSeqCmds[16]; +SfxChannelState sSfxChannelState[16]; +PlayerNoiseModulation sPlayerNoise[4]; f32 D_8014BA10[4]; u8 D_8014BA20[4]; u8 D_8014BA24[4]; s32 D_8014BA28[4]; -u8 gChannelsPerBank[5][5] = { +u8 sChannelsPerBank[5][5] = { { 3, 2, 2, 2, 2 }, { 3, 1, 2, 2, 2 }, { 3, 2, 2, 2, 3 }, { 6, 0, 2, 0, 4 }, { 0, 0, 0, 0, 0 }, }; -u8 gUsedChannelsPerBank[5][5] = { +u8 sUsedChannelsPerBank[5][5] = { { 3, 2, 1, 2, 3 }, { 3, 2, 1, 1, 2 }, { 3, 2, 1, 1, 3 }, { 2, 0, 1, 0, 1 }, { 0, 0, 0, 0, 0 }, }; -u8 gSfxRequestWriteIndex = 0; -u8 gSfxRequestReadIndex = 0; -u8 gSfxChannelLayout = 0; -u16 D_800C5D24 = 0; +u8 sSfxRequestWriteIndex = 0; +u8 sSfxRequestReadIndex = 0; +u8 sSfxChannelLayout = 0; +u16 sChannelMuteFlags = 0; f32 gDefaultSfxSource[3] = { 0.0f, 0.0f, 0.0f }; f32 gDefaultMod = 1.0f; s32 D_800C5D38 = 0; // unused. perhaps a default pan? s8 gDefaultReverb = 0; -s32 gAudioFrameCounter = 0; -u8 gSeqCmdWritePos = 0; -u8 gSeqCmdReadPos = 0; -u8 gStartSeqDisabled = 0; -u8 gSoundModeList[4] = { SOUNDMODE_STEREO, SOUNDMODE_HEADSET, SOUNDMODE_SURROUND, SOUNDMODE_MONO }; +s32 sAudioFrameCounter = 0; +u8 sSeqCmdWritePos = 0; +u8 sSeqCmdReadPos = 0; +u8 sStartSeqDisabled = 0; +u8 sSoundModeList[4] = { SOUNDMODE_STEREO, SOUNDMODE_HEADSET, SOUNDMODE_SURROUND, SOUNDMODE_MONO }; u8 sNewAudioSpecId = 0; u8 D_800C5D58 = 0; s32 D_800C5D5C = 0; // unused. file split? @@ -105,509 +106,408 @@ s8 D_800C5E38[29] = { u32 D_800C5E58[5] = { 20, 16, 10, 10, 20 }; s32 D_800C5E6C = 0; // unused. file split? u8 D_800C5E70 = 0; -f32 gSfxFreqMod = 1.0f; -f32 gSfxVolMod = 1.0f; // never modified -u8 gPlaylistIndex = 255; -s32 gPlaylistTimer = 0; -u8 gPlaylistCmdIndex = 0; +f32 sSfxFreqMod = 1.0f; +f32 sSfxVolMod = 1.0f; // never modified +u8 sPlaylistIndex = 255; +s32 sPlaylistTimer = 0; +u8 sPlaylistCmdIndex = 0; u32 D_800C5E88[] = { 0x1903000D, 0x1903000E, 0x19500015, 0x2903A021, 0x4900000C, 0x19122005, 0x1913204A, 0x2900306A, 0x29034024, 0x2902306C, 0x19032056, 0x19030057, 0x19033058, 0x19030006, 0x29503032, 0x1903407D, 0x4900402E, 0x19038072, 0x1903807E, 0x1903807F, 0x19038080, 0x11032081, 0x19031082, }; -SoundTestTrack D_800C5EE4[] = { - { 35, 22, 255, 0 }, - { 34, 23, 255, 0 }, - { 36, 23, 255, 0 }, - { 60, 280, 255, 0 }, - { 37, 0, 255, 0 }, - { 44, 1, 255, 0 }, - { 45, 1, 255, 0 }, - { 50, 1, 255, 0 }, - { 51, 8, 255, 0 }, - { 0x8000 + 2, 0, 255, 0 }, - { 0x8000 + 3, 1, 255, 0 }, - { 0x8000 + 4, 2, 255, 0 }, - { 0x8000 + 5, 3, 255, 0 }, - { 0x8000 + 6, 4, 255, 0 }, - { 0x8000 + 7, 5, 255, 0 }, - { 0x8000 + 8, 6, 255, 0 }, - { 0x8000 + 9, 7, 255, 0 }, - { 0x8000 + 10, 8, 255, 0 }, - { 0x8000 + 12, 10, 255, 0 }, - { 0x8000 + 13, 11, 255, 0 }, - { 14, 12, 255, 0 }, - { 0x8000 + 58, 1, 255, 0 }, - { 54, 13, 255, 0 }, - { 55, 11, 255, 0 }, - { 0x8000 + 18, 0, 255, 0 }, - { 0x8000 + 19, 1, 0, 0 }, - { 0x8000 + 19, 1, 255, 0 }, - { 0x8000 + 65, 7, 255, 0 }, - { 0x8000 + 28, 10, 255, 0 }, - { 0x8000 + 43, 6, 255, 0 }, - { 38, 0, 255, 0 }, - { 49, 0, 255, 0 }, - { 39, 0, 255, 0 }, - { 40, 25, 255, 0 }, - { 0x8000 + 63, 28, 255, 0 }, - { 0x8000 + 46, 784, 255, 0 }, - { 0x8000 + 47, 785, 255, 0 }, - { 56, 23, 255, 0 }, - { 0x8000 + 62, 6, 0, 0 }, - { 0x8000 + 17, 23, 255, 0 }, - { 0x8000 + 33, 6, 0, 0 }, - { 0x8000 + 33, 6, 255, 0 }, - { 0x8000 + 61, 6, 255, 0 }, - { 0x8000 + 64, 6, 255, 0 }, - { 42, 27, 255, 0 }, +SoundTestTrack sSoundTestTracks[] = { + /* 0 */ { SEQ_ID_OPENING, 22, -1 }, + /* 1 */ { SEQ_ID_TITLE, 23, -1 }, + /* 2 */ { SEQ_ID_MENU, 23, -1 }, + /* 3 */ { SEQ_ID_WORLD_MAP, 280, -1 }, + /* 4 */ { SEQ_ID_CO_INTRO, 0, -1 }, + /* 5 */ { SEQ_ID_INTRO_44, 1, -1 }, + /* 6 */ { SEQ_ID_INTRO_45, 1, -1 }, + /* 7 */ { SEQ_ID_ME_INTRO, 1, -1 }, + /* 8 */ { SEQ_ID_INTRO_51, 8, -1 }, + /* 9 */ { SEQ_ID_CORNERIA | SEQ_FLAG, 0, -1 }, + /* 10 */ { SEQ_ID_METEO | SEQ_FLAG, 1, -1 }, + /* 11 */ { SEQ_ID_TITANIA | SEQ_FLAG, 2, -1 }, + /* 12 */ { SEQ_ID_SECTOR_X | SEQ_FLAG, 3, -1 }, + /* 13 */ { SEQ_ID_ZONESS | SEQ_FLAG, 4, -1 }, + /* 14 */ { SEQ_ID_AREA_6 | SEQ_FLAG, 5, -1 }, + /* 15 */ { SEQ_ID_VENOM_1 | SEQ_FLAG, 6, -1 }, + /* 16 */ { SEQ_ID_SECTOR_Y | SEQ_FLAG, 7, -1 }, + /* 17 */ { SEQ_ID_FORTUNA | SEQ_FLAG, 8, -1 }, + /* 18 */ { SEQ_ID_BOLSE | SEQ_FLAG, 10, -1 }, + /* 19 */ { SEQ_ID_KATINA | SEQ_FLAG, 11, -1 }, + /* 20 */ { SEQ_ID_AQUAS, 12, -1 }, + /* 21 */ { SEQ_ID_WARP_ZONE | SEQ_FLAG, 1, -1 }, + /* 22 */ { SEQ_ID_KATT, 13, -1 }, + /* 23 */ { SEQ_ID_BILL, 11, -1 }, + /* 24 */ { SEQ_ID_CO_BOSS_1 | SEQ_FLAG, 0, -1 }, + /* 25 */ { SEQ_ID_ME_BOSS | SEQ_FLAG, 1, 0 }, + /* 26 */ { SEQ_ID_ME_BOSS | SEQ_FLAG, 1, -1 }, + /* 27 */ { SEQ_ID_BOSS_RESUME | SEQ_FLAG, 7, -1 }, + /* 28 */ { SEQ_ID_BO_BOSS | SEQ_FLAG, 10, -1 }, + /* 29 */ { SEQ_ID_STAR_WOLF | SEQ_FLAG, 6, -1 }, + /* 30 */ { SEQ_ID_GOOD_END, 0, -1 }, + /* 31 */ { SEQ_ID_BAD_END, 0, -1 }, + /* 32 */ { SEQ_ID_DEATH, 0, -1 }, + /* 33 */ { SEQ_ID_GAME_OVER, 25, -1 }, + /* 34 */ { SEQ_ID_TRAINING | SEQ_FLAG, 28, -1 }, + /* 35 */ { SEQ_ID_VERSUS | SEQ_FLAG, 784, -1 }, + /* 36 */ { SEQ_ID_VS_HURRY | SEQ_FLAG, 785, -1 }, + /* 37 */ { SEQ_ID_VS_MENU, 23, -1 }, + /* 38 */ { SEQ_ID_TO_ANDROSS | SEQ_FLAG, 6, 0 }, + /* 39 */ { SEQ_ID_ANDROSS | SEQ_FLAG, 23, -1 }, + /* 40 */ { SEQ_ID_AND_BOSS | SEQ_FLAG, 6, 0 }, + /* 41 */ { SEQ_ID_AND_BOSS | SEQ_FLAG, 6, -1 }, + /* 42 */ { SEQ_ID_AND_BRAIN | SEQ_FLAG, 6, -1 }, + /* 43 */ { SEQ_ID_VE_CLEAR | SEQ_FLAG, 6, -1 }, + /* 44 */ { SEQ_ID_ENDING, 27, -1 }, }; -PlaylistCmd gPlaylists[][100] = { + +PlaylistCmd sPlaylists[][100] = { { - { 0, 0, 0x25, 0, 0, 255, 1620 }, - { 0, 0, 0x8002, 0, 0, 255, 2490 }, - { 1, 0, 0x8002, 0, 50, 255, 50 }, - { 0, 0, 0x8012, 0, 0, 255, 1600 }, - { 1, 0, 0x8012, 0, 1, 255, 50 }, - { 0, 0, 0x26, 0, 0, 255, 1091 }, - { 1, 0, 0x26, 0, 100, 255, 100 }, - { 0, 0, 0x32, 0, 0, 255, 838 }, - { 0, 0, 0x8003, 0, 0, 255, 1584 }, - { 1, 0, 0x8003, 0, 50, 255, 50 }, - { 0, 0, 0x8013, 0, 0, 0, 1620 }, - { 1, 0, 0x8013, 0, 1, 255, 50 }, - { 0, 0, 0x8041, 0, 0, 255, 1620 }, - { 1, 0, 0x8041, 0, 1, 255, 50 }, - { 0, 0, 0x26, 0, 0, 255, 1091 }, - { 1, 0, 0x26, 0, 100, 255, 100 }, - { 0, 0, 0x33, 0, 0, 255, 241 }, - { 0, 0, 0x800A, 0, 0, 255, 1632 }, - { 1, 0, 0x800A, 0, 100, 255, 100 }, - { 0, 0, 0x802B, 0, 0, 255, 2120 }, - { 0, 0, 0x800A, 0, 0, 0, 450 }, - { 1, 0, 0x800A, 0, 50, 255, 200 }, - { 0, 0, 0x31, 0, 0, 255, 1604 }, - { 1, 0, 0x31, 0, 100, 255, 100 }, - { 0, 0, 0x2C, 0, 0, 255, 242 }, - { 0, 0, 0x8005, 0, 0, 255, 2291 }, - { 1, 0, 0x8005, 0, 50, 255, 100 }, - { 0, 0, 0x8015, 0, 0, 255, 1600 }, - { 1, 0, 0x8015, 0, 1, 255, 50 }, - { 2, 0, 0x8015, 0, 0, 255, 1600 }, - { 1, 0, 0x8015, 0, 1, 255, 50 }, - { 0, 0, 0x26, 0, 0, 255, 1091 }, - { 1, 0, 0x26, 0, 100, 255, 100 }, - { 0, 0, 0x2D, 0, 0, 255, 542 }, - { 0, 0, 0x8004, 0, 0, 255, 1920 }, - { 1, 0, 0x8004, 0, 50, 255, 50 }, - { 0, 0, 0x8014, 0, 0, 255, 1600 }, - { 1, 0, 0x8014, 0, 1, 255, 50 }, - { 0, 0, 0x26, 0, 0, 255, 1091 }, - { 1, 0, 0x26, 0, 100, 255, 100 }, - { 0, 0, 0x33, 0, 0, 255, 241 }, - { 0, 0, 0x800C, 0, 0, 255, 1177 }, - { 1, 0, 0x800C, 0, 100, 255, 100 }, - { 0, 0, 0x801C, 0, 0, 255, 1115 }, - { 1, 0, 0x801C, 0, 50, 255, 50 }, - { 0, 0, 0x802B, 0, 0, 255, 2120 }, - { 1, 0, 0x802B, 0, 1, 255, 50 }, - { 0, 0, 0x27, 0, 0, 255, 150 }, - { 0, 0, 0x28, 0, 0, 255, 1020 }, - { 1, 0, 0x28, 0, 100, 255, 100 }, - { 255, 0, 0x8002, 0, 50, 255, 50 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, + { 0, 0, SEQ_ID_CO_INTRO, 0, 255, 1620 }, + { 0, 0, SEQ_ID_CORNERIA | SEQ_FLAG, 0, 255, 2490 }, + { 1, 0, SEQ_ID_CORNERIA | SEQ_FLAG, 50, 255, 50 }, + { 0, 0, SEQ_ID_CO_BOSS_1 | SEQ_FLAG, 0, 255, 1600 }, + { 1, 0, SEQ_ID_CO_BOSS_1 | SEQ_FLAG, 1, 255, 50 }, + { 0, 0, SEQ_ID_GOOD_END, 0, 255, 1091 }, + { 1, 0, SEQ_ID_GOOD_END, 100, 255, 100 }, + { 0, 0, SEQ_ID_ME_INTRO, 0, 255, 838 }, + { 0, 0, SEQ_ID_METEO | SEQ_FLAG, 0, 255, 1584 }, + { 1, 0, SEQ_ID_METEO | SEQ_FLAG, 50, 255, 50 }, + { 0, 0, SEQ_ID_ME_BOSS | SEQ_FLAG, 0, 0, 1620 }, + { 1, 0, SEQ_ID_ME_BOSS | SEQ_FLAG, 1, 255, 50 }, + { 0, 0, SEQ_ID_BOSS_RESUME | SEQ_FLAG, 0, 255, 1620 }, + { 1, 0, SEQ_ID_BOSS_RESUME | SEQ_FLAG, 1, 255, 50 }, + { 0, 0, SEQ_ID_GOOD_END, 0, 255, 1091 }, + { 1, 0, SEQ_ID_GOOD_END, 100, 255, 100 }, + { 0, 0, SEQ_ID_INTRO_51, 0, 255, 241 }, + { 0, 0, SEQ_ID_FORTUNA | SEQ_FLAG, 0, 255, 1632 }, + { 1, 0, SEQ_ID_FORTUNA | SEQ_FLAG, 100, 255, 100 }, + { 0, 0, SEQ_ID_STAR_WOLF | SEQ_FLAG, 0, 255, 2120 }, + { 0, 0, SEQ_ID_FORTUNA | SEQ_FLAG, 0, 0, 450 }, + { 1, 0, SEQ_ID_FORTUNA | SEQ_FLAG, 50, 255, 200 }, + { 0, 0, SEQ_ID_BAD_END, 0, 255, 1604 }, + { 1, 0, SEQ_ID_BAD_END, 100, 255, 100 }, + { 0, 0, SEQ_ID_INTRO_44, 0, 255, 242 }, + { 0, 0, SEQ_ID_SECTOR_X | SEQ_FLAG, 0, 255, 2291 }, + { 1, 0, SEQ_ID_SECTOR_X | SEQ_FLAG, 50, 255, 100 }, + { 0, 0, SEQ_ID_SX_BOSS | SEQ_FLAG, 0, 255, 1600 }, + { 1, 0, SEQ_ID_SX_BOSS | SEQ_FLAG, 1, 255, 50 }, + { 2, 0, SEQ_ID_SX_BOSS | SEQ_FLAG, 0, 255, 1600 }, + { 1, 0, SEQ_ID_SX_BOSS | SEQ_FLAG, 1, 255, 50 }, + { 0, 0, SEQ_ID_GOOD_END, 0, 255, 1091 }, + { 1, 0, SEQ_ID_GOOD_END, 100, 255, 100 }, + { 0, 0, SEQ_ID_INTRO_45, 0, 255, 542 }, + { 0, 0, SEQ_ID_TITANIA | SEQ_FLAG, 0, 255, 1920 }, + { 1, 0, SEQ_ID_TITANIA | SEQ_FLAG, 50, 255, 50 }, + { 0, 0, SEQ_ID_TI_BOSS | SEQ_FLAG, 0, 255, 1600 }, + { 1, 0, SEQ_ID_TI_BOSS | SEQ_FLAG, 1, 255, 50 }, + { 0, 0, SEQ_ID_GOOD_END, 0, 255, 1091 }, + { 1, 0, SEQ_ID_GOOD_END, 100, 255, 100 }, + { 0, 0, SEQ_ID_INTRO_51, 0, 255, 241 }, + { 0, 0, SEQ_ID_BOLSE | SEQ_FLAG, 0, 255, 1177 }, + { 1, 0, SEQ_ID_BOLSE | SEQ_FLAG, 100, 255, 100 }, + { 0, 0, SEQ_ID_BO_BOSS | SEQ_FLAG, 0, 255, 1115 }, + { 1, 0, SEQ_ID_BO_BOSS | SEQ_FLAG, 50, 255, 50 }, + { 0, 0, SEQ_ID_STAR_WOLF | SEQ_FLAG, 0, 255, 2120 }, + { 1, 0, SEQ_ID_STAR_WOLF | SEQ_FLAG, 1, 255, 50 }, + { 0, 0, SEQ_ID_DEATH, 0, 255, 150 }, + { 0, 0, SEQ_ID_GAME_OVER, 0, 255, 1020 }, + { 1, 0, SEQ_ID_GAME_OVER, 100, 255, 100 }, + { 255, 0, SEQ_ID_CORNERIA | SEQ_FLAG, 50, 255, 50 }, }, { - { 0, 0, 0x25, 0, 0, 255, 1620 }, - { 0, 0, 0x8002, 0, 0, 255, 2490 }, - { 1, 0, 0x8002, 0, 50, 255, 50 }, - { 0, 0, 0x8030, 0, 0, 255, 1620 }, - { 1, 0, 0x8030, 0, 1, 255, 50 }, - { 0, 0, 0x26, 0, 0, 255, 1091 }, - { 1, 0, 0x26, 0, 100, 255, 100 }, - { 0, 0, 0x2C, 0, 0, 255, 242 }, - { 0, 0, 0x8009, 0, 0, 255, 2096 }, - { 1, 0, 0x8009, 0, 50, 255, 50 }, - { 0, 0, 0x8019, 0, 0, 2, 1600 }, - { 1, 0, 0x8019, 0, 1, 255, 50 }, - { 0, 0, 0x8041, 0, 0, 255, 1600 }, - { 1, 0, 0x8041, 0, 1, 255, 50 }, - { 0, 0, 0x26, 0, 0, 255, 1091 }, - { 1, 0, 0x26, 0, 100, 255, 100 }, - { 0, 0, 0x33, 0, 0, 255, 241 }, - { 0, 0, 0x800D, 0, 0, 255, 2184 }, - { 1, 0, 0x800D, 0, 1, 255, 100 }, - { 0, 0, 0x801D, 0, 0, 1, 1115 }, - { 1, 0, 0x801D, 0, 50, 255, 100 }, - { 0, 0, 0x26, 0, 0, 255, 1091 }, - { 1, 0, 0x26, 0, 100, 255, 100 }, - { 0, 0, 0x33, 0, 0, 255, 250 }, - { 0, 0, 0x800B, 0, 0, 255, 1096 }, - { 3, 0, 0x37, 0, 0, 255, 1000 }, - { 1, 0, 0x800B, 0, 50, 255, 50 }, - { 0, 0, 0x801B, 0, 0, 255, 1600 }, - { 1, 0, 0x801B, 0, 1, 255, 50 }, - { 0, 0, 0x26, 0, 0, 255, 1091 }, - { 1, 0, 0x26, 0, 100, 255, 100 }, - { 0, 0, 0x2C, 0, 0, 255, 260 }, - { 0, 0, 0x8010, 0, 0, 255, 1920 }, - { 1, 0, 0x8010, 0, 50, 255, 50 }, - { 0, 0, 0x8020, 0, 0, 255, 1600 }, - { 1, 0, 0x8020, 0, 1, 255, 50 }, - { 0, 0, 0x26, 0, 0, 255, 1091 }, - { 1, 0, 0x26, 0, 100, 255, 100 }, - { 0, 0, 0x33, 0, 0, 255, 241 }, - { 0, 0, 0x800C, 0, 0, 255, 1177 }, - { 1, 0, 0x800C, 0, 100, 255, 100 }, - { 0, 0, 0x801C, 0, 0, 255, 1115 }, - { 1, 0, 0x801C, 0, 50, 255, 50 }, - { 0, 0, 0x802B, 0, 0, 255, 2120 }, - { 1, 0, 0x802B, 0, 1, 255, 50 }, - { 0, 0, 0x26, 0, 0, 255, 1091 }, - { 1, 0, 0x26, 0, 100, 255, 100 }, - { 0, 0, 0x8008, 0, 0, 255, 1671 }, - { 1, 0, 0x8008, 0, 50, 255, 50 }, - { 0, 0, 0x8018, 0, 0, 255, 1600 }, - { 1, 0, 0x8018, 0, 1, 255, 50 }, - { 0, 0, 0x803E, 0, 0, 0, 176 }, - { 0, 0, 0x8011, 0, 0, 255, 588 }, - { 0, 0, 0x8021, 0, 0, 0, 2420 }, - { 1, 0, 0x8021, 0, 10, 255, 50 }, - { 0, 0, 0x8021, 0, 0, 255, 1200 }, - { 1, 0, 0x8021, 0, 1, 255, 150 }, - { 0, 0, 0x8040, 0, 0, 255, 1091 }, - { 1, 0, 0x8040, 0, 80, 255, 160 }, - { 0, 0, 0x2A, 0, 0, 255, 9500 }, - { 255, 0, 0x8002, 0, 50, 255, 50 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, + { 0, 0, SEQ_ID_CO_INTRO, 0, 255, 1620 }, + { 0, 0, SEQ_ID_CORNERIA | SEQ_FLAG, 0, 255, 2490 }, + { 1, 0, SEQ_ID_CORNERIA | SEQ_FLAG, 50, 255, 50 }, + { 0, 0, SEQ_ID_CO_BOSS_2 | SEQ_FLAG, 0, 255, 1620 }, + { 1, 0, SEQ_ID_CO_BOSS_2 | SEQ_FLAG, 1, 255, 50 }, + { 0, 0, SEQ_ID_GOOD_END, 0, 255, 1091 }, + { 1, 0, SEQ_ID_GOOD_END, 100, 255, 100 }, + { 0, 0, SEQ_ID_INTRO_44, 0, 255, 242 }, + { 0, 0, SEQ_ID_SECTOR_Y | SEQ_FLAG, 0, 255, 2096 }, + { 1, 0, SEQ_ID_SECTOR_Y | SEQ_FLAG, 50, 255, 50 }, + { 0, 0, SEQ_ID_SY_BOSS | SEQ_FLAG, 0, 2, 1600 }, + { 1, 0, SEQ_ID_SY_BOSS | SEQ_FLAG, 1, 255, 50 }, + { 0, 0, SEQ_ID_BOSS_RESUME | SEQ_FLAG, 0, 255, 1600 }, + { 1, 0, SEQ_ID_BOSS_RESUME | SEQ_FLAG, 1, 255, 50 }, + { 0, 0, SEQ_ID_GOOD_END, 0, 255, 1091 }, + { 1, 0, SEQ_ID_GOOD_END, 100, 255, 100 }, + { 0, 0, SEQ_ID_INTRO_51, 0, 255, 241 }, + { 0, 0, SEQ_ID_KATINA | SEQ_FLAG, 0, 255, 2184 }, + { 1, 0, SEQ_ID_KATINA | SEQ_FLAG, 1, 255, 100 }, + { 0, 0, SEQ_ID_KA_BOSS | SEQ_FLAG, 0, 1, 1115 }, + { 1, 0, SEQ_ID_KA_BOSS | SEQ_FLAG, 50, 255, 100 }, + { 0, 0, SEQ_ID_GOOD_END, 0, 255, 1091 }, + { 1, 0, SEQ_ID_GOOD_END, 100, 255, 100 }, + { 0, 0, SEQ_ID_INTRO_51, 0, 255, 250 }, + { 0, 0, SEQ_ID_SOLAR | SEQ_FLAG, 0, 255, 1096 }, + { 3, 0, SEQ_ID_BILL, 0, 255, 1000 }, + { 1, 0, SEQ_ID_SOLAR | SEQ_FLAG, 50, 255, 50 }, + { 0, 0, SEQ_ID_SO_BOSS | SEQ_FLAG, 0, 255, 1600 }, + { 1, 0, SEQ_ID_SO_BOSS | SEQ_FLAG, 1, 255, 50 }, + { 0, 0, SEQ_ID_GOOD_END, 0, 255, 1091 }, + { 1, 0, SEQ_ID_GOOD_END, 100, 255, 100 }, + { 0, 0, SEQ_ID_INTRO_44, 0, 255, 260 }, + { 0, 0, SEQ_ID_MACBETH | SEQ_FLAG, 0, 255, 1920 }, + { 1, 0, SEQ_ID_MACBETH | SEQ_FLAG, 50, 255, 50 }, + { 0, 0, SEQ_ID_MA_BOSS | SEQ_FLAG, 0, 255, 1600 }, + { 1, 0, SEQ_ID_MA_BOSS | SEQ_FLAG, 1, 255, 50 }, + { 0, 0, SEQ_ID_GOOD_END, 0, 255, 1091 }, + { 1, 0, SEQ_ID_GOOD_END, 100, 255, 100 }, + { 0, 0, SEQ_ID_INTRO_51, 0, 255, 241 }, + { 0, 0, SEQ_ID_BOLSE | SEQ_FLAG, 0, 255, 1177 }, + { 1, 0, SEQ_ID_BOLSE | SEQ_FLAG, 100, 255, 100 }, + { 0, 0, SEQ_ID_BO_BOSS | SEQ_FLAG, 0, 255, 1115 }, + { 1, 0, SEQ_ID_BO_BOSS | SEQ_FLAG, 50, 255, 50 }, + { 0, 0, SEQ_ID_STAR_WOLF | SEQ_FLAG, 0, 255, 2120 }, + { 1, 0, SEQ_ID_STAR_WOLF | SEQ_FLAG, 1, 255, 50 }, + { 0, 0, SEQ_ID_GOOD_END, 0, 255, 1091 }, + { 1, 0, SEQ_ID_GOOD_END, 100, 255, 100 }, + { 0, 0, SEQ_ID_VENOM_1 | SEQ_FLAG, 0, 255, 1671 }, + { 1, 0, SEQ_ID_VENOM_1 | SEQ_FLAG, 50, 255, 50 }, + { 0, 0, SEQ_ID_VE_BOSS | SEQ_FLAG, 0, 255, 1600 }, + { 1, 0, SEQ_ID_VE_BOSS | SEQ_FLAG, 1, 255, 50 }, + { 0, 0, SEQ_ID_TO_ANDROSS | SEQ_FLAG, 0, 0, 176 }, + { 0, 0, SEQ_ID_ANDROSS | SEQ_FLAG, 0, 255, 588 }, + { 0, 0, SEQ_ID_AND_BOSS | SEQ_FLAG, 0, 0, 2420 }, + { 1, 0, SEQ_ID_AND_BOSS | SEQ_FLAG, 10, 255, 50 }, + { 0, 0, SEQ_ID_AND_BOSS | SEQ_FLAG, 0, 255, 1200 }, + { 1, 0, SEQ_ID_AND_BOSS | SEQ_FLAG, 1, 255, 150 }, + { 0, 0, SEQ_ID_VE_CLEAR | SEQ_FLAG, 0, 255, 1091 }, + { 1, 0, SEQ_ID_VE_CLEAR | SEQ_FLAG, 80, 255, 160 }, + { 0, 0, SEQ_ID_ENDING, 0, 255, 9500 }, + { 255, 0, SEQ_ID_CORNERIA | SEQ_FLAG, 50, 255, 50 }, + { 0 }, + { 0 }, + { 0 }, + { 0 }, + { 0 }, + { 0 }, + { 0 }, + { 0 }, + { 0 }, + { 0 }, + { 0 }, + { 0 }, + { 0 }, + { 0 }, + { 0 }, + { 0 }, + { 0 }, + { 0 }, + { 0 }, + { 0 }, + { 0 }, + { 0 }, + { 0 }, + { 0 }, + { 0 }, + { 0 }, + { 0 }, + { 0 }, + { 0 }, + { 0 }, + { 0 }, + { 0 }, + { 0 }, + { 0 }, + { 0 }, + { 0 }, + { 0 }, + { 0 }, + { 0 }, }, { - { 0, 0, 0x25, 0, 0, 255, 1620 }, { 0, 0, 0x8002, 0, 0, 255, 2490 }, { 1, 0, 0x8002, 0, 50, 255, 50 }, - { 0, 0, 0x8030, 0, 0, 255, 1620 }, { 1, 0, 0x8030, 0, 1, 255, 50 }, { 0, 0, 0x26, 0, 0, 255, 1091 }, - { 1, 0, 0x26, 0, 100, 255, 100 }, { 0, 0, 0x2C, 0, 0, 255, 260 }, { 0, 0, 0x8009, 0, 0, 255, 2096 }, - { 1, 0, 0x8009, 0, 50, 255, 50 }, { 0, 0, 0x8019, 0, 0, 2, 1590 }, { 1, 0, 0x8019, 0, 1, 255, 50 }, - { 0, 0, 0x8041, 0, 0, 255, 1600 }, { 1, 0, 0x8041, 0, 1, 255, 50 }, { 0, 0, 0x26, 0, 0, 255, 1091 }, - { 1, 0, 0x26, 0, 100, 255, 100 }, { 0, 0, 0x2C, 0, 0, 255, 260 }, { 0, 0, 0xE, 0, 0, 255, 2400 }, - { 1, 0, 0xE, 0, 150, 255, 200 }, { 0, 0, 0x801E, 0, 0, 1, 1590 }, { 1, 0, 0x801E, 0, 1, 255, 50 }, - { 0, 0, 0x26, 0, 0, 255, 1091 }, { 1, 0, 0x26, 0, 100, 255, 100 }, { 0, 0, 0x2C, 0, 0, 255, 260 }, - { 0, 0, 0x8006, 0, 0, 255, 1005 }, { 3, 0, 0x36, 0, 0, 255, 1000 }, { 1, 0, 0x8006, 0, 50, 255, 100 }, - { 0, 0, 0x8016, 0, 0, 255, 1600 }, { 1, 0, 0x8016, 0, 1, 255, 50 }, { 0, 0, 0x26, 0, 0, 255, 1091 }, - { 1, 0, 0x26, 0, 100, 255, 100 }, { 0, 0, 0x33, 0, 0, 255, 241 }, { 0, 0, 0x800F, 0, 0, 255, 1632 }, - { 1, 0, 0x800F, 0, 50, 255, 100 }, { 0, 0, 0x801F, 0, 0, 1, 1310 }, { 3, 0, 0x36, 0, 0, 255, 500 }, - { 1, 0, 0x801F, 0, 1, 255, 50 }, { 0, 0, 0x26, 0, 0, 255, 1091 }, { 1, 0, 0x26, 0, 100, 255, 100 }, - { 0, 0, 0x33, 0, 0, 255, 241 }, { 0, 0, 0x8007, 0, 0, 255, 1906 }, { 1, 0, 0x8007, 0, 50, 255, 100 }, - { 0, 0, 0x8017, 0, 0, 1, 1590 }, { 1, 0, 0x8017, 0, 1, 255, 50 }, { 0, 0, 0x26, 0, 0, 255, 1091 }, - { 1, 0, 0x26, 0, 100, 255, 100 }, { 0, 0, 0x802B, 0, 0, 255, 2120 }, { 1, 0, 0x802B, 0, 30, 255, 150 }, - { 0, 0, 0x803E, 0, 0, 0, 176 }, { 0, 0, 0x8011, 0, 0, 255, 588 }, { 0, 0, 0x8021, 0, 0, 0, 2392 }, - { 1, 0, 0x8021, 0, 10, 255, 50 }, { 0, 0, 0x803D, 0, 0, 255, 1700 }, { 1, 0, 0x8021, 0, 10, 255, 250 }, - { 0, 0, 0x8017, 0, 0, 255, 1600 }, { 1, 0, 0x8017, 0, 1, 255, 50 }, { 0, 0, 0x8040, 0, 0, 255, 1091 }, - { 1, 0, 0x8040, 0, 80, 255, 160 }, { 0, 0, 0x2A, 0, 0, 255, 9250 }, { 255, 0, 0x8002, 0, 50, 255, 50 }, - { 0, 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, + { 0, 0, SEQ_ID_CO_INTRO, 0, 255, 1620 }, + { 0, 0, SEQ_ID_CORNERIA | SEQ_FLAG, 0, 255, 2490 }, + { 1, 0, SEQ_ID_CORNERIA | SEQ_FLAG, 50, 255, 50 }, + { 0, 0, SEQ_ID_CO_BOSS_2 | SEQ_FLAG, 0, 255, 1620 }, + { 1, 0, SEQ_ID_CO_BOSS_2 | SEQ_FLAG, 1, 255, 50 }, + { 0, 0, SEQ_ID_GOOD_END, 0, 255, 1091 }, + { 1, 0, SEQ_ID_GOOD_END, 100, 255, 100 }, + { 0, 0, SEQ_ID_INTRO_44, 0, 255, 260 }, + { 0, 0, SEQ_ID_SECTOR_Y | SEQ_FLAG, 0, 255, 2096 }, + { 1, 0, SEQ_ID_SECTOR_Y | SEQ_FLAG, 50, 255, 50 }, + { 0, 0, SEQ_ID_SY_BOSS | SEQ_FLAG, 0, 2, 1590 }, + { 1, 0, SEQ_ID_SY_BOSS | SEQ_FLAG, 1, 255, 50 }, + { 0, 0, SEQ_ID_BOSS_RESUME | SEQ_FLAG, 0, 255, 1600 }, + { 1, 0, SEQ_ID_BOSS_RESUME | SEQ_FLAG, 1, 255, 50 }, + { 0, 0, SEQ_ID_GOOD_END, 0, 255, 1091 }, + { 1, 0, SEQ_ID_GOOD_END, 100, 255, 100 }, + { 0, 0, SEQ_ID_INTRO_44, 0, 255, 260 }, + { 0, 0, SEQ_ID_AQUAS, 0, 255, 2400 }, + { 1, 0, SEQ_ID_AQUAS, 150, 255, 200 }, + { 0, 0, SEQ_ID_AQ_BOSS | SEQ_FLAG, 0, 1, 1590 }, + { 1, 0, SEQ_ID_AQ_BOSS | SEQ_FLAG, 1, 255, 50 }, + { 0, 0, SEQ_ID_GOOD_END, 0, 255, 1091 }, + { 1, 0, SEQ_ID_GOOD_END, 100, 255, 100 }, + { 0, 0, SEQ_ID_INTRO_44, 0, 255, 260 }, + { 0, 0, SEQ_ID_ZONESS | SEQ_FLAG, 0, 255, 1005 }, + { 3, 0, SEQ_ID_KATT, 0, 255, 1000 }, + { 1, 0, SEQ_ID_ZONESS | SEQ_FLAG, 50, 255, 100 }, + { 0, 0, SEQ_ID_ZO_BOSS | SEQ_FLAG, 0, 255, 1600 }, + { 1, 0, SEQ_ID_ZO_BOSS | SEQ_FLAG, 1, 255, 50 }, + { 0, 0, SEQ_ID_GOOD_END, 0, 255, 1091 }, + { 1, 0, SEQ_ID_GOOD_END, 100, 255, 100 }, + { 0, 0, SEQ_ID_INTRO_51, 0, 255, 241 }, + { 0, 0, SEQ_ID_SECTOR_Z | SEQ_FLAG, 0, 255, 1632 }, + { 1, 0, SEQ_ID_SECTOR_Z | SEQ_FLAG, 50, 255, 100 }, + { 0, 0, SEQ_ID_SZ_BOSS | SEQ_FLAG, 0, 1, 1310 }, + { 3, 0, SEQ_ID_KATT, 0, 255, 500 }, + { 1, 0, SEQ_ID_SZ_BOSS | SEQ_FLAG, 1, 255, 50 }, + { 0, 0, SEQ_ID_GOOD_END, 0, 255, 1091 }, + { 1, 0, SEQ_ID_GOOD_END, 100, 255, 100 }, + { 0, 0, SEQ_ID_INTRO_51, 0, 255, 241 }, + { 0, 0, SEQ_ID_AREA_6 | SEQ_FLAG, 0, 255, 1906 }, + { 1, 0, SEQ_ID_AREA_6 | SEQ_FLAG, 50, 255, 100 }, + { 0, 0, SEQ_ID_A6_BOSS | SEQ_FLAG, 0, 1, 1590 }, + { 1, 0, SEQ_ID_A6_BOSS | SEQ_FLAG, 1, 255, 50 }, + { 0, 0, SEQ_ID_GOOD_END, 0, 255, 1091 }, + { 1, 0, SEQ_ID_GOOD_END, 100, 255, 100 }, + { 0, 0, SEQ_ID_STAR_WOLF | SEQ_FLAG, 0, 255, 2120 }, + { 1, 0, SEQ_ID_STAR_WOLF | SEQ_FLAG, 30, 255, 150 }, + { 0, 0, SEQ_ID_TO_ANDROSS | SEQ_FLAG, 0, 0, 176 }, + { 0, 0, SEQ_ID_ANDROSS | SEQ_FLAG, 0, 255, 588 }, + { 0, 0, SEQ_ID_AND_BOSS | SEQ_FLAG, 0, 0, 2392 }, + { 1, 0, SEQ_ID_AND_BOSS | SEQ_FLAG, 10, 255, 50 }, + { 0, 0, SEQ_ID_AND_BRAIN | SEQ_FLAG, 0, 255, 1700 }, + { 1, 0, SEQ_ID_AND_BOSS | SEQ_FLAG, 10, 255, 250 }, + { 0, 0, SEQ_ID_A6_BOSS | SEQ_FLAG, 0, 255, 1600 }, + { 1, 0, SEQ_ID_A6_BOSS | SEQ_FLAG, 1, 255, 50 }, + { 0, 0, SEQ_ID_VE_CLEAR | SEQ_FLAG, 0, 255, 1091 }, + { 1, 0, SEQ_ID_VE_CLEAR | SEQ_FLAG, 80, 255, 160 }, + { 0, 0, SEQ_ID_ENDING, 0, 255, 9250 }, + { 255, 0, SEQ_ID_CORNERIA | SEQ_FLAG, 50, 255, 50 }, }, { - { 0, 0, 0x25, 0, 0, 255, 1620 }, - { 0, 0, 0x8002, 0, 0, 255, 2490 }, - { 1, 0, 0x8002, 0, 50, 255, 50 }, - { 0, 0, 0x8012, 0, 0, 255, 1600 }, - { 1, 0, 0x8012, 0, 1, 255, 50 }, - { 0, 0, 0x26, 0, 0, 255, 1091 }, - { 1, 0, 0x26, 0, 100, 255, 100 }, - { 0, 0, 0x32, 0, 0, 255, 838 }, - { 0, 0, 0x8003, 0, 0, 255, 1584 }, - { 1, 0, 0x8003, 0, 150, 255, 150 }, - { 0, 0, 0x803A, 0, 0, 255, 1635 }, - { 1, 0, 0x803A, 0, 150, 255, 150 }, - { 0, 0, 0x33, 0, 0, 255, 241 }, - { 0, 0, 0x800D, 0, 0, 255, 2184 }, - { 1, 0, 0x800D, 0, 1, 255, 100 }, - { 0, 0, 0x801D, 0, 0, 1, 1115 }, - { 1, 0, 0x801D, 0, 50, 255, 100 }, - { 0, 0, 0x31, 0, 0, 255, 1604 }, - { 1, 0, 0x31, 0, 100, 255, 100 }, - { 0, 0, 0x2C, 0, 0, 255, 242 }, - { 0, 0, 0x8005, 0, 0, 255, 1291 }, - { 3, 0, 0x37, 0, 0, 255, 1000 }, - { 1, 0, 0x8005, 0, 50, 255, 100 }, - { 0, 0, 0x803A, 0, 0, 255, 1635 }, - { 1, 0, 0x803A, 0, 150, 255, 150 }, - { 0, 0, 0x33, 0, 0, 255, 241 }, - { 0, 0, 0x800F, 0, 0, 255, 1632 }, - { 1, 0, 0x800F, 0, 50, 255, 100 }, - { 0, 0, 0x801F, 0, 0, 1, 1115 }, - { 1, 0, 0x801F, 0, 1, 255, 50 }, - { 0, 0, 0x26, 0, 0, 255, 1091 }, - { 1, 0, 0x26, 0, 100, 255, 100 }, - { 0, 0, 0x33, 0, 0, 255, 241 }, - { 0, 0, 0x8007, 0, 0, 255, 1906 }, - { 1, 0, 0x8007, 0, 50, 255, 100 }, - { 0, 0, 0x8017, 0, 0, 1, 1590 }, - { 1, 0, 0x8017, 0, 1, 255, 50 }, - { 0, 0, 0x27, 0, 0, 255, 150 }, - { 0, 0, 0x28, 0, 0, 255, 1020 }, - { 1, 0, 0x28, 0, 100, 255, 100 }, - { 255, 0, 0x8002, 0, 50, 255, 50 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, + { 0, 0, SEQ_ID_CO_INTRO, 0, 255, 1620 }, + { 0, 0, SEQ_ID_CORNERIA | SEQ_FLAG, 0, 255, 2490 }, + { 1, 0, SEQ_ID_CORNERIA | SEQ_FLAG, 50, 255, 50 }, + { 0, 0, SEQ_ID_CO_BOSS_1 | SEQ_FLAG, 0, 255, 1600 }, + { 1, 0, SEQ_ID_CO_BOSS_1 | SEQ_FLAG, 1, 255, 50 }, + { 0, 0, SEQ_ID_GOOD_END, 0, 255, 1091 }, + { 1, 0, SEQ_ID_GOOD_END, 100, 255, 100 }, + { 0, 0, SEQ_ID_ME_INTRO, 0, 255, 838 }, + { 0, 0, SEQ_ID_METEO | SEQ_FLAG, 0, 255, 1584 }, + { 1, 0, SEQ_ID_METEO | SEQ_FLAG, 150, 255, 150 }, + { 0, 0, SEQ_ID_WARP_ZONE | SEQ_FLAG, 0, 255, 1635 }, + { 1, 0, SEQ_ID_WARP_ZONE | SEQ_FLAG, 150, 255, 150 }, + { 0, 0, SEQ_ID_INTRO_51, 0, 255, 241 }, + { 0, 0, SEQ_ID_KATINA | SEQ_FLAG, 0, 255, 2184 }, + { 1, 0, SEQ_ID_KATINA | SEQ_FLAG, 1, 255, 100 }, + { 0, 0, SEQ_ID_KA_BOSS | SEQ_FLAG, 0, 1, 1115 }, + { 1, 0, SEQ_ID_KA_BOSS | SEQ_FLAG, 50, 255, 100 }, + { 0, 0, SEQ_ID_BAD_END, 0, 255, 1604 }, + { 1, 0, SEQ_ID_BAD_END, 100, 255, 100 }, + { 0, 0, SEQ_ID_INTRO_44, 0, 255, 242 }, + { 0, 0, SEQ_ID_SECTOR_X | SEQ_FLAG, 0, 255, 1291 }, + { 3, 0, SEQ_ID_BILL, 0, 255, 1000 }, + { 1, 0, SEQ_ID_SECTOR_X | SEQ_FLAG, 50, 255, 100 }, + { 0, 0, SEQ_ID_WARP_ZONE | SEQ_FLAG, 0, 255, 1635 }, + { 1, 0, SEQ_ID_WARP_ZONE | SEQ_FLAG, 150, 255, 150 }, + { 0, 0, SEQ_ID_INTRO_51, 0, 255, 241 }, + { 0, 0, SEQ_ID_SECTOR_Z | SEQ_FLAG, 0, 255, 1632 }, + { 1, 0, SEQ_ID_SECTOR_Z | SEQ_FLAG, 50, 255, 100 }, + { 0, 0, SEQ_ID_SZ_BOSS | SEQ_FLAG, 0, 1, 1115 }, + { 1, 0, SEQ_ID_SZ_BOSS | SEQ_FLAG, 1, 255, 50 }, + { 0, 0, SEQ_ID_GOOD_END, 0, 255, 1091 }, + { 1, 0, SEQ_ID_GOOD_END, 100, 255, 100 }, + { 0, 0, SEQ_ID_INTRO_51, 0, 255, 241 }, + { 0, 0, SEQ_ID_AREA_6 | SEQ_FLAG, 0, 255, 1906 }, + { 1, 0, SEQ_ID_AREA_6 | SEQ_FLAG, 50, 255, 100 }, + { 0, 0, SEQ_ID_A6_BOSS | SEQ_FLAG, 0, 1, 1590 }, + { 1, 0, SEQ_ID_A6_BOSS | SEQ_FLAG, 1, 255, 50 }, + { 0, 0, SEQ_ID_DEATH, 0, 255, 150 }, + { 0, 0, SEQ_ID_GAME_OVER, 0, 255, 1020 }, + { 1, 0, SEQ_ID_GAME_OVER, 100, 255, 100 }, + { 255, 0, SEQ_ID_CORNERIA | SEQ_FLAG, 50, 255, 50 }, }, { - { 0, 0, 0x23, 0, 0, 255, 2926 }, - { 0, 0, 0x22, 0, 0, 255, 1251 }, - { 1, 0, 0x22, 0, 200, 255, 200 }, - { 0, 0, 0x24, 0, 0, 255, 1636 }, - { 1, 0, 0x24, 0, 200, 255, 200 }, - { 0, 0, 0x3C, 0, 0, 255, 1560 }, - { 1, 0, 0x3C, 0, 200, 255, 200 }, - { 0, 0, 0x25, 0, 0, 255, 1618 }, - { 0, 0, 0x2C, 0, 0, 255, 242 }, - { 0, 0, 0x2D, 0, 0, 255, 582 }, - { 0, 0, 0x32, 0, 0, 255, 868 }, - { 0, 0, 0x33, 0, 0, 255, 281 }, - { 0, 0, 0x8002, 0, 0, 255, 2490 }, - { 1, 0, 0x8002, 0, 200, 255, 200 }, - { 0, 0, 0x8003, 0, 0, 255, 1584 }, - { 1, 0, 0x8003, 0, 200, 255, 200 }, - { 0, 0, 0x8004, 0, 0, 255, 1920 }, - { 1, 0, 0x8004, 0, 200, 255, 200 }, - { 0, 0, 0x8005, 0, 0, 255, 2290 }, - { 1, 0, 0x8005, 0, 200, 255, 200 }, - { 0, 0, 0x8006, 0, 0, 255, 2005 }, - { 1, 0, 0x8006, 0, 200, 255, 200 }, - { 0, 0, 0x8007, 0, 0, 255, 1905 }, - { 1, 0, 0x8007, 0, 200, 255, 200 }, - { 0, 0, 0x8008, 0, 0, 255, 1671 }, - { 1, 0, 0x8008, 0, 200, 255, 200 }, - { 0, 0, 0x8009, 0, 0, 255, 2095 }, - { 1, 0, 0x8009, 0, 200, 255, 200 }, - { 0, 0, 0x800A, 0, 0, 255, 1632 }, - { 1, 0, 0x800A, 0, 200, 255, 200 }, - { 0, 0, 0x800D, 0, 0, 255, 2184 }, - { 1, 0, 0x800D, 0, 200, 255, 200 }, - { 0, 0, 0xE, 0, 0, 255, 2400 }, - { 1, 0, 0xE, 0, 200, 255, 200 }, - { 0, 0, 0x803A, 0, 0, 255, 1635 }, - { 1, 0, 0x803A, 0, 200, 255, 200 }, - { 0, 0, 0x36, 0, 0, 255, 389 }, - { 0, 0, 0x37, 0, 0, 255, 268 }, - { 0, 0, 0x8012, 0, 0, 255, 1598 }, - { 1, 0, 0x8012, 0, 200, 255, 200 }, - { 0, 0, 0x8013, 0, 0, 0, 1470 }, - { 1, 0, 0x8013, 0, 200, 255, 200 }, - { 0, 0, 0x8013, 0, 0, 255, 1470 }, - { 1, 0, 0x8013, 0, 200, 255, 200 }, - { 0, 0, 0x8041, 0, 0, 255, 1311 }, - { 1, 0, 0x8041, 0, 200, 255, 200 }, - { 0, 0, 0x801C, 0, 0, 255, 1115 }, - { 1, 0, 0x801C, 0, 200, 255, 200 }, - { 0, 0, 0x802B, 0, 0, 255, 2120 }, - { 1, 0, 0x802B, 0, 200, 255, 200 }, - { 0, 0, 0x26, 0, 0, 255, 1091 }, - { 1, 0, 0x26, 0, 200, 255, 200 }, - { 0, 0, 0x31, 0, 0, 255, 1604 }, - { 1, 0, 0x31, 0, 200, 255, 200 }, - { 0, 0, 0x27, 0, 0, 255, 200 }, - { 0, 0, 0x28, 0, 0, 255, 1020 }, - { 1, 0, 0x28, 0, 200, 255, 200 }, - { 0, 0, 0x803F, 0, 0, 255, 900 }, - { 1, 0, 0x803F, 0, 200, 255, 200 }, - { 0, 0, 0x38, 0, 0, 255, 665 }, - { 1, 0, 0x38, 0, 200, 255, 200 }, - { 0, 0, 0x802E, 0, 0, 255, 1647 }, - { 1, 0, 0x802E, 0, 200, 255, 200 }, - { 0, 0, 0x802F, 0, 0, 255, 1667 }, - { 1, 0, 0x802F, 0, 200, 255, 200 }, - { 0, 0, 0x803E, 0, 0, 0, 176 }, - { 0, 0, 0x8011, 0, 0, 255, 588 }, - { 1, 0, 0x8011, 0, 200, 255, 200 }, - { 0, 0, 0x8021, 0, 0, 0, 2391 }, - { 1, 0, 0x8021, 0, 200, 255, 200 }, - { 0, 0, 0x8021, 0, 0, 255, 2391 }, - { 1, 0, 0x8021, 0, 200, 255, 200 }, - { 0, 0, 0x803D, 0, 0, 255, 1700 }, - { 1, 0, 0x803D, 0, 200, 255, 200 }, - { 0, 0, 0x8040, 0, 0, 255, 1459 }, - { 1, 0, 0x8040, 0, 200, 255, 200 }, - { 0, 0, 0x2A, 0, 0, 255, 9250 }, - { 1, 0, 0x2A, 0, 200, 255, 200 }, - { 255, 0, 0x8002, 0, 50, 255, 50 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, + { 0, 0, SEQ_ID_OPENING, 0, 255, 2926 }, + { 0, 0, SEQ_ID_TITLE, 0, 255, 1251 }, + { 1, 0, SEQ_ID_TITLE, 200, 255, 200 }, + { 0, 0, SEQ_ID_MENU, 0, 255, 1636 }, + { 1, 0, SEQ_ID_MENU, 200, 255, 200 }, + { 0, 0, SEQ_ID_WORLD_MAP, 0, 255, 1560 }, + { 1, 0, SEQ_ID_WORLD_MAP, 200, 255, 200 }, + { 0, 0, SEQ_ID_CO_INTRO, 0, 255, 1618 }, + { 0, 0, SEQ_ID_INTRO_44, 0, 255, 242 }, + { 0, 0, SEQ_ID_INTRO_45, 0, 255, 582 }, + { 0, 0, SEQ_ID_ME_INTRO, 0, 255, 868 }, + { 0, 0, SEQ_ID_INTRO_51, 0, 255, 281 }, + { 0, 0, SEQ_ID_CORNERIA | SEQ_FLAG, 0, 255, 2490 }, + { 1, 0, SEQ_ID_CORNERIA | SEQ_FLAG, 200, 255, 200 }, + { 0, 0, SEQ_ID_METEO | SEQ_FLAG, 0, 255, 1584 }, + { 1, 0, SEQ_ID_METEO | SEQ_FLAG, 200, 255, 200 }, + { 0, 0, SEQ_ID_TITANIA | SEQ_FLAG, 0, 255, 1920 }, + { 1, 0, SEQ_ID_TITANIA | SEQ_FLAG, 200, 255, 200 }, + { 0, 0, SEQ_ID_SECTOR_X | SEQ_FLAG, 0, 255, 2290 }, + { 1, 0, SEQ_ID_SECTOR_X | SEQ_FLAG, 200, 255, 200 }, + { 0, 0, SEQ_ID_ZONESS | SEQ_FLAG, 0, 255, 2005 }, + { 1, 0, SEQ_ID_ZONESS | SEQ_FLAG, 200, 255, 200 }, + { 0, 0, SEQ_ID_AREA_6 | SEQ_FLAG, 0, 255, 1905 }, + { 1, 0, SEQ_ID_AREA_6 | SEQ_FLAG, 200, 255, 200 }, + { 0, 0, SEQ_ID_VENOM_1 | SEQ_FLAG, 0, 255, 1671 }, + { 1, 0, SEQ_ID_VENOM_1 | SEQ_FLAG, 200, 255, 200 }, + { 0, 0, SEQ_ID_SECTOR_Y | SEQ_FLAG, 0, 255, 2095 }, + { 1, 0, SEQ_ID_SECTOR_Y | SEQ_FLAG, 200, 255, 200 }, + { 0, 0, SEQ_ID_FORTUNA | SEQ_FLAG, 0, 255, 1632 }, + { 1, 0, SEQ_ID_FORTUNA | SEQ_FLAG, 200, 255, 200 }, + { 0, 0, SEQ_ID_KATINA | SEQ_FLAG, 0, 255, 2184 }, + { 1, 0, SEQ_ID_KATINA | SEQ_FLAG, 200, 255, 200 }, + { 0, 0, SEQ_ID_AQUAS, 0, 255, 2400 }, + { 1, 0, SEQ_ID_AQUAS, 200, 255, 200 }, + { 0, 0, SEQ_ID_WARP_ZONE | SEQ_FLAG, 0, 255, 1635 }, + { 1, 0, SEQ_ID_WARP_ZONE | SEQ_FLAG, 200, 255, 200 }, + { 0, 0, SEQ_ID_KATT, 0, 255, 389 }, + { 0, 0, SEQ_ID_BILL, 0, 255, 268 }, + { 0, 0, SEQ_ID_CO_BOSS_1 | SEQ_FLAG, 0, 255, 1598 }, + { 1, 0, SEQ_ID_CO_BOSS_1 | SEQ_FLAG, 200, 255, 200 }, + { 0, 0, SEQ_ID_ME_BOSS | SEQ_FLAG, 0, 0, 1470 }, + { 1, 0, SEQ_ID_ME_BOSS | SEQ_FLAG, 200, 255, 200 }, + { 0, 0, SEQ_ID_ME_BOSS | SEQ_FLAG, 0, 255, 1470 }, + { 1, 0, SEQ_ID_ME_BOSS | SEQ_FLAG, 200, 255, 200 }, + { 0, 0, SEQ_ID_BOSS_RESUME | SEQ_FLAG, 0, 255, 1311 }, + { 1, 0, SEQ_ID_BOSS_RESUME | SEQ_FLAG, 200, 255, 200 }, + { 0, 0, SEQ_ID_BO_BOSS | SEQ_FLAG, 0, 255, 1115 }, + { 1, 0, SEQ_ID_BO_BOSS | SEQ_FLAG, 200, 255, 200 }, + { 0, 0, SEQ_ID_STAR_WOLF | SEQ_FLAG, 0, 255, 2120 }, + { 1, 0, SEQ_ID_STAR_WOLF | SEQ_FLAG, 200, 255, 200 }, + { 0, 0, SEQ_ID_GOOD_END, 0, 255, 1091 }, + { 1, 0, SEQ_ID_GOOD_END, 200, 255, 200 }, + { 0, 0, SEQ_ID_BAD_END, 0, 255, 1604 }, + { 1, 0, SEQ_ID_BAD_END, 200, 255, 200 }, + { 0, 0, SEQ_ID_DEATH, 0, 255, 200 }, + { 0, 0, SEQ_ID_GAME_OVER, 0, 255, 1020 }, + { 1, 0, SEQ_ID_GAME_OVER, 200, 255, 200 }, + { 0, 0, SEQ_ID_TRAINING | SEQ_FLAG, 0, 255, 900 }, + { 1, 0, SEQ_ID_TRAINING | SEQ_FLAG, 200, 255, 200 }, + { 0, 0, SEQ_ID_VS_MENU, 0, 255, 665 }, + { 1, 0, SEQ_ID_VS_MENU, 200, 255, 200 }, + { 0, 0, SEQ_ID_VERSUS | SEQ_FLAG, 0, 255, 1647 }, + { 1, 0, SEQ_ID_VERSUS | SEQ_FLAG, 200, 255, 200 }, + { 0, 0, SEQ_ID_VS_HURRY | SEQ_FLAG, 0, 255, 1667 }, + { 1, 0, SEQ_ID_VS_HURRY | SEQ_FLAG, 200, 255, 200 }, + { 0, 0, SEQ_ID_TO_ANDROSS | SEQ_FLAG, 0, 0, 176 }, + { 0, 0, SEQ_ID_ANDROSS | SEQ_FLAG, 0, 255, 588 }, + { 1, 0, SEQ_ID_ANDROSS | SEQ_FLAG, 200, 255, 200 }, + { 0, 0, SEQ_ID_AND_BOSS | SEQ_FLAG, 0, 0, 2391 }, + { 1, 0, SEQ_ID_AND_BOSS | SEQ_FLAG, 200, 255, 200 }, + { 0, 0, SEQ_ID_AND_BOSS | SEQ_FLAG, 0, 255, 2391 }, + { 1, 0, SEQ_ID_AND_BOSS | SEQ_FLAG, 200, 255, 200 }, + { 0, 0, SEQ_ID_AND_BRAIN | SEQ_FLAG, 0, 255, 1700 }, + { 1, 0, SEQ_ID_AND_BRAIN | SEQ_FLAG, 200, 255, 200 }, + { 0, 0, SEQ_ID_VE_CLEAR | SEQ_FLAG, 0, 255, 1459 }, + { 1, 0, SEQ_ID_VE_CLEAR | SEQ_FLAG, 200, 255, 200 }, + { 0, 0, SEQ_ID_ENDING, 0, 255, 9250 }, + { 1, 0, SEQ_ID_ENDING, 200, 255, 200 }, + { 255, 0, SEQ_ID_CORNERIA | SEQ_FLAG, 50, 255, 50 }, }, }; + s32 D_800C737C = 0; // unused. file split? f32 D_800C7380 = 1.0f; u32 sNextVoiceId = 0; @@ -627,14 +527,14 @@ f32 Audio_GetSfxFalloff(u8 bankId, u8 entryIndex) { f32 midrange; f32 range; - if (SFX_BIT09(gSfxBanks[bankId][entryIndex].sfxId)) { + if (SFX_BIT09(sSfxBanks[bankId][entryIndex].sfxId)) { return 1.0f; } - distance = gSfxBanks[bankId][entryIndex].distance; + distance = sSfxBanks[bankId][entryIndex].distance; if (distance > 33000.0f) { falloff = 0.0f; } else { - switch (SFX_RANGE_MASK(gSfxBanks[bankId][entryIndex].sfxId)) { + switch (SFX_RANGE_MASK(sSfxBanks[bankId][entryIndex].sfxId)) { default: range = 1650.0f; break; @@ -668,26 +568,26 @@ s8 Audio_GetSfxReverb(u8 bankId, u8 entryIndex, u8 channelId) { s8 distReverb = 0; s8 scriptReverb = 0; - if (!SFX_BIT10(gSfxBanks[bankId][entryIndex].sfxId)) { - if (gSfxBanks[bankId][entryIndex].distance < 8250.0f) { - distReverb = (gSfxBanks[bankId][entryIndex].distance / 8250.0f) * 40.0f; + if (!SFX_BIT10(sSfxBanks[bankId][entryIndex].sfxId)) { + if (sSfxBanks[bankId][entryIndex].distance < 8250.0f) { + distReverb = (sSfxBanks[bankId][entryIndex].distance / 8250.0f) * 40.0f; } else { distReverb = 40; } } - if (gSeqPlayers[SEQ_PLAYER_SFX].channels[channelId] != &gSeqChannelNone) { + if (IS_SEQUENCE_CHANNEL_VALID(gSeqPlayers[SEQ_PLAYER_SFX].channels[channelId])) { scriptReverb = gSeqPlayers[SEQ_PLAYER_SFX].channels[channelId]->seqScriptIO[6]; } if (scriptReverb == -1) { scriptReverb = 0; } - totalReverb = *gSfxBanks[bankId][entryIndex].reverbAdd + distReverb + scriptReverb + sBaseReverb + sAudioSpecReverb; + totalReverb = *sSfxBanks[bankId][entryIndex].reverbAdd + distReverb + scriptReverb + sBaseReverb + sAudioSpecReverb; totalReverb = MIN(127, totalReverb); return totalReverb; } s8 Audio_GetSfxPan(f32 xPos, f32 zPos, u8 mode) { - if (gSfxChannelLayout != 3) { + if (sSfxChannelLayout != 3) { f32 absx = ABSF(xPos); f32 absz = ABSF(zPos); f32 pan; @@ -718,18 +618,18 @@ f32 Audio_GetSfxFreqMod(u8 bankId, u8 entryIndex) { f32 distance; f32 freqMod = 1.0f; - if (SFX_BIT08(gSfxBanks[bankId][entryIndex].sfxId)) { + if (SFX_BIT08(sSfxBanks[bankId][entryIndex].sfxId)) { freqMod -= ((gAudioRandom % 16) / 192.0f); } - distance = gSfxBanks[bankId][entryIndex].distance; - if (!SFX_BIT09(gSfxBanks[bankId][entryIndex].sfxId)) { + distance = sSfxBanks[bankId][entryIndex].distance; + if (!SFX_BIT09(sSfxBanks[bankId][entryIndex].sfxId)) { if (distance >= 33000.0f) { freqMod += 0.2f; } else { freqMod += 0.2f * (distance / 33000.0f); } } - if ((gSfxChannelLayout != 0) && (gSfxBanks[bankId][entryIndex].token & 2)) { + if ((sSfxChannelLayout != 0) && (sSfxBanks[bankId][entryIndex].token & 2)) { freqMod *= 1.1f; } return freqMod; @@ -740,7 +640,7 @@ void Audio_SetSfxProperties(u8 bankId, u8 entryIndex, u8 channelId) { s8 reverb = 0; f32 freqMod = 1.0f; s8 pan = 64; - SfxBankEntry* entry = &gSfxBanks[bankId][entryIndex]; + SfxBankEntry* entry = &sSfxBanks[bankId][entryIndex]; switch (bankId) { case 0: @@ -756,36 +656,36 @@ void Audio_SetSfxProperties(u8 bankId, u8 entryIndex, u8 channelId) { entry->distance = SQ(*entry->xPos) + SQ(yScaled); } entry->distance = sqrtf(entry->distance); - volumeMod = (Audio_GetSfxFalloff(bankId, entryIndex) * *entry->volMod) * gSfxVolumeMods[bankId].value; + volumeMod = (Audio_GetSfxFalloff(bankId, entryIndex) * *entry->volMod) * sSfxVolumeMods[bankId].value; reverb = Audio_GetSfxReverb(bankId, entryIndex, channelId); freqMod = Audio_GetSfxFreqMod(bankId, entryIndex) * *entry->freqMod; - if ((bankId != 0) || !(*entry->zPos > -200.0f) || !(*entry->zPos < 200.0f) || (gSfxChannelLayout == 3)) { + if ((bankId != 0) || !(*entry->zPos > -200.0f) || !(*entry->zPos < 200.0f) || (sSfxChannelLayout == 3)) { pan = Audio_GetSfxPan(*entry->xPos, *entry->zPos, entry->token); } break; case 4: - if (gSfxChannelLayout == 3) { + if (sSfxChannelLayout == 3) { if (entry->token != 4) { pan = (entry->token & 1) * 127; } } break; } - if (volumeMod != gSfxChannelState[channelId].volMod) { + if (volumeMod != sSfxChannelState[channelId].volMod) { AUDIOCMD_CHANNEL_SET_VOL_SCALE(SEQ_PLAYER_SFX, channelId, volumeMod); - gSfxChannelState[channelId].volMod = volumeMod; + sSfxChannelState[channelId].volMod = volumeMod; } - if (reverb != gSfxChannelState[channelId].reverb) { + if (reverb != sSfxChannelState[channelId].reverb) { AUDIOCMD_CHANNEL_SET_REVERB_VOLUME(SEQ_PLAYER_SFX, channelId, reverb); - gSfxChannelState[channelId].reverb = reverb; + sSfxChannelState[channelId].reverb = reverb; } - if (freqMod != gSfxChannelState[channelId].freqMod) { + if (freqMod != sSfxChannelState[channelId].freqMod) { AUDIOCMD_CHANNEL_SET_FREQ_SCALE(SEQ_PLAYER_SFX, channelId, freqMod); - gSfxChannelState[channelId].freqMod = freqMod; + sSfxChannelState[channelId].freqMod = freqMod; } - if (pan != gSfxChannelState[channelId].pan) { + if (pan != sSfxChannelState[channelId].pan) { AUDIOCMD_CHANNEL_SET_PAN(SEQ_PLAYER_SFX, channelId, pan); - gSfxChannelState[channelId].pan = pan; + sSfxChannelState[channelId].pan = pan; } } @@ -857,10 +757,10 @@ void Audio_ResetSfxChannelState(void) { sBaseReverb = 0; sAudioSpecReverb = D_800C5E38[sNewAudioSpecId]; for (i = 0; i < 16; i++) { - gSfxChannelState[i].volMod = 1.0f; - gSfxChannelState[i].freqMod = 1.0f; - gSfxChannelState[i].reverb = 0; - gSfxChannelState[i].pan = 64; + sSfxChannelState[i].volMod = 1.0f; + sSfxChannelState[i].freqMod = 1.0f; + sSfxChannelState[i].reverb = 0; + sSfxChannelState[i].pan = 64; } } @@ -868,28 +768,28 @@ void Audio_StartSequence(u8 seqPlayId, u8 seqId, u8 seqArgs, u16 fadeInTime) { u8 i; s32 pad; - if (!gStartSeqDisabled || (seqPlayId == SEQ_PLAYER_SFX)) { + if (!sStartSeqDisabled || (seqPlayId == SEQ_PLAYER_SFX)) { AUDIOCMD_GLOBAL_INIT_SEQPLAYER((u32) seqPlayId, (u32) seqId, 0, fadeInTime); - gActiveSequences[seqPlayId].prevSeqId = gActiveSequences[seqPlayId].seqId = seqId | ((seqArgs) << 8); - if (gActiveSequences[seqPlayId].mainVolume.mod != 1.0f) { - AUDIOCMD_SEQPLAYER_FADE_VOLUME_SCALE((u32) seqPlayId, gActiveSequences[seqPlayId].mainVolume.mod); + sActiveSequences[seqPlayId].prevSeqId = sActiveSequences[seqPlayId].seqId = seqId | ((seqArgs) << 8); + if (sActiveSequences[seqPlayId].mainVolume.mod != 1.0f) { + AUDIOCMD_SEQPLAYER_FADE_VOLUME_SCALE((u32) seqPlayId, sActiveSequences[seqPlayId].mainVolume.mod); } - gActiveSequences[seqPlayId].tempo.timer = 0; - gActiveSequences[seqPlayId].tempoOriginal = 0; - gActiveSequences[seqPlayId].tempoCmd = 0; + sActiveSequences[seqPlayId].tempo.timer = 0; + sActiveSequences[seqPlayId].tempoOriginal = 0; + sActiveSequences[seqPlayId].tempoCmd = 0; for (i = 0; i < 16; i++) { - gActiveSequences[seqPlayId].channelMod[i].volume.value = 1.0f; - gActiveSequences[seqPlayId].channelMod[i].volume.timer = 0; - gActiveSequences[seqPlayId].channelMod[i].freq.value = 1.0f; - gActiveSequences[seqPlayId].channelMod[i].freq.timer = 0; + sActiveSequences[seqPlayId].channelMod[i].volume.value = 1.0f; + sActiveSequences[seqPlayId].channelMod[i].volume.timer = 0; + sActiveSequences[seqPlayId].channelMod[i].freq.value = 1.0f; + sActiveSequences[seqPlayId].channelMod[i].freq.timer = 0; } - gActiveSequences[seqPlayId].volChannelFlags = gActiveSequences[seqPlayId].freqModChannelFlags = 0; + sActiveSequences[seqPlayId].volChannelFlags = sActiveSequences[seqPlayId].freqModChannelFlags = 0; } } void Audio_StopSequence(u8 seqPlayId, u16 fadeOutTime) { AUDIOCMD_GLOBAL_DISABLE_SEQPLAYER(seqPlayId, fadeOutTime); - gActiveSequences[seqPlayId].seqId = 0xFFFF; + sActiveSequences[seqPlayId].seqId = SEQ_ID_NONE; } void Audio_ProcessSeqCmd(u32 seqCmd) { @@ -916,111 +816,109 @@ void Audio_ProcessSeqCmd(u32 seqCmd) { seqPlayId = (seqCmd & 0x0F000000) >> 0x18; switch ((seqCmd >> 0x1C) & 0xFF) { - case 0: + case SEQCMD_OP_PLAY_SEQUENCE: seqNumber = seqCmd & 0xFF; seqArgs = (seqCmd & 0xFF00) >> 8; fadeTimer = (seqCmd & 0xFF0000) >> 13; - if (gActiveSequences[seqPlayId].isWaitingForFonts == 0) { + if (sActiveSequences[seqPlayId].isWaitingForFonts == 0) { if (seqArgs < 0x80) { Audio_StartSequence(seqPlayId, seqNumber, seqArgs, fadeTimer); } else { - gActiveSequences[seqPlayId].startSeqCmd = seqCmd & ~0x8000; - gActiveSequences[seqPlayId].isWaitingForFonts = 1; + sActiveSequences[seqPlayId].startSeqCmd = seqCmd & ~0x8000; + sActiveSequences[seqPlayId].isWaitingForFonts = 1; Audio_StopSequence(seqPlayId, 1); - if (gActiveSequences[seqPlayId].prevSeqId != 0xFFFF) { + if (sActiveSequences[seqPlayId].prevSeqId != SEQ_ID_NONE) { tempptr = AudioThread_GetFontsForSequence(seqNumber, &sp4C); - tempPtr2 = AudioThread_GetFontsForSequence(gActiveSequences[seqPlayId].prevSeqId & 0xFF, &sp4C); + tempPtr2 = AudioThread_GetFontsForSequence(sActiveSequences[seqPlayId].prevSeqId & 0xFF, &sp4C); if (tempptr[0] != tempPtr2[0]) { AUDIOCMD_GLOBAL_DISCARD_SEQ_FONTS(seqNumber); } } AUDIOCMD_GLOBAL_ASYNC_LOAD_FONT(seqNumber, 20, (s8) (seqPlayId + 1)); - // AudioThread_QueueCmdS8(0xF5000000 | ((temp1 & 0xFF) << 0x10) | 0x1400 | ((seqPlayId + 1) & 0xFF), - // 0); } } break; - case 1: + case SEQCMD_OP_STOP_SEQUENCE: fadeTimer = (seqCmd & 0xFF0000) >> 13; Audio_StopSequence(seqPlayId, fadeTimer); return; - case 2: + case SEQCMD_OP_QUEUE_SEQUENCE: seqNumber = seqCmd & 0xFF; seqArgs = (seqCmd & 0xFF00) >> 8; fadeTimer = (seqCmd & 0xFF0000) >> 13; priority = seqArgs; - for (i = 0; i < gNumSeqRequests[seqPlayId]; i++) { - if (seqNumber == gSeqRequests[seqPlayId][i].seqId) { + for (i = 0; i < sNumSeqRequests[seqPlayId]; i++) { + if (seqNumber == sSeqRequests[seqPlayId][i].seqId) { if (i == 0) { Audio_StartSequence(seqPlayId, seqNumber, seqArgs, fadeTimer); } return; } } - found = gNumSeqRequests[seqPlayId]; - for (i = 0; i < gNumSeqRequests[seqPlayId]; i++) { - if (seqArgs >= gSeqRequests[seqPlayId][i].priority) { + found = sNumSeqRequests[seqPlayId]; + for (i = 0; i < sNumSeqRequests[seqPlayId]; i++) { + if (seqArgs >= sSeqRequests[seqPlayId][i].priority) { found = i; - i = gNumSeqRequests[seqPlayId]; + i = sNumSeqRequests[seqPlayId]; } } - if ((found != gNumSeqRequests[seqPlayId]) || (found == 0)) { - if (gNumSeqRequests[seqPlayId] < 5) { - gNumSeqRequests[seqPlayId]++; + if ((found != sNumSeqRequests[seqPlayId]) || (found == 0)) { + if (sNumSeqRequests[seqPlayId] < 5) { + sNumSeqRequests[seqPlayId]++; } - for (i = gNumSeqRequests[seqPlayId] - 1; i != found; i--) { - gSeqRequests[seqPlayId][i].priority = gSeqRequests[seqPlayId][i - 1].priority; - gSeqRequests[seqPlayId][i].seqId = gSeqRequests[seqPlayId][i - 1].seqId; + for (i = sNumSeqRequests[seqPlayId] - 1; i != found; i--) { + sSeqRequests[seqPlayId][i].priority = sSeqRequests[seqPlayId][i - 1].priority; + sSeqRequests[seqPlayId][i].seqId = sSeqRequests[seqPlayId][i - 1].seqId; } - gSeqRequests[seqPlayId][found].priority = seqArgs; - gSeqRequests[seqPlayId][found].seqId = seqNumber; + sSeqRequests[seqPlayId][found].priority = seqArgs; + sSeqRequests[seqPlayId][found].seqId = seqNumber; } if (found == 0) { Audio_StartSequence(seqPlayId, seqNumber, seqArgs, fadeTimer); } break; - case 3: + case SEQCMD_OP_UNQUEUE_SEQUENCE: fadeTimer = (seqCmd & 0xFF0000) >> 0xD; - found = gNumSeqRequests[seqPlayId]; - for (i = 0; i < gNumSeqRequests[seqPlayId]; i++) { + found = sNumSeqRequests[seqPlayId]; + for (i = 0; i < sNumSeqRequests[seqPlayId]; i++) { seqNumber = seqCmd & 0xFF; - if (gSeqRequests[seqPlayId][i].seqId == seqNumber) { + if (sSeqRequests[seqPlayId][i].seqId == seqNumber) { found = i; - i = gNumSeqRequests[seqPlayId]; + i = sNumSeqRequests[seqPlayId]; } } - if (found != gNumSeqRequests[seqPlayId]) { - for (i = found; i < gNumSeqRequests[seqPlayId] - 1; i++) { - gSeqRequests[seqPlayId][i].priority = gSeqRequests[seqPlayId][i + 1].priority; - gSeqRequests[seqPlayId][i].seqId = gSeqRequests[seqPlayId][i + 1].seqId; + if (found != sNumSeqRequests[seqPlayId]) { + for (i = found; i < sNumSeqRequests[seqPlayId] - 1; i++) { + sSeqRequests[seqPlayId][i].priority = sSeqRequests[seqPlayId][i + 1].priority; + sSeqRequests[seqPlayId][i].seqId = sSeqRequests[seqPlayId][i + 1].seqId; } - gNumSeqRequests[seqPlayId]--; + sNumSeqRequests[seqPlayId]--; } if (found == 0) { Audio_StopSequence(seqPlayId, fadeTimer); - if (gNumSeqRequests[seqPlayId] != 0) { + if (sNumSeqRequests[seqPlayId] != 0) { - Audio_StartSequence(seqPlayId, gSeqRequests[seqPlayId][0].seqId, - gSeqRequests[seqPlayId][0].priority, fadeTimer); + Audio_StartSequence(seqPlayId, sSeqRequests[seqPlayId][0].seqId, + sSeqRequests[seqPlayId][0].priority, fadeTimer); } } break; - case 4: + case SEQCMD_OP_SET_SEQPLAYER_VOLUME: val = seqCmd & 0xFF; duration = (seqCmd & 0xFF0000) >> 0xF; if (duration == 0) { duration++; } - gActiveSequences[seqPlayId].mainVolume.target = val / 127.0f; - if (gActiveSequences[seqPlayId].mainVolume.mod != gActiveSequences[seqPlayId].mainVolume.target) { - gActiveSequences[seqPlayId].mainVolume.step = - (gActiveSequences[seqPlayId].mainVolume.mod - gActiveSequences[seqPlayId].mainVolume.target) / + sActiveSequences[seqPlayId].mainVolume.target = val / 127.0f; + if (sActiveSequences[seqPlayId].mainVolume.mod != sActiveSequences[seqPlayId].mainVolume.target) { + sActiveSequences[seqPlayId].mainVolume.step = + (sActiveSequences[seqPlayId].mainVolume.mod - sActiveSequences[seqPlayId].mainVolume.target) / duration; - gActiveSequences[seqPlayId].mainVolume.timer = duration; + sActiveSequences[seqPlayId].mainVolume.timer = duration; } break; - case 5: + case SEQCMD_OP_SET_SEQPLAYER_FREQ: val = (seqCmd & 0xFFFF); duration = (seqCmd & 0xFF0000) >> 0xF; @@ -1028,16 +926,16 @@ void Audio_ProcessSeqCmd(u32 seqCmd) { duration++; } for (i = 0; i < 16; i++) { - gActiveSequences[seqPlayId].channelMod[i].freq.target = val / 1000.0f; - gActiveSequences[seqPlayId].channelMod[i].freq.step = - (gActiveSequences[seqPlayId].channelMod[i].freq.value - - gActiveSequences[seqPlayId].channelMod[i].freq.target) / + sActiveSequences[seqPlayId].channelMod[i].freq.target = val / 1000.0f; + sActiveSequences[seqPlayId].channelMod[i].freq.step = + (sActiveSequences[seqPlayId].channelMod[i].freq.value - + sActiveSequences[seqPlayId].channelMod[i].freq.target) / duration; - gActiveSequences[seqPlayId].channelMod[i].freq.timer = duration; + sActiveSequences[seqPlayId].channelMod[i].freq.timer = duration; } - gActiveSequences[seqPlayId].freqModChannelFlags = 0xFFFF; + sActiveSequences[seqPlayId].freqModChannelFlags = 0xFFFF; break; - case 6: + case SEQCMD_OP_SET_CHANNEL_VOLUME: val = (seqCmd & 0xFF); channel = (seqCmd & 0xF00) >> 8; duration = (seqCmd & 0xFF0000) >> 0xF; @@ -1046,39 +944,39 @@ void Audio_ProcessSeqCmd(u32 seqCmd) { duration++; } - gActiveSequences[seqPlayId].channelMod[channel].volume.target = val / 127.0f; - if (gActiveSequences[seqPlayId].channelMod[channel].volume.value != - gActiveSequences[seqPlayId].channelMod[channel].volume.target) { - gActiveSequences[seqPlayId].channelMod[channel].volume.step = - (gActiveSequences[seqPlayId].channelMod[channel].volume.value - - gActiveSequences[seqPlayId].channelMod[channel].volume.target) / + sActiveSequences[seqPlayId].channelMod[channel].volume.target = val / 127.0f; + if (sActiveSequences[seqPlayId].channelMod[channel].volume.value != + sActiveSequences[seqPlayId].channelMod[channel].volume.target) { + sActiveSequences[seqPlayId].channelMod[channel].volume.step = + (sActiveSequences[seqPlayId].channelMod[channel].volume.value - + sActiveSequences[seqPlayId].channelMod[channel].volume.target) / duration; - gActiveSequences[seqPlayId].channelMod[channel].volume.timer = duration; - gActiveSequences[seqPlayId].freqModChannelFlags |= 1 << channel; + sActiveSequences[seqPlayId].channelMod[channel].volume.timer = duration; + sActiveSequences[seqPlayId].freqModChannelFlags |= 1 << channel; } break; - case 7: + case SEQCMD_OP_SET_SEQPLAYER_IO: val = seqCmd & 0xFF; ioPort = ((seqCmd & 0xFF0000) >> 0x10); // may be misnamed AUDIOCMD_SEQPLAYER_SET_IO(seqPlayId, ioPort, val); // AudioThread_QueueCmdS8(((seqPlayId & 0xFF) << 0x10) | 0x46000000 | (temp3 << 8), temp4); break; - case 8: + case SEQCMD_OP_SET_CHANNEL_IO: val = seqCmd & 0xFF; channel = (seqCmd & 0xF00) >> 8; ioPort = (seqCmd & 0xFF0000) >> 0x10; - if (!(gActiveSequences[seqPlayId].channelPortMask & (1 << channel))) { + if (!(sActiveSequences[seqPlayId].channelPortMask & (1 << channel))) { AUDIOCMD_CHANNEL_SET_IO(seqPlayId, (u32) channel, ioPort, val); // AudioThread_QueueCmdS8(((seqPlayId & 0xFF) << 0x10) | 0x06000000 | ((temp_a2_5 & 0xFF) << 8) | temp3, // temp4); } break; - case 9: + case SEQCMD_OP_SET_CHANNEL_IO_DISABLE_MASK: channelDisableMask = seqCmd & 0xFFFF; - gActiveSequences[seqPlayId].channelPortMask = channelDisableMask; + sActiveSequences[seqPlayId].channelPortMask = channelDisableMask; break; - case 10: + case SEQCMD_OP_SET_CHANNEL_DISABLE_MASK: channelDisableMask = seqCmd & 0xFFFF; flag = 1; @@ -1087,38 +985,38 @@ void Audio_ProcessSeqCmd(u32 seqCmd) { flag <<= 1; } break; - case 11: - gActiveSequences[seqPlayId].tempoCmd = seqCmd; + case SEQCMD_OP_TEMPO_CMD: + sActiveSequences[seqPlayId].tempoCmd = seqCmd; break; - case 12: + case SEQCMD_OP_SETUP_CMD: subOp = (seqCmd & 0xF00000) >> 20; - if (subOp != 15) { - found = gActiveSequences[seqPlayId].setupCmdNum++; + if (subOp != SEQCMD_SUB_OP_SETUP_RESET_SETUP_CMDS) { + found = sActiveSequences[seqPlayId].setupCmdNum++; if (found < 5) { - gActiveSequences[seqPlayId].setupCmd[found] = seqCmd; - gActiveSequences[seqPlayId].setupCmdTimer = 2; + sActiveSequences[seqPlayId].setupCmd[found] = seqCmd; + sActiveSequences[seqPlayId].setupCmdTimer = 2; } } else { - gActiveSequences[seqPlayId].setupCmdNum = 0; + sActiveSequences[seqPlayId].setupCmdNum = 0; } break; - case 14: + case SEQCMD_OP_GLOBAL_CMD: val = seqCmd & 0xFF; subOp = (seqCmd & 0xF00) >> 8; switch (subOp) { - case 0: - AUDIOCMD_GLOBAL_SET_SOUND_MODE(gSoundModeList[val]); - // AudioThread_QueueCmdS32(0xF0000000, gSoundModeList[temp11]); + case SEQCMD_SUB_OP_GLOBAL_SET_SOUND_MODE: + AUDIOCMD_GLOBAL_SET_SOUND_MODE(sSoundModeList[val]); + // AudioThread_QueueCmdS32(0xF0000000, sSoundModeList[temp11]); break; - case 1: - gStartSeqDisabled = val & 1; + case SEQCMD_SUB_OP_GLOBAL_DISABLE_NEW_SEQUENCES: + sStartSeqDisabled = val & 1; break; } break; - case 15: + case SEQCMD_OP_RESET_AUDIO_HEAP: specId = seqCmd & 0xFF; - gSfxChannelLayout = (seqCmd & 0xFF00) >> 8; + sSfxChannelLayout = (seqCmd & 0xFF00) >> 8; sp61 = sNewAudioSpecId; sNewAudioSpecId = specId; @@ -1136,13 +1034,13 @@ void Audio_ProcessSeqCmd(u32 seqCmd) { } void Audio_QueueSeqCmd(s32 seqCmd) { - gAudioSeqCmds[gSeqCmdWritePos] = seqCmd; - gSeqCmdWritePos++; + sAudioSeqCmds[sSeqCmdWritePos] = seqCmd; + sSeqCmdWritePos++; } void Audio_ProcessSeqCmds(void) { - while (gSeqCmdWritePos != gSeqCmdReadPos) { - Audio_ProcessSeqCmd(gAudioSeqCmds[gSeqCmdReadPos++]); + while (sSeqCmdWritePos != sSeqCmdReadPos) { + Audio_ProcessSeqCmd(sAudioSeqCmds[sSeqCmdReadPos++]); } } @@ -1150,17 +1048,17 @@ u16 Audio_GetActiveSeqId(u8 seqPlayId) { if (!gSeqPlayers[seqPlayId].enabled) { return 0xFFFF; } - return gActiveSequences[seqPlayId].seqId; + return sActiveSequences[seqPlayId].seqId; } s32 Audio_SeqCmdNotQueued(s32 seqCmd) { s32 notFound = true; u8 i; - for (i = gSeqCmdReadPos; i < gSeqCmdWritePos; i++) { - if (seqCmd == gAudioSeqCmds[i]) { + for (i = sSeqCmdReadPos; i < sSeqCmdWritePos; i++) { + if (seqCmd == sAudioSeqCmds[i]) { notFound = false; - i = gSeqCmdWritePos; + i = sSeqCmdWritePos; } } return notFound; @@ -1170,35 +1068,35 @@ s32 Audio_SeqCmdValueNotQueued(s32 cmdVal, s32 cmdMask) { s32 notFound = true; u8 i; - for (i = gSeqCmdReadPos; i < gSeqCmdWritePos; i++) { - if (cmdVal == (gAudioSeqCmds[i] & cmdMask)) { + for (i = sSeqCmdReadPos; i < sSeqCmdWritePos; i++) { + if (cmdVal == (sAudioSeqCmds[i] & cmdMask)) { notFound = false; - i = gSeqCmdWritePos; + i = sSeqCmdWritePos; } } return notFound; } void Audio_ResetSequenceRequests(u8 seqPlayId) { - gNumSeqRequests[seqPlayId] = 0; + sNumSeqRequests[seqPlayId] = 0; } void func_800184EC(u8 seqPlayId, u8 setupOpDisable) { u8 i; - for (i = 0; i < gActiveSequences[seqPlayId].setupCmdNum; i++) { - u8 setupOp = ((gActiveSequences[seqPlayId].setupCmd[i] & 0xF00000) >> 20); + for (i = 0; i < sActiveSequences[seqPlayId].setupCmdNum; i++) { + u8 setupOp = ((sActiveSequences[seqPlayId].setupCmd[i] & 0xF00000) >> 20); if (setupOp == setupOpDisable) { - gActiveSequences[seqPlayId].setupCmd[i] = 0xFF000000; + sActiveSequences[seqPlayId].setupCmd[i] = 0xFF000000; } } } void Audio_SetSequenceFade(u8 seqPlayId, u8 fadeModId, u8 fadeMod, u8 fadeTime) { - gActiveSequences[seqPlayId].mainVolume.fadeMod[fadeModId] = fadeMod; - gActiveSequences[seqPlayId].mainVolume.fadeTimer = fadeTime; - gActiveSequences[seqPlayId].mainVolume.fadeActive = true; + sActiveSequences[seqPlayId].mainVolume.fadeMod[fadeModId] = fadeMod; + sActiveSequences[seqPlayId].mainVolume.fadeTimer = fadeTime; + sActiveSequences[seqPlayId].mainVolume.fadeActive = true; } void Audio_UpdateActiveSequences(void) { @@ -1223,37 +1121,37 @@ void Audio_UpdateActiveSequences(void) { s32 pad2; for (seqPlayId = 0; seqPlayId < 4; seqPlayId++) { - if ((gActiveSequences[seqPlayId].isWaitingForFonts != 0)) { + if ((sActiveSequences[seqPlayId].isWaitingForFonts != 0)) { switch ((s32) AudioThread_GetAsyncLoadStatus(&sp70)) { case SEQ_PLAYER_BGM + 1: case SEQ_PLAYER_FANFARE + 1: case SEQ_PLAYER_SFX + 1: case SEQ_PLAYER_VOICE + 1: - gActiveSequences[seqPlayId].isWaitingForFonts = 0; - Audio_ProcessSeqCmd(gActiveSequences[seqPlayId].startSeqCmd); + sActiveSequences[seqPlayId].isWaitingForFonts = 0; + Audio_ProcessSeqCmd(sActiveSequences[seqPlayId].startSeqCmd); break; } } - if (gActiveSequences[seqPlayId].mainVolume.fadeActive != 0) { + if (sActiveSequences[seqPlayId].mainVolume.fadeActive != 0) { fadeMod = 1.0f; for (i = 0; i < 3; i++) { - fadeMod *= gActiveSequences[seqPlayId].mainVolume.fadeMod[i] / 127.0f; + fadeMod *= sActiveSequences[seqPlayId].mainVolume.fadeMod[i] / 127.0f; } - SEQCMD_SET_SEQPLAYER_VOLUME(seqPlayId, gActiveSequences[seqPlayId].mainVolume.fadeTimer, + SEQCMD_SET_SEQPLAYER_VOLUME(seqPlayId, sActiveSequences[seqPlayId].mainVolume.fadeTimer, (u8) (fadeMod * 127.0f)); - gActiveSequences[seqPlayId].mainVolume.fadeActive = false; + sActiveSequences[seqPlayId].mainVolume.fadeActive = false; } - if (gActiveSequences[seqPlayId].mainVolume.timer != 0) { - gActiveSequences[seqPlayId].mainVolume.timer--; - if (gActiveSequences[seqPlayId].mainVolume.timer != 0) { - gActiveSequences[seqPlayId].mainVolume.mod -= gActiveSequences[seqPlayId].mainVolume.step; + if (sActiveSequences[seqPlayId].mainVolume.timer != 0) { + sActiveSequences[seqPlayId].mainVolume.timer--; + if (sActiveSequences[seqPlayId].mainVolume.timer != 0) { + sActiveSequences[seqPlayId].mainVolume.mod -= sActiveSequences[seqPlayId].mainVolume.step; } else { - gActiveSequences[seqPlayId].mainVolume.mod = gActiveSequences[seqPlayId].mainVolume.target; + sActiveSequences[seqPlayId].mainVolume.mod = sActiveSequences[seqPlayId].mainVolume.target; } - AUDIOCMD_SEQPLAYER_FADE_VOLUME_SCALE((u32) seqPlayId, gActiveSequences[seqPlayId].mainVolume.mod); + AUDIOCMD_SEQPLAYER_FADE_VOLUME_SCALE((u32) seqPlayId, sActiveSequences[seqPlayId].mainVolume.mod); } - if (gActiveSequences[seqPlayId].tempoCmd != 0) { - cmd = gActiveSequences[seqPlayId].tempoCmd; + if (sActiveSequences[seqPlayId].tempoCmd != 0) { + cmd = sActiveSequences[seqPlayId].tempoCmd; temp = cmd & 0xFFF; temp2 = (cmd & 0xFF0000) >> 0xF; tempoTimer = temp2; @@ -1279,8 +1177,8 @@ void Audio_UpdateActiveSequences(void) { tempoTarget = prevTempo * (tempoTarget / 100.0f); break; case SEQCMD_SUB_OP_TEMPO_RESET: - if (gActiveSequences[seqPlayId].tempoOriginal != 0) { - tempoTarget = gActiveSequences[seqPlayId].tempoOriginal; + if (sActiveSequences[seqPlayId].tempoOriginal != 0) { + tempoTarget = sActiveSequences[seqPlayId].tempoOriginal; } else { tempoTarget = prevTempo; } @@ -1289,88 +1187,88 @@ void Audio_UpdateActiveSequences(void) { if (tempoTarget > 300) { tempoTarget = 300; } - if (!gActiveSequences[seqPlayId].tempoOriginal) { - gActiveSequences[seqPlayId].tempoOriginal = prevTempo; + if (!sActiveSequences[seqPlayId].tempoOriginal) { + sActiveSequences[seqPlayId].tempoOriginal = prevTempo; } - gActiveSequences[seqPlayId].tempo.target = tempoTarget; - gActiveSequences[seqPlayId].tempo.value = (s32) gSeqPlayers[seqPlayId].tempo / 48; + sActiveSequences[seqPlayId].tempo.target = tempoTarget; + sActiveSequences[seqPlayId].tempo.value = (s32) gSeqPlayers[seqPlayId].tempo / 48; - gActiveSequences[seqPlayId].tempo.step = - (gActiveSequences[seqPlayId].tempo.value - gActiveSequences[seqPlayId].tempo.target) / tempoTimer; - gActiveSequences[seqPlayId].tempo.timer = tempoTimer; - gActiveSequences[seqPlayId].tempoCmd = 0; + sActiveSequences[seqPlayId].tempo.step = + (sActiveSequences[seqPlayId].tempo.value - sActiveSequences[seqPlayId].tempo.target) / tempoTimer; + sActiveSequences[seqPlayId].tempo.timer = tempoTimer; + sActiveSequences[seqPlayId].tempoCmd = 0; } } - if (gActiveSequences[seqPlayId].tempo.timer != 0) { - gActiveSequences[seqPlayId].tempo.timer--; - if (gActiveSequences[seqPlayId].tempo.timer != 0) { - gActiveSequences[seqPlayId].tempo.value -= gActiveSequences[seqPlayId].tempo.step; + if (sActiveSequences[seqPlayId].tempo.timer != 0) { + sActiveSequences[seqPlayId].tempo.timer--; + if (sActiveSequences[seqPlayId].tempo.timer != 0) { + sActiveSequences[seqPlayId].tempo.value -= sActiveSequences[seqPlayId].tempo.step; } else { - gActiveSequences[seqPlayId].tempo.value = gActiveSequences[seqPlayId].tempo.target; + sActiveSequences[seqPlayId].tempo.value = sActiveSequences[seqPlayId].tempo.target; } - AUDIOCMD_SEQPLAYER_SET_TEMPO((u32) seqPlayId, (s32) gActiveSequences[seqPlayId].tempo.value); + AUDIOCMD_SEQPLAYER_SET_TEMPO((u32) seqPlayId, (s32) sActiveSequences[seqPlayId].tempo.value); } - if (gActiveSequences[seqPlayId].volChannelFlags != 0) { + if (sActiveSequences[seqPlayId].volChannelFlags != 0) { for (channelId = 0; channelId < 16; channelId++) { - if (gActiveSequences[seqPlayId].channelMod[channelId].volume.timer != 0) { - gActiveSequences[seqPlayId].channelMod[channelId].volume.timer--; - if (gActiveSequences[seqPlayId].channelMod[channelId].volume.timer) { - gActiveSequences[seqPlayId].channelMod[channelId].volume.value -= - gActiveSequences[seqPlayId].channelMod[channelId].volume.step; + if (sActiveSequences[seqPlayId].channelMod[channelId].volume.timer != 0) { + sActiveSequences[seqPlayId].channelMod[channelId].volume.timer--; + if (sActiveSequences[seqPlayId].channelMod[channelId].volume.timer) { + sActiveSequences[seqPlayId].channelMod[channelId].volume.value -= + sActiveSequences[seqPlayId].channelMod[channelId].volume.step; } else { - gActiveSequences[seqPlayId].channelMod[channelId].volume.value = - gActiveSequences[seqPlayId].channelMod[channelId].volume.target; - gActiveSequences[seqPlayId].volChannelFlags ^= 1 << channelId; + sActiveSequences[seqPlayId].channelMod[channelId].volume.value = + sActiveSequences[seqPlayId].channelMod[channelId].volume.target; + sActiveSequences[seqPlayId].volChannelFlags ^= 1 << channelId; } AUDIOCMD_CHANNEL_SET_VOL_SCALE((u32) seqPlayId, (u32) channelId, - gActiveSequences[seqPlayId].channelMod[channelId].volume.value); + sActiveSequences[seqPlayId].channelMod[channelId].volume.value); } } } - if (gActiveSequences[seqPlayId].freqModChannelFlags != 0) { + if (sActiveSequences[seqPlayId].freqModChannelFlags != 0) { for (channelId = 0; channelId < 16; channelId++) { - if (gActiveSequences[seqPlayId].channelMod[channelId].freq.timer != 0) { - gActiveSequences[seqPlayId].channelMod[channelId].freq.timer--; - if (gActiveSequences[seqPlayId].channelMod[channelId].freq.timer != 0) { - gActiveSequences[seqPlayId].channelMod[channelId].freq.value -= - gActiveSequences[seqPlayId].channelMod[channelId].freq.step; + if (sActiveSequences[seqPlayId].channelMod[channelId].freq.timer != 0) { + sActiveSequences[seqPlayId].channelMod[channelId].freq.timer--; + if (sActiveSequences[seqPlayId].channelMod[channelId].freq.timer != 0) { + sActiveSequences[seqPlayId].channelMod[channelId].freq.value -= + sActiveSequences[seqPlayId].channelMod[channelId].freq.step; } else { - gActiveSequences[seqPlayId].channelMod[channelId].freq.value = - gActiveSequences[seqPlayId].channelMod[channelId].freq.target; - gActiveSequences[seqPlayId].freqModChannelFlags ^= 1 << channelId; + sActiveSequences[seqPlayId].channelMod[channelId].freq.value = + sActiveSequences[seqPlayId].channelMod[channelId].freq.target; + sActiveSequences[seqPlayId].freqModChannelFlags ^= 1 << channelId; } AUDIOCMD_CHANNEL_SET_FREQ_SCALE((u32) seqPlayId, (u32) channelId, - gActiveSequences[seqPlayId].channelMod[channelId].freq.value); + sActiveSequences[seqPlayId].channelMod[channelId].freq.value); } } } - if (gActiveSequences[seqPlayId].setupCmdNum == 0) { + if (sActiveSequences[seqPlayId].setupCmdNum == 0) { continue; } if (!Audio_SeqCmdValueNotQueued(SEQCMD_OP_MASK, SEQCMD_OP_RESET_AUDIO_HEAP << 28)) { - gActiveSequences[seqPlayId].setupCmdNum = 0; + sActiveSequences[seqPlayId].setupCmdNum = 0; break; } - if (gActiveSequences[seqPlayId].setupCmdTimer != 0) { - gActiveSequences[seqPlayId].setupCmdTimer--; + if (sActiveSequences[seqPlayId].setupCmdTimer != 0) { + sActiveSequences[seqPlayId].setupCmdTimer--; } else if (!gSeqPlayers[seqPlayId].enabled) { - for (i = 0; i < gActiveSequences[seqPlayId].setupCmdNum; i++) { - setupOp = (gActiveSequences[seqPlayId].setupCmd[i] & 0xF00000) >> 0x14; + for (i = 0; i < sActiveSequences[seqPlayId].setupCmdNum; i++) { + setupOp = (sActiveSequences[seqPlayId].setupCmd[i] & 0xF00000) >> 0x14; - setupSeqPlayId = (gActiveSequences[seqPlayId].setupCmd[i] & 0xF0000) >> 0x10; - val2 = (gActiveSequences[seqPlayId].setupCmd[i] & 0xFF00) >> 8; - val1 = gActiveSequences[seqPlayId].setupCmd[i] & 0xFF; + setupSeqPlayId = (sActiveSequences[seqPlayId].setupCmd[i] & 0xF0000) >> 0x10; + val2 = (sActiveSequences[seqPlayId].setupCmd[i] & 0xFF00) >> 8; + val1 = sActiveSequences[seqPlayId].setupCmd[i] & 0xFF; switch (setupOp) { case SEQCMD_SUB_OP_SETUP_RESTORE_SEQPLAYER_VOLUME: Audio_SetSequenceFade(setupSeqPlayId, 1, 127, val2); break; case SEQCMD_SUB_OP_SETUP_SEQ_UNQUEUE: - SEQCMD_UNQUEUE_SEQUENCE(seqPlayId, 0, gActiveSequences[seqPlayId].seqId); + SEQCMD_UNQUEUE_SEQUENCE(seqPlayId, 0, sActiveSequences[seqPlayId].seqId); break; case SEQCMD_SUB_OP_SETUP_RESTART_SEQ: - SEQCMD_PLAY_SEQUENCE(setupSeqPlayId, 1, 0, gActiveSequences[setupSeqPlayId].seqId); - gActiveSequences[setupSeqPlayId].mainVolume.fadeActive = true; - gActiveSequences[setupSeqPlayId].mainVolume.fadeMod[1] = 127; + SEQCMD_PLAY_SEQUENCE(setupSeqPlayId, 1, 0, sActiveSequences[setupSeqPlayId].seqId); + sActiveSequences[setupSeqPlayId].mainVolume.fadeActive = true; + sActiveSequences[setupSeqPlayId].mainVolume.fadeMod[1] = 127; break; case SEQCMD_SUB_OP_SETUP_TEMPO_SCALE: SEQCMD_SCALE_TEMPO(setupSeqPlayId, val2, val1); @@ -1379,17 +1277,17 @@ void Audio_UpdateActiveSequences(void) { SEQCMD_RESET_TEMPO(setupSeqPlayId, val1); break; case SEQCMD_SUB_OP_SETUP_PLAY_SEQ: - seqId = gActiveSequences[seqPlayId].setupCmd[i] & 0xFFFF; - SEQCMD_PLAY_SEQUENCE(setupSeqPlayId, gActiveSequences[setupSeqPlayId].setupFadeTimer, 0, seqId); + seqId = sActiveSequences[seqPlayId].setupCmd[i] & 0xFFFF; + SEQCMD_PLAY_SEQUENCE(setupSeqPlayId, sActiveSequences[setupSeqPlayId].setupFadeTimer, 0, seqId); Audio_SetSequenceFade(setupSeqPlayId, 1, 127, 0); - gActiveSequences[setupSeqPlayId].setupFadeTimer = 0; + sActiveSequences[setupSeqPlayId].setupFadeTimer = 0; break; case SEQCMD_SUB_OP_SETUP_SET_FADE_TIMER: - gActiveSequences[seqPlayId].setupFadeTimer = val2; + sActiveSequences[seqPlayId].setupFadeTimer = val2; break; } } - gActiveSequences[seqPlayId].setupCmdNum = 0; + sActiveSequences[seqPlayId].setupCmdNum = 0; } } } @@ -1397,23 +1295,23 @@ void Audio_UpdateActiveSequences(void) { void Audio_SetDelayedSeqCmd(u32 seqCmd, u16 delay) { u8 opcode = (seqCmd >> 0x1C); - gDelayedSeqCmds[opcode].seqData = seqCmd; - gDelayedSeqCmds[opcode].timer = delay; - gDelayedSeqCmdFlags |= 1 << opcode; + sDelayedSeqCmds[opcode].seqData = seqCmd; + sDelayedSeqCmds[opcode].timer = delay; + sDelayedSeqCmdFlags |= 1 << opcode; } void Audio_UpdateDelayedSeqCmds(void) { u8 opcode = 0; u16 flag = 1; - u16 delayedCmdFlags = gDelayedSeqCmdFlags; + u16 delayedCmdFlags = sDelayedSeqCmdFlags; while (delayedCmdFlags) { if (delayedCmdFlags & flag) { - if (gDelayedSeqCmds[opcode].timer != 0) { - gDelayedSeqCmds[opcode].timer--; + if (sDelayedSeqCmds[opcode].timer != 0) { + sDelayedSeqCmds[opcode].timer--; } else { - Audio_QueueSeqCmd(gDelayedSeqCmds[opcode].seqData); - gDelayedSeqCmdFlags ^= flag; + Audio_QueueSeqCmd(sDelayedSeqCmds[opcode].seqData); + sDelayedSeqCmdFlags ^= flag; } delayedCmdFlags ^= flag; } @@ -1427,7 +1325,7 @@ u8 func_80018FA4(void) { if (D_800C5D58 == 1) { if (func_8001ED34() == 1) { D_800C5D58 = 0; - AUDIOCMD_SEQPLAYER_SET_IO(SEQ_PLAYER_SFX, 0, gSfxChannelLayout); + AUDIOCMD_SEQPLAYER_SET_IO(SEQ_PLAYER_SFX, 0, sSfxChannelLayout); func_8001DD40(); } } else if (D_800C5D58 == 2) { @@ -1435,7 +1333,7 @@ u8 func_80018FA4(void) { ; } D_800C5D58 = 0; - AUDIOCMD_SEQPLAYER_SET_IO(SEQ_PLAYER_SFX, 0, gSfxChannelLayout); + AUDIOCMD_SEQPLAYER_SET_IO(SEQ_PLAYER_SFX, 0, sSfxChannelLayout); func_8001DD40(); } } @@ -1446,18 +1344,18 @@ void Audio_ResetActiveSequences(void) { u8 i; for (i = 0; i < 4; i++) { - gNumSeqRequests[i] = 0; - gActiveSequences[i].seqId = 0xFFFF; - gActiveSequences[i].prevSeqId = 0xFFFF; - gActiveSequences[i].tempo.timer = 0; - gActiveSequences[i].tempoOriginal = 0; - gActiveSequences[i].tempoCmd = 0; - gActiveSequences[i].channelPortMask = 0; - gActiveSequences[i].setupCmdNum = 0; - gActiveSequences[i].setupFadeTimer = 0; - gActiveSequences[i].freqModChannelFlags = 0; - gActiveSequences[i].volChannelFlags = 0; - gActiveSequences[i].mainVolume.fadeMod[2] = 127; + sNumSeqRequests[i] = 0; + sActiveSequences[i].seqId = SEQ_ID_NONE; + sActiveSequences[i].prevSeqId = SEQ_ID_NONE; + sActiveSequences[i].tempo.timer = 0; + sActiveSequences[i].tempoOriginal = 0; + sActiveSequences[i].tempoCmd = 0; + sActiveSequences[i].channelPortMask = 0; + sActiveSequences[i].setupCmdNum = 0; + sActiveSequences[i].setupFadeTimer = 0; + sActiveSequences[i].freqModChannelFlags = 0; + sActiveSequences[i].volChannelFlags = 0; + sActiveSequences[i].mainVolume.fadeMod[2] = 127; } } @@ -1465,12 +1363,12 @@ void Audio_ResetActiveSequencesAndVolume(void) { u8 i; for (i = 0; i < 4; i++) { - gActiveSequences[i].mainVolume.mod = 1.0f; - gActiveSequences[i].mainVolume.timer = 0; - gActiveSequences[i].mainVolume.fadeActive = false; - gActiveSequences[i].mainVolume.fadeMod[0] = 127; - gActiveSequences[i].mainVolume.fadeMod[1] = 127; - gActiveSequences[i].mainVolume.fadeMod[2] = 127; + sActiveSequences[i].mainVolume.mod = 1.0f; + sActiveSequences[i].mainVolume.timer = 0; + sActiveSequences[i].mainVolume.fadeActive = false; + sActiveSequences[i].mainVolume.fadeMod[0] = 127; + sActiveSequences[i].mainVolume.fadeMod[1] = 127; + sActiveSequences[i].mainVolume.fadeMod[2] = 127; } Audio_ResetActiveSequences(); } @@ -1479,21 +1377,21 @@ void Audio_SetSfxBanksMute(u16 muteFlags) { u8 i; for (i = 0; i < 5; i++) { - gSfxBankMuted[i] = (muteFlags & 1) ? true : false; + sSfxBankMuted[i] = (muteFlags & 1) ? true : false; muteFlags = muteFlags >> 1; } } void Audio_ClearBGMMute(u8 channelIndex) { - D_800C5D24 &= (1 << channelIndex) ^ 0xFFFF; - if (D_800C5D24 == 0) { + sChannelMuteFlags &= (1 << channelIndex) ^ 0xFFFF; + if (sChannelMuteFlags == 0) { Audio_SetSequenceFade(SEQ_PLAYER_BGM, 2, 127, 15); } } void Audio_PlaySfx(u32 sfxId, f32* sfxSource, u8 token, f32* freqMod, f32* volMod, s8* reverbAdd) { - if (gSfxBankMuted[SFX_BANK_SHIFT(sfxId)] == 0) { - SfxRequest* request = &gSfxRequests[gSfxRequestWriteIndex]; + if (sSfxBankMuted[SFX_BANK_SHIFT(sfxId)] == 0) { + SfxRequest* request = &sSfxRequests[sSfxRequestWriteIndex]; request->sfxId = sfxId; request->pos = sfxSource; @@ -1501,16 +1399,16 @@ void Audio_PlaySfx(u32 sfxId, f32* sfxSource, u8 token, f32* freqMod, f32* volMo request->freqMod = freqMod; request->volMod = volMod; request->reverbAdd = reverbAdd; - gSfxRequestWriteIndex++; + sSfxRequestWriteIndex++; } } void Audio_RemoveMatchingSfxRequests(u8 aspect, SfxBankEntry* data) { - u8 i = gSfxRequestReadIndex; + u8 i = sSfxRequestReadIndex; - for (i; i != gSfxRequestWriteIndex; i++) { + for (i; i != sSfxRequestWriteIndex; i++) { s32 found = false; - SfxRequest* request = &gSfxRequests[i]; + SfxRequest* request = &sSfxRequests[i]; switch (aspect) { case 0: @@ -1551,7 +1449,7 @@ void Audio_RemoveMatchingSfxRequests(u8 aspect, SfxBankEntry* data) { } void Audio_ProcessSfxRequest(void) { - SfxRequest* request = &gSfxRequests[gSfxRequestReadIndex]; + SfxRequest* request = &sSfxRequests[sSfxRequestReadIndex]; u8 next; s32 bankId; u8 evict; @@ -1563,22 +1461,22 @@ void Audio_ProcessSfxRequest(void) { return; } bankId = SFX_BANK(request->sfxId); - next = gSfxBanks[bankId][0].next; + next = sSfxBanks[bankId][0].next; count = 0; while ((next != 0xFF) && (next != 0)) { - if (request->pos == gSfxBanks[bankId][next].xPos) { - if (request->sfxId == gSfxBanks[bankId][next].sfxId) { - count = gUsedChannelsPerBank[gSfxChannelLayout][bankId]; + if (request->pos == sSfxBanks[bankId][next].xPos) { + if (request->sfxId == sSfxBanks[bankId][next].sfxId) { + count = sUsedChannelsPerBank[sSfxChannelLayout][bankId]; } else { if (count == 0) { evict = next; - sfxId = gSfxBanks[bankId][next].sfxId; - } else if (SFX_IMPORTANCE_MASK(gSfxBanks[bankId][next].sfxId) < SFX_IMPORTANCE_MASK(sfxId)) { + sfxId = sSfxBanks[bankId][next].sfxId; + } else if (SFX_IMPORTANCE_MASK(sSfxBanks[bankId][next].sfxId) < SFX_IMPORTANCE_MASK(sfxId)) { evict = next; - sfxId = gSfxBanks[bankId][next].sfxId; + sfxId = sSfxBanks[bankId][next].sfxId; } count++; - if (count == gUsedChannelsPerBank[gSfxChannelLayout][bankId]) { + if (count == sUsedChannelsPerBank[sSfxChannelLayout][bankId]) { if (SFX_IMPORTANCE_MASK(request->sfxId) >= SFX_IMPORTANCE_MASK(sfxId)) { next = evict; } else { @@ -1586,29 +1484,29 @@ void Audio_ProcessSfxRequest(void) { } } } - if (count == gUsedChannelsPerBank[gSfxChannelLayout][bankId]) { + if (count == sUsedChannelsPerBank[sSfxChannelLayout][bankId]) { if (SFX_BIT04(request->sfxId) || SFX_BIT13(request->sfxId) || (next == evict)) { - if (SFX_BIT12(gSfxBanks[bankId][next].sfxId) && (gSfxBanks[bankId][next].state != 1)) { - Audio_ClearBGMMute(gSfxBanks[bankId][next].channelIndex); + if (SFX_BIT12(sSfxBanks[bankId][next].sfxId) && (sSfxBanks[bankId][next].state != 1)) { + Audio_ClearBGMMute(sSfxBanks[bankId][next].channelIndex); } - gSfxBanks[bankId][next].token = request->token; - gSfxBanks[bankId][next].sfxId = request->sfxId; - gSfxBanks[bankId][next].state = SFX_STATE(request->sfxId); - gSfxBanks[bankId][next].freshness = 2; - gSfxBanks[bankId][next].freqMod = request->freqMod; - gSfxBanks[bankId][next].volMod = request->volMod; - gSfxBanks[bankId][next].reverbAdd = request->reverbAdd; + sSfxBanks[bankId][next].token = request->token; + sSfxBanks[bankId][next].sfxId = request->sfxId; + sSfxBanks[bankId][next].state = SFX_STATE(request->sfxId); + sSfxBanks[bankId][next].freshness = 2; + sSfxBanks[bankId][next].freqMod = request->freqMod; + sSfxBanks[bankId][next].volMod = request->volMod; + sSfxBanks[bankId][next].reverbAdd = request->reverbAdd; } next = 0; } } if (next != 0) { - next = gSfxBanks[bankId][next].next; + next = sSfxBanks[bankId][next].next; } } - if ((gSfxBanks[bankId][gSfxBankFreeListStart[bankId]].next != 0xFF) && (next != 0)) { - next = gSfxBankFreeListStart[bankId]; - entry = &gSfxBanks[bankId][next]; + if ((sSfxBanks[bankId][sSfxBankFreeListStart[bankId]].next != 0xFF) && (next != 0)) { + next = sSfxBankFreeListStart[bankId]; + entry = &sSfxBanks[bankId][next]; entry->xPos = &request->pos[0]; entry->yPos = &request->pos[1]; entry->zPos = &request->pos[2]; @@ -1620,35 +1518,35 @@ void Audio_ProcessSfxRequest(void) { entry->state = SFX_STATE(request->sfxId); entry->freshness = 2; - entry->prev = gSfxBankListEnd[bankId]; + entry->prev = sSfxBankListEnd[bankId]; - gSfxBanks[bankId][gSfxBankListEnd[bankId]].next = gSfxBankFreeListStart[bankId]; - gSfxBankListEnd[bankId] = gSfxBankFreeListStart[bankId]; - gSfxBankFreeListStart[bankId] = gSfxBanks[bankId][gSfxBankFreeListStart[bankId]].next; - gSfxBanks[bankId][gSfxBankFreeListStart[bankId]].prev = 0xFF; + sSfxBanks[bankId][sSfxBankListEnd[bankId]].next = sSfxBankFreeListStart[bankId]; + sSfxBankListEnd[bankId] = sSfxBankFreeListStart[bankId]; + sSfxBankFreeListStart[bankId] = sSfxBanks[bankId][sSfxBankFreeListStart[bankId]].next; + sSfxBanks[bankId][sSfxBankFreeListStart[bankId]].prev = 0xFF; entry->next = 0xFF; } } void Audio_RemoveSfxBankEntry(u8 bankId, u8 entryIndex) { - SfxBankEntry* sfxBank = gSfxBanks[bankId]; + SfxBankEntry* sfxBank = sSfxBanks[bankId]; s32 pad; if (SFX_BIT12(sfxBank[entryIndex].sfxId)) { Audio_ClearBGMMute(sfxBank[entryIndex].channelIndex); } - if (entryIndex == gSfxBankListEnd[bankId]) { - gSfxBankListEnd[bankId] = sfxBank[entryIndex].prev; + if (entryIndex == sSfxBankListEnd[bankId]) { + sSfxBankListEnd[bankId] = sfxBank[entryIndex].prev; } else { sfxBank[sfxBank[entryIndex].next].prev = sfxBank[entryIndex].prev; } sfxBank[sfxBank[entryIndex].prev].next = sfxBank[entryIndex].next; - sfxBank[entryIndex].next = gSfxBankFreeListStart[bankId]; + sfxBank[entryIndex].next = sSfxBankFreeListStart[bankId]; sfxBank[entryIndex].prev = 0xFF; - sfxBank[gSfxBankFreeListStart[bankId]].prev = entryIndex; - gSfxBankFreeListStart[bankId] = entryIndex; + sfxBank[sSfxBankFreeListStart[bankId]].prev = entryIndex; + sSfxBankFreeListStart[bankId] = entryIndex; sfxBank[entryIndex].state = 0; } @@ -1672,17 +1570,17 @@ void Audio_ChooseActiveSfx(u8 bankId) { chosenSfx[i].priority = INT32_MAX; chosenSfx[i].entryIndex = 0xFF; } - entryIndex = gSfxBanks[bankId]->next; + entryIndex = sSfxBanks[bankId]->next; k = 0; while (entryIndex != 0xFF) { - if ((gSfxBanks[bankId][entryIndex].state == 1) && - (SFX_BIT04(gSfxBanks[bankId][entryIndex].sfxId) == SFX_BIT04(-1))) { - gSfxBanks[bankId][entryIndex].freshness--; + if ((sSfxBanks[bankId][entryIndex].state == 1) && + (SFX_BIT04(sSfxBanks[bankId][entryIndex].sfxId) == SFX_BIT04(-1))) { + sSfxBanks[bankId][entryIndex].freshness--; } - if (gSfxBanks[bankId][entryIndex].freshness == 0) { + if (sSfxBanks[bankId][entryIndex].freshness == 0) { Audio_RemoveSfxBankEntry(bankId, entryIndex); - } else if (gSfxBanks[bankId][entryIndex].state != 0) { - entry = &gSfxBanks[bankId][entryIndex]; + } else if (sSfxBanks[bankId][entryIndex].state != 0) { + entry = &sSfxBanks[bankId][entryIndex]; if (&entry->xPos[0] == gDefaultSfxSource) { entry->distance = 0.0f; @@ -1713,10 +1611,10 @@ void Audio_ChooseActiveSfx(u8 bankId) { } } } else { - numChannels = gChannelsPerBank[gSfxChannelLayout][bankId]; + numChannels = sChannelsPerBank[sSfxChannelLayout][bankId]; for (i = 0; i < numChannels; i++) { if (chosenSfx[i].priority >= entry->priority) { - if (numChosenSfx < gChannelsPerBank[gSfxChannelLayout][bankId]) { + if (numChosenSfx < sChannelsPerBank[sSfxChannelLayout][bankId]) { numChosenSfx++; } for (j = numChannels - 1; j > i; j--) { @@ -1731,30 +1629,30 @@ void Audio_ChooseActiveSfx(u8 bankId) { } k = entryIndex; } - entryIndex = gSfxBanks[bankId][k].next; + entryIndex = sSfxBanks[bankId][k].next; } for (i = 0; i < numChosenSfx; i++) { - if (gSfxBanks[bankId][chosenSfx[i].entryIndex].state == 1) { - gSfxBanks[bankId][chosenSfx[i].entryIndex].state = 2; - } else if (gSfxBanks[bankId][chosenSfx[i].entryIndex].state == 4) { - gSfxBanks[bankId][chosenSfx[i].entryIndex].state = 3; + if (sSfxBanks[bankId][chosenSfx[i].entryIndex].state == 1) { + sSfxBanks[bankId][chosenSfx[i].entryIndex].state = 2; + } else if (sSfxBanks[bankId][chosenSfx[i].entryIndex].state == 4) { + sSfxBanks[bankId][chosenSfx[i].entryIndex].state = 3; } } - numChannels = gChannelsPerBank[gSfxChannelLayout][bankId]; + numChannels = sChannelsPerBank[sSfxChannelLayout][bankId]; for (i = 0; i < numChannels; i++) { - activeSfx = &gActiveSfx[bankId][i]; + activeSfx = &sActiveSfx[bankId][i]; needNewSfx = 0; if (activeSfx->entryIndex == 0xFF) { needNewSfx = 1; - } else if (gSfxBanks[bankId][activeSfx->entryIndex].state == 4) { - if (SFX_BIT04(gSfxBanks[bankId][activeSfx->entryIndex].sfxId)) { + } else if (sSfxBanks[bankId][activeSfx->entryIndex].state == 4) { + if (SFX_BIT04(sSfxBanks[bankId][activeSfx->entryIndex].sfxId)) { Audio_RemoveSfxBankEntry(bankId, activeSfx->entryIndex); } else { - gSfxBanks[bankId][activeSfx->entryIndex].state = 1; + sSfxBanks[bankId][activeSfx->entryIndex].state = 1; } needNewSfx = 1; - } else if (gSfxBanks[bankId][activeSfx->entryIndex].state == 0) { + } else if (sSfxBanks[bankId][activeSfx->entryIndex].state == 0) { activeSfx->entryIndex = 0xFF; needNewSfx = 1; } else { @@ -1770,9 +1668,9 @@ void Audio_ChooseActiveSfx(u8 bankId) { if (needNewSfx == 1) { for (j = 0; j < numChannels; j++) { chosenEntryIndex = chosenSfx[j].entryIndex; - if ((chosenEntryIndex != 0xFF) && (gSfxBanks[bankId][chosenEntryIndex].state != 3)) { + if ((chosenEntryIndex != 0xFF) && (sSfxBanks[bankId][chosenEntryIndex].state != 3)) { for (k = 0; k < numChannels; k++) { - if (chosenEntryIndex == gActiveSfx[bankId][k].entryIndex) { + if (chosenEntryIndex == sActiveSfx[bankId][k].entryIndex) { needNewSfx = 0; k = numChannels; } @@ -1795,51 +1693,51 @@ void Audio_ChooseActiveSfx(u8 bankId) { void Audio_PlayActiveSfx(u8 bankId) { u8 i; - for (i = 0; i < gChannelsPerBank[gSfxChannelLayout][bankId]; i++) { - u8 entryIndex = gActiveSfx[bankId][i].entryIndex; + for (i = 0; i < sChannelsPerBank[sSfxChannelLayout][bankId]; i++) { + u8 entryIndex = sActiveSfx[bankId][i].entryIndex; if (entryIndex != 0xFF) { - SfxBankEntry* entry = &gSfxBanks[bankId][entryIndex]; - SequenceChannel* channel = gSeqPlayers[SEQ_PLAYER_SFX].channels[gCurSfxPlayerChannelIndex]; + SfxBankEntry* entry = &sSfxBanks[bankId][entryIndex]; + SequenceChannel* channel = gSeqPlayers[SEQ_PLAYER_SFX].channels[sCurSfxPlayerChannelIndex]; s32 pad; if (entry->state == 2) { - entry->channelIndex = gCurSfxPlayerChannelIndex; + entry->channelIndex = sCurSfxPlayerChannelIndex; if (SFX_BIT12(entry->sfxId)) { - D_800C5D24 |= 1 << gCurSfxPlayerChannelIndex; + sChannelMuteFlags |= 1 << sCurSfxPlayerChannelIndex; Audio_SetSequenceFade(SEQ_PLAYER_BGM, 2, 64, 15); } - Audio_SetSfxProperties(bankId, entryIndex, gCurSfxPlayerChannelIndex); - AUDIOCMD_CHANNEL_SET_IO(SEQ_PLAYER_SFX, gCurSfxPlayerChannelIndex, 0, 1); - AUDIOCMD_CHANNEL_SET_IO(SEQ_PLAYER_SFX, gCurSfxPlayerChannelIndex, 4, SFX_INDEX(entry->sfxId) & 0xFF); + Audio_SetSfxProperties(bankId, entryIndex, sCurSfxPlayerChannelIndex); + AUDIOCMD_CHANNEL_SET_IO(SEQ_PLAYER_SFX, sCurSfxPlayerChannelIndex, 0, 1); + AUDIOCMD_CHANNEL_SET_IO(SEQ_PLAYER_SFX, sCurSfxPlayerChannelIndex, 4, SFX_INDEX(entry->sfxId) & 0xFF); entry->state = 4; } else if ((u8) channel->seqScriptIO[7] == 0x80) { - AUDIOCMD_CHANNEL_SET_IO(SEQ_PLAYER_SFX, gCurSfxPlayerChannelIndex, 7, 0); + AUDIOCMD_CHANNEL_SET_IO(SEQ_PLAYER_SFX, sCurSfxPlayerChannelIndex, 7, 0); Audio_RemoveSfxBankEntry(bankId, entryIndex); } else if (entry->state == 3) { - Audio_SetSfxProperties(bankId, entryIndex, gCurSfxPlayerChannelIndex); + Audio_SetSfxProperties(bankId, entryIndex, sCurSfxPlayerChannelIndex); entry->state = 4; } } - gCurSfxPlayerChannelIndex++; + sCurSfxPlayerChannelIndex++; } } void Audio_KillSfxByBank(u8 bankId) { SfxBankEntry* entry; - u8 next = gSfxBanks[bankId][0].next; + u8 next = sSfxBanks[bankId][0].next; SfxBankEntry cmp; while (next != 0xFF) { - entry = &gSfxBanks[bankId][next]; + entry = &sSfxBanks[bankId][next]; if (entry->state >= 3) { AUDIOCMD_CHANNEL_SET_IO(2, entry->channelIndex, 0, 0); } if (entry->state != 0) { Audio_RemoveSfxBankEntry(bankId, next); } - next = gSfxBanks[bankId][0].next; + next = sSfxBanks[bankId][0].next; } cmp.sfxId = bankId << 28; Audio_RemoveMatchingSfxRequests(0, &cmp); @@ -1848,10 +1746,10 @@ void Audio_KillSfxByBank(u8 bankId) { void Audio_StopSfxByBankAndSource(u8 bankId, f32* sfxSource) { SfxBankEntry* entry; u8 curIndex = 0; - u8 nextIndex = gSfxBanks[bankId][0].next; + u8 nextIndex = sSfxBanks[bankId][0].next; while (nextIndex != 0xFF) { - entry = &gSfxBanks[bankId][nextIndex]; + entry = &sSfxBanks[bankId][nextIndex]; if (entry->xPos == sfxSource) { if (entry->state >= 3) { AUDIOCMD_CHANNEL_SET_IO(SEQ_PLAYER_SFX, entry->channelIndex, 0, 0); @@ -1862,7 +1760,7 @@ void Audio_StopSfxByBankAndSource(u8 bankId, f32* sfxSource) { } else { curIndex = nextIndex; } - nextIndex = gSfxBanks[bankId][curIndex].next; + nextIndex = sSfxBanks[bankId][curIndex].next; } } @@ -1888,16 +1786,16 @@ void Audio_KillSfxBySource(f32* sfxSource) { void Audio_KillSfxBySourceAndId(f32* sfxSource, u32 sfxId) { u32 bankId = SFX_BANK(sfxId); - u8 next = gSfxBanks[bankId][0].next; + u8 next = sSfxBanks[bankId][0].next; u8 current = 0; SfxBankEntry cmp; while (next != 0xFF) { - if ((gSfxBanks[bankId][next].xPos == sfxSource) && (gSfxBanks[bankId][next].sfxId == sfxId)) { - if (gSfxBanks[bankId][next].state >= 3) { - AUDIOCMD_CHANNEL_SET_IO(SEQ_PLAYER_SFX, gSfxBanks[bankId][next].channelIndex, 0, 0); + if ((sSfxBanks[bankId][next].xPos == sfxSource) && (sSfxBanks[bankId][next].sfxId == sfxId)) { + if (sSfxBanks[bankId][next].state >= 3) { + AUDIOCMD_CHANNEL_SET_IO(SEQ_PLAYER_SFX, sSfxBanks[bankId][next].channelIndex, 0, 0); } - if (gSfxBanks[bankId][next].state != 0) { + if (sSfxBanks[bankId][next].state != 0) { Audio_RemoveSfxBankEntry(bankId, next); } next = 0xFF; @@ -1905,7 +1803,7 @@ void Audio_KillSfxBySourceAndId(f32* sfxSource, u32 sfxId) { current = next; } if (next != 0xFF) { - next = gSfxBanks[bankId][current].next; + next = sSfxBanks[bankId][current].next; } } cmp.sfxId = sfxId; @@ -1915,23 +1813,23 @@ void Audio_KillSfxBySourceAndId(f32* sfxSource, u32 sfxId) { void Audio_KillSfxByTokenAndId(u8 token, u32 sfxId) { u32 bankId = SFX_BANK(sfxId); - u8 next = gSfxBanks[bankId][0].next; + u8 next = sSfxBanks[bankId][0].next; u8 current = 0; SfxBankEntry cmp; while (next != 0xFF) { - if ((gSfxBanks[bankId][next].token == token) && (gSfxBanks[bankId][next].sfxId == sfxId)) { - if (gSfxBanks[bankId][next].state >= 3) { - AUDIOCMD_CHANNEL_SET_IO(SEQ_PLAYER_SFX, gSfxBanks[bankId][next].channelIndex, 0, 0); + if ((sSfxBanks[bankId][next].token == token) && (sSfxBanks[bankId][next].sfxId == sfxId)) { + if (sSfxBanks[bankId][next].state >= 3) { + AUDIOCMD_CHANNEL_SET_IO(SEQ_PLAYER_SFX, sSfxBanks[bankId][next].channelIndex, 0, 0); } - if (gSfxBanks[bankId][next].state != 0) { + if (sSfxBanks[bankId][next].state != 0) { Audio_RemoveSfxBankEntry(bankId, next); } } else { current = next; } if (next != 0xFF) { - next = gSfxBanks[bankId][current].next; + next = sSfxBanks[bankId][current].next; } } cmp.token = token; @@ -1941,36 +1839,36 @@ void Audio_KillSfxByTokenAndId(u8 token, u32 sfxId) { void Audio_KillSfxById(u32 sfxId) { u32 bankId = SFX_BANK(sfxId); - u8 next = gSfxBanks[bankId][0].next; + u8 next = sSfxBanks[bankId][0].next; u8 current = 0; SfxBankEntry cmp; while (next != 0xFF) { - if (sfxId == gSfxBanks[bankId][next].sfxId) { - if (gSfxBanks[bankId][next].state >= 3) { - AUDIOCMD_CHANNEL_SET_IO(SEQ_PLAYER_SFX, gSfxBanks[bankId][next].channelIndex, 0, 0); + if (sfxId == sSfxBanks[bankId][next].sfxId) { + if (sSfxBanks[bankId][next].state >= 3) { + AUDIOCMD_CHANNEL_SET_IO(SEQ_PLAYER_SFX, sSfxBanks[bankId][next].channelIndex, 0, 0); } - if (gSfxBanks[bankId][next].state != 0) { + if (sSfxBanks[bankId][next].state != 0) { Audio_RemoveSfxBankEntry(bankId, next); } } else { current = next; } - next = gSfxBanks[bankId][current].next; + next = sSfxBanks[bankId][current].next; } cmp.sfxId = sfxId; Audio_RemoveMatchingSfxRequests(5, &cmp); } void Audio_ProcessSfxRequests(void) { - while (gSfxRequestWriteIndex != gSfxRequestReadIndex) { + while (sSfxRequestWriteIndex != sSfxRequestReadIndex) { Audio_ProcessSfxRequest(); - gSfxRequestReadIndex++; + sSfxRequestReadIndex++; } } void Audio_SetSfxVolumeMod(u8 bankId, u8 target, u16 timer) { - Modulation* scale = &gSfxVolumeMods[bankId]; + Modulation* scale = &sSfxVolumeMods[bankId]; if (timer == 0) { timer++; @@ -1982,7 +1880,7 @@ void Audio_SetSfxVolumeMod(u8 bankId, u8 target, u16 timer) { } void Audio_UpdateSfxVolumeMod(u8 bankId) { - Modulation* scale = &gSfxVolumeMods[bankId]; + Modulation* scale = &sSfxVolumeMods[bankId]; if (scale->timer != 0) { scale->timer--; @@ -1997,8 +1895,8 @@ void Audio_UpdateSfxVolumeMod(u8 bankId) { void Audio_PlayAllSfx(void) { u8 bankId; - if (gSeqPlayers[SEQ_PLAYER_SFX].channels[0] != &gSeqChannelNone) { - gCurSfxPlayerChannelIndex = 0; + if (IS_SEQUENCE_CHANNEL_VALID(gSeqPlayers[SEQ_PLAYER_SFX].channels[0])) { + sCurSfxPlayerChannelIndex = 0; for (bankId = 0; bankId < 5; bankId++) { Audio_ChooseActiveSfx(bankId); Audio_PlayActiveSfx(bankId); @@ -2011,31 +1909,31 @@ void Audio_ResetSfx(void) { u8 i; u8 j; - gSfxRequestWriteIndex = 0; - gSfxRequestReadIndex = 0; - D_800C5D24 = 0; + sSfxRequestWriteIndex = 0; + sSfxRequestReadIndex = 0; + sChannelMuteFlags = 0; for (i = 0; i < 5; i++) { - gSfxBankListEnd[i] = 0; - gSfxBankFreeListStart[i] = 1; - gSfxBankUnused[i] = 0; - gSfxBankMuted[i] = 0; - gSfxVolumeMods[i].value = 1.0f; - gSfxVolumeMods[i].timer = 0; + sSfxBankListEnd[i] = 0; + sSfxBankFreeListStart[i] = 1; + sSfxBankUnused[i] = 0; + sSfxBankMuted[i] = 0; + sSfxVolumeMods[i].value = 1.0f; + sSfxVolumeMods[i].timer = 0; } for (i = 0; i < 5; i++) { for (j = 0; j < 8; j++) { - gActiveSfx[i][j].entryIndex = 0xFF; + sActiveSfx[i][j].entryIndex = 0xFF; } } for (i = 0; i < 5; i++) { - gSfxBanks[i][0].prev = 0xFF; - gSfxBanks[i][0].next = 0xFF; + sSfxBanks[i][0].prev = 0xFF; + sSfxBanks[i][0].next = 0xFF; for (j = 1; j < 19; j++) { - gSfxBanks[i][j].prev = j - 1; - gSfxBanks[i][j].next = j + 1; + sSfxBanks[i][j].prev = j - 1; + sSfxBanks[i][j].next = j + 1; } - gSfxBanks[i][j].prev = j - 1; - gSfxBanks[i][j].next = 0xFF; + sSfxBanks[i][j].prev = j - 1; + sSfxBanks[i][j].next = 0xFF; } } @@ -2079,7 +1977,7 @@ void Audio_ClearVoice(void) { } s32 Audio_GetCurrentVoice(void) { - if (gSeqPlayers[SEQ_PLAYER_VOICE].channels[15] == &gSeqChannelNone) { + if (!IS_SEQUENCE_CHANNEL_VALID(gSeqPlayers[SEQ_PLAYER_VOICE].channels[15])) { return 0; } if (gSeqPlayers[SEQ_PLAYER_VOICE].channels[15]->seqScriptIO[1] == 1) { @@ -2096,7 +1994,7 @@ s32 Audio_GetCurrentVoiceStatus(void) { SequenceChannel* channel = gSeqPlayers[SEQ_PLAYER_VOICE].channels[15]; SequenceLayer* layer = channel->layers[0]; - if ((channel == &gSeqChannelNone) || (layer == NULL) || (channel->seqScriptIO[1] != 1)) { + if (!IS_SEQUENCE_CHANNEL_VALID(channel) || (layer == NULL) || (channel->seqScriptIO[1] != 1)) { return 0; } if (layer->note != NULL) { @@ -2126,10 +2024,10 @@ void Audio_ResetPlayerFreqMods(void) { for (i = 0; i < 4; i++) { for (j = 0; j < 5; j++) { - gPlayerNoise[i].freqMod[j].value = 1.0f; - gPlayerNoise[i].freqMod[j].timer = 0; - gPlayerNoise[i].freqMod[j].boost = 0; - gPlayerNoise[i].freqMod[j].brake = 0; + sPlayerNoise[i].freqMod[j].value = 1.0f; + sPlayerNoise[i].freqMod[j].timer = 0; + sPlayerNoise[i].freqMod[j].boost = 0; + sPlayerNoise[i].freqMod[j].brake = 0; } } } @@ -2139,75 +2037,75 @@ void Audio_UpdateArwingNoise(u8 playerId) { u8 i; if (gPlayer[playerId].sfx.boost) { - gPlayerNoise[playerId].freqMod[0].target = 1.5f; - gPlayerNoise[playerId].freqMod[0].timer = 18; - gPlayerNoise[playerId].freqMod[0].step = - (gPlayerNoise[playerId].freqMod[0].target - gPlayerNoise[playerId].freqMod[0].value) / 18; - gPlayerNoise[playerId].freqMod[0].boost = true; - } else if (gPlayerNoise[playerId].freqMod[0].boost) { - gPlayerNoise[playerId].freqMod[0].boost = false; - gPlayerNoise[playerId].freqMod[0].timer = 1; + sPlayerNoise[playerId].freqMod[0].target = 1.5f; + sPlayerNoise[playerId].freqMod[0].timer = 18; + sPlayerNoise[playerId].freqMod[0].step = + (sPlayerNoise[playerId].freqMod[0].target - sPlayerNoise[playerId].freqMod[0].value) / 18; + sPlayerNoise[playerId].freqMod[0].boost = true; + } else if (sPlayerNoise[playerId].freqMod[0].boost) { + sPlayerNoise[playerId].freqMod[0].boost = false; + sPlayerNoise[playerId].freqMod[0].timer = 1; } if (gPlayer[playerId].sfx.brake) { - gPlayerNoise[playerId].freqMod[0].target = 0.65f; - gPlayerNoise[playerId].freqMod[0].timer = 20; - gPlayerNoise[playerId].freqMod[0].step = - (gPlayerNoise[playerId].freqMod[0].target - gPlayerNoise[playerId].freqMod[0].value) / 20; - gPlayerNoise[playerId].freqMod[0].brake = true; - } else if (gPlayerNoise[playerId].freqMod[0].brake) { - gPlayerNoise[playerId].freqMod[0].brake = false; - gPlayerNoise[playerId].freqMod[0].timer = 1; + sPlayerNoise[playerId].freqMod[0].target = 0.65f; + sPlayerNoise[playerId].freqMod[0].timer = 20; + sPlayerNoise[playerId].freqMod[0].step = + (sPlayerNoise[playerId].freqMod[0].target - sPlayerNoise[playerId].freqMod[0].value) / 20; + sPlayerNoise[playerId].freqMod[0].brake = true; + } else if (sPlayerNoise[playerId].freqMod[0].brake) { + sPlayerNoise[playerId].freqMod[0].brake = false; + sPlayerNoise[playerId].freqMod[0].timer = 1; } if ((gPlayer[playerId].sfx.bank != 0) && (gPlayer[playerId].sfx.zRot < 45.0f)) { - gPlayerNoise[playerId].freqMod[2].target = 1.25f; - gPlayerNoise[playerId].freqMod[2].timer = 10; - gPlayerNoise[playerId].freqMod[2].step = - (gPlayerNoise[playerId].freqMod[2].target - gPlayerNoise[playerId].freqMod[2].value) / 10; + sPlayerNoise[playerId].freqMod[2].target = 1.25f; + sPlayerNoise[playerId].freqMod[2].timer = 10; + sPlayerNoise[playerId].freqMod[2].step = + (sPlayerNoise[playerId].freqMod[2].target - sPlayerNoise[playerId].freqMod[2].value) / 10; } if (gPlayer[playerId].sfx.roll != 0) { - Audio_PlaySfx(0x09000012, gPlayer[playerId].sfx.srcPos, playerId, &gDefaultMod, &gDefaultMod, &gDefaultReverb); - gPlayerNoise[playerId].freqMod[1].target = 1.65f; - gPlayerNoise[playerId].freqMod[1].timer = 8; - gPlayerNoise[playerId].freqMod[1].step = - (gPlayerNoise[playerId].freqMod[1].target - gPlayerNoise[playerId].freqMod[1].value) / 8; + AUDIO_PLAY_SFX(0x09000012, gPlayer[playerId].sfx.srcPos, playerId); + sPlayerNoise[playerId].freqMod[1].target = 1.65f; + sPlayerNoise[playerId].freqMod[1].timer = 8; + sPlayerNoise[playerId].freqMod[1].step = + (sPlayerNoise[playerId].freqMod[1].target - sPlayerNoise[playerId].freqMod[1].value) / 8; } if (ABS(gPlayer[playerId].sfx.yVel) > 2.0f) { - gPlayerNoise[playerId].freqMod[3].target = 1.25f; - gPlayerNoise[playerId].freqMod[3].timer = 15; - gPlayerNoise[playerId].freqMod[3].step = - (gPlayerNoise[playerId].freqMod[3].target - gPlayerNoise[playerId].freqMod[3].value) / 15; - gPlayerNoise[playerId].freqMod[3].boost = true; - } else if (gPlayerNoise[playerId].freqMod[3].boost) { - gPlayerNoise[playerId].freqMod[3].boost = false; - gPlayerNoise[playerId].freqMod[3].timer = 1; + sPlayerNoise[playerId].freqMod[3].target = 1.25f; + sPlayerNoise[playerId].freqMod[3].timer = 15; + sPlayerNoise[playerId].freqMod[3].step = + (sPlayerNoise[playerId].freqMod[3].target - sPlayerNoise[playerId].freqMod[3].value) / 15; + sPlayerNoise[playerId].freqMod[3].boost = true; + } else if (sPlayerNoise[playerId].freqMod[3].boost) { + sPlayerNoise[playerId].freqMod[3].boost = false; + sPlayerNoise[playerId].freqMod[3].timer = 1; } - if (gPlayerNoise[playerId].freqMod[4].timer == 0) { - gPlayerNoise[playerId].freqMod[4].target = (((f32) (gAudioRandom % 0x10000) / 32768.0) * 0.15f) + 1.0f - 0.15f; - gPlayerNoise[playerId].freqMod[4].timer = 16 + (gAudioRandom >> 27); - gPlayerNoise[playerId].freqMod[4].step = - (gPlayerNoise[playerId].freqMod[4].target - gPlayerNoise[playerId].freqMod[3].value) / - gPlayerNoise[playerId].freqMod[4].timer; + if (sPlayerNoise[playerId].freqMod[4].timer == 0) { + sPlayerNoise[playerId].freqMod[4].target = (((f32) (gAudioRandom % 0x10000) / 32768.0) * 0.15f) + 1.0f - 0.15f; + sPlayerNoise[playerId].freqMod[4].timer = 16 + (gAudioRandom >> 27); + sPlayerNoise[playerId].freqMod[4].step = + (sPlayerNoise[playerId].freqMod[4].target - sPlayerNoise[playerId].freqMod[3].value) / + sPlayerNoise[playerId].freqMod[4].timer; } for (i = 0; i < 5; i++) { - if (gPlayerNoise[playerId].freqMod[i].timer != 0) { - gPlayerNoise[playerId].freqMod[i].timer--; - gPlayerNoise[playerId].freqMod[i].value += gPlayerNoise[playerId].freqMod[i].step; - if ((gPlayerNoise[playerId].freqMod[i].timer == 0) && (gPlayerNoise[playerId].freqMod[i].target != 1.0f)) { - gPlayerNoise[playerId].freqMod[i].target = 1.0f; - gPlayerNoise[playerId].freqMod[i].timer = D_800C5E58[i]; - gPlayerNoise[playerId].freqMod[i].step = - (1.0f - gPlayerNoise[playerId].freqMod[i].value) / D_800C5E58[i]; + if (sPlayerNoise[playerId].freqMod[i].timer != 0) { + sPlayerNoise[playerId].freqMod[i].timer--; + sPlayerNoise[playerId].freqMod[i].value += sPlayerNoise[playerId].freqMod[i].step; + if ((sPlayerNoise[playerId].freqMod[i].timer == 0) && (sPlayerNoise[playerId].freqMod[i].target != 1.0f)) { + sPlayerNoise[playerId].freqMod[i].target = 1.0f; + sPlayerNoise[playerId].freqMod[i].timer = D_800C5E58[i]; + sPlayerNoise[playerId].freqMod[i].step = + (1.0f - sPlayerNoise[playerId].freqMod[i].value) / D_800C5E58[i]; } } } freqMod = 1.0f; for (i = 0; i < 5; i++) { - freqMod *= gPlayerNoise[playerId].freqMod[i].value; + freqMod *= sPlayerNoise[playerId].freqMod[i].value; } if (freqMod >= 4.0f) { freqMod = 4.0f; } - gPlayerNoise[playerId].totalMod = freqMod; + sPlayerNoise[playerId].totalMod = freqMod; } void Audio_UpdateLandmasterNoise(u8 playerId) { @@ -2215,39 +2113,39 @@ void Audio_UpdateLandmasterNoise(u8 playerId) { u8 i; if ((gPlayer[playerId].sfx.bank != 0) && (gPlayer[playerId].sfx.zRot < 45.0f)) { - gPlayerNoise[playerId].freqMod[2].timer = 10; - gPlayerNoise[playerId].freqMod[2].target = 1.25f; - gPlayerNoise[playerId].freqMod[2].step = (1.25f - gPlayerNoise[playerId].freqMod[2].value) / 10; + sPlayerNoise[playerId].freqMod[2].timer = 10; + sPlayerNoise[playerId].freqMod[2].target = 1.25f; + sPlayerNoise[playerId].freqMod[2].step = (1.25f - sPlayerNoise[playerId].freqMod[2].value) / 10; } if (gPlayer[playerId].sfx.roll != 0) { - gPlayerNoise[playerId].freqMod[1].timer = 8; - gPlayerNoise[playerId].freqMod[1].target = 1.65f; - gPlayerNoise[playerId].freqMod[1].step = (1.65f - gPlayerNoise[playerId].freqMod[1].value) / 8; + sPlayerNoise[playerId].freqMod[1].timer = 8; + sPlayerNoise[playerId].freqMod[1].target = 1.65f; + sPlayerNoise[playerId].freqMod[1].step = (1.65f - sPlayerNoise[playerId].freqMod[1].value) / 8; } if (ABS(gPlayer[playerId].sfx.yVel) > 2.0f) { - gPlayerNoise[playerId].freqMod[3].target = 1.25f; - gPlayerNoise[playerId].freqMod[3].timer = 15; - gPlayerNoise[playerId].freqMod[3].boost = true; - gPlayerNoise[playerId].freqMod[3].step = (1.25f - gPlayerNoise[playerId].freqMod[3].value) / 15; - } else if (gPlayerNoise[playerId].freqMod[3].boost) { - gPlayerNoise[playerId].freqMod[3].boost = false; - gPlayerNoise[playerId].freqMod[3].timer = 1; + sPlayerNoise[playerId].freqMod[3].target = 1.25f; + sPlayerNoise[playerId].freqMod[3].timer = 15; + sPlayerNoise[playerId].freqMod[3].boost = true; + sPlayerNoise[playerId].freqMod[3].step = (1.25f - sPlayerNoise[playerId].freqMod[3].value) / 15; + } else if (sPlayerNoise[playerId].freqMod[3].boost) { + sPlayerNoise[playerId].freqMod[3].boost = false; + sPlayerNoise[playerId].freqMod[3].timer = 1; } for (i = 0; i < 5; i++) { - if (gPlayerNoise[playerId].freqMod[i].timer != 0) { - gPlayerNoise[playerId].freqMod[i].timer--; - gPlayerNoise[playerId].freqMod[i].value += gPlayerNoise[playerId].freqMod[i].step; - if ((gPlayerNoise[playerId].freqMod[i].timer == 0) && (gPlayerNoise[playerId].freqMod[i].target != 1.0f)) { - gPlayerNoise[playerId].freqMod[i].target = 1.0f; - gPlayerNoise[playerId].freqMod[i].timer = D_800C5E58[i]; - gPlayerNoise[playerId].freqMod[i].step = - (1.0f - gPlayerNoise[playerId].freqMod[i].value) / D_800C5E58[i]; + if (sPlayerNoise[playerId].freqMod[i].timer != 0) { + sPlayerNoise[playerId].freqMod[i].timer--; + sPlayerNoise[playerId].freqMod[i].value += sPlayerNoise[playerId].freqMod[i].step; + if ((sPlayerNoise[playerId].freqMod[i].timer == 0) && (sPlayerNoise[playerId].freqMod[i].target != 1.0f)) { + sPlayerNoise[playerId].freqMod[i].target = 1.0f; + sPlayerNoise[playerId].freqMod[i].timer = D_800C5E58[i]; + sPlayerNoise[playerId].freqMod[i].step = + (1.0f - sPlayerNoise[playerId].freqMod[i].value) / D_800C5E58[i]; } } } freqMod = 1.0f; for (i = 0; i < 5; i++) { - freqMod *= gPlayerNoise[playerId].freqMod[i].value; + freqMod *= sPlayerNoise[playerId].freqMod[i].value; } if (ABS(gPlayer[playerId].pos.y) < 600.0f) { freqMod += (gPlayer[playerId].pos.y / 600.0f); @@ -2264,7 +2162,7 @@ void Audio_UpdateLandmasterNoise(u8 playerId) { if (freqMod > 2.0f) { freqMod = 2.0f; } - gPlayerNoise[playerId].totalMod = freqMod; + sPlayerNoise[playerId].totalMod = freqMod; } void Audio_UpdateBlueMarineNoise(u8 playerId) { @@ -2272,58 +2170,58 @@ void Audio_UpdateBlueMarineNoise(u8 playerId) { f32 freqMod; if ((gPlayer[playerId].sfx.bank != 0) && (gPlayer[playerId].sfx.zRot < 45.0f)) { - gPlayerNoise[playerId].freqMod[2].timer = 10; - gPlayerNoise[playerId].freqMod[2].target = 1.1f; - gPlayerNoise[playerId].freqMod[2].step = (1.1f - gPlayerNoise[playerId].freqMod[2].value) / 10; + sPlayerNoise[playerId].freqMod[2].timer = 10; + sPlayerNoise[playerId].freqMod[2].target = 1.1f; + sPlayerNoise[playerId].freqMod[2].step = (1.1f - sPlayerNoise[playerId].freqMod[2].value) / 10; } if (gPlayer[playerId].sfx.roll != 0) { - Audio_PlaySfx(0x09000017, gPlayer[playerId].sfx.srcPos, playerId, &gDefaultMod, &gDefaultMod, &gDefaultReverb); - gPlayerNoise[playerId].freqMod[1].timer = 8; - gPlayerNoise[playerId].freqMod[1].target = 1.2f; - gPlayerNoise[playerId].freqMod[1].step = (1.2f - gPlayerNoise[playerId].freqMod[1].value) / 8; + AUDIO_PLAY_SFX(0x09000017, gPlayer[playerId].sfx.srcPos, playerId); + sPlayerNoise[playerId].freqMod[1].timer = 8; + sPlayerNoise[playerId].freqMod[1].target = 1.2f; + sPlayerNoise[playerId].freqMod[1].step = (1.2f - sPlayerNoise[playerId].freqMod[1].value) / 8; } if (ABS(gPlayer[playerId].sfx.yVel) > 2.0f) { - gPlayerNoise[playerId].freqMod[3].timer = 15; - gPlayerNoise[playerId].freqMod[3].boost = true; - gPlayerNoise[playerId].freqMod[3].target = 1.12f; - gPlayerNoise[playerId].freqMod[3].step = (1.12f - gPlayerNoise[playerId].freqMod[3].value) / 15; - } else if (gPlayerNoise[playerId].freqMod[3].boost) { - gPlayerNoise[playerId].freqMod[3].boost = false; - gPlayerNoise[playerId].freqMod[3].timer = 1; + sPlayerNoise[playerId].freqMod[3].timer = 15; + sPlayerNoise[playerId].freqMod[3].boost = true; + sPlayerNoise[playerId].freqMod[3].target = 1.12f; + sPlayerNoise[playerId].freqMod[3].step = (1.12f - sPlayerNoise[playerId].freqMod[3].value) / 15; + } else if (sPlayerNoise[playerId].freqMod[3].boost) { + sPlayerNoise[playerId].freqMod[3].boost = false; + sPlayerNoise[playerId].freqMod[3].timer = 1; } for (i = 0; i < 5; i++) { - if (gPlayerNoise[playerId].freqMod[i].timer != 0) { - gPlayerNoise[playerId].freqMod[i].timer--; - gPlayerNoise[playerId].freqMod[i].value += gPlayerNoise[playerId].freqMod[i].step; - if ((gPlayerNoise[playerId].freqMod[i].timer == 0) && (gPlayerNoise[playerId].freqMod[i].target != 1.0f)) { - gPlayerNoise[playerId].freqMod[i].target = 1.0f; - gPlayerNoise[playerId].freqMod[i].timer = D_800C5E58[i]; - gPlayerNoise[playerId].freqMod[i].step = - (1.0f - gPlayerNoise[playerId].freqMod[i].value) / D_800C5E58[i]; + if (sPlayerNoise[playerId].freqMod[i].timer != 0) { + sPlayerNoise[playerId].freqMod[i].timer--; + sPlayerNoise[playerId].freqMod[i].value += sPlayerNoise[playerId].freqMod[i].step; + if ((sPlayerNoise[playerId].freqMod[i].timer == 0) && (sPlayerNoise[playerId].freqMod[i].target != 1.0f)) { + sPlayerNoise[playerId].freqMod[i].target = 1.0f; + sPlayerNoise[playerId].freqMod[i].timer = D_800C5E58[i]; + sPlayerNoise[playerId].freqMod[i].step = + (1.0f - sPlayerNoise[playerId].freqMod[i].value) / D_800C5E58[i]; } } } freqMod = 1.0f; for (i = 0; i < 5; i++) { - freqMod *= gPlayerNoise[playerId].freqMod[i].value; + freqMod *= sPlayerNoise[playerId].freqMod[i].value; } if (freqMod > 2.0f) { freqMod = 2.0f; } - gPlayerNoise[playerId].totalMod = freqMod; + sPlayerNoise[playerId].totalMod = freqMod; } void Audio_UpdatePlayerFreqMod(void) { u8 playerId; for (playerId = 0; playerId < 4; playerId++) { - switch (gPlayerNoise[playerId].form) { + switch (sPlayerNoise[playerId].form) { case FORM_ARWING: Audio_UpdateArwingNoise(playerId); - gPlayerNoise[playerId].totalMod *= + sPlayerNoise[playerId].totalMod *= Audio_UpdateDopplerShift(gPlayer[playerId].sfx.srcPos, gPlayer[playerId].sfx.srcVel, 150.0f, - &gPlayerNoise[playerId].dopplerShift); + &sPlayerNoise[playerId].dopplerShift); break; case FORM_LANDMASTER: Audio_UpdateLandmasterNoise(playerId); @@ -2341,11 +2239,11 @@ void Audio_UpdatePlayerReverb(void) { u8 playerId; for (playerId = 0; playerId < 4; playerId++) { - if ((gPlayerNoise[playerId].form == FORM_ARWING) && (gPlayer[playerId].sfx.levelType == LEVELTYPE_PLANET)) { + if ((sPlayerNoise[playerId].form == FORM_ARWING) && (gPlayer[playerId].sfx.levelType == LEVELTYPE_PLANET)) { if (gPlayer[playerId].pos.y < 150.0f) { - gPlayerNoise[playerId].reverbAdd = (150.0f - gPlayer[playerId].pos.y) * 0.53f; + sPlayerNoise[playerId].reverbAdd = (150.0f - gPlayer[playerId].pos.y) * 0.53f; } else { - gPlayerNoise[playerId].reverbAdd = 0; + sPlayerNoise[playerId].reverbAdd = 0; } } } @@ -2361,20 +2259,20 @@ void Audio_ResetVoicesAndPlayers(void) { Audio_ResetPlayerFreqMods(); for (playerId = 0; playerId < 4; playerId++) { - gPlayerNoise[playerId].form = FORM_NONE; - gPlayerNoise[playerId].reverbAdd = 0; - gPlayerNoise[playerId].totalMod = 1.0f; - gPlayerNoise[playerId].dopplerShift = 1.0f; + sPlayerNoise[playerId].form = FORM_NONE; + sPlayerNoise[playerId].reverbAdd = 0; + sPlayerNoise[playerId].totalMod = 1.0f; + sPlayerNoise[playerId].dopplerShift = 1.0f; D_8014BA24[playerId] = 0; D_8014BA28[playerId] = 0; } - gSfxFreqMod = 1.0f; - gSfxVolMod = 1.0f; + sSfxFreqMod = 1.0f; + sSfxVolMod = 1.0f; sNextVoiceId = 0; sCurrentVoiceId = 0; sSetNextVoiceId = 0; sMuteBgmForVoice = 0; - gPlaylistIndex = 0xFF; + sPlaylistIndex = 0xFF; } void Audio_ProcessPlaylist(void) { @@ -2384,36 +2282,36 @@ void Audio_ProcessPlaylist(void) { u32 temp1; u32 temp5; - if (gPlaylistIndex != 0xFF) { - if (gPlaylistTimer == 0) { - cmd = &gPlaylists[gPlaylistIndex][gPlaylistCmdIndex]; - switch (cmd->type) { + if (sPlaylistIndex != 0xFF) { + if (sPlaylistTimer == 0) { + cmd = &sPlaylists[sPlaylistIndex][sPlaylistCmdIndex]; + switch (cmd->opCode) { case 0: - Audio_PlaySequence(cmd->unk_1, cmd->unk_2 & 0xFF, 0, cmd->unk_6); - gPlaylistTimer = gPlaylists[gPlaylistIndex][gPlaylistCmdIndex].unk_8; - gPlaylistCmdIndex++; + Audio_PlaySequence(cmd->seqPlayId, cmd->seqId & 0xFF, 0, cmd->bgmParam); + sPlaylistTimer = sPlaylists[sPlaylistIndex][sPlaylistCmdIndex].timer; + sPlaylistCmdIndex++; break; case 1: - SEQCMD_STOP_SEQUENCE_ALT(cmd->unk_1, cmd->unk_5); - gPlaylistTimer = gPlaylists[gPlaylistIndex][gPlaylistCmdIndex].unk_8; - gPlaylistCmdIndex++; + SEQCMD_STOP_SEQUENCE_ALT(cmd->seqPlayId, cmd->fadeoutTime); + sPlaylistTimer = sPlaylists[sPlaylistIndex][sPlaylistCmdIndex].timer; + sPlaylistCmdIndex++; break; case 2: - Audio_PlaySequenceDistorted(cmd->unk_1, cmd->unk_2 & 0xFF, 1121, 25, cmd->unk_6); - gPlaylistTimer = gPlaylists[gPlaylistIndex][gPlaylistCmdIndex].unk_8; - gPlaylistCmdIndex++; + Audio_PlaySequenceDistorted(cmd->seqPlayId, cmd->seqId & 0xFF, 1121, 25, cmd->bgmParam); + sPlaylistTimer = sPlaylists[sPlaylistIndex][sPlaylistCmdIndex].timer; + sPlaylistCmdIndex++; break; case 3: - Audio_PlayFanfare(cmd->unk_2 & 0xFF, 20, 10, 10); - gPlaylistTimer = gPlaylists[gPlaylistIndex][gPlaylistCmdIndex].unk_8; - gPlaylistCmdIndex++; + Audio_PlayFanfare(cmd->seqId & 0xFF, 20, 10, 10); + sPlaylistTimer = sPlaylists[sPlaylistIndex][sPlaylistCmdIndex].timer; + sPlaylistCmdIndex++; break; case 0xFF: - gPlaylistIndex = 0xFF; + sPlaylistIndex = 0xFF; break; } } else { - gPlaylistTimer--; + sPlaylistTimer--; } } } @@ -2551,9 +2449,9 @@ u8* Audio_UpdateFrequencyAnalysis(void) { void func_8001C8B8(u8 playerId) { u32 sfxId = 0x00000000; - gPlayerNoise[playerId].form = gPlayer[playerId].sfx.form; + sPlayerNoise[playerId].form = gPlayer[playerId].sfx.form; Audio_ResetPlayerFreqMods(); - switch (gPlayerNoise[playerId].form) { + switch (sPlayerNoise[playerId].form) { case FORM_ARWING: if (gPlayer[playerId].sfx.levelType == LEVELTYPE_SPACE) { sfxId = 0x0100F020; @@ -2567,19 +2465,19 @@ void func_8001C8B8(u8 playerId) { case FORM_BLUE_MARINE: sfxId = 0x0100F022; Audio_PlaySfx(0x1100802C, gPlayer[playerId].sfx.srcPos, playerId, &gDefaultMod, &gDefaultMod, - &gPlayerNoise[playerId].reverbAdd); + &sPlayerNoise[playerId].reverbAdd); break; } if (sfxId != 0) { - Audio_PlaySfx(sfxId, gPlayer[playerId].sfx.srcPos, playerId, &gPlayerNoise[playerId].totalMod, &gDefaultMod, - &gPlayerNoise[playerId].reverbAdd); + Audio_PlaySfx(sfxId, gPlayer[playerId].sfx.srcPos, playerId, &sPlayerNoise[playerId].totalMod, &gDefaultMod, + &sPlayerNoise[playerId].reverbAdd); } } void func_8001CA24(u8 playerId) { u32 sfxId = 0x00000000; - switch (gPlayerNoise[playerId].form) { + switch (sPlayerNoise[playerId].form) { case FORM_ARWING: if (gPlayer[playerId].sfx.levelType == LEVELTYPE_SPACE) { sfxId = 0x0100F020; @@ -2596,14 +2494,14 @@ void func_8001CA24(u8 playerId) { Audio_KillSfxBySourceAndId(gPlayer[playerId].sfx.srcPos, 0x1100802C); break; } - gPlayerNoise[playerId].form = FORM_NONE; + sPlayerNoise[playerId].form = FORM_NONE; if (sfxId != 0) { Audio_KillSfxBySourceAndId(gPlayer[playerId].sfx.srcPos, sfxId); } } void func_8001CB80(u8 playerId, u8 arg1) { - D_8014BA28[playerId] = gAudioFrameCounter; + D_8014BA28[playerId] = sAudioFrameCounter; switch (arg1) { case 1: D_8014BA10[playerId] = 1.0f; @@ -2621,7 +2519,7 @@ void func_8001CB80(u8 playerId, u8 arg1) { } if (D_8014BA24[playerId] != 1) { Audio_PlaySfx(0x01008008, gPlayer[playerId].sfx.srcPos, playerId, &D_8014BA10[playerId], &gDefaultMod, - &gPlayerNoise[playerId].reverbAdd); + &sPlayerNoise[playerId].reverbAdd); D_8014BA24[playerId] = 1; } } @@ -2642,7 +2540,7 @@ void func_8001CCDC(u8 playerId, f32* sfxSource) { } Audio_KillSfxBySourceAndId(gPlayer[playerId].sfx.srcPos, 0x01008008); Audio_PlaySfx(0x09001001, sfxSource, playerId, &D_8014BA10[playerId], &gDefaultMod, - &gPlayerNoise[playerId].reverbAdd); + &sPlayerNoise[playerId].reverbAdd); D_8014BA24[playerId] = 2; } } @@ -2664,7 +2562,7 @@ void func_8001CE28(u8 playerId, f32* sfxSource) { break; } Audio_KillSfxByTokenAndId(playerId, 0x09001001); - Audio_PlaySfx(sfxId, sfxSource, playerId, &gDefaultMod, &gDefaultMod, &gDefaultReverb); + AUDIO_PLAY_SFX(sfxId, sfxSource, playerId); D_8014BA24[playerId] = 0; } } @@ -2672,7 +2570,7 @@ void func_8001CE28(u8 playerId, f32* sfxSource) { void func_8001CEFC(f32* sfxSource) { u32 sfxId = (gPlayer[0].sfx.levelType == LEVELTYPE_SPACE) ? 0x31000040 : 0x3100000C; - Audio_PlaySfx(sfxId, sfxSource, 0, &gDefaultMod, &gDefaultMod, &gDefaultReverb); + AUDIO_PLAY_SFX(sfxId, sfxSource, 0); } void func_8001CF60(f32* sfxSource) { @@ -2690,7 +2588,7 @@ void func_8001CFA8(f32 arg0) { var_fv0 = 30.0f; } - gSfxFreqMod = ((var_fv0 - 18.0f) / 24.0f) + 1.0f; + sSfxFreqMod = ((var_fv0 - 18.0f) / 24.0f) + 1.0f; } void func_8001D034(f32* sfxSource, u32 sfxId, u8 semitones) { @@ -2705,19 +2603,19 @@ void func_8001D034(f32* sfxSource, u32 sfxId, u8 semitones) { } void func_8001D0B4(f32* sfxSource, u32 sfxId, f32 freqMod) { - gSfxFreqMod = freqMod; - Audio_PlaySfx(sfxId, sfxSource, 0, &gSfxFreqMod, &gDefaultMod, &gDefaultReverb); + sSfxFreqMod = freqMod; + Audio_PlaySfx(sfxId, sfxSource, 0, &sSfxFreqMod, &gDefaultMod, &gDefaultReverb); } void func_8001D10C(f32* sfxSource, u32 sfxId) { - Audio_PlaySfx(sfxId, sfxSource, 0, &gSfxFreqMod, &gSfxVolMod, &gDefaultReverb); + Audio_PlaySfx(sfxId, sfxSource, 0, &sSfxFreqMod, &sSfxVolMod, &gDefaultReverb); } void func_8001D15C(u8 arg0) { if (arg0 < 12) { - gSfxFreqMod = (arg0 / 11.0f) + 0.5f; + sSfxFreqMod = (arg0 / 11.0f) + 0.5f; } else { - gSfxFreqMod = 1.5f; + sSfxFreqMod = 1.5f; } } @@ -2741,15 +2639,15 @@ void func_8001D1C8(u8 arg0, u8 arg1) { AUDIOCMD_CHANNEL_SET_IO(SEQ_PLAYER_SFX, 11, 3, temp1); } -void func_8001D2FC(f32* sfxSource, u16 arg1) { +void Audio_PlayEventSfx(f32* sfxSource, u16 arg1) { if ((D_800C5E88[arg1] & 0xF0000000) != 0x40000000) { - Audio_PlaySfx(D_800C5E88[arg1], sfxSource, 0, &gDefaultMod, &gDefaultMod, &gDefaultReverb); + AUDIO_PLAY_SFX(D_800C5E88[arg1], sfxSource, 0); } else { - Audio_PlaySfx(D_800C5E88[arg1], gDefaultSfxSource, 0, &gDefaultMod, &gDefaultMod, &gDefaultReverb); + AUDIO_PLAY_SFX(D_800C5E88[arg1], gDefaultSfxSource, 0); } } -void func_8001D3A0(f32* sfxSource, u16 arg1) { +void Audio_StopEventSfx(f32* sfxSource, u16 arg1) { if ((D_800C5E88[arg1] & 0xF0000000) != 0x40000000) { Audio_KillSfxBySourceAndId(sfxSource, D_800C5E88[arg1]); } else { @@ -2771,7 +2669,7 @@ void Audio_PlaySequence(u8 seqPlayId, u16 seqId, u8 fadeinTime, u8 bgmParam) { } void Audio_PlayFanfare(u16 seqId, u8 bgmVolume, u8 bgmFadeoutTime, u8 bgmFadeinTime) { - if (Audio_GetActiveSeqId(SEQ_PLAYER_BGM) != 39) { + if (Audio_GetActiveSeqId(SEQ_PLAYER_BGM) != SEQ_ID_DEATH) { Audio_SetSequenceFade(SEQ_PLAYER_BGM, 1, bgmVolume, bgmFadeoutTime); SEQCMD_SETUP_RESTORE_SEQPLAYER_VOLUME(SEQ_PLAYER_FANFARE, SEQ_PLAYER_BGM, bgmFadeinTime); SEQCMD_PLAY_SEQUENCE(SEQ_PLAYER_FANFARE, 0, 0, seqId); @@ -2784,7 +2682,7 @@ void func_8001D520(void) { if (sNewAudioSpecId == 24) { Audio_ClearVoice(); func_8001D6DC(0); - Audio_PlaySfx(0x0903F004, gDefaultSfxSource, 4, &gDefaultMod, &gDefaultMod, &gDefaultReverb); + AUDIO_PLAY_SFX(0x0903F004, gDefaultSfxSource, 4); SEQCMD_SET_SEQPLAYER_VOLUME(SEQ_PLAYER_BGM, 5, 30); SEQCMD_SETUP_RESTORE_SEQPLAYER_VOLUME(SEQ_PLAYER_FANFARE, SEQ_PLAYER_BGM, 30); SEQCMD_PLAY_SEQUENCE(SEQ_PLAYER_FANFARE, 0, 0, 39); @@ -2793,7 +2691,7 @@ void func_8001D520(void) { Audio_KillSfxByBank(i); } AUDIOCMD_GLOBAL_UNMUTE(true); - Audio_PlaySfx(0x0903F004, gDefaultSfxSource, 4, &gDefaultMod, &gDefaultMod, &gDefaultReverb); + AUDIO_PLAY_SFX(0x0903F004, gDefaultSfxSource, 4); SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM, 0); SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_FANFARE, 0); SEQCMD_PLAY_SEQUENCE(SEQ_PLAYER_BGM, 0, 0, 39); @@ -2802,20 +2700,20 @@ void func_8001D520(void) { void func_8001D638(u8 arg0) { if (arg0) { - Audio_PlaySfx(0x4900F000, gDefaultSfxSource, 4, &gDefaultMod, &gDefaultMod, &gDefaultReverb); + AUDIO_PLAY_SFX(0x4900F000, gDefaultSfxSource, 4); AUDIOCMD_GLOBAL_MUTE(); } else { - Audio_PlaySfx(0x4900F000, gDefaultSfxSource, 4, &gDefaultMod, &gDefaultMod, &gDefaultReverb); + AUDIO_PLAY_SFX(0x4900F000, gDefaultSfxSource, 4); AUDIOCMD_GLOBAL_UNMUTE(false); } } void func_8001D6DC(u8 arg0) { if (arg0) { - Audio_PlaySfx(0x49000019, gDefaultSfxSource, 4, &gDefaultMod, &gDefaultMod, &gDefaultReverb); + AUDIO_PLAY_SFX(0x49000019, gDefaultSfxSource, 4); AUDIOCMD_GLOBAL_MUTE(); } else { - Audio_PlaySfx(0x4900101A, gDefaultSfxSource, 4, &gDefaultMod, &gDefaultMod, &gDefaultReverb); + AUDIO_PLAY_SFX(0x4900101A, gDefaultSfxSource, 4); AUDIOCMD_GLOBAL_UNMUTE(false); } } @@ -2851,16 +2749,16 @@ void func_8001D8A8(u8 audioType, u8 volume) { void Audio_PlaySoundTest(u8 enable) { switch (enable) { case false: - Audio_PlaySequence(0, 36, 0, 255); + AUDIO_PLAY_BGM(SEQ_ID_MENU); Audio_PlayVoice(1); Audio_KillSfxById(0x0100001F); Audio_KillSfxById(0x0100F005); break; case true: - Audio_PlaySequence(0, 46, 0, 255); + AUDIO_PLAY_BGM(SEQ_ID_VERSUS); Audio_PlayVoice(2); - Audio_PlaySfx(0x0100001F, gDefaultSfxSource, 0, &gDefaultMod, &gDefaultMod, &gDefaultReverb); - Audio_PlaySfx(0x0100F005, gDefaultSfxSource, 0, &gDefaultMod, &gDefaultMod, &gDefaultReverb); + AUDIO_PLAY_SFX(0x0100001F, gDefaultSfxSource, 0); + AUDIO_PLAY_SFX(0x0100F005, gDefaultSfxSource, 0); break; } } @@ -2868,7 +2766,7 @@ void Audio_PlaySoundTest(u8 enable) { void Audio_PlaySequenceDistorted(u8 seqPlayId, u16 seqId, u16 distortion, u8 fadeinTime, u8 unused) { u8 tempoDistortion = (distortion / 10); - Audio_PlaySequence(seqPlayId, seqId & ~0x8000, 0, 255); + Audio_PlaySequence(seqPlayId, seqId & ~0x8000, 0, -1); SEQCMD_SET_SEQPLAYER_FREQ(seqPlayId, fadeinTime, distortion); SEQCMD_SCALE_TEMPO(seqPlayId, fadeinTime, tempoDistortion); } @@ -2880,15 +2778,15 @@ void Audio_PlaySoundTestTrack(u8 trackNumber) { if ((trackNumber >= 45) && (trackNumber < 50)) { SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM, 1); SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_FANFARE, 1); - gPlaylistIndex = trackNumber - 45; - gPlaylistCmdIndex = 0; - gPlaylistTimer = 0; + sPlaylistIndex = trackNumber - 45; + sPlaylistCmdIndex = 0; + sPlaylistTimer = 0; } else if (trackNumber >= 50) { - Audio_PlaySfx(0x4900100A, gDefaultSfxSource, 4, &gDefaultMod, &gDefaultMod, &gDefaultReverb); + AUDIO_PLAY_SFX(0x4900100A, gDefaultSfxSource, 4); } else { - gPlaylistIndex = 0xFF; - sp26 = D_800C5EE4[trackNumber].unk_0 & 0xFF; - sp25 = D_800C5EE4[trackNumber].unk_4; + sPlaylistIndex = 0xFF; + sp26 = sSoundTestTracks[trackNumber].seqId & 0xFF; + sp25 = sSoundTestTracks[trackNumber].bgmParam; SEQCMD_STOP_SEQUENCE(D_800C5E70 ^ 1, 5); Audio_PlaySequence(D_800C5E70, sp26, 0, sp25); D_800C5E70 ^= 1; @@ -2917,7 +2815,7 @@ void Audio_SetAudioSpec(u8 unused, u16 specParam) { SEQCMD_RESET_AUDIO_HEAP(sfxChannelLayout, specId); } -// unused despite being equivalent to AUDIO_PLAY_BGM +// unused void Audio_PlayBgm(u16 seqId) { SEQCMD_PLAY_SEQUENCE(SEQ_PLAYER_BGM, 1, 0, seqId); } @@ -2927,8 +2825,8 @@ void Audio_InitSounds(void) { Audio_ResetSfxChannelState(); Audio_ResetActiveSequencesAndVolume(); Audio_ResetSfx(); - Audio_StartSequence(SEQ_PLAYER_VOICE, 1, 0xFF, 1); - Audio_StartSequence(SEQ_PLAYER_SFX, 0, 0xFF, 10); + Audio_StartSequence(SEQ_PLAYER_VOICE, SEQ_ID_VOICE, 0xFF, 1); + Audio_StartSequence(SEQ_PLAYER_SFX, SEQ_ID_SFX, 0xFF, 10); } void func_8001DD40(void) { @@ -2936,13 +2834,13 @@ void func_8001DD40(void) { s32 pad2; u16 sp1E = 1; - Audio_StartSequence(SEQ_PLAYER_VOICE, 1, 0xFF, 1); + Audio_StartSequence(SEQ_PLAYER_VOICE, SEQ_ID_VOICE, 0xFF, 1); if (sNewAudioSpecId == 12) { sp1E = 360; } else if (sNewAudioSpecId < 23) { sp1E = 90; } - Audio_StartSequence(SEQ_PLAYER_SFX, 0, 0xFF, sp1E); + Audio_StartSequence(SEQ_PLAYER_SFX, SEQ_ID_SFX, 0xFF, sp1E); func_80017494(); func_80017550(); SEQCMD_SET_SEQPLAYER_VOLUME(SEQ_PLAYER_SFX, 0, 127); @@ -2985,5 +2883,5 @@ void Audio_Update(void) { Audio_UpdateDelayedSeqCmds(); AudioThread_ScheduleProcessCmds(); } - gAudioFrameCounter++; + sAudioFrameCounter++; } diff --git a/src/audio/audio_heap.c b/src/audio/audio_heap.c index 523d46cd..69c5e6ca 100644 --- a/src/audio/audio_heap.c +++ b/src/audio/audio_heap.c @@ -11,8 +11,6 @@ void* AudioHeap_SearchRegularCaches(s32 tableType, s32 cache, s32 id); void* AudioHeap_SearchPermanentCache(s32 tableType, s32 id); SampleCacheEntry* AudioHeap_AllocPersistentSampleCacheEntry(u32); -s32 D_80146D80; - static char devstr00[] = "Warning:Kill Note %x \n"; static char devstr01[] = "Kill Voice %d (ID %d) %d\n"; static char devstr02[] = "Warning: Running Sequence's data disappear!\n"; @@ -555,7 +553,7 @@ void AudioHeap_ClearCurrentAiBuffer(void) { gAiBuffLengths[index] = gAudioBufferParams.minAiBufferLength; - for (i = 0; i < 0xAA0; i++) { + for (i = 0; i < AIBUF_LEN; i++) { gAiBuffers[index][i] = 0; } } @@ -600,7 +598,7 @@ s32 AudioHeap_ResetStep(void) { AudioHeap_UpdateReverbs(); } else { for (i = 0; i < 3; i++) { - for (j = 0; j < 0xAA0; j++) { + for (j = 0; j < AIBUF_LEN; j++) { gAiBuffers[i][j] = 0; } } @@ -623,7 +621,7 @@ s32 AudioHeap_ResetStep(void) { gResetStatus = 0; for (i = 0; i < 3; i++) { gAiBuffLengths[i] = gAudioBufferParams.maxAiBufferLength; - for (j = 0; j < 0xAA0; j++) { + for (j = 0; j < AIBUF_LEN; j++) { gAiBuffers[i][j] = 0; } } diff --git a/src/audio/audio_load.c b/src/audio/audio_load.c index 9639921e..9a87a93b 100644 --- a/src/audio/audio_load.c +++ b/src/audio/audio_load.c @@ -24,8 +24,44 @@ static char devstr18[] = "Bank Offset %x %d %d\n"; static char devstr19[] = "PEP Touch %x \n"; static char D_800C50E8[] = "FastCopy"; +s32 D_80146D80; +s32 PAD_80146D88[2]; AudioSlowLoadBuffer gSlowLoads; +s32 AudioLoad_DiscardFont(s32 fontId); + +void AudioLoad_SyncInitSeqPlayerInternal(s32 playerIdx, s32 seqId, s32 arg2); +void* AudioLoad_SyncLoadSeq(s32 seqId); +void* AudioLoad_SyncLoadSampleBank(u32 sampleBankId, s32* outMedium); +void* AudioLoad_SyncLoadFont(s32 fontId); +void* AudioLoad_SyncLoad(u32 tableType, u32 id, s32* didAllocate); +s32 AudioLoad_GetLoadTableIndex(s32 tableType, u32 entryId); +void* AudioLoad_SearchCaches(s32 tableType, s32 id); +AudioTable* AudioLoad_GetLoadTable(s32 tableType); +void AudioLoad_SyncDma(u32 devAddr, u8* ramAddr, u32 size, s32 medium); +void AudioLoad_SyncDmaUnkMedium(u32 devAddr, u8* ramAddr, u32 size, s32 unkMediumParam); +s32 AudioLoad_Dma(OSIoMesg* mesg, u32 priority, s32 direction, u32 devAddr, void* ramAddr, u32 size, + OSMesgQueue* retQueue, s32 medium, const char* dmaType); +s32 func_8000FC7C(u32 unkMediumParam, u32* addrPtr); +void func_8000FC8C(s32 unkParam2, u32 addr, u8* ramAddr, u32 size); +void AudioLoad_SyncLoadSimple(u32 tableType, u32 id); +void* AudioLoad_AsyncLoadInner(s32 tableType, s32 id, s32 nChunks, s32 retData, OSMesgQueue* retQueue); + +Sample* AudioLoad_GetFontSample(s32 fontId, s32 instId); +void AudioLoad_ProcessSlowLoads(s32 resetStatus); +void AudioLoad_DmaSlowCopy(AudioSlowLoad* slowLoad, s32 size); +void AudioLoad_DmaSlowCopyUnkMedium(u32 devAddr, u8* ramAddr, u32 size, s32 unkMediumParam); +AudioAsyncLoad* AudioLoad_StartAsyncLoad(u32 devAddr, u8* ramAddr, u32 size, s32 medium, s32 nChunks, + OSMesgQueue* retQueue, u32 retMesg); +void AudioLoad_ProcessAsyncLoads(s32 resetStatus); +void AudioLoad_ProcessAsyncLoad(AudioAsyncLoad* asyncLoad, s32 resetStatus); +void AudioLoad_AsyncDma(AudioAsyncLoad* asyncLoad, u32 size); +void AudioLoad_AsyncDmaUnkMedium(u32 devAddr, u8* ramAddr, u32 size, s32 unkMediumParam); +void AudioLoad_RelocateSample(TunedSample* tSample, u32 fontDataAddr, SampleBankRelocInfo* relocInfo); +s32 AudioLoad_RelocateFontAndPreloadSamples(s32 fontId, u32 fontDataAddr, SampleBankRelocInfo* relocData, s32 isAsync); +s32 AudioLoad_ProcessSamplePreloads(s32 resetStatus); +s32 AudioLoad_GetSamplesForFont(s32 fontId, Sample** sampleSet); + void AudioLoad_DecreaseSampleDmaTtls(void) { SampleDma* dma; u32 i; @@ -840,8 +876,8 @@ void AudioLoad_Init(void) { gSampleDmaCount = 0; AudioHeap_InitMainPools(gInitPoolSize); for (i = 0; i < 3; i++) { - gAiBuffers[i] = AudioHeap_Alloc(&gInitPool, 0xAA0 * sizeof(u16)); - for (j = 0; j < 0xAA0; j++) { + gAiBuffers[i] = AudioHeap_Alloc(&gInitPool, AIBUF_SIZE); + for (j = 0; j < AIBUF_LEN; j++) { gAiBuffers[i][j] = 0; } } @@ -1180,7 +1216,7 @@ void AudioLoad_RelocateSample(TunedSample* tSample, u32 fontDataAddr, SampleBank Sample* sample; // "Error: Already wavetable is touched %x.\n"; - if ((u32) tSample->sample <= 0x80000000) { + if ((u32) tSample->sample <= AUDIO_RELOCATED_ADDRESS_START) { sample = tSample->sample = reloc = (u32) tSample->sample + fontDataAddr; // "Touch Warning: Length zero %x\n"; if ((sample->size != 0) && (sample->isRelocated != 1)) { diff --git a/src/audio/audio_playback.c b/src/audio/audio_playback.c index 01026264..dc533ce1 100644 --- a/src/audio/audio_playback.c +++ b/src/audio/audio_playback.c @@ -21,7 +21,7 @@ static char devstr16[] = "Error:Wait Track disappear\n"; static char devstr17[] = "NoteOff Comes during wait release %x (note %x)\n"; static char devstr18[] = "Slow Release Batting\n"; -u8 gSamplesPerWavePeriod[] = { 64, 32, 16, 8 }; +u8 sSamplesPerWavePeriod[] = { 64, 32, 16, 8 }; static char devstr19[] = "Audio:Wavemem: Bad voiceno (%d)\n"; static char devstr20[] = "Audio: C-Alloc : Dealloc voice is NULL\n"; @@ -33,6 +33,12 @@ static char devstr25[] = "Intterupt UseStop %d (Kill %d)\n"; static char devstr26[] = "Intterupt RelWait %d (Kill %d)\n"; static char devstr27[] = "Drop Voice (Prio %x)\n"; +void func_80011C58(Note* note, f32); +void func_8001268C(SequenceLayer* layer); +void func_80012C00(AudioListItem* item1, AudioListItem* item2); +void func_80012C40(Note* note); +void func_80012CEC(Note* note, SequenceLayer* layer); + void func_80011890(Note* note, NoteAttributes* noteAttr) { NoteSubEu* temp_v0; f32 var_fa0; @@ -189,7 +195,7 @@ Drum* Audio_GetDrum(s32 arg0, s32 arg1) { D_80155D88 = (arg0 << 8) + arg1 + 0x04000000; return NULL; } - if ((u32) gSoundFontList[arg0].drums < 0x80000000U) { + if ((u32) gSoundFontList[arg0].drums < AUDIO_RELOCATED_ADDRESS_START) { return NULL; } temp = gSoundFontList[arg0].drums[arg1]; @@ -463,8 +469,8 @@ void func_800127B0(Note* note, SequenceLayer* layer) { } sp1C = note->playbackState.harmonicIndex; note->synthesisState.samplePosInt = - (note->synthesisState.samplePosInt * gSamplesPerWavePeriod[func_800126AC(note, layer, var_a2)]) / - gSamplesPerWavePeriod[sp1C]; + (note->synthesisState.samplePosInt * sSamplesPerWavePeriod[func_800126AC(note, layer, var_a2)]) / + sSamplesPerWavePeriod[sp1C]; } void func_80012854(AudioListItem* item) { diff --git a/src/audio/audio_seqplayer.c b/src/audio/audio_seqplayer.c index 2c787711..7279d3ea 100644 --- a/src/audio/audio_seqplayer.c +++ b/src/audio/audio_seqplayer.c @@ -33,6 +33,10 @@ static char devstr28[] = "Macro Level Over Error!\n"; static char devstr29[] = "Group:Undefine upper C0h command (%x)\n"; static char devstr30[] = "Group:Undefined Command\n"; +void func_800145BC(AudioListItem* list, AudioListItem* item); +void* func_800145FC(AudioListItem* list); +u8 func_800152C0(SequenceChannel* channel, u8 arg1, Instrument** instrument, AdsrSettings* adsrSettings); + void func_80013EA0(SequenceChannel* channel) { s32 i; @@ -166,12 +170,12 @@ void func_80014244(SequencePlayer* seqPlayer, u16 arg1) { for (i = 0; i < 16; i++) { if (arg1 & 1) { temp_s0 = seqPlayer->channels[i]; - if ((((u32) temp_s0 != (u32) &gSeqChannelNone) == 1) && (seqPlayer == temp_s0->seqPlayer)) { + if ((IS_SEQUENCE_CHANNEL_VALID(temp_s0) == 1) && (seqPlayer == temp_s0->seqPlayer)) { func_8001415C(temp_s0); temp_s0->seqPlayer = NULL; } temp_v0 = func_800141C8(); - if (((u32) temp_v0 == (u32) &gSeqChannelNone) != 0) { + if (IS_SEQUENCE_CHANNEL_VALID(temp_v0) == 0) { D_80155D88 = i + 0x10000; seqPlayer->channels[i] = temp_v0; } else { @@ -194,7 +198,7 @@ void func_80014370(SequencePlayer* seqPlayer, u16 arg1) { if (arg1 & 1) { SequenceChannel* temp_s0 = seqPlayer->channels[i]; - if (((u32) temp_s0 != (u32) &gSeqChannelNone) == 1) { + if (IS_SEQUENCE_CHANNEL_VALID(temp_s0) == 1) { if (seqPlayer == temp_s0->seqPlayer) { func_8001415C(temp_s0); if (0) {} @@ -211,7 +215,7 @@ void func_80014440(SequencePlayer* seqPlayer, u8 arg1, u8* arg2) { SequenceChannel* temp_s2 = seqPlayer->channels[arg1]; s32 i; - if (((u32) temp_s2 != (u32) &gSeqChannelNone) != 0) { + if (IS_SEQUENCE_CHANNEL_VALID(temp_s2) != 0) { temp_s2->scriptState.depth = 0; temp_s2->scriptState.pc = arg2; temp_s2->enabled = 1; @@ -1339,7 +1343,7 @@ void func_80015FD4(SequencePlayer* seqPlayer) { } } for (i = 0; i < 0x10; i++) { - if (((u32) &gSeqChannelNone != (u32) seqPlayer->channels[i]) == 1) { + if (IS_SEQUENCE_CHANNEL_VALID(seqPlayer->channels[i]) == 1) { func_800153E8(seqPlayer->channels[i]); } } diff --git a/src/audio/audio_synthesis.c b/src/audio/audio_synthesis.c index b2a38b8a..44042134 100644 --- a/src/audio/audio_synthesis.c +++ b/src/audio/audio_synthesis.c @@ -25,6 +25,22 @@ static char devstr7[] = "S->W\n"; static char devstr8[] = "W->S\n"; static char devstr9[] = "S-Resample Pitch %x (old %d -> delay %d)\n"; +void func_80009A2C(s32 updateIndex, s32 noteIndex); +void func_80009AAC(s32 updateIndex); +Acmd* func_8000A700(s32 noteIndex, NoteSubEu* noteSub, NoteSynthesisState* synthState, s16* aiBuf, s32 aiBufLen, + Acmd* aList, s32 updateIndex); +Acmd* func_8000A25C(s16* aiBuf, s32 aiBufLen, Acmd* aList, s32 updateIndex); +Acmd* func_800098DC(Acmd* aList, u16 dmem, u16 startPos, s32 size, s32 reverbIndex); +Acmd* func_80009984(Acmd* aList, u16 dmem, u16 startPos, s32 size, s32 reverbIndex); +Acmd* func_80009D78(Acmd* aList, s32 aiBufLen, s16 reverbIndex, s16 updateIndex); +Acmd* func_8000A128(Acmd* aList, s16 reverbIndex, s16 updateIndex); +Acmd* func_8000B3F0(Acmd* aList, NoteSubEu* noteSub, NoteSynthesisState* synthState, s32 numSamplesToLoad); +Acmd* func_8000B480(Acmd* aList, NoteSynthesisState* synthState, s32 size, u16 pitch, u16 inpDmem, u32 resampleFlags); +Acmd* func_8000B51C(Acmd* aList, NoteSubEu* noteSub, NoteSynthesisState* synthState, s32 aiBufLen, u16 dmemSrc, + s32 delaySide, s32 flags); +Acmd* func_8000B98C(Acmd* aList, NoteSubEu* noteSub, NoteSynthesisState* synthState, s32 size, s32 flags, + s32 delaySide); + void func_800080C0(s32 sampleCount, s32 itemIndex, s32 reverbIndex) { ReverbRingBufferItem* ringItem; SynthesisReverb* reverb = &gSynthReverbs[reverbIndex]; @@ -955,7 +971,7 @@ Acmd* func_8000A700(s32 noteIndex, NoteSubEu* noteSub, NoteSynthesisState* synth case 2: temp = func_800097A8(bookSample, samplesLenAdjusted, flags, &synthState->synthesisBuffers->unk_40); - aLoadBuffer(aList++, temp - 0x80000000, 0x5F0, (samplesLenAdjusted + 0x10) * 2); + aLoadBuffer(aList++, OS_K0_TO_PHYSICAL(temp), 0x5F0, (samplesLenAdjusted + 0x10) * 2); s5 = samplesLenAdjusted; nAdpcmSamplesProcessed = samplesLenAdjusted; skipBytes = 0; diff --git a/src/audio/audio_tables.c b/src/audio/audio_tables.c index 1899da88..77c78a0d 100644 --- a/src/audio/audio_tables.c +++ b/src/audio/audio_tables.c @@ -1,4 +1,5 @@ #include "sys.h" +#include "sf64audio_external.h" typedef struct { /* 0x00 */ s16 numEntries; @@ -27,72 +28,39 @@ AudioTableEntry gSampleBankTableInitEntries[4] = { AudioTableBase gSeqTableInit = { 66, 0, 0 }; AudioTableEntry gSeqTableInitEntries[66] = { - /* 00 */ { 0, 0x3AF0, 2, 0, 0, 0, 0 }, - /* 01 */ { 0x3AF0, 0x56B0, 2, 0, 0, 0, 0 }, - /* 02 */ { 0x91A0, 0x2D80, 2, 3, 0, 0, 0 }, - /* 03 */ { 0xBF20, 0x1410, 2, 3, 0, 0, 0 }, - /* 04 */ { 0xD330, 0x1600, 2, 3, 0, 0, 0 }, - /* 05 */ { 0xE930, 0xF20, 2, 3, 0, 0, 0 }, - /* 06 */ { 0xF850, 0x13A0, 2, 3, 0, 0, 0 }, - /* 07 */ { 0x10BF0, 0x1100, 2, 3, 0, 0, 0 }, - /* 08 */ { 0x11CF0, 0x19E0, 2, 3, 0, 0, 0 }, - /* 09 */ { 0x136D0, 0x13E0, 2, 3, 0, 0, 0 }, - /* 10 */ { 0x14AB0, 0x12F0, 2, 3, 0, 0, 0 }, - /* 11 */ { 9, 0, 2, 3, 0, 0, 0 }, - /* 12 */ { 0x15DA0, 0xB70, 2, 3, 0, 0, 0 }, - /* 13 */ { 0x16910, 0x2460, 2, 3, 0, 0, 0 }, - /* 14 */ { 0x18D70, 0xD40, 2, 3, 0, 0, 0 }, - /* 15 */ { 10, 0, 2, 3, 0, 0, 0 }, - /* 16 */ { 4, 0, 2, 3, 0, 0, 0 }, - /* 17 */ { 0x19AB0, 0x7F0, 2, 3, 0, 0, 0 }, - /* 18 */ { 0x1A2A0, 0x1440, 2, 3, 0, 0, 0 }, - /* 19 */ { 0x1B6E0, 0x1B20, 2, 3, 0, 0, 0 }, - /* 20 */ { 19, 0, 2, 3, 0, 0, 0 }, - /* 21 */ { 18, 0, 2, 3, 0, 0, 0 }, - /* 22 */ { 18, 0, 2, 3, 0, 0, 0 }, - /* 23 */ { 19, 0, 2, 3, 0, 0, 0 }, - /* 24 */ { 19, 0, 2, 3, 0, 0, 0 }, - /* 25 */ { 0x1D200, 0x1B30, 2, 3, 0, 0, 0 }, - /* 26 */ { 18, 0, 2, 3, 0, 0, 0 }, - /* 27 */ { 19, 0, 2, 3, 0, 0, 0 }, - /* 28 */ { 0x1ED30, 0x10B0, 2, 3, 0, 0, 0 }, - /* 29 */ { 28, 0, 2, 3, 0, 0, 0 }, - /* 30 */ { 19, 0, 2, 3, 0, 0, 0 }, - /* 31 */ { 28, 0, 2, 3, 0, 0, 0 }, - /* 32 */ { 19, 0, 2, 3, 0, 0, 0 }, - /* 33 */ { 0x1FDE0, 0x1410, 2, 3, 0, 0, 0 }, - /* 34 */ { 0x211F0, 0xF30, 2, 3, 0, 0, 0 }, - /* 35 */ { 0x22120, 0x2B30, 2, 3, 0, 0, 0 }, - /* 36 */ { 0x24C50, 0x7F0, 2, 3, 0, 0, 0 }, - /* 37 */ { 0x25440, 0x13B0, 2, 3, 0, 0, 0 }, - /* 38 */ { 0x267F0, 0xC70, 2, 3, 0, 0, 0 }, - /* 39 */ { 0x27460, 0x180, 2, 3, 0, 0, 0 }, - /* 40 */ { 0x275E0, 0x5C0, 2, 3, 0, 0, 0 }, - /* 41 */ { 34, 0, 2, 3, 0, 0, 0 }, - /* 42 */ { 0x27BA0, 0x4E40, 2, 3, 0, 0, 0 }, - /* 43 */ { 0x2C9E0, 0x14E0, 2, 3, 0, 0, 0 }, - /* 44 */ { 0x2DEC0, 0x400, 2, 3, 0, 0, 0 }, - /* 45 */ { 0x2E2C0, 0x800, 2, 3, 0, 0, 0 }, - /* 46 */ { 0x2EAC0, 0x1AB0, 2, 3, 0, 0, 0 }, - /* 47 */ { 0x30570, 0x1AA0, 2, 3, 0, 0, 0 }, - /* 48 */ { 19, 0, 2, 3, 0, 0, 0 }, - /* 49 */ { 0x32010, 0x1370, 2, 3, 0, 0, 0 }, - /* 50 */ { 0x33380, 0xB80, 2, 3, 0, 0, 0 }, - /* 51 */ { 0x33F00, 0x5C0, 2, 3, 0, 0, 0 }, - /* 52 */ { 37, 0, 2, 3, 0, 0, 0 }, - /* 53 */ { 37, 0, 2, 3, 0, 0, 0 }, - /* 54 */ { 0x344C0, 0x550, 2, 3, 0, 0, 0 }, - /* 55 */ { 0x34A10, 0x360, 2, 3, 0, 0, 0 }, - /* 56 */ { 0x34D70, 0x620, 2, 3, 0, 0, 0 }, - /* 57 */ { 56, 0, 2, 3, 0, 0, 0 }, - /* 58 */ { 0x35390, 0xA70, 2, 3, 0, 0, 0 }, - /* 59 */ { 43, 0, 2, 3, 0, 0, 0 }, - /* 60 */ { 0x35E00, 0xAB0, 2, 3, 0, 0, 0 }, - /* 61 */ { 0x368B0, 0x13D0, 2, 3, 0, 0, 0 }, - /* 62 */ { 0x37C80, 0x250, 2, 3, 0, 0, 0 }, - /* 63 */ { 0x37ED0, 0x6F0, 2, 3, 0, 0, 0 }, - /* 64 */ { 0x385C0, 0xFB0, 2, 3, 0, 0, 0 }, - /* 65 */ { 0x39570, 0x1780, 2, 3, 0, 0, 0 }, + { 0x00000, 0x3AF0, 2, 0, 0, 0, 0 }, { 0x03AF0, 0x56B0, 2, 0, 0, 0, 0 }, + { 0x091A0, 0x2D80, 2, 3, 0, 0, 0 }, { 0x0BF20, 0x1410, 2, 3, 0, 0, 0 }, + { 0x0D330, 0x1600, 2, 3, 0, 0, 0 }, { 0x0E930, 0xF20, 2, 3, 0, 0, 0 }, + { 0x0F850, 0x13A0, 2, 3, 0, 0, 0 }, { 0x010BF0, 0x1100, 2, 3, 0, 0, 0 }, + { 0x011CF0, 0x19E0, 2, 3, 0, 0, 0 }, { 0x0136D0, 0x13E0, 2, 3, 0, 0, 0 }, + { 0x014AB0, 0x12F0, 2, 3, 0, 0, 0 }, { SEQ_ID_SECTOR_Y, 0, 2, 3, 0, 0, 0 }, + { 0x15DA0, 0xB70, 2, 3, 0, 0, 0 }, { 0x16910, 0x2460, 2, 3, 0, 0, 0 }, + { 0x18D70, 0xD40, 2, 3, 0, 0, 0 }, { SEQ_ID_FORTUNA, 0, 2, 3, 0, 0, 0 }, + { SEQ_ID_TITANIA, 0, 2, 3, 0, 0, 0 }, { 0x19AB0, 0x7F0, 2, 3, 0, 0, 0 }, + { 0x1A2A0, 0x1440, 2, 3, 0, 0, 0 }, { 0x1B6E0, 0x1B20, 2, 3, 0, 0, 0 }, + { SEQ_ID_ME_BOSS, 0, 2, 3, 0, 0, 0 }, { SEQ_ID_CO_BOSS_1, 0, 2, 3, 0, 0, 0 }, + { SEQ_ID_CO_BOSS_1, 0, 2, 3, 0, 0, 0 }, { SEQ_ID_ME_BOSS, 0, 2, 3, 0, 0, 0 }, + { SEQ_ID_ME_BOSS, 0, 2, 3, 0, 0, 0 }, { 0x1D200, 0x1B30, 2, 3, 0, 0, 0 }, + { SEQ_ID_CO_BOSS_1, 0, 2, 3, 0, 0, 0 }, { SEQ_ID_ME_BOSS, 0, 2, 3, 0, 0, 0 }, + { 0x1ED30, 0x10B0, 2, 3, 0, 0, 0 }, { SEQ_ID_BO_BOSS, 0, 2, 3, 0, 0, 0 }, + { SEQ_ID_ME_BOSS, 0, 2, 3, 0, 0, 0 }, { SEQ_ID_BO_BOSS, 0, 2, 3, 0, 0, 0 }, + { SEQ_ID_ME_BOSS, 0, 2, 3, 0, 0, 0 }, { 0x1FDE0, 0x1410, 2, 3, 0, 0, 0 }, + { 0x211F0, 0xF30, 2, 3, 0, 0, 0 }, { 0x22120, 0x2B30, 2, 3, 0, 0, 0 }, + { 0x24C50, 0x7F0, 2, 3, 0, 0, 0 }, { 0x25440, 0x13B0, 2, 3, 0, 0, 0 }, + { 0x267F0, 0xC70, 2, 3, 0, 0, 0 }, { 0x27460, 0x180, 2, 3, 0, 0, 0 }, + { 0x275E0, 0x5C0, 2, 3, 0, 0, 0 }, { SEQ_ID_TITLE, 0, 2, 3, 0, 0, 0 }, + { 0x27BA0, 0x4E40, 2, 3, 0, 0, 0 }, { 0x2C9E0, 0x14E0, 2, 3, 0, 0, 0 }, + { 0x2DEC0, 0x400, 2, 3, 0, 0, 0 }, { 0x2E2C0, 0x800, 2, 3, 0, 0, 0 }, + { 0x2EAC0, 0x1AB0, 2, 3, 0, 0, 0 }, { 0x30570, 0x1AA0, 2, 3, 0, 0, 0 }, + { SEQ_ID_ME_BOSS, 0, 2, 3, 0, 0, 0 }, { 0x32010, 0x1370, 2, 3, 0, 0, 0 }, + { 0x33380, 0xB80, 2, 3, 0, 0, 0 }, { 0x33F00, 0x5C0, 2, 3, 0, 0, 0 }, + { SEQ_ID_CO_INTRO, 0, 2, 3, 0, 0, 0 }, { SEQ_ID_CO_INTRO, 0, 2, 3, 0, 0, 0 }, + { 0x344C0, 0x550, 2, 3, 0, 0, 0 }, { 0x34A10, 0x360, 2, 3, 0, 0, 0 }, + { 0x34D70, 0x620, 2, 3, 0, 0, 0 }, { SEQ_ID_VS_MENU, 0, 2, 3, 0, 0, 0 }, + { 0x35390, 0xA70, 2, 3, 0, 0, 0 }, { SEQ_ID_STAR_WOLF, 0, 2, 3, 0, 0, 0 }, + { 0x35E00, 0xAB0, 2, 3, 0, 0, 0 }, { 0x368B0, 0x13D0, 2, 3, 0, 0, 0 }, + { 0x37C80, 0x250, 2, 3, 0, 0, 0 }, { 0x37ED0, 0x6F0, 2, 3, 0, 0, 0 }, + { 0x385C0, 0xFB0, 2, 3, 0, 0, 0 }, { 0x39570, 0x1780, 2, 3, 0, 0, 0 }, }; AudioTableBase gSoundFontTableInit = { 33, 0, 0 }; AudioTableEntry gSoundFontTableInitEntries[33] = { diff --git a/src/audio/audio_thread.c b/src/audio/audio_thread.c index 4bf358d4..8d383393 100644 --- a/src/audio/audio_thread.c +++ b/src/audio/audio_thread.c @@ -339,7 +339,7 @@ void AudioThread_ProcessCmds(u32 msg) { } } else if ((player->enabled) && (cmd->arg1 < 16)) { channel = player->channels[cmd->arg1]; - if (channel != &gSeqChannelNone) { + if (IS_SEQUENCE_CHANNEL_VALID(channel)) { switch (cmd->op) { case AUDIOCMD_OP_CHANNEL_SET_VOL_SCALE: if (channel->volumeMod != cmd->asFloat) { diff --git a/src/engine/fox_360.c b/src/engine/fox_360.c index 9d84304d..9dbdfa93 100644 --- a/src/engine/fox_360.c +++ b/src/engine/fox_360.c @@ -16,16 +16,16 @@ { -300.0f, 800.0f, 6800.0f }, { 300.0f, 900.0f, 7200.0f }, }; -/* static */ s32 D_360_800C9ACC[4] = { 0, 1, 2, 3 }; -/* static */ s32 D_360_800C9ADC[4] = { -1, 10, 11, 12 }; -/* static */ s32 D_360_800C9AEC[4] = { -1, 21, 23, 25 }; +/* static */ AllRangeAi D_360_800C9ACC[4] = { AI360_FOX, AI360_FALCO, AI360_SLIPPY, AI360_PEPPY }; +/* static */ s32 D_360_800C9ADC[4] = { -1, AI360_10, AI360_10 + 1, AI360_10 + 2 }; +/* static */ s32 D_360_800C9AEC[4] = { -1, AI360_10 + 11, AI360_10 + 13, AI360_10 + 15 }; /* static */ Vec3f D_360_800C9AFC[4] = { { 9500.0f, 5000.0f, 9500.0f }, { 10000.0f, 5000.0f, 10000.0f }, { 10000.0f, 5000.0f, 9500.0f }, { 9500.0f, 5000.0f, 10000.0f }, }; -/* static */ s32 D_360_800C9B2C[4] = { 0, 1, 3, 2 }; +/* static */ s32 D_360_800C9B2C[4] = { AI360_FOX, AI360_FALCO, AI360_PEPPY, AI360_SLIPPY }; /* static */ f32 D_360_800C9B3C[4] = { 330.0f, 90.0f, 280.0f, 70.0f }; s32 D_360_800C9B4C = 96 * 30; /* static */ Vec3f D_360_800C9B50[6] = { @@ -364,10 +364,10 @@ void func_360_8002F180(void) { } Actor_Initialize(actor); actor->obj.status = OBJ_ACTIVE; - actor->obj.id = OBJ_ACTOR_197; + actor->obj.id = OBJ_ACTOR_ALLRANGE; Object_SetInfo(&actor->info, actor->obj.id); if (i == 0) { - actor->aiType = 1000; + actor->aiType = AI360_EVENT_HANDLER; } else { actor->obj.pos.x = D_360_800C9A9C[i].x; actor->obj.pos.y = D_360_800C9A9C[i].y; @@ -380,7 +380,7 @@ void func_360_8002F180(void) { } actor->state = 2; actor->unk_0F4.y = 180.0f; - if (actor->aiIndex < 0) { + if (actor->aiIndex <= -1) { actor->state = 3; } actor->health = 50; @@ -388,7 +388,7 @@ void func_360_8002F180(void) { actor->unk_0C9 = 1; } actor->iwork[11] = 1; - if (actor->aiType < 4) { + if (actor->aiType <= AI360_PEPPY) { AUDIO_PLAY_SFX(0x3100000C, actor->sfxSource, 4); actor->info.hitbox = SEGMENTED_TO_VIRTUAL(D_edata_800CC01C); actor->info.unk_1C = 0.0f; @@ -411,8 +411,8 @@ void func_360_8002F3E0(void) { actor->obj.pos.x = D_360_800C9AFC[i].x; actor->obj.pos.y = D_360_800C9AFC[i].y; actor->obj.pos.z = D_360_800C9AFC[i].z; - actor->obj.id = OBJ_ACTOR_197; - actor->aiType = i + 4; + actor->obj.id = OBJ_ACTOR_ALLRANGE; + actor->aiType = i + AI360_WOLF; actor->aiIndex = D_360_800C9B2C[i]; gActors[actor->aiIndex].aiIndex = -1; actor->health = 100; @@ -424,7 +424,7 @@ void func_360_8002F3E0(void) { actor->iwork[11] = 1; if (gCurrentLevel == LEVEL_VENOM_2) { actor->obj.rot.z = D_360_800C9B3C[i]; - actor->unk_044 = 25; + actor->itemDrop = DROP_SILVER_STAR; } Object_SetInfo(&actor->info, actor->obj.id); if (gCurrentLevel == LEVEL_VENOM_2) { @@ -472,7 +472,7 @@ void func_360_8002F69C(Actor* actor) { if ((gCurrentLevel == LEVEL_VENOM_2) || (gCurrentLevel == LEVEL_BOLSE)) { gPlayer[0].unk_034 = 20.0f; } - AUDIO_PLAY_BGM(SEQ_ID_43 | 0x8000); + AUDIO_PLAY_BGM(SEQ_ID_STAR_WOLF | SEQ_FLAG); func_360_8002EE34(); if ((gCurrentLevel == LEVEL_FORTUNA) || (gCurrentLevel == LEVEL_VENOM_2)) { gPlayer[0].camEye.x = 4500.0f; @@ -491,8 +491,9 @@ void func_360_8002F69C(Actor* actor) { for (i = 1, otherActor = &gActors[1]; i < 8; i++, otherActor++) { if ((otherActor->obj.status == OBJ_ACTIVE) && (otherActor->state == 2) && (otherActor->health < 70) && (otherActor->timer_0C6 != 0) && (otherActor->unk_0D4 == 1)) { - if ((gActors[otherActor->aiIndex].state == 3) && (gActors[otherActor->aiIndex].aiType < 8)) { - gActors[otherActor->aiIndex].iwork[2] = 0; + if ((gActors[otherActor->aiIndex].state == 3) && + (gActors[otherActor->aiIndex].aiType < AI360_KATT)) { + gActors[otherActor->aiIndex].iwork[2] = AI360_FOX; gActors[otherActor->aiIndex].state = 2; gActors[otherActor->aiIndex].aiIndex = otherActor->aiType; if (D_display_800CA234 == &gActors[otherActor->aiIndex]) { @@ -501,20 +502,20 @@ void func_360_8002F69C(Actor* actor) { } if (gActors[otherActor->aiIndex].iwork[3] == 0) { switch (gActors[otherActor->aiIndex].aiType) { - case 1: + case AI360_FALCO: func_360_8002F5F4(gMsg_ID_9160, RCID_FALCO); break; - case 2: + case AI360_SLIPPY: func_360_8002F5F4(gMsg_ID_9170, RCID_SLIPPY); break; - case 3: + case AI360_PEPPY: func_360_8002F5F4(gMsg_ID_9180, RCID_PEPPY); break; } gActors[otherActor->aiIndex].iwork[3] = 200; } } - if (otherActor->aiType == 4) { + if (otherActor->aiType == AI360_WOLF) { if (gCurrentLevel != LEVEL_VENOM_2) { otherActor->state = 3; otherActor->unk_04E = 300; @@ -526,13 +527,13 @@ void func_360_8002F69C(Actor* actor) { } } if (gTeamShields[1] <= 0) { - gActors[5].aiIndex = 0; + gActors[AI360_LEON].aiIndex = AI360_FOX; } if (gTeamShields[2] <= 0) { - gActors[7].aiIndex = 0; + gActors[AI360_ANDREW].aiIndex = AI360_FOX; } if (gTeamShields[3] <= 0) { - gActors[6].aiIndex = 0; + gActors[AI360_PIGMA].aiIndex = AI360_FOX; } } } @@ -545,9 +546,9 @@ void func_360_8002FB4C(Actor* actor) { s32 j; s32 i; - for (i = 10, actor1 = &gActors[10]; i < 60; i++, actor1++) { - if ((actor1->obj.status == OBJ_ACTIVE) && (actor1->obj.id == OBJ_ACTOR_197) && (actor1->unk_0B6 == 0) && - (actor1->aiIndex < 0)) { + for (i = 10, actor1 = &gActors[10]; i < ARRAY_COUNT(gActors); i++, actor1++) { + if ((actor1->obj.status == OBJ_ACTIVE) && (actor1->obj.id == OBJ_ACTOR_ALLRANGE) && (actor1->unk_0B6 == 0) && + (actor1->aiIndex <= -1)) { var_a0 = false; for (j = 1, actor2 = &gActors[1]; j < 4; j++, actor2++) { if ((j != actor->index) && (i == actor2->aiIndex)) { @@ -557,7 +558,7 @@ void func_360_8002FB4C(Actor* actor) { if (!var_a0) { actor->aiIndex = i; actor->state = 2; - actor->iwork[2] = 0; + actor->iwork[2] = AI360_FOX; break; } } @@ -569,7 +570,8 @@ void func_360_8002FC00(Actor* actor) { s32 i; for (i = 0, otherActor = &gActors[10]; i < 50; i++, otherActor++) { - if ((otherActor->obj.status == OBJ_DYING) && (otherActor->aiIndex > 0) && (otherActor->aiIndex < 4)) { + if ((otherActor->obj.status == OBJ_DYING) && (otherActor->aiIndex >= AI360_FALCO) && + (otherActor->aiIndex <= AI360_PEPPY)) { Actor* actor2; s32 j; @@ -588,13 +590,13 @@ void func_360_8002FC00(Actor* actor) { D_display_Timer_800CA238 = 0; } switch (gActors[otherActor->aiIndex].aiType) { - case 1: + case AI360_FALCO: func_360_8002F5F4(gMsg_ID_9160, RCID_FALCO); break; - case 2: + case AI360_SLIPPY: func_360_8002F5F4(gMsg_ID_9170, RCID_SLIPPY); break; - case 3: + case AI360_PEPPY: func_360_8002F5F4(gMsg_ID_9180, RCID_PEPPY); break; } @@ -636,7 +638,7 @@ void func_360_8002FEF0(Actor* actor) { if (newActor->obj.status == OBJ_FREE) { Actor_Initialize(newActor); newActor->obj.status = OBJ_INIT; - newActor->obj.id = OBJ_ACTOR_291; + newActor->obj.id = OBJ_ACTOR_SUPPLIES; if (gCurrentLevel == LEVEL_SECTOR_Z) { newActor->obj.pos.x = 200.0f; newActor->obj.pos.y = -500.0f; @@ -767,7 +769,7 @@ s32 func_360_8003049C(Actor* actor) { } sp44 = 1200.0f; var_ft5 = 650.0f; - if (actor->aiType < 8) { + if (actor->aiType < AI360_KATT) { var_ft5 = 720.0f; } @@ -794,14 +796,15 @@ void func_360_8003088C(Actor* actor) { Vec3f sp3C; if (actor->unk_0D0 != 0) { - if (actor->aiType == 100) { + if (actor->aiType == AI360_GREAT_FOX) { actor->unk_0D0 = 0; } - if ((actor->unk_0D0 >= 2) && (actor->aiType >= 4) && (actor->aiType < 8)) { + if ((actor->unk_0D0 >= 2) && (actor->aiType >= AI360_WOLF) && (actor->aiType < AI360_KATT)) { actor->damage = 10; actor->timer_0C2 = 10; } - if (((actor->aiType < 4) || (actor->aiType == 9) || (actor->aiType == 8)) && (actor->unk_0D0 == 2)) { + if (((actor->aiType <= AI360_PEPPY) || (actor->aiType == AI360_BILL) || (actor->aiType == AI360_KATT)) && + (actor->unk_0D0 == 2)) { actor->unk_0D0 = 0; } if ((actor->unk_0D0 == 2) && (actor->fwork[22] > 0.0f)) { @@ -813,8 +816,9 @@ void func_360_8003088C(Actor* actor) { if (actor->unk_0D0 != 0) { var_a1 = false; if ((actor->unk_0B6 == 3) || - ((gCurrentLevel == LEVEL_BOLSE) && (gBosses[1].obj.status != OBJ_FREE) && (actor->aiType >= 4)) || - ((gCurrentLevel == LEVEL_VENOM_2) && (actor->aiType >= 4) && (actor->aiType < 10) && + ((gCurrentLevel == LEVEL_BOLSE) && (gBosses[1].obj.status != OBJ_FREE) && + (actor->aiType >= AI360_WOLF)) || + ((gCurrentLevel == LEVEL_VENOM_2) && (actor->aiType >= AI360_WOLF) && (actor->aiType < AI360_10) && (actor->unk_0D0 == 2))) { actor->damage = 0; var_a1 = true; @@ -822,13 +826,13 @@ void func_360_8003088C(Actor* actor) { actor->unk_0D4 = 0; } } - if (actor->aiType >= 4) { - if (((actor->unk_0D0 != 3) || (actor->aiType != 4)) && - ((actor->aiType != 200) || (actor->unk_0D0 != 2))) { + if (actor->aiType >= AI360_WOLF) { + if (((actor->unk_0D0 != 3) || (actor->aiType != AI360_WOLF)) && + ((actor->aiType != AI360_MISSILE) || (actor->unk_0D0 != 2))) { actor->health -= actor->damage; } - } else if ((actor->aiType < 4) && (actor->state != 6)) { - if (actor->aiType == 1) { + } else if ((actor->aiType <= AI360_PEPPY) && (actor->state != 6)) { + if (actor->aiType == AI360_FALCO) { gTeamDamage[actor->aiType] = actor->damage; } else { gTeamDamage[actor->aiType] = actor->damage * 2; @@ -836,7 +840,7 @@ void func_360_8003088C(Actor* actor) { } if (actor->health <= 0) { actor->health = 0; - if (actor->aiType == 200) { + if (actor->aiType == AI360_MISSILE) { SectorZ_80199900(actor, 1); if (actor->unk_0D4 == 1) { if (gActors[8].obj.status == OBJ_ACTIVE) { @@ -896,7 +900,7 @@ void func_360_8003088C(Actor* actor) { actor->timer_0BC = RAND_INT(50.0f); } } - if ((actor->aiType >= 4) && (actor->aiType < 8)) { + if ((actor->aiType >= AI360_WOLF) && (actor->aiType < AI360_KATT)) { actor->timer_0BC = RAND_INT(40.0f) + 60.0f; } if (actor->damage >= 20) { @@ -909,7 +913,7 @@ void func_360_8003088C(Actor* actor) { D_360_8015F921++; } switch (actor->aiType) { - case 4: + case AI360_WOLF: D_ctx_80177CD0[0] = 0; if (gCurrentLevel == LEVEL_VENOM_2) { func_360_8002F64C(gMsg_ID_19458, RCID_WOLF); @@ -917,7 +921,7 @@ void func_360_8003088C(Actor* actor) { func_360_8002F64C(gMsg_ID_9365, RCID_WOLF); } break; - case 5: + case AI360_LEON: D_ctx_80177CD0[1] = 0; if (gCurrentLevel == LEVEL_VENOM_2) { func_360_8002F64C(gMsg_ID_19459, RCID_LEON); @@ -925,7 +929,7 @@ void func_360_8003088C(Actor* actor) { func_360_8002F64C(gMsg_ID_9366, RCID_LEON); } break; - case 6: + case AI360_PIGMA: D_ctx_80177CD0[2] = 0; if (gCurrentLevel == LEVEL_VENOM_2) { func_360_8002F64C(gMsg_ID_19460, RCID_PIGMA); @@ -933,7 +937,7 @@ void func_360_8003088C(Actor* actor) { func_360_8002F64C(gMsg_ID_9367, RCID_PIGMA); } break; - case 7: + case AI360_ANDREW: D_ctx_80177CD0[3] = 0; if (gCurrentLevel == LEVEL_VENOM_2) { func_360_8002F64C(gMsg_ID_19461, RCID_ANDREW); @@ -942,20 +946,20 @@ void func_360_8003088C(Actor* actor) { } break; } - if ((actor->aiType >= 4) && (actor->aiType < 8)) { + if ((actor->aiType >= AI360_WOLF) && (actor->aiType < AI360_KATT)) { D_360_8015F904 = 150; } switch (actor->unk_0D4) { case 1: - if (actor->aiType >= 10) { + if (actor->aiType >= AI360_10) { switch (actor->iwork[2]) { - case 1: + case AI360_FALCO: func_360_8002F5F4(gMsg_ID_20170, RCID_FALCO); break; - case 2: + case AI360_SLIPPY: func_360_8002F5F4(gMsg_ID_20150, RCID_SLIPPY); break; - case 3: + case AI360_PEPPY: func_360_8002F5F4(gMsg_ID_20160, RCID_PEPPY); break; } @@ -964,7 +968,7 @@ void func_360_8003088C(Actor* actor) { case 102: case 103: case 104: - if ((actor->aiType >= 4) && (actor->aiType < 8)) { + if ((actor->aiType >= AI360_WOLF) && (actor->aiType < AI360_KATT)) { if ((D_ctx_80177CD0[0] + D_ctx_80177CD0[1] + D_ctx_80177CD0[2] + D_ctx_80177CD0[3]) == 0) { switch (actor->unk_0D4) { case 102: @@ -1002,13 +1006,13 @@ void func_360_8003088C(Actor* actor) { actor->timer_0C6 = 20; actor->iwork[8] = 20; } - if (actor->aiType == 200) { + if (actor->aiType == AI360_MISSILE) { AUDIO_PLAY_SFX(0x29034003, actor->sfxSource, 4); } else if (actor->iwork[7] == 0) { AUDIO_PLAY_SFX(0x2903300E, actor->sfxSource, 4); } func_effect_8007D10C(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 1.5f); - if (actor->aiType < 100) { + if (actor->aiType < AI360_GREAT_FOX) { Matrix_RotateY(gCalcMatrix, actor->unk_0F4.y * M_DTOR, 0); sp48.x = 30.0f; if (Rand_ZeroOne() < 0.5f) { @@ -1032,41 +1036,41 @@ void func_360_8003088C(Actor* actor) { if ((gRadioState == 0) && (gActors[0].obj.status == OBJ_ACTIVE)) { if (actor->unk_0D0 == 3) { switch (actor->aiType) { - case 1: + case AI360_FALCO: func_360_8002F5F4(gMsg_ID_20210, RCID_FALCO); break; - case 3: + case AI360_PEPPY: func_360_8002F5F4(gMsg_ID_20200, RCID_PEPPY); break; - case 2: + case AI360_SLIPPY: func_360_8002F5F4(gMsg_ID_20190, RCID_SLIPPY); break; - case 8: + case AI360_KATT: func_360_8002F5F4(gMsg_ID_20084, RCID_KATT); break; } } else if (actor->unk_0D4 < 105) { - if (actor->aiType >= 4) { + if (actor->aiType >= AI360_WOLF) { if (actor->unk_0D4 == 1) { if ((gCurrentLevel == LEVEL_KATINA) && (actor->unk_0B6 == 1) && (D_360_8015F920 == 0)) { D_360_8015F920 = 1; Radio_PlayMessage(gMsg_ID_18015, RCID_BILL); - } else if (actor->aiType == 8) { + } else if (actor->aiType == AI360_KATT) { func_360_8002F5F4(gMsg_ID_20084, RCID_KATT); - } else if (actor->aiType == 9) { + } else if (actor->aiType == AI360_BILL) { func_360_8002F5F4(gMsg_ID_20085, RCID_BILL); } else if (gCurrentLevel == LEVEL_VENOM_2) { switch (actor->aiType) { - case 4: + case AI360_WOLF: func_360_8002F5F4(gMsg_ID_19454, RCID_WOLF); break; - case 5: + case AI360_LEON: func_360_8002F5F4(gMsg_ID_19455, RCID_LEON); break; - case 6: + case AI360_PIGMA: func_360_8002F5F4(gMsg_ID_19456, RCID_PIGMA); break; - case 7: + case AI360_ANDREW: func_360_8002F5F4(gMsg_ID_19457, RCID_ANDREW); break; } @@ -1074,20 +1078,21 @@ void func_360_8003088C(Actor* actor) { } } else if (actor->unk_0D4 == 1) { switch (actor->aiType) { - case 1: + case AI360_FALCO: func_360_8002F5F4(gMsg_ID_20060, RCID_FALCO); break; - case 3: + case AI360_PEPPY: func_360_8002F5F4(gMsg_ID_20070, RCID_PEPPY); break; - case 2: + case AI360_SLIPPY: func_360_8002F5F4(gMsg_ID_20080, RCID_SLIPPY); break; } } - } else if ((actor->aiType < 4) && (actor->iwork[6] != 0) && (actor->iwork[2] != 0)) { + } else if ((actor->aiType <= AI360_PEPPY) && (actor->iwork[6] != 0) && + (actor->iwork[2] != AI360_FOX)) { switch (actor->aiType) { - case 1: + case AI360_FALCO: if (gTeamShields[1] >= 90) { func_360_8002F5F4(gMsg_ID_9130, RCID_FALCO); } else { @@ -1098,7 +1103,7 @@ void func_360_8003088C(Actor* actor) { D_display_Timer_800CA238 = 320; } break; - case 2: + case AI360_SLIPPY: if (gTeamShields[2] >= 90) { func_360_8002F5F4(gMsg_ID_9140, RCID_SLIPPY); } else { @@ -1109,7 +1114,7 @@ void func_360_8003088C(Actor* actor) { D_display_Timer_800CA238 = 320; } break; - case 3: + case AI360_PEPPY: if (gTeamShields[3] >= 90) { func_360_8002F5F4(gMsg_ID_9150, RCID_PEPPY); } else { @@ -1155,7 +1160,7 @@ bool func_360_80031900(Actor* actor) { return false; } -void func_360_800319AC(Actor* this) { +void ActorAllRange_Update(Actor* this) { u8 sp10F; s32 sp108; s32 sp104; @@ -1188,13 +1193,13 @@ void func_360_800319AC(Actor* this) { s32 pad2; s32 pad3; - if (this->aiType == 1000) { + if (this->aiType == AI360_EVENT_HANDLER) { this->timer_0C2 = 10; this->info.unk_1C = 0.0f; func_360_8003010C(this); return; } - if ((this->iwork[17] != 0) && (this->iwork[16] == 0) && (this->aiType >= 4)) { + if ((this->iwork[17] != 0) && (this->iwork[16] == 0) && (this->aiType >= AI360_WOLF)) { switch (RAND_INT(3.9f)) { case 0: case 1: @@ -1215,7 +1220,7 @@ void func_360_800319AC(Actor* this) { this->iwork[16] = 0; } } - if ((this->timer_0CA[0] != 0) && (gCurrentLevel != LEVEL_VENOM_2) && (this->aiType < 10) && + if ((this->timer_0CA[0] != 0) && (gCurrentLevel != LEVEL_VENOM_2) && (this->aiType < AI360_10) && (this->timer_0CA[0] < 5) && !(gGameFrameCount & 0x1F)) { this->iwork[16] = 10; } @@ -1244,7 +1249,7 @@ void func_360_800319AC(Actor* this) { } break; case 10: - this->timer_0BC = 0x23; + this->timer_0BC = 35; if (Rand_ZeroOne() < 0.5f) { this->fwork[7] = 360.0f; this->fwork[8] = 0.0f; @@ -1274,17 +1279,17 @@ void func_360_800319AC(Actor* this) { } else { this->iwork[11] = 1; } - if (this->aiType < 10) { + if (this->aiType < AI360_10) { func_360_80031858(this); if (this->iwork[10] == 200) { switch (this->aiType) { - case 4: - case 5: - case 6: - case 7: - case 8: + case AI360_WOLF: + case AI360_LEON: + case AI360_PIGMA: + case AI360_ANDREW: + case AI360_KATT: break; - case 1: + case AI360_FALCO: if (gPlayer[0].shields < (Play_GetMaxShields() / 2)) { Radio_PlayMessage(gMsg_ID_20298, RCID_FALCO); } else if (Rand_ZeroOne() < 0.5f) { @@ -1293,7 +1298,7 @@ void func_360_800319AC(Actor* this) { Radio_PlayMessage(gMsg_ID_20301, RCID_FALCO); } break; - case 2: + case AI360_SLIPPY: if (gPlayer[0].shields < (Play_GetMaxShields() / 2)) { Radio_PlayMessage(gMsg_ID_20297, RCID_SLIPPY); } else if (Rand_ZeroOne() < 0.5f) { @@ -1302,7 +1307,7 @@ void func_360_800319AC(Actor* this) { Radio_PlayMessage(gMsg_ID_20300, RCID_SLIPPY); } break; - case 3: + case AI360_PEPPY: if (gPlayer[0].shields < (Play_GetMaxShields() / 2)) { Radio_PlayMessage(gMsg_ID_20296, RCID_PEPPY); } else if (Rand_ZeroOne() < 0.5f) { @@ -1311,7 +1316,7 @@ void func_360_800319AC(Actor* this) { Radio_PlayMessage(gMsg_ID_20299, RCID_PEPPY); } break; - case 9: + case AI360_BILL: Radio_PlayMessage(gMsg_ID_18120, RCID_BILL); break; } @@ -1319,18 +1324,19 @@ void func_360_800319AC(Actor* this) { } sp104 = 0; this->iwork[5] = 0; - if ((this->aiType > 0) && (this->aiType < 4) && (gTeamShields[this->aiType] <= 0) && (this->state != 6)) { + if ((this->aiType > AI360_FOX) && (this->aiType <= AI360_PEPPY) && (gTeamShields[this->aiType] <= 0) && + (this->state != 6)) { this->state = 6; if (this->timer_0C2 < 100) { gTeamShields[this->aiType] = 1; switch (this->aiType) { - case 1: + case AI360_FALCO: Radio_PlayMessage(gMsg_ID_20220, RCID_FALCO); break; - case 2: + case AI360_SLIPPY: Radio_PlayMessage(gMsg_ID_20222, RCID_SLIPPY); break; - case 3: + case AI360_PEPPY: Radio_PlayMessage(gMsg_ID_20221, RCID_PEPPY); break; } @@ -1384,7 +1390,7 @@ void func_360_800319AC(Actor* this) { this->fwork[1] = 200.0f; } if (this->timer_0BC == 0) { - if (this->aiType == 4) { + if (this->aiType == AI360_WOLF) { this->state = 3; if (gCurrentLevel == LEVEL_VENOM_2) { this->unk_04E = 200; @@ -1393,7 +1399,7 @@ void func_360_800319AC(Actor* this) { } } else { this->state = 2; - if (this->aiType == 8) { + if (this->aiType == AI360_KATT) { this->fwork[7] = 360.0f; this->fwork[8] = 0.0f; } @@ -1409,7 +1415,7 @@ void func_360_800319AC(Actor* this) { } if (this->timer_0BC == 0) { this->state = 3; - if ((gCurrentLevel == LEVEL_BOLSE) && (this->aiIndex >= 0)) { + if ((gCurrentLevel == LEVEL_BOLSE) && (this->aiIndex > -1)) { this->state = 2; } } @@ -1422,30 +1428,30 @@ void func_360_800319AC(Actor* this) { spEC = fabsf(this->fwork[4] - this->obj.pos.x); spE8 = fabsf(this->fwork[6] - this->obj.pos.z); sp10F = 0xB; - if (this->aiType == 1) { + if (this->aiType == AI360_FALCO) { spF0 = 0.5f; } else if ((this->unk_0B6 != 2) && (this->unk_0B6 == 3)) { spF0 = 0.5f; } - if (this->aiIndex == 0) { + if (this->aiIndex == AI360_FOX) { spF0 = 0.2f; } - if (this->aiIndex < 0) { + if (this->aiIndex <= -1) { this->state = 3; } else { - if (gActors[this->aiIndex].aiType == 200) { + if (gActors[this->aiIndex].aiType == AI360_MISSILE) { spF0 = 0.8f; spF4 = spF8 = 3000.0f; this->fwork[3] = 2.0f; } - if (this->aiIndex == 0) { + if (this->aiIndex == AI360_FOX) { if (gCurrentLevel != LEVEL_VENOM_2) { if (((gPlayer[0].unk_4DC != 0) && (this->iwork[4] > 10)) || ((gCurrentLevel == LEVEL_BOLSE) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_0))) { this->state = 3; this->unk_04E = 300; this->timer_0BC = 160; - if (this->aiType == 4) { + if (this->aiType == AI360_WOLF) { func_360_8002F5F4(gMsg_ID_9369, RCID_WOLF); } break; @@ -1454,8 +1460,8 @@ void func_360_800319AC(Actor* this) { break; } } - if ((this->aiType >= 4) && (this->aiType != 8) && - ((gCurrentLevel != LEVEL_VENOM_2) || (this->aiType != 4))) { + if ((this->aiType >= AI360_WOLF) && (this->aiType != AI360_KATT) && + ((gCurrentLevel != LEVEL_VENOM_2) || (this->aiType != AI360_WOLF))) { spCC = SIN_DEG((this->index * 45) + gGameFrameCount) * 100.0f; spC8 = COS_DEG((this->index * 45) + (gGameFrameCount * 2)) * 100.0f; spC4 = SIN_DEG((this->index * 45) + gGameFrameCount) * 100.0f; @@ -1466,11 +1472,11 @@ void func_360_800319AC(Actor* this) { this->fwork[6] = gPlayer[0].unk_138 + spC4; this->fwork[1] = gPlayer[0].unk_0D0 + 10.0f; } - if ((gActors[0].state == 6) && (this->aiType < 4)) { + if ((gActors[0].state == 6) && (this->aiType <= AI360_PEPPY)) { this->fwork[3] = 3.0f; this->fwork[1] = gPlayer[0].unk_0D0 - 5.0f; this->iwork[11] = 2; - } else if ((gCurrentLevel == LEVEL_VENOM_2) && (this->aiType >= 4)) { + } else if ((gCurrentLevel == LEVEL_VENOM_2) && (this->aiType >= AI360_WOLF)) { this->fwork[3] = 1.6f; this->fwork[1] = 55.0f; } else { @@ -1484,8 +1490,8 @@ void func_360_800319AC(Actor* this) { } else { spF0 = 0.7f; } - } else if (this->aiIndex != 100) { - if (this->aiType >= 10) { + } else if (this->aiIndex != AI360_GREAT_FOX) { + if (this->aiType >= AI360_10) { spCC = SIN_DEG((this->index * 45) + gGameFrameCount) * 200.0f; spC8 = COS_DEG((this->index * 45) + (gGameFrameCount * 2)) * 200.0f; spC4 = SIN_DEG((this->index * 45) + gGameFrameCount) * 200.0f; @@ -1493,10 +1499,10 @@ void func_360_800319AC(Actor* this) { this->fwork[4] = gActors[this->aiIndex].obj.pos.x + spCC; this->fwork[5] = gActors[this->aiIndex].obj.pos.y + spC8; this->fwork[6] = gActors[this->aiIndex].obj.pos.z + spC4; - if ((gCurrentLevel == LEVEL_VENOM_2) && (this->aiType >= 4)) { + if ((gCurrentLevel == LEVEL_VENOM_2) && (this->aiType >= AI360_WOLF)) { this->fwork[1] = 55.0f; this->fwork[3] = 1.6f; - } else if ((gCurrentLevel == LEVEL_FORTUNA) && (this->aiType >= 0xB)) { + } else if ((gCurrentLevel == LEVEL_FORTUNA) && (this->aiType > AI360_10)) { this->fwork[3] = 1.4f; this->fwork[1] = 50.0f; } else { @@ -1512,10 +1518,10 @@ void func_360_800319AC(Actor* this) { this->fwork[6] = gBosses[0].obj.pos.z; this->fwork[1] = 40.0f; } - if ((this->aiIndex >= 0) && (this->aiIndex != 100) && (gActors[0].state != 6)) { + if ((this->aiIndex > -1) && (this->aiIndex != AI360_GREAT_FOX) && (gActors[0].state != 6)) { if (spE8 < spF8) { if (spEC < spF8) { - if (this->aiIndex != 0) { + if (this->aiIndex != AI360_FOX) { this->fwork[1] = gActors[this->aiIndex].fwork[0] - 5.0f; } else { this->fwork[1] = gPlayer[0].unk_0D0 - 5.0f; @@ -1534,21 +1540,21 @@ void func_360_800319AC(Actor* this) { this->iwork[5] = 1; if (!((this->index + gGameFrameCount) & sp10F) && (Rand_ZeroOne() < spF0) && func_360_80031900(this) && ((gActors[0].state == 2) || (gCurrentLevel == LEVEL_TRAINING))) { - if ((this->aiIndex == 0) && (gCurrentLevel != LEVEL_TRAINING)) { + if ((this->aiIndex == AI360_FOX) && (gCurrentLevel != LEVEL_TRAINING)) { if ((this->iwork[4] > 250) && (gCurrentLevel != LEVEL_VENOM_ANDROSS)) { if ((Rand_ZeroOne() < 0.5f) || (gCurrentLevel == LEVEL_VENOM_2)) { this->iwork[4] = 0; switch (this->aiType) { - case 4: + case AI360_WOLF: func_360_8002E4F8(gMsg_ID_19450, RCID_WOLF); break; - case 5: + case AI360_LEON: func_360_8002E4F8(gMsg_ID_19451, RCID_LEON); break; - case 6: + case AI360_PIGMA: func_360_8002E4F8(gMsg_ID_19452, RCID_PIGMA); break; - case 7: + case AI360_ANDREW: func_360_8002E4F8(gMsg_ID_19453, RCID_ANDREW); break; } @@ -1567,7 +1573,7 @@ void func_360_800319AC(Actor* this) { if (Rand_ZeroOne() < 0.5f) { gActors[this->aiIndex].iwork[6]++; switch (this->aiIndex) { - case 1: + case AI360_FALCO: if ((gCurrentLevel == LEVEL_VENOM_2) && (Rand_ZeroOne() < 0.5f)) { func_360_8002F5F4(gMsg_ID_19462, RCID_FALCO); } else if ((gActors[this->aiIndex].iwork[6] >= 3) && (Rand_ZeroOne() < 0.5f)) { @@ -1581,7 +1587,7 @@ void func_360_800319AC(Actor* this) { D_display_Timer_800CA238 = 320; } break; - case 2: + case AI360_SLIPPY: if ((gCurrentLevel == LEVEL_VENOM_2) && (Rand_ZeroOne() < 0.5f)) { func_360_8002F5F4(gMsg_ID_19463, RCID_SLIPPY); } else if ((gActors[this->aiIndex].iwork[6] >= 3) && (Rand_ZeroOne() < 0.5f)) { @@ -1595,13 +1601,13 @@ void func_360_800319AC(Actor* this) { D_display_Timer_800CA238 = 320; } break; - case 3: + case AI360_PEPPY: if ((gCurrentLevel == LEVEL_VENOM_2) && (Rand_ZeroOne() < 0.5f)) { - func_360_8002F5F4(gMsg_ID_19464, 0x1E); + func_360_8002F5F4(gMsg_ID_19464, RCID_PEPPY); } else if ((gActors[this->aiIndex].iwork[6] >= 3) && (Rand_ZeroOne() < 0.5f)) { - func_360_8002F5F4(gMsg_ID_20312, 0x1E); + func_360_8002F5F4(gMsg_ID_20312, RCID_PEPPY); } else { - func_360_8002F5F4(gMsg_ID_9120, 0x1E); + func_360_8002F5F4(gMsg_ID_9120, RCID_PEPPY); } gActors[this->aiIndex].iwork[2] = this->aiType; if ((D_display_800CA234 == NULL) || (gTeamShields[this->aiIndex] <= 50)) { @@ -1609,22 +1615,22 @@ void func_360_800319AC(Actor* this) { D_display_Timer_800CA238 = 320; } break; - case 4: + case AI360_WOLF: if (D_ctx_80177CD0[0] != 0) { func_360_8002F5F4(gMsg_ID_9330, RCID_WOLF); } break; - case 5: + case AI360_LEON: if (D_ctx_80177CD0[1] != 0) { func_360_8002F5F4(gMsg_ID_9340, RCID_LEON); } break; - case 6: + case AI360_PIGMA: if (D_ctx_80177CD0[2] != 0) { func_360_8002F5F4(gMsg_ID_9350, RCID_PIGMA); } break; - case 7: + case AI360_ANDREW: if (D_ctx_80177CD0[3] != 0) { func_360_8002F5F4(gMsg_ID_9360, RCID_ANDREW); } @@ -1632,31 +1638,31 @@ void func_360_800319AC(Actor* this) { } } else { switch (this->aiType) { - case 1: + case AI360_FALCO: if ((gCurrentLevel == LEVEL_FORTUNA) && (Rand_ZeroOne() < 0.5f)) { func_360_8002F5F4(gMsg_ID_9211, RCID_FALCO); } else { func_360_8002F5F4(gMsg_ID_9190, RCID_FALCO); } - gActors[this->aiIndex].iwork[2] = 1; + gActors[this->aiIndex].iwork[2] = AI360_FALCO; break; - case 2: + case AI360_SLIPPY: if ((gCurrentLevel == LEVEL_FORTUNA) && (Rand_ZeroOne() < 0.5f)) { func_360_8002F5F4(gMsg_ID_9212, RCID_SLIPPY); } else { func_360_8002F5F4(gMsg_ID_9200, RCID_SLIPPY); } - gActors[this->aiIndex].iwork[2] = 2; + gActors[this->aiIndex].iwork[2] = AI360_SLIPPY; break; - case 3: + case AI360_PEPPY: if ((gCurrentLevel == LEVEL_FORTUNA) && (Rand_ZeroOne() < 0.5f)) { func_360_8002F5F4(gMsg_ID_9213, RCID_PEPPY); } else { func_360_8002F5F4(gMsg_ID_9210, RCID_PEPPY); } - gActors[this->aiIndex].iwork[2] = 3; + gActors[this->aiIndex].iwork[2] = AI360_PEPPY; break; - case 4: + case AI360_WOLF: if (gCurrentLevel != LEVEL_VENOM_2) { if (this->iwork[6] == 0) { this->iwork[6] = 1; @@ -1673,40 +1679,40 @@ void func_360_800319AC(Actor* this) { } } break; - case 5: + case AI360_LEON: if (gCurrentLevel == LEVEL_VENOM_2) { - if ((Rand_ZeroOne() < 0.5f) && (this->aiIndex == 1)) { + if ((Rand_ZeroOne() < 0.5f) && (this->aiIndex == AI360_FALCO)) { func_360_8002F5F4(gMsg_ID_9323, RCID_LEON); } else { func_360_8002F5F4(gMsg_ID_19451, RCID_LEON); } - } else if ((Rand_ZeroOne() < 0.5f) && (this->aiIndex == 1)) { + } else if ((Rand_ZeroOne() < 0.5f) && (this->aiIndex == AI360_FALCO)) { func_360_8002F5F4(gMsg_ID_9323, RCID_LEON); } else { func_360_8002F5F4(gMsg_ID_9300, RCID_LEON); } break; - case 6: + case AI360_PIGMA: if (gCurrentLevel == LEVEL_VENOM_2) { - if ((Rand_ZeroOne() < 0.5f) && (this->aiIndex == 3)) { + if ((Rand_ZeroOne() < 0.5f) && (this->aiIndex == AI360_PEPPY)) { func_360_8002F5F4(gMsg_ID_9324, RCID_PIGMA); } else { func_360_8002F5F4(gMsg_ID_19452, RCID_PIGMA); } - } else if ((Rand_ZeroOne() < 0.5f) && (this->aiIndex == 3)) { + } else if ((Rand_ZeroOne() < 0.5f) && (this->aiIndex == AI360_PEPPY)) { func_360_8002F5F4(gMsg_ID_9324, RCID_PIGMA); } else { func_360_8002F5F4(gMsg_ID_9310, RCID_PIGMA); } break; - case 7: + case AI360_ANDREW: if (gCurrentLevel == LEVEL_VENOM_2) { - if ((Rand_ZeroOne() < 0.5f) && (this->aiIndex == 2)) { + if ((Rand_ZeroOne() < 0.5f) && (this->aiIndex == AI360_SLIPPY)) { func_360_8002F5F4(gMsg_ID_9325, RCID_ANDREW); } else { func_360_8002F5F4(gMsg_ID_19453, RCID_ANDREW); } - } else if ((Rand_ZeroOne() < 0.5f) && (this->aiIndex == 2)) { + } else if ((Rand_ZeroOne() < 0.5f) && (this->aiIndex == AI360_SLIPPY)) { func_360_8002F5F4(gMsg_ID_9325, RCID_ANDREW); } else { func_360_8002F5F4(gMsg_ID_9320, RCID_ANDREW); @@ -1718,7 +1724,7 @@ void func_360_800319AC(Actor* this) { } else { this->iwork[4] = 0; } - if ((this->aiIndex > 0) && + if ((this->aiIndex >= AI360_FALCO) && ((gActors[this->aiIndex].obj.status == OBJ_DYING) || (gActors[this->aiIndex].state == 6) || (gActors[this->aiIndex].obj.status == OBJ_FREE))) { this->state = 3; @@ -1732,9 +1738,9 @@ void func_360_800319AC(Actor* this) { case 3: sp104 = 1; if (this->timer_0BC == 0) { - if ((this->aiType < 10) || (gCurrentLevel == LEVEL_BOLSE)) { + if ((this->aiType < AI360_10) || (gCurrentLevel == LEVEL_BOLSE)) { if (gCurrentLevel == LEVEL_VENOM_2) { - if (this->aiType >= 4) { + if (this->aiType >= AI360_WOLF) { this->fwork[3] = 1.6f; this->fwork[1] = 55.0f; } else { @@ -1749,11 +1755,11 @@ void func_360_800319AC(Actor* this) { this->fwork[3] = 1.0f; this->fwork[1] = 38.0f; } - if ((gCurrentLevel == LEVEL_SECTOR_Z) && (gActors[0].state == 0xA)) { + if ((gCurrentLevel == LEVEL_SECTOR_Z) && (gActors[0].state == 10)) { this->fwork[10] = 30.0f; } if ((gLevelType == LEVELTYPE_SPACE) && (gCurrentLevel != LEVEL_BOLSE)) { - if ((gCurrentLevel == LEVEL_SECTOR_Z) && (this->aiType == 8)) { + if ((gCurrentLevel == LEVEL_SECTOR_Z) && (this->aiType == AI360_KATT)) { spE4 = RAND_FLOAT_CENTERED(0.0f); spE0 = RAND_FLOAT_CENTERED(500.0f); spDC = RAND_FLOAT_CENTERED(5000.0f) + 12000.0f; @@ -1787,18 +1793,18 @@ void func_360_800319AC(Actor* this) { this->timer_0C0 = RAND_INT(200.0f) + 200; this->fwork[10] = 30.0f; } - if ((this->aiIndex > 0) && (gActors[this->aiIndex].obj.id == OBJ_ACTOR_197) && + if ((this->aiIndex >= AI360_FALCO) && (gActors[this->aiIndex].obj.id == OBJ_ACTOR_ALLRANGE) && (gActors[this->aiIndex].timer_0C2 == 0) && (gActors[this->aiIndex].obj.status == OBJ_ACTIVE)) { this->state = 2; - this->iwork[2] = 0; + this->iwork[2] = AI360_FOX; } - if (this->aiIndex == 0) { + if (this->aiIndex == AI360_FOX) { if (this->unk_04E != 0) { this->unk_04E--; } if (this->unk_04E == 0) { this->state = 2; - this->iwork[2] = 0; + this->iwork[2] = AI360_FOX; } } break; @@ -1830,7 +1836,7 @@ void func_360_800319AC(Actor* this) { if (this->obj.rot.z >= 360.0f) { this->obj.rot.z -= 360.0f; } - this->timer_0BC = 0x28; + this->timer_0BC = 40; this->unk_046 += 1; } this->obj.pos.y -= 3.0f; @@ -1882,9 +1888,9 @@ void func_360_800319AC(Actor* this) { spD4 = this->fwork[19]; sp108 = 0; if (sp104 == 1) { - if (this->aiType < 100) { + if (this->aiType < AI360_GREAT_FOX) { sp108 = func_360_8003049C(this); - if ((sp108 != 0) && (this->aiType < 10) && (this->timer_0BE == 0) && + if ((sp108 != 0) && (this->aiType < AI360_10) && (this->timer_0BE == 0) && ((this->fwork[7] < 0.01f) || (this->fwork[7] > 359.9f))) { this->timer_0BE = RAND_INT(200.0f) + 200; if (Rand_ZeroOne() < 0.5f) { @@ -1897,7 +1903,7 @@ void func_360_800319AC(Actor* this) { } } if (sp108 != 0) { - if ((this->aiType < 10) || (gCurrentLevel != LEVEL_FORTUNA)) { + if ((this->aiType < AI360_10) || (gCurrentLevel != LEVEL_FORTUNA)) { spD8 += 40.0f * sp108; } else { spD8 += 20.0f * sp108; @@ -1936,7 +1942,7 @@ void func_360_800319AC(Actor* this) { } if ((this->fwork[7] > 0.01f) && (this->fwork[7] < 359.9f)) { Math_SmoothStepToAngle(&this->obj.rot.z, this->fwork[7], 0.2f, 100.0f, 0.01f); - if ((this->aiType == 8) && !(gGameFrameCount & 1)) { + if ((this->aiType == AI360_KATT) && !(gGameFrameCount & 1)) { if ((this->fwork[7] > 10.0f) && (this->fwork[7] < 350.0f)) { Matrix_RotateY(gCalcMatrix, this->obj.rot.y * M_DTOR, 0); Matrix_RotateX(gCalcMatrix, this->obj.rot.x * M_DTOR, 1); @@ -1983,7 +1989,7 @@ void func_360_800319AC(Actor* this) { sp90.x = spBC * sp90.z; sp90.z = spB4 * sp90.z; - if ((gCurrentLevel == LEVEL_VENOM_2) && (this->aiType >= 4)) { + if ((gCurrentLevel == LEVEL_VENOM_2) && (this->aiType >= AI360_WOLF)) { Matrix_RotateY(gCalcMatrix, this->obj.rot.y * M_DTOR, 0); Matrix_RotateX(gCalcMatrix, this->obj.rot.x * M_DTOR, 1); Matrix_RotateZ(gCalcMatrix, this->obj.rot.z * M_DTOR, 1); @@ -2014,7 +2020,7 @@ void func_360_800319AC(Actor* this) { func_360_8003088C(this); radarMark = &gRadarMarks[this->index]; radarMark->unk_00 = 1; - if (this->aiType == 200) { + if (this->aiType == AI360_MISSILE) { radarMark->unk_02 = 100; } else { radarMark->unk_02 = this->aiType; @@ -2030,13 +2036,13 @@ void func_360_800319AC(Actor* this) { this->iwork[1]--; if ((this->iwork[1] == 0) && (gActors[0].state == 2) && (gRadioState == 0)) { switch (this->aiType) { - case 1: + case AI360_FALCO: func_360_8002F5F4(gMsg_ID_9220, RCID_FALCO); break; - case 2: + case AI360_SLIPPY: func_360_8002F5F4(gMsg_ID_9230, RCID_SLIPPY); break; - case 3: + case AI360_PEPPY: if ((Rand_ZeroOne() < 0.1f) && (gCurrentLevel == LEVEL_KATINA)) { func_360_8002F5F4(gMsg_ID_18150, RCID_PEPPY); } else { @@ -2047,8 +2053,8 @@ void func_360_800319AC(Actor* this) { } } if ((gCurrentLevel != LEVEL_KATINA) && (gCurrentLevel != LEVEL_VENOM_ANDROSS) && (this->timer_0C2 == 0)) { - if (((this->aiType >= 10) && (this->aiType < 100)) || - ((this->aiType >= 4) && (this->aiType < 10) && (this->timer_0C6 != 0))) { + if (((this->aiType >= AI360_10) && (this->aiType < AI360_GREAT_FOX)) || + ((this->aiType >= AI360_WOLF) && (this->aiType < AI360_10) && (this->timer_0C6 != 0))) { s32 var_a3 = 0; if (((gCurrentLevel == LEVEL_BOLSE) || (gCurrentLevel == LEVEL_SECTOR_Z)) && (this->timer_0C6 == 0)) { @@ -2062,12 +2068,11 @@ void func_360_800319AC(Actor* this) { this->obj.pos.x -= this->vel.x; this->obj.pos.y -= this->vel.y; this->obj.pos.z -= this->vel.z; - if ((temp_v0_27 >= 2) && (this->aiType >= 0xB)) { + if ((temp_v0_27 >= 2) && (this->aiType > AI360_10)) { this->timer_0BE = 2; this->obj.status = OBJ_DYING; - this->unk_044 = 0; - func_effect_8007BFFC(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 0.0f, 0.0f, 0.0f, 5.0f, - 0xF); + this->itemDrop = DROP_NONE; + func_effect_8007BFFC(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 0.0f, 0.0f, 0.0f, 5.0f, 15); func_effect_8007A6F0(&this->obj.pos, 0x2903A008); } else { this->unk_0D0 = 1; @@ -2166,15 +2171,15 @@ bool func_360_800352E0(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* return false; } -void func_360_80035448(Actor* actor) { +void ActorAllRange_Draw(Actor* actor) { f32 sp38; s32 pad[3]; Vec3f sp1E4 = { 0.0f, 0.0f, 0.0f }; Vec3f sp7C[30]; f32 pad2; - if (actor->aiType != 1000) { - if ((actor->iwork[8] != 0) && (actor->aiType < 100)) { + if (actor->aiType != AI360_EVENT_HANDLER) { + if ((actor->iwork[8] != 0) && (actor->aiType < AI360_GREAT_FOX)) { pad2 = SIN_DEG(actor->iwork[8] * 400.0f); sp38 = actor->iwork[8] * pad2; Matrix_RotateY(gGfxMatrix, M_DTOR * sp38, 1); @@ -2187,19 +2192,19 @@ void func_360_80035448(Actor* actor) { gSPFogPosition(gMasterDisp++, gFogNear, 1005); } switch (actor->aiType) { - case 0: - case 1: - case 2: - case 3: + case AI360_FOX: + case AI360_FALCO: + case AI360_SLIPPY: + case AI360_PEPPY: Matrix_Push(&gGfxMatrix); func_edisplay_8005B388(actor); Matrix_Pop(&gGfxMatrix); func_360_80035098(actor); break; - case 4: - case 5: - case 6: - case 7: + case AI360_WOLF: + case AI360_LEON: + case AI360_PIGMA: + case AI360_ANDREW: if (gCurrentLevel == LEVEL_VENOM_2) { gSPDisplayList(gMasterDisp++, D_STAR_WOLF_F0103D0); Matrix_Push(&gGfxMatrix); @@ -2222,20 +2227,20 @@ void func_360_80035448(Actor* actor) { } } break; - case 8: + case AI360_KATT: gSPDisplayList(gMasterDisp++, D_D009A40); func_edisplay_8005ADAC(actor); break; - case 9: + case AI360_BILL: gSPDisplayList(gMasterDisp++, D_D00B880); func_edisplay_8005ADAC(actor); break; - case 100: + case AI360_GREAT_FOX: func_edisplay_8005F670(&actor->obj.pos); actor->unk_0B6 = 1; func_demo_8004FEC0(actor); break; - case 200: + case AI360_MISSILE: Animation_GetFrameData(&D_SZ_6006D64, 0, sp7C); Animation_DrawSkeleton(3, D_SZ_6006E50, sp7C, func_360_800352E0, NULL, actor, gCalcMatrix); Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -400.0f, 1); @@ -2282,7 +2287,7 @@ void func_360_80035448(Actor* actor) { } else if (gCurrentLevel == LEVEL_VERSUS) { gSPDisplayList(gMasterDisp++, D_versus_3015740); } else if (gCurrentLevel == LEVEL_TRAINING) { - if (actor->aiIndex == 0) { + if (actor->aiIndex == AI360_FOX) { gSPDisplayList(gMasterDisp++, D_STAR_WOLF_F00F200); Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -60.0f, 1); func_edisplay_8005B1E8(actor, 3); diff --git a/src/engine/fox_852F0.c b/src/engine/fox_852F0.c index 27364304..3444511a 100644 --- a/src/engine/fox_852F0.c +++ b/src/engine/fox_852F0.c @@ -31,7 +31,7 @@ void func_800846F0(FrameBuffer* arg0) { sp4C[0] = (sp4C[1] + sp4C[2] + sp4C[3] + sp4C[4]) / 4; sp38[0] = (sp38[1] + sp38[2] + sp38[3] + sp38[4]) / 4; - var_v0[0] = (sp60[0] << 0xB) | (sp4C[0] << 0x6) | (sp38[0] << 0x1); + var_v0[0] = (sp60[0] << 11) | (sp4C[0] << 6) | (sp38[0] << 1); } } osWritebackDCacheAll(); diff --git a/src/engine/fox_beam.c b/src/engine/fox_beam.c index ef5b476f..b23aa806 100644 --- a/src/engine/fox_beam.c +++ b/src/engine/fox_beam.c @@ -57,10 +57,10 @@ void func_beam_80035E78(PlayerShot* shot) { shot->unk_64 = 30; shot->unk_58 = 150; func_8001CE28(shot->playerNum, shot->sfxSource); - D_play_Timer_80161A60 = 4; + gScreenFlashTimer = 4; if (shot->obj.pos.y < (gGroundLevel + 450.0f)) { - D_ctx_80178480 = 15; - if (D_80161A88 == 2) { + gCameraShake = 15; + if (D_ctx_80161A88 == 2) { func_effect_8007D9DC(shot->obj.pos.x, gGroundLevel + 2.0f, shot->obj.pos.z, shot->unk_48 * 0.1f, shot->unk_48 * 3.0f, 0); func_effect_8007D9DC(shot->obj.pos.x, gGroundLevel + 2.0f, shot->obj.pos.z, shot->unk_48 * 0.1f, @@ -184,7 +184,7 @@ void func_beam_800365E4(f32 xPos, f32 yPos, f32 zPos, f32 arg3, f32 arg4, f32 ar s32 unk44, s32 time) { s32 i; - if ((D_ctx_801784AC != 4) && (gLevelType == LEVELTYPE_PLANET) && (D_80161A88 != 2) && + if ((D_ctx_801784AC != 4) && (gLevelType == LEVELTYPE_PLANET) && (D_ctx_80161A88 != 2) && (gCurrentLevel != LEVEL_SOLAR) && (gCurrentLevel != LEVEL_BOLSE) && (gCurrentLevel != LEVEL_TRAINING) && (gCurrentLevel != LEVEL_ZONESS)) { for (i = 0; i < 50; i++) { @@ -213,7 +213,7 @@ void func_beam_800366CC(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 yRot, void func_beam_80036770(f32 xPos, f32 yPos, f32 zPos, f32 yRot, f32 scale) { s32 i; - if ((D_ctx_801784AC != 4) && (gLevelType == LEVELTYPE_PLANET) && (D_80161A88 <= 0) && + if ((D_ctx_801784AC != 4) && (gLevelType == LEVELTYPE_PLANET) && (D_ctx_80161A88 <= 0) && (gCurrentLevel != LEVEL_TRAINING) && (gCurrentLevel != LEVEL_SOLAR) && (gCurrentLevel != LEVEL_ZONESS)) { for (i = 0; i < 50; i++) { if (gEffects[i].obj.status == OBJ_FREE) { @@ -485,7 +485,7 @@ bool func_beam_8003774C(PlayerShot* shot, ObjectId objId, Object* obj) { sp7C.z = obj->pos.z - shot->obj.pos.z; // undefined behavior: if this check fails, the function returns no value if (((fabsf(sp7C.x) < 1100.0f) && (fabsf(sp7C.z) < 1100.0f) && (shot->obj.pos.y < 900.0f)) || - (objId == OBJ_BOSS_313) || (objId == OBJ_UNK_1000) || (objId == OBJ_80_39)) { + (objId == OBJ_BOSS_313) || (objId == ACTOR_EVENT_ID) || (objId == OBJ_80_39)) { Matrix_RotateY(gCalcMatrix, -obj->rot.y * M_DTOR, 0); sp7C.x = shot->obj.pos.x - obj->pos.x; sp7C.y = shot->obj.pos.y - obj->pos.y; @@ -526,7 +526,7 @@ bool func_beam_8003774C(PlayerShot* shot, ObjectId objId, Object* obj) { case OBJ_BOSS_309: objId = COL1_7; break; - case OBJ_UNK_1000: + case ACTOR_EVENT_ID: objId = COL1_3; break; case OBJ_BOSS_313: @@ -684,10 +684,10 @@ void func_beam_80037CF4(PlayerShot* shot, Actor* actor, s32 hitIndex) { actor->unk_0D8.x = shot->obj.pos.x; actor->unk_0D8.y = shot->obj.pos.y; actor->unk_0D8.z = shot->obj.pos.z; - if (((actor->obj.id == OBJ_ACTOR_200) && (actor->unk_0D2 == 0) && + if (((actor->obj.id == OBJ_ACTOR_EVENT) && (actor->unk_0D2 == 0) && ((actor->unk_0B4 == 48) || (actor->unk_0B4 == 49) || (actor->unk_0B4 == 50))) || - ((actor->obj.id == OBJ_ACTOR_197) && (actor->fwork[23] > 1.0f)) || - ((actor->obj.id == OBJ_ACTOR_200) && (actor->unk_0D2 == 0) && (actor->unk_0B4 == 67)) || + ((actor->obj.id == OBJ_ACTOR_ALLRANGE) && (actor->fwork[23] > 1.0f)) || + ((actor->obj.id == OBJ_ACTOR_EVENT) && (actor->unk_0D2 == 0) && (actor->unk_0B4 == 67)) || ((actor->obj.id == OBJ_ACTOR_261) && (shot->obj.id != PLAYERSHOT_8) && ((actor->state < 3) || (actor->state >= 5))) || ((actor->obj.id == OBJ_ACTOR_260) && (shot->obj.id != PLAYERSHOT_8) && (actor->timer_0BC != 0))) { @@ -763,9 +763,9 @@ void func_beam_80038140(PlayerShot* shot) { return; } break; - case OBJ_ACTOR_200: + case OBJ_ACTOR_EVENT: if (actor->unk_0B4 == 42) { - if (func_beam_8003774C(shot, OBJ_UNK_1000, &actor->obj)) { + if (func_beam_8003774C(shot, ACTOR_EVENT_ID, &actor->obj)) { actor->unk_0D0 = 1; actor->unk_0D2 = shot->playerNum; return; @@ -787,8 +787,8 @@ void func_beam_80038140(PlayerShot* shot) { break; default: if (actor->info.unk_16 != 0) { - if (actor->obj.id == OBJ_ACTOR_197) { - if ((actor->aiType >= 4) && (actor->aiType < 10) && + if (actor->obj.id == OBJ_ACTOR_ALLRANGE) { + if ((actor->aiType >= AI360_WOLF) && (actor->aiType < AI360_10) && (((gCurrentLevel == LEVEL_VENOM_2) && (shot->playerNum < 104)) || ((gCurrentLevel != LEVEL_VENOM_2) && (shot->playerNum == 0))) && (shot->obj.id != PLAYERSHOT_8) && @@ -1591,7 +1591,7 @@ void func_beam_8003B55C(PlayerShot* shot, s32 index) { Vec3f sp44; Vec3f sp38; - if ((D_80161A88 == 2) && (shot->obj.pos.y < (gGroundLevel + 50.0f)) && (index == 0)) { + if ((D_ctx_80161A88 == 2) && (shot->obj.pos.y < (gGroundLevel + 50.0f)) && (index == 0)) { func_effect_8007ACE0(shot->obj.pos.x, gGroundLevel, shot->obj.pos.z, 0.1f, 1.5f, shot->obj.rot.y + 20.0f); func_effect_8007ACE0(shot->obj.pos.x, gGroundLevel, shot->obj.pos.z, 0.1f, 1.5f, shot->obj.rot.y - 20.0f); } @@ -1620,7 +1620,7 @@ void func_beam_8003B55C(PlayerShot* shot, s32 index) { func_beam_80036770(shot->obj.pos.x, gGroundLevel + 2.0f, shot->obj.pos.z, shot->obj.rot.y, 2.0f); } } - if (D_80161A88 == 2) { + if (D_ctx_80161A88 == 2) { Object_Kill(&shot->obj, shot->sfxSource); return; } @@ -1872,7 +1872,7 @@ void func_beam_8003C4D0(PlayerShot* shot, s32 damage) { if ((actor->obj.status == OBJ_ACTIVE) && (actor->timer_0C2 == 0) && !((gCurrentLevel == LEVEL_MACBETH) && (OBJ_ACTOR_205 <= actor->obj.id) && (actor->obj.id < OBJ_ACTOR_214)) && - !((actor->obj.id == OBJ_ACTOR_200) && (actor->iwork[12] != 0)) && + !((actor->obj.id == OBJ_ACTOR_EVENT) && (actor->iwork[12] != 0)) && ((actor->scale >= 0.0f) || (actor->obj.id == OBJ_ACTOR_271))) { sp68 = actor->obj.pos.x - shot->obj.pos.x; sp64 = actor->obj.pos.y - shot->obj.pos.y; @@ -1887,8 +1887,9 @@ void func_beam_8003C4D0(PlayerShot* shot, s32 damage) { if ((actor->obj.id == OBJ_ACTOR_193) || (actor->obj.id == OBJ_ACTOR_186) || (actor->obj.id == OBJ_ACTOR_190) || (actor->obj.id == OBJ_ACTOR_202) || (actor->obj.id == OBJ_ACTOR_201) || (actor->obj.id == OBJ_ACTOR_187) || - ((actor->obj.id == OBJ_ACTOR_200) && (actor->unk_0B4 == 78)) || - ((actor->obj.id == OBJ_ACTOR_200) && (actor->unk_0B4 == 38)) || (actor->obj.id == OBJ_ACTOR_196)) { + ((actor->obj.id == OBJ_ACTOR_EVENT) && (actor->unk_0B4 == 78)) || + ((actor->obj.id == OBJ_ACTOR_EVENT) && (actor->unk_0B4 == 38)) || + (actor->obj.id == OBJ_ACTOR_196)) { actor->unk_0D0 = 2; actor->unk_0D2 = 0; actor->unk_0D4 = shot->playerNum + 1; @@ -1897,7 +1898,7 @@ void func_beam_8003C4D0(PlayerShot* shot, s32 damage) { if (actor->info.bonus != 0) { shot->bonus++; } - } else if ((actor->obj.id == OBJ_ACTOR_200) && (actor->scale >= 0.5f) && (damage >= 31)) { + } else if ((actor->obj.id == OBJ_ACTOR_EVENT) && (actor->scale >= 0.5f) && (damage >= 31)) { actor->unk_0D4 = shot->playerNum + 1; actor->vel.x = sp68 * 0.03f; actor->vel.y = sp64 * 0.03f; @@ -1965,13 +1966,13 @@ void func_beam_8003C4D0(PlayerShot* shot, s32 damage) { if (sqrtf(SQ(sp68) + SQ(sp64) + SQ(sp60)) < temp_fs2) { player->unk_288 = shot->playerNum + 1; switch (player->form) { - case 0: + case FORM_ARWING: Player_ApplyDamage(player, 0, 80); break; - case 1: + case FORM_LANDMASTER: Player_ApplyDamage(player, 0, 60); break; - case 3: + case FORM_ON_FOOT: Player_ApplyDamage(player, 0, 180); break; } @@ -2064,7 +2065,7 @@ void func_beam_8003CF90(PlayerShot* shot) { Player* player; if ((shot->obj.pos.y < gGroundLevel) || (shot->unk_64 == 1)) { - if ((D_80161A88 == 2) && (shot->obj.pos.y < gGroundLevel)) { + if ((D_ctx_80161A88 == 2) && (shot->obj.pos.y < gGroundLevel)) { shot->unk_48 = 10.0f; func_effect_8007D9DC(shot->obj.pos.x, gGroundLevel + 2.0f, shot->obj.pos.z, shot->unk_48 * 0.1f, shot->unk_48 * 3.0f, 0); diff --git a/src/engine/fox_bg.c b/src/engine/fox_bg.c index 189a66e5..71952a96 100644 --- a/src/engine/fox_bg.c +++ b/src/engine/fox_bg.c @@ -754,49 +754,50 @@ void func_bg_80040954(void) { f32 var_fs2; f32 var_fv0; - if ((gCurrentLevel != LEVEL_VENOM_ANDROSS) && (gLevelType != LEVELTYPE_SPACE) && - (D_ctx_80178380[gPlayerNum] != 0)) { - var_fs2 = 1.0f; - if (D_ctx_80178380[gPlayerNum] < 80) { - var_fs2 = D_ctx_80178380[gPlayerNum] / 80.0f; - } - var_fs2 *= D_bg_800C9E5C[gLevelType]; + if ((gCurrentLevel == LEVEL_VENOM_ANDROSS) || (gLevelType == LEVELTYPE_SPACE) || + (D_ctx_80178380[gPlayerNum] == 0)) { + return; + } + var_fs2 = 1.0f; + if (D_ctx_80178380[gPlayerNum] < 80) { + var_fs2 = D_ctx_80178380[gPlayerNum] / 80.0f; + } + var_fs2 *= D_bg_800C9E5C[gLevelType]; + Matrix_Push(&gGfxMatrix); + Matrix_RotateZ(gGfxMatrix, gPlayer[gPlayerNum].unk_034 * M_DTOR, 1); + Matrix_Translate(gGfxMatrix, D_ctx_801783D0, D_ctx_801783D4, -200.0f, 1); + RCP_SetupDL_62(); + temp_fs0 = D_ctx_801783D0 * -0.03f; + temp_fs1 = D_ctx_801783D4 * 0.03f; + var_s1 = &D_bg_800C9D94[5]; + var_s4 = &D_bg_800C9DE4[5]; + var_s5 = &D_bg_800C9C5C[5]; + var_s6 = &D_bg_800C9D2C[5]; + var_s7 = &D_bg_800C9CC4[5]; + if (gCurrentLevel == LEVEL_KATINA) { + var_s1 = &D_bg_800C9DBC[5]; + var_s4 = &D_bg_800C9E18[5]; + var_s5 = &D_bg_800C9C90[5]; + var_s6 = &D_bg_800C9D60[5]; + var_s7 = &D_bg_800C9CF8[5]; + } + for (i = 5; i < 13; i++, var_s1++, var_s4++, var_s5++, var_s6++, var_s7++) { Matrix_Push(&gGfxMatrix); - Matrix_RotateZ(gGfxMatrix, gPlayer[gPlayerNum].unk_034 * M_DTOR, 1); - Matrix_Translate(gGfxMatrix, D_ctx_801783D0, D_ctx_801783D4, -200.0f, 1); - RCP_SetupDL_62(); - temp_fs0 = D_ctx_801783D0 * -0.03f; - temp_fs1 = D_ctx_801783D4 * 0.03f; - var_s1 = &D_bg_800C9D94[5]; - var_s4 = &D_bg_800C9DE4[5]; - var_s5 = &D_bg_800C9C5C[5]; - var_s6 = &D_bg_800C9D2C[5]; - var_s7 = &D_bg_800C9CC4[5]; - if (gCurrentLevel == LEVEL_KATINA) { - var_s1 = &D_bg_800C9DBC[5]; - var_s4 = &D_bg_800C9E18[5]; - var_s5 = &D_bg_800C9C90[5]; - var_s6 = &D_bg_800C9D60[5]; - var_s7 = &D_bg_800C9CF8[5]; + Matrix_Translate(gGfxMatrix, *var_s7 * temp_fs0, *var_s7 * -temp_fs1, 0.0f, 1); + Matrix_Scale(gGfxMatrix, *var_s6, *var_s6, *var_s6, 1); + if (((i == 5) || (i == 11)) && (gCurrentLevel != LEVEL_KATINA)) { + Matrix_RotateX(gGfxMatrix, M_PI / 2, 1); } - for (i = 5; i < 13; i++, var_s1++, var_s4++, var_s5++, var_s6++, var_s7++) { - Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, *var_s7 * temp_fs0, *var_s7 * -temp_fs1, 0.0f, 1); - Matrix_Scale(gGfxMatrix, *var_s6, *var_s6, *var_s6, 1); - if (((i == 5) || (i == 11)) && (gCurrentLevel != LEVEL_KATINA)) { - Matrix_RotateX(gGfxMatrix, M_PI / 2, 1); - } - Matrix_SetGfxMtx(&gMasterDisp); - var_fv0 = *var_s4; - if (i >= 5) { - var_fv0 *= var_fs2; - } - gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, var_s1->r, var_s1->g, var_s1->b, (s32) var_fv0); - gSPDisplayList(gMasterDisp++, *var_s5); - Matrix_Pop(&gGfxMatrix); + Matrix_SetGfxMtx(&gMasterDisp); + var_fv0 = *var_s4; + if (i >= 5) { + var_fv0 *= var_fs2; } + gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, var_s1->r, var_s1->g, var_s1->b, (s32) var_fv0); + gSPDisplayList(gMasterDisp++, *var_s5); Matrix_Pop(&gGfxMatrix); } + Matrix_Pop(&gGfxMatrix); } void func_bg_80040CDC(void) { @@ -868,7 +869,7 @@ void func_bg_80040CE4(void) { } } Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, gPlayer[gPlayerNum].unk_0AC, -3.0f + D_ctx_8017847C, sp1D4, 1); + Matrix_Translate(gGfxMatrix, gPlayer[gPlayerNum].unk_0AC, -3.0f + gCameraShakeY, sp1D4, 1); if (D_ctx_80177C70 == 2) { Matrix_Scale(gGfxMatrix, 1.2f, 1.2f, 1.0f, 1); } @@ -886,7 +887,7 @@ void func_bg_80040CE4(void) { temp_fv0 = Math_ModF((10000.0f - gPlayer[gPlayerNum].unk_0AC) * 0.32f, 128.0f); gDPSetupTile(gMasterDisp++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 32, 32, temp_fv0, temp_s0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 5, 5, G_TX_NOLOD, G_TX_NOLOD); - switch (D_80161A88) { + switch (D_ctx_80161A88) { case 0: gDPLoadTileTexture(gMasterDisp++, D_CO_601B6C0, G_IM_FMT_RGBA, G_IM_SIZ_16b, 32, 32); gBgColor = 0x845; // 8, 8, 32 @@ -913,7 +914,7 @@ void func_bg_80040CE4(void) { Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_CO_601B640); } else { - D_80161A88 = 0; + D_ctx_80161A88 = 0; gBgColor = 0x845; // 8, 8, 32 for (i = 0; i < 4; i++) { Matrix_Push(&gGfxMatrix); @@ -1131,7 +1132,7 @@ void func_bg_80042D38(void) { xEye = gPlayer[gPlayerNum].camEye.x; if (0) {} zEye = gPlayer[gPlayerNum].camEye.z; - Matrix_Translate(gGfxMatrix, xEye, 2.0f + D_ctx_8017847C, zEye, 1); + Matrix_Translate(gGfxMatrix, xEye, 2.0f + gCameraShakeY, zEye, 1); Matrix_Scale(gGfxMatrix, 1.5f, 1.0f, 1.0f, 1); RCP_SetupDL_37(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, 125); diff --git a/src/engine/fox_boss.c b/src/engine/fox_boss.c index 4ccfb68e..419702df 100644 --- a/src/engine/fox_boss.c +++ b/src/engine/fox_boss.c @@ -2,11 +2,15 @@ s32 gBossFrameCount; -s32 D_boss_800C9E90[28] = { - 0x8012, 0x8013, 0x8015, 0x8017, 0x8017, 0x8019, 0x8018, 0x801B, 0x8016, 0x8018, 0x8012, 0x8020, 0x8014, 0x801E, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +s32 D_boss_800C9E90[] = { + SEQ_ID_CO_BOSS_1 | SEQ_FLAG, SEQ_ID_ME_BOSS | SEQ_FLAG, SEQ_ID_SX_BOSS | SEQ_FLAG, SEQ_ID_A6_BOSS | SEQ_FLAG, + SEQ_ID_A6_BOSS | SEQ_FLAG, SEQ_ID_SY_BOSS | SEQ_FLAG, SEQ_ID_VE_BOSS | SEQ_FLAG, SEQ_ID_SO_BOSS | SEQ_FLAG, + SEQ_ID_ZO_BOSS | SEQ_FLAG, SEQ_ID_VE_BOSS | SEQ_FLAG, SEQ_ID_CO_BOSS_1 | SEQ_FLAG, SEQ_ID_MA_BOSS | SEQ_FLAG, + SEQ_ID_TI_BOSS | SEQ_FLAG, SEQ_ID_AQ_BOSS | SEQ_FLAG, }; +s32 PAD_boss_C9EC4[14] = { 0 }; + const f32 D_boss_800D55D0[] = { 6000.0f, 18000.0f, -6000.0f, -18000.0f }; void func_boss_80042EC0(Boss* boss) { @@ -37,22 +41,22 @@ void func_boss_80042EC0(Boss* boss) { D_ctx_80177850 = 15; } -void func_boss_80042FAC(Boss* boss) { +void Boss299_Init(Boss* boss) { } -void func_boss_80042FB8(Boss* boss) { +void Boss299_Update(Boss* boss) { } -void func_boss_80042FC4(Boss* boss) { +void Boss299_Draw(Boss* boss) { } -void func_boss_80042FD0(Boss* boss) { +void Boss300_Init(Boss* boss) { } -void func_boss_80042FDC(Boss* boss) { +void Boss300_Update(Boss* boss) { } -void func_boss_80042FE8(Boss* boss) { +void Boss300_Draw(Boss* boss) { } void func_boss_80042FF4(Actor* actor, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6, f32 arg7, f32 arg8, diff --git a/src/engine/fox_context.c b/src/engine/fox_context.c index c1d8ad0e..e2a7a97a 100644 --- a/src/engine/fox_context.c +++ b/src/engine/fox_context.c @@ -20,7 +20,7 @@ s32 gPlayerNum; s32 gCamCount; s32 gTeamShields[6]; s32 gSavedTeamShields[6]; -UNK_TYPE D_ctx_801778F0[6]; +s32 D_ctx_801778F0[6]; s32 gTeamDamage[6]; u8 D_ctx_80177930; // next planet path f32 gGroundLevel; @@ -33,8 +33,8 @@ f32 gCsCamEyeZ; f32 gCsCamAtX; f32 gCsCamAtY; f32 gCsCamAtZ; -Vec3f D_ctx_801779D8; -Vec3f D_ctx_801779E8; +Vec3f gPlayerCamEye; +Vec3f gPlayerCamAt; bool gExpertMode; s32 D_ctx_80177A10[10]; f32 D_ctx_80177A48[10]; @@ -50,12 +50,12 @@ s32 D_ctx_80177B50[7]; s32 D_ctx_80177B70[7]; PlanetId D_ctx_80177B90[7]; s32 D_ctx_80177BB0[7]; -s32 D_ctx_80177BD8[22]; // overruns D_ctx_80177C30? +s32 D_ctx_80177BD8[22]; // overruns D_ctx_80177C38? s32 D_ctx_80177C38[6]; s32 D_ctx_80177C58[6]; u8 gSoundMode; s32 gVolumeSettings[3]; -u16 D_ctx_80177C90; +u16 gBgmSeqId; u8 gLevelType; s32 D_ctx_80177CA0; UNK_TYPE F_80177CA8; @@ -161,8 +161,8 @@ f32 D_ctx_80178448; f32 D_ctx_80178450[3]; f32 D_ctx_80178460[3]; f32 D_ctx_80178470[3]; -f32 D_ctx_8017847C; -s32 D_ctx_80178480; +f32 gCameraShakeY; +s32 gCameraShake; s32 D_ctx_80178484; bool D_ctx_80178488; UNK_TYPE F_8017848C; @@ -226,21 +226,21 @@ UNK_TYPE P_800D31A0 = 0; s32 D_ctx_80178570; // Color32 light color 2 modifier? s32 D_ctx_80178574; s32 D_ctx_80178578; -s32 D_80161A70; // Color32? start of bss -s32 D_80161A74; -s32 D_80161A78; -s32 D_80161A7C; -s32 D_80161A80; -s32 D_80161A84; -s32 D_80161A88; -s32 D_80161A8C; +s32 D_ctx_80161A70; // Color32? start of bss +s32 D_ctx_80161A74; +s32 D_ctx_80161A78; +s32 D_ctx_80161A7C; +s32 D_ctx_80161A80; +s32 D_ctx_80161A84; +s32 D_ctx_80161A88; +s32 D_ctx_80161A8C; u8 gGoldRingCount[4]; -u8 D_80161A94[4]; +u8 D_ctx_80161A94[4]; s32 gHitCount; s32 gSavedHitCount; s16 gLifeCount[4]; LaserStrength gLaserStrength[4]; -s32 D_80161AB8; +s32 D_ctx_80161AB8; UNK_TYPE F_80161AC0[4]; UNK_TYPE F_80161AD0[4]; UNK_TYPE F_80161AE0[4]; diff --git a/src/engine/fox_demo.c b/src/engine/fox_demo.c index 6a7577a9..a37f5747 100644 --- a/src/engine/fox_demo.c +++ b/src/engine/fox_demo.c @@ -114,7 +114,7 @@ void func_demo_80048AC0(s32 teamId) { s32 teamShield; if (teamId == 1) { - if (gTeamShields[1] < 0x40) { + if (gTeamShields[1] < 64) { Radio_PlayMessage(gMsg_ID_20303, RCID_FALCO); return; } @@ -242,7 +242,7 @@ void func_demo_80048E40(Player* player) { break; case 100: - D_ctx_80177840 = 0x64; + D_ctx_80177840 = 100; break; case 200: @@ -273,7 +273,7 @@ void func_demo_80048E40(Player* player) { default: break; } - if (gCsFrameCount >= 0x1C3) { + if (gCsFrameCount > 450) { Math_SmoothStepToF(&D_ctx_80177A48[0], 1.0f, 0.1f, 0.004f, 0.0f); player->unk_0D0 += 2.0f; player->unk_0E4 += 0.1f; @@ -358,7 +358,7 @@ void func_demo_80049630(Actor* actor) { case 1: actor->state = 2; AUDIO_PLAY_SFX(0x09000002U, actor->sfxSource, 0); - actor->timer_0BC = 0x96; + actor->timer_0BC = 150; actor->fwork[29] = 5.0f; case 2: @@ -450,7 +450,7 @@ void func_demo_80049C0C(Player* player) { s32 pad[4]; player->pos.x += player->vel.x; - player->unk_228 = 0; + player->flags_228 = 0; player->unk_238 = 0; player->pos.y += player->vel.y; player->pos.z += player->vel.z; @@ -497,7 +497,7 @@ void func_demo_80049C0C(Player* player) { } func_demo_80049968(&gActors[3], 3); - player->timer_1F8 = 0x32; + player->timer_1F8 = 50; break; case 1: @@ -506,7 +506,7 @@ void func_demo_80049C0C(Player* player) { D_ctx_80178414 *= 1.05f; if (player->timer_1F8 == 0) { player->unk_1D0 = 2; - player->timer_1F8 = 0x96; + player->timer_1F8 = 150; } player->unk_190 = 2.0f; player->unk_08C -= 2.0f; @@ -538,12 +538,12 @@ void func_demo_80049C0C(Player* player) { var_v0 = 1; player->unk_190 = 2.0f; - if ((player->timer_1F8 == 0x5F) && (gTeamShields[1] > 0)) { + if ((player->timer_1F8 == 95) && (gTeamShields[1] > 0)) { gActors[0].state = var_v0; AUDIO_PLAY_SFX(0x0940802AU, gActors[0].sfxSource, 0); } - if ((player->timer_1F8 == 0x5A) && (gTeamShields[3] > 0)) { + if ((player->timer_1F8 == 90) && (gTeamShields[3] > 0)) { gActors[2].state = var_v0; AUDIO_PLAY_SFX(0x0940802AU, gActors[2].sfxSource, 0); } @@ -576,7 +576,7 @@ void func_demo_80049C0C(Player* player) { if (D_ctx_80178340 == 255) { func_play_800A6148(); player->unk_1D0 = 5; - player->timer_1F8 = 0xA; + player->timer_1F8 = 10; player->unk_08C = -10000.0f; player->unk_0AC = player->unk_0B8 = player->unk_0B0 = player->unk_0BC = player->pos.x = player->pos.y = player->pos.z = player->unk_130 = player->unk_034 = player->unk_138 = @@ -609,7 +609,7 @@ void func_demo_80049C0C(Player* player) { case 6: Math_SmoothStepToF(&D_ctx_80178414, 0.0f, 0.2f, 1000.0f, 0.1f); Math_SmoothStepToF(&player->unk_08C, 0.0f, 0.2f, 500.0f, 0.1f); - if (player->timer_1F8 < 0x1E) { + if (player->timer_1F8 < 30) { for (var_v0 = 0; var_v0 < 3; var_v0++) { func_demo_80049B44(); } @@ -617,13 +617,13 @@ void func_demo_80049C0C(Player* player) { if (player->timer_1F8 == 30) { D_ctx_80178410 = 300; - AUDIO_PLAY_BGM(SEQ_ID_58 | 0x8000); + AUDIO_PLAY_BGM(SEQ_ID_WARP_ZONE | SEQ_FLAG); } if (player->timer_1F8 == 0) { D_bg_8015F960 = 0.0f; D_ctx_80178414 = 0.0f; - player->state_1C8 = 3; + player->state_1C8 = PLAYERSTATE_1C8_3; player->unk_014 = 0.0f; player->unk_018 = 0.0f; D_ctx_801782B8 = 0; @@ -772,8 +772,8 @@ void func_demo_8004A888(Effect* effect) { effect->vel.y = sp20.y; effect->vel.z = sp20.z; effect->obj.id = OBJ_EFFECT_352; - effect->timer_50 = 0x28; - effect->unk_46 = 0x90; + effect->timer_50 = 40; + effect->unk_46 = 144; effect->scale2 = RAND_FLOAT(30.0f) + 10.0f; if (Rand_ZeroOne() < 0.5f) { @@ -813,7 +813,7 @@ void func_demo_8004AAF4(Player* player) { D_ctx_80177E84 = 1; if (gCurrentLevel == LEVEL_VENOM_ANDROSS) { Radio_PlayMessage(gMsg_ID_19466, RCID_FOX); - AUDIO_PLAY_BGM(SEQ_ID_61 | 0x8000); + AUDIO_PLAY_BGM(SEQ_ID_AND_BRAIN | SEQ_FLAG); } else if (gCurrentLevel != LEVEL_TRAINING) { Radio_PlayMessage(gMsg_ID_20180, RCID_FOX); if (gCurrentLevel == LEVEL_SECTOR_Y) { @@ -860,15 +860,15 @@ void func_demo_8004AAF4(Player* player) { player->unk_204 = 2; } - if ((gCsFrameCount >= 0x88) && (gCsFrameCount < 0xB4)) { + if ((gCsFrameCount > 135) && (gCsFrameCount < 180)) { Math_SmoothStepToF(&D_ctx_801779A8[player->num], 30.0f, 1.0f, 10.0f, 0.0f); } - if (gCsFrameCount == 0x8A) { + if (gCsFrameCount == 138) { AUDIO_PLAY_SFX(0x09000007U, player->sfxSource, 0); } - if (gCsFrameCount == 0xBE) { + if (gCsFrameCount == 190) { AUDIO_PLAY_SFX(0x09000013U, player->sfxSource, 0); } @@ -888,7 +888,7 @@ void func_demo_8004AAF4(Player* player) { for (i = 0, actor = &gActors[2]; i < 3; i++, actor++) { Actor_Initialize(actor); actor->obj.status = OBJ_INIT; - actor->obj.id = OBJ_ACTOR_198; + actor->obj.id = OBJ_ACTOR_TEAM_BOSS; actor->obj.pos.x = D_demo_800CA080[i] + player->pos.x; actor->obj.pos.y = D_demo_800CA08C[i] + player->pos.y; actor->obj.pos.z = player->unk_138 - 1000.0f; @@ -957,7 +957,7 @@ void func_demo_8004B368(Player* player) { s32 pad2[2]; f32 var_fa1; - player->unk_228 = 0; + player->flags_228 = 0; Math_SmoothStepToF(&player->unk_034, 0.0f, 0.1f, 5.0f, 0.01f); @@ -986,7 +986,7 @@ void func_demo_8004B368(Player* player) { player->camEye.y += ((player->camAt.y + 500.0f) - player->camEye.y) * 0.01f; player->camEye.z += ((D_ctx_80178448 + (2000.0f * D_ctx_80177950)) - player->camEye.z) * 0.01f; - if (player->timer_1FC >= 0x1A) { + if (player->timer_1FC > 25) { D_ctx_80177A48[2] += 1.5f * player->unk_004; Math_SmoothStepToF(&player->unk_0EC, (player->unk_004 * (-450.0f)) * D_ctx_80177950, 0.2f, 20.0f, 0.1f); } else { @@ -1014,8 +1014,8 @@ void func_demo_8004B368(Player* player) { if (player->timer_1F8 == 0) { player->unk_1D0 = 0; - player->timer_1F8 = 0x78; - player->timer_1FC = 0x14; + player->timer_1F8 = 120; + player->timer_1FC = 20; D_ctx_80177A48[0] = 0.001f; gCsCamEyeX = player->camEye.x; gCsCamEyeY = player->camEye.y; @@ -1066,7 +1066,7 @@ void func_demo_8004B368(Player* player) { } if (player->timer_1F8 == 0) { player->unk_1D0 = 1; - player->timer_1F8 = 0x96; + player->timer_1F8 = 150; player->wings.unk_10 = 0.0f; player->wings.unk_08 = 0.0f; player->wings.unk_0C = 0.0f; @@ -1092,19 +1092,19 @@ void func_demo_8004B368(Player* player) { Math_SmoothStepToF(&player->unk_0E4, 20.0f, 0.1f, 0.2f, 0.01f); Math_SmoothStepToF(&player->pos.x, player->camEye.x, 0.1f, 2.0f, 0.0f); - if (player->timer_1F8 < 0x6F) { + if (player->timer_1F8 <= 110) { Math_SmoothStepToF(&player->unk_0EC, player->unk_004 * 360.0f, 0.1f, 2.5f, 0.0f); } else { Math_SmoothStepToF(&player->unk_0EC, player->unk_004 * 180.0f, 0.1f, 2.5f, 0.0f); } if ((180.0f - fabsf(player->unk_0EC)) <= 3.0f) { - D_80161A88 = 1; + D_ctx_80161A88 = 1; } if (player->timer_1F8 == 0) { - player->timer_1F8 = 0xC8; - player->timer_1FC = 0x1F4; + player->timer_1F8 = 200; + player->timer_1FC = 500; player->unk_1D0 = 2; player->unk_000 = (player->unk_004 = (player->unk_008 = (D_ctx_80178418 = 0.0f))); player->unk_0D0 = 0.0f; @@ -1169,7 +1169,7 @@ void func_demo_8004B368(Player* player) { if (gTeamShields[3] > 0) { func_demo_8004A840(2); } - D_80161A88 = 0; + D_ctx_80161A88 = 0; } Matrix_RotateY(gCalcMatrix, (player->unk_0E8 + 180.0f) * M_DTOR, 0); @@ -1235,7 +1235,7 @@ void func_demo_8004B368(Player* player) { break; case 816: - if ((gTeamShields[1] == (-1)) || (gTeamShields[1] == 0)) { + if ((gTeamShields[1] == -1) || (gTeamShields[1] == 0)) { Radio_PlayMessage(gMsg_ID_20331, RCID_ROB64); } else { Radio_PlayMessage(gMsg_ID_2320, RCID_FALCO); @@ -1249,7 +1249,7 @@ void func_demo_8004B368(Player* player) { D_ctx_8017842C += 0.2f; if (player->timer_1F8 == 0) { player->unk_1D0 = 4; - player->timer_1F8 = 0x1E; + player->timer_1F8 = 30; player->unk_000 = 0.0f; player->unk_194 = 5.0f; player->unk_190 = 5.0f; @@ -1272,7 +1272,7 @@ void func_demo_8004B368(Player* player) { D_ctx_80177A48[9] = player->vel.z; player->unk_1D0 = 5; player->unk_0D0 = 0.0f; - player->timer_1F8 = 0xA; + player->timer_1F8 = 10; func_effect_80078E50(player->pos.x, player->pos.y, player->unk_138, 30.0f); } gCsCamAtX = player->pos.x; @@ -1306,7 +1306,7 @@ void func_demo_8004B368(Player* player) { case 1255: player->unk_1D0 = 3; - player->timer_1F8 = 0xA; + player->timer_1F8 = 10; func_play_800A6028(player->sfxSource, 0x09000002U); SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM, 50); SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_FANFARE, 50); @@ -1403,7 +1403,7 @@ void func_demo_8004C930(Player* player) { func_play_800AA800(player); } else { if (gCsFrameCount == 170) { - AUDIO_PLAY_BGM(SEQ_ID_38); + AUDIO_PLAY_BGM(SEQ_ID_GOOD_END); } func_demo_8004B368(player); func_play_800AA800(player); @@ -1464,9 +1464,9 @@ void func_demo_8004CCC0(Player* player) { switch (player->unk_1D0) { case 0: if (player->unk_19C != 0) { - player->timer_1F8 = 0xA; + player->timer_1F8 = 10; } else { - player->timer_1F8 = 0x1E; + player->timer_1F8 = 30; } player->unk_1D0 = 1; if (player->unk_4D8 > 180.0f) { @@ -1478,9 +1478,9 @@ void func_demo_8004CCC0(Player* player) { if (player->timer_1F8 == 0) { player->unk_1D0 = 2; if (player->unk_19C != 0) { - player->timer_1F8 = 0x3C; + player->timer_1F8 = 60; } else { - player->timer_1F8 = 0x50; + player->timer_1F8 = 80; } } player->camEye.x += player->vel.x * 0.2f; @@ -1614,8 +1614,8 @@ void func_demo_8004D440(Player* player) { Audio_KillSfxBySourceAndId(player->sfxSource, 0x0900C010U); func_play_800A5FA0(player->sfxSource, 0x0903F004U, player->num); player->state_1C8 = PLAYERSTATE_1C8_6; - player->timer_1F8 = 0x46; - player->timer_224 = 0x14; + player->timer_1F8 = 70; + player->timer_224 = 20; D_ctx_8017837C = 7; if (player->unk_1D4 != 0) { @@ -1658,17 +1658,17 @@ void func_demo_8004D440(Player* player) { if (D_ctx_801778A4 == D_ctx_80177DB8[player->unk_288 - 1]) { player->unk_288 = -1; if (player->unk_284 == 0) { - func_effect_8007C688(player->pos.x, player->pos.y, player->unk_138, 3.0f, 0x3E8); + func_effect_8007C688(player->pos.x, player->pos.y, player->unk_138, 3.0f, 1000); } } } if (gBombCount[gPlayerNum] != 0) { gBombCount[gPlayerNum] = 0; - func_demo_8004D3D4(player, 0x147, &gItems[1]); + func_demo_8004D3D4(player, OBJ_ITEM_BOMB, &gItems[1]); } if (gLaserStrength[gPlayerNum] != 0) { gLaserStrength[gPlayerNum] = 0; - func_demo_8004D3D4(player, 0x142, &gItems[0]); + func_demo_8004D3D4(player, OBJ_ITEM_LASERS, &gItems[0]); } } } @@ -1677,10 +1677,10 @@ void func_demo_8004D738(Player* player) { player->pos.y += 30.0f; func_effect_8007D0E0(player->pos.x, player->pos.y, player->unk_138, 6.0f); if (gCamCount == 1) { - func_effect_8007BFFC(player->pos.x, player->pos.y, player->unk_138, 0.0f, 0.0f, 0.0f, 3.0f, 0x50); - func_effect_8007C688(player->pos.x, player->pos.y, player->unk_138, 3.0f, 0x320); + func_effect_8007BFFC(player->pos.x, player->pos.y, player->unk_138, 0.0f, 0.0f, 0.0f, 3.0f, 80); + func_effect_8007C688(player->pos.x, player->pos.y, player->unk_138, 3.0f, 800); } else { - func_effect_8007BFFC(player->pos.x, player->pos.y, player->unk_138, 0.0f, 0.0f, 0.0f, 3.0f, 0xA); + func_effect_8007BFFC(player->pos.x, player->pos.y, player->unk_138, 0.0f, 0.0f, 0.0f, 3.0f, 10); } func_demo_8004D440(player); } @@ -1750,8 +1750,7 @@ void func_demo_8004D828(Player* player) { (player->timer_1F8 == 0)) { if (gCamCount != 4) { if (player->unk_284 == 0) { - func_effect_8007C688(player->pos.x, player->pos.y, player->unk_138 - (2.0f * player->vel.z), 3.0f, - 0x50); + func_effect_8007C688(player->pos.x, player->pos.y, player->unk_138 - (2.0f * player->vel.z), 3.0f, 80); } if (player->pos.y < player->unk_0A4) { func_enmy_80062C38(player->pos.x, player->pos.z); @@ -1768,7 +1767,7 @@ void func_demo_8004D828(Player* player) { } func_effect_8007D0E0(player->pos.x, player->pos.y, player->unk_138, 5.0f); func_effect_8007BFFC(player->pos.x, player->pos.y, player->unk_138, player->vel.x, 0.0f, player->vel.z, 5.0f, - 0x14); + 20); func_demo_8004D440(player); } Math_SmoothStepToF(&player->unk_034, 0.0f, 0.05f, 5.0f, 0.00001f); @@ -1858,13 +1857,13 @@ void func_demo_8004DEF8(Player* player) { (player->timer_1F8 == 0)) { if (player->pos.y < player->unk_0A4) { func_effect_8007C688(player->pos.x, gGroundLevel + 20.0f, player->unk_138 - (2.0f * player->vel.z), 3.0f, - 0x320); + 800); func_enmy_80062C38(player->pos.x, player->pos.z); } func_effect_8007D0E0(player->pos.x, player->pos.y - (2.0f * player->vel.y), player->unk_138 - (2.0f * player->vel.z), 6.0f); func_effect_8007BFFC(player->pos.x, player->pos.y - player->vel.y, player->unk_138 - (2.0f * player->vel.z), - 0.0f, 0.0f, 0.0f, 3.0f, 0x14); + 0.0f, 0.0f, 0.0f, 3.0f, 20); if (gLevelType == LEVELTYPE_PLANET) { for (i = 0; i < 2; i++) { func_play_800A69F8(2, player->pos.x, player->pos.y, player->unk_138); @@ -1883,14 +1882,14 @@ void func_demo_8004DEF8(Player* player) { player->unk_034 += 10.0f; } - if ((D_80161A88 == 2) && (player->pos.y <= player->unk_0A4)) { + if ((D_ctx_80161A88 == 2) && (player->pos.y <= player->unk_0A4)) { func_effect_8007D9DC(player->pos.x, gGroundLevel + 2.0f, player->unk_138, 3.0f, 20.0f, 0); func_effect_8007ADF4(player->pos.x, gGroundLevel, player->unk_138, 0.1f, 2.0f); } } void func_demo_8004E3D8(Player* player) { - player->unk_228 = 0; + player->flags_228 = 0; player->unk_280 = 0; if (gGameFrameCount & 1) { @@ -1947,7 +1946,7 @@ void func_demo_8004E4D4(Actor* actor) { case 1: actor->state = 2; - actor->timer_0BC = 0x32; + actor->timer_0BC = 50; actor->fwork[9] = 2.0f; AUDIO_PLAY_SFX(0x09000002U, actor->sfxSource, 0); actor->fwork[29] = 5.0f; @@ -1968,9 +1967,9 @@ void func_demo_8004E4D4(Actor* actor) { break; case 10: - actor->state = 0xB; - actor->timer_0BC = 0x96; - actor->timer_0BE = 0x28; + actor->state = 11; + actor->timer_0BC = 150; + actor->timer_0BE = 40; AUDIO_PLAY_SFX(0x09000002U, actor->sfxSource, 0); actor->fwork[29] = 5.0f; /* fallthrough */ @@ -2103,10 +2102,10 @@ void func_demo_8004EBD0(Actor* actor) { case 2: if (actor->timer_0BC == 110) { - gPlayer[0].timer_1F8 = 0x2710; + gPlayer[0].timer_1F8 = 10000; } if (actor->timer_0BC == 260) { - gPlayer[0].timer_1FC = 0x2710; + gPlayer[0].timer_1FC = 10000; } if (actor->timer_0BC == 0) { actor->state++; @@ -2182,7 +2181,7 @@ void func_demo_8004F05C(Actor* actor) { case 1: actor->state = 2; - actor->timer_0BC = 0x64; + actor->timer_0BC = 100; AUDIO_PLAY_SFX(0x09000002U, actor->sfxSource, 0U); actor->fwork[29] = 5.0f; @@ -2228,7 +2227,7 @@ void func_demo_8004F05C(Actor* actor) { if (actor->timer_0BC == 0) { if (actor->obj.pos.x >= -3500.0f) { if (actor->obj.pos.z <= 3000.0f) { - if ((fabsf(actor->obj.pos.y) <= 400.0f) && (gCsFrameCount < 0x12D)) { + if ((fabsf(actor->obj.pos.y) <= 400.0f) && (gCsFrameCount <= 300)) { func_effect_8007D2C8(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 8.0f); } } @@ -2267,7 +2266,7 @@ void func_demo_8004F05C(Actor* actor) { case 0: actor->obj.rot.z = actor->unk_0F4.z; - if (actor->unk_0B6 == 0xA) { + if (actor->unk_0B6 == 10) { actor->obj.pos.z = gPlayer[0].camEye.z + 12000.0f; } break; @@ -2395,12 +2394,12 @@ void func_demo_8004F8AC(Actor* actor) { break; case LEVEL_FORTUNA: - if (actor->unk_0B6 == 0xB) { + if (actor->unk_0B6 == 11) { switch (actor->state) { case 0: - if (gCsFrameCount == 0x64) { + if (gCsFrameCount == 100) { actor->state = 1; - actor->timer_0BC = 0x32; + actor->timer_0BC = 50; actor->iwork[0] = 255; AUDIO_PLAY_SFX(0x2902F026U, actor->sfxSource, 0); } @@ -2410,9 +2409,8 @@ void func_demo_8004F8AC(Actor* actor) { Math_SmoothStepToF(&actor->scale, 0.5f, 0.03f, 0.01f, 0.0f); D_ctx_80178348 = D_ctx_80178340 = D_ctx_80178350 = D_ctx_80178354 = 0; - if ((actor->timer_0BC == 0x2B) || (actor->timer_0BC == 0x2E) || - (actor->timer_0BC == 0x31)) { - D_ctx_80178340 = 0xC0; + if ((actor->timer_0BC == 43) || (actor->timer_0BC == 46) || (actor->timer_0BC == 49)) { + D_ctx_80178340 = 192; D_ctx_80178348 = D_ctx_80178350 = D_ctx_80178354 = 255; } @@ -2428,7 +2426,7 @@ void func_demo_8004F8AC(Actor* actor) { D_ctx_80178378 = gActors[0].obj.pos.z - 70.0f; D_ctx_80178360 = 255; D_ctx_80178364 = 255; - D_ctx_80178368 = 0x50; + D_ctx_80178368 = 80; break; } } @@ -2543,7 +2541,7 @@ void func_demo_8004FEC0(Actor* actor) { gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, actor->unk_046); gSPDisplayList(gMasterDisp++, D_ENMY_PLANET_40018A0); - if (actor->unk_046 >= 0x33) { + if (actor->unk_046 > 50) { func_edisplay_8005ADAC(actor); } break; @@ -2859,7 +2857,7 @@ void func_demo_8004FEC0(Actor* actor) { RCP_SetupDL_49(); gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, actor->iwork[0]); - gDPSetEnvColor(gMasterDisp++, 255, 0xC0, 128, 255); + gDPSetEnvColor(gMasterDisp++, 255, 192, 128, 255); Matrix_RotateY( gGfxMatrix, diff --git a/src/engine/fox_display.c b/src/engine/fox_display.c index f9eee36d..2cc32156 100644 --- a/src/engine/fox_display.c +++ b/src/engine/fox_display.c @@ -32,7 +32,7 @@ void func_display_80051B30(void) { Vec3f sp68; Vec3f sp5C; - if ((D_ctx_80177854 == 0x64) || (D_display_800CA234 == NULL)) { + if ((D_ctx_80177854 == 100) || (D_display_800CA234 == NULL)) { return; } if ((D_display_800CA234->obj.status != OBJ_ACTIVE) || (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_3)) { @@ -60,13 +60,13 @@ void func_display_80051B30(void) { } RCP_SetupDL(&gMasterDisp, 0xC); switch (D_display_800CA234->aiType) { - case 3: + case AI360_PEPPY: gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 30, 0, 255); break; - case 2: + case AI360_SLIPPY: gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 00, 179, 67, 255); break; - case 1: + case AI360_FALCO: gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 30, 30, 255, 255); break; } @@ -130,11 +130,11 @@ bool func_display_800520FC(s32 limbIndex, Gfx** gfxPtr, Vec3f* pos, Vec3f* rot, gSPSetGeometryMode(gMasterDisp++, G_CULL_BACK); if (player->num == 1) { - if (limbIndex == 0x10) { + if (limbIndex == 16) { rot->y += player->unk_154; rot->y -= player->unk_180; } - if (limbIndex == 0x16) { + if (limbIndex == 22) { rot->y += -player->unk_158 * 0.8f; rot->x -= player->unk_15C; } @@ -155,7 +155,7 @@ bool func_display_800520FC(s32 limbIndex, Gfx** gfxPtr, Vec3f* pos, Vec3f* rot, rot->y += player->unk_168; } } else { - if (limbIndex == 0xB) { + if (limbIndex == 11) { if (player->num == 0) { rot->y += -player->unk_154 * 0.8f; } @@ -167,11 +167,11 @@ bool func_display_800520FC(s32 limbIndex, Gfx** gfxPtr, Vec3f* pos, Vec3f* rot, rot->y += player->unk_154 * 0.8f; } } - if (limbIndex == 0x10) { + if (limbIndex == 16) { rot->y += -player->unk_158 * 0.8f; rot->x -= player->unk_15C; } - if ((limbIndex == 0x11) && (player->num != 2)) { + if ((limbIndex == 17) && (player->num != 2)) { rot->y += player->unk_180; rot->x -= player->unk_180; rot->y += -player->unk_158 * 0.2f; @@ -185,7 +185,7 @@ void func_display_800523A8(s32 limbIndex, Vec3f* rot, void* data) { Vec3f sp1C; Player* player = (Player*) data; - if (limbIndex == 0xB) { + if (limbIndex == 11) { sp1C.x = 3.0f; sp1C.y = 1.0f; sp1C.z = -28.0f; @@ -197,7 +197,7 @@ void func_display_80052420(s32 limbIndex, Vec3f* rot, void* data) { Vec3f sp1C; Player* player = (Player*) data; - if (limbIndex == 0x10) { + if (limbIndex == 16) { sp1C.x = 13.0f; sp1C.y = 2.0f; sp1C.z = 28.0f; @@ -209,7 +209,7 @@ void func_display_80052498(s32 limbIndex, Vec3f* rot, void* data) { Vec3f sp1C; Player* player = (Player*) data; - if (limbIndex == 0xB) { + if (limbIndex == 11) { sp1C.x = 0.0f; sp1C.y = 2.0f; sp1C.z = 29.0f; @@ -221,7 +221,7 @@ void func_display_8005250C(s32 limbIndex, Vec3f* rot, void* data) { Vec3f sp1C; Player* player = (Player*) data; - if (limbIndex == 0xB) { + if (limbIndex == 11) { sp1C.x = 19.0f; sp1C.y = 1.0f; sp1C.z = 32.0f; @@ -711,7 +711,7 @@ void func_display_80054300(Player* player) { if (player->unk_068 > 30.0f) { gSPSetGeometryMode(gMasterDisp++, G_CULL_BACK); } - if ((D_80161A88 == 2) && (player->unk_068 < 10.0f)) { + if ((D_ctx_80161A88 == 2) && (player->unk_068 < 10.0f)) { player->unk_23C = 90; } else { player->unk_23C = 180; @@ -853,8 +853,8 @@ void func_display_80054CA4(Player* player) { gDPSetEnvColor(gMasterDisp++, 255, 0, 255, (s32) D_ctx_80177AB8[player->num]); gSPDisplayList(gMasterDisp++, D_101CD70); Matrix_Pop(&gGfxMatrix); - Texture_Scroll(D_101D070, 0x20, 0x20, 3); - Texture_Scroll(D_101D070, 0x20, 0x20, 3); + Texture_Scroll(D_101D070, 32, 32, 3); + Texture_Scroll(D_101D070, 32, 32, 3); } } @@ -982,7 +982,7 @@ void func_display_80054E80(Player* player) { void func_display_80055788(Player* player) { f32 sp54; - if (gChargeTimers[player->num] >= 0xB) { + if (gChargeTimers[player->num] >= 11) { RCP_SetupDL(&gMasterDisp, 0x43); Matrix_Push(&gGfxMatrix); sp54 = gChargeTimers[player->num] / 20.0f; @@ -1188,7 +1188,7 @@ void func_display_800564C0(Player* player, s32 arg1) { Matrix_Push(&gGfxMatrix); if (player->form == FORM_LANDMASTER) { if (player->unk_1D4 != 0) { - Matrix_Translate(gGfxMatrix, 0.0f, D_ctx_8017847C, 0.0f, 1); + Matrix_Translate(gGfxMatrix, 0.0f, gCameraShakeY, 0.0f, 1); } Matrix_Translate(gGfxMatrix, player->pos.x, player->pos.y + player->unk_18C + 30.0f, player->unk_138 + player->unk_144, 1); @@ -1228,7 +1228,7 @@ void func_display_800564C0(Player* player, s32 arg1) { return; } Matrix_Pop(&gGfxMatrix); - Matrix_Translate(gCalcMatrix, player->pos.x, player->pos.y + D_ctx_8017847C, + Matrix_Translate(gCalcMatrix, player->pos.x, player->pos.y + gCameraShakeY, player->unk_138 + player->unk_144, 0); Matrix_RotateY(gCalcMatrix, (player->unk_114 + player->unk_0E8 + player->unk_134 + 180.0f) * M_DTOR, 1); Matrix_RotateX(gCalcMatrix, -((player->unk_120 + player->unk_0E4 + player->unk_134) * M_DTOR), 1); @@ -1413,7 +1413,7 @@ void func_display_80057504(void) { Matrix_Push(&gGfxMatrix); Matrix_Translate(gGfxMatrix, D_display_80161578[i].x, D_display_80161578[i].y, D_display_80161578[i].z, 1); - if ((D_ctx_80177854 != 0x64) && (i == gPlayerNum)) { + if ((D_ctx_80177854 != 100) && (i == gPlayerNum)) { Math_SmoothStepToF(&D_display_801615A8[i], 0.0f, 0.5f, 20.0f, 0); Math_SmoothStepToF(&D_display_801615B8[i], 1.0, 0.5f, 0.2f, 0); } @@ -1466,12 +1466,12 @@ void func_display_800578C4(Player* player) { case 0: Math_SmoothStepToAngle(&player->wings.unk_30, 0.0f, 0.2f, 3.0f, 0.0f); Math_SmoothStepToAngle(&player->wings.unk_34, 0.0f, 0.2f, 3.0f, 0.0f); - D_ctx_801779D8.x = player->camEye.x; - D_ctx_801779D8.y = player->camEye.y; - D_ctx_801779D8.z = player->camEye.z; - D_ctx_801779E8.x = player->camAt.x; - D_ctx_801779E8.y = player->camAt.y; - D_ctx_801779E8.z = player->camAt.z; + gPlayerCamEye.x = player->camEye.x; + gPlayerCamEye.y = player->camEye.y; + gPlayerCamEye.z = player->camEye.z; + gPlayerCamAt.x = player->camAt.x; + gPlayerCamAt.y = player->camAt.y; + gPlayerCamAt.z = player->camAt.z; break; case 1: case 2: @@ -1500,12 +1500,12 @@ void func_display_800578C4(Player* player) { Matrix_RotateX(gCalcMatrix, (player->unk_0E8 + D_display_800CA380) * M_DTOR, 0); Matrix_RotateY(gCalcMatrix, (player->unk_0E4 + D_display_800CA384) * M_DTOR, 1); Matrix_MultVec3f(gCalcMatrix, &sp4C, &sp40); - D_ctx_801779D8.x = player->pos.x + sp40.x; - D_ctx_801779D8.y = player->pos.y + sp40.y + 20.0f; - D_ctx_801779D8.z = player->unk_138 + sp40.z; - D_ctx_801779E8.x = (SIN_DEG(gGameFrameCount * 3.0f) * 3.0f) + player->pos.x; - D_ctx_801779E8.y = (COS_DEG(gGameFrameCount * 4.0f) * 3.0f) + player->pos.y; - D_ctx_801779E8.z = (SIN_DEG(gGameFrameCount * 3.5f) * 3.0f) + player->unk_138; + gPlayerCamEye.x = player->pos.x + sp40.x; + gPlayerCamEye.y = player->pos.y + sp40.y + 20.0f; + gPlayerCamEye.z = player->unk_138 + sp40.z; + gPlayerCamAt.x = (SIN_DEG(gGameFrameCount * 3.0f) * 3.0f) + player->pos.x; + gPlayerCamAt.y = (COS_DEG(gGameFrameCount * 4.0f) * 3.0f) + player->pos.y; + gPlayerCamAt.z = (SIN_DEG(gGameFrameCount * 3.5f) * 3.0f) + player->unk_138; break; } } @@ -1545,35 +1545,35 @@ void func_display_80057D00(void) { sp78.x = player->camEye.x - player->pos.x; sp78.y = player->camEye.y - player->pos.y; sp78.z = player->camEye.z - (player->unk_138 + player->unk_144); - Matrix_MultVec3f(gCalcMatrix, &sp78, &D_ctx_801779D8); - D_ctx_801779D8.x += player->pos.x; - D_ctx_801779D8.y += player->pos.y; - D_ctx_801779D8.z += player->unk_138 + player->unk_144; + Matrix_MultVec3f(gCalcMatrix, &sp78, &gPlayerCamEye); + gPlayerCamEye.x += player->pos.x; + gPlayerCamEye.y += player->pos.y; + gPlayerCamEye.z += player->unk_138 + player->unk_144; sp78.x = player->camAt.x - player->pos.x; sp78.y = player->camAt.y - player->pos.y; sp78.z = player->camAt.z - (player->unk_138 + player->unk_144); - Matrix_MultVec3f(gCalcMatrix, &sp78, &D_ctx_801779E8); - D_ctx_801779E8.x += player->pos.x; - D_ctx_801779E8.y += player->pos.y; - D_ctx_801779E8.z += player->unk_138 + player->unk_144; + Matrix_MultVec3f(gCalcMatrix, &sp78, &gPlayerCamAt); + gPlayerCamAt.x += player->pos.x; + gPlayerCamAt.y += player->pos.y; + gPlayerCamAt.z += player->unk_138 + player->unk_144; if ((player->unk_238 != 0) && (player->unk_110 > 5.0f)) { - D_ctx_801779E8.x += SIN_DEG(gGameFrameCount * 150.0f) * player->unk_110 * 0.2f; + gPlayerCamAt.x += SIN_DEG(gGameFrameCount * 150.0f) * player->unk_110 * 0.2f; } } else if (player->state_1C8 == PLAYERSTATE_1C8_7) { func_display_800578C4(player); } else { - D_ctx_801779D8.x = player->camEye.x; - D_ctx_801779D8.y = player->camEye.y; - D_ctx_801779D8.z = player->camEye.z; - D_ctx_801779E8.x = player->camAt.x; - D_ctx_801779E8.y = player->camAt.y; - D_ctx_801779E8.z = player->camAt.z; + gPlayerCamEye.x = player->camEye.x; + gPlayerCamEye.y = player->camEye.y; + gPlayerCamEye.z = player->camEye.z; + gPlayerCamAt.x = player->camAt.x; + gPlayerCamAt.y = player->camAt.y; + gPlayerCamAt.z = player->camAt.z; } - player->unk_058 = -Math_Atan2F(D_ctx_801779D8.x - D_ctx_801779E8.x, D_ctx_801779D8.z - D_ctx_801779E8.z); - player->unk_05C = -Math_Atan2F(D_ctx_801779D8.y - D_ctx_801779E8.y, sqrtf(SQ(D_ctx_801779D8.z - D_ctx_801779E8.z) + - SQ(D_ctx_801779D8.x - D_ctx_801779E8.x))); + player->unk_058 = -Math_Atan2F(gPlayerCamEye.x - gPlayerCamAt.x, gPlayerCamEye.z - gPlayerCamAt.z); + player->unk_05C = -Math_Atan2F(gPlayerCamEye.y - gPlayerCamAt.y, + sqrtf(SQ(gPlayerCamEye.z - gPlayerCamAt.z) + SQ(gPlayerCamEye.x - gPlayerCamAt.x))); Matrix_RotateY(gCalcMatrix, -player->unk_058, 0); Matrix_RotateX(gCalcMatrix, player->unk_05C, 1); Matrix_RotateZ(gCalcMatrix, -player->unk_034 * M_DTOR, 1); @@ -1583,25 +1583,25 @@ void func_display_80057D00(void) { Matrix_MultVec3f(gCalcMatrix, &sp78, &sp6C); if (D_ctx_80178410 != 0) { D_ctx_80178428 = DEG_TO_RAD(gPlayer[0].unk_034); - func_play_800B6F50(D_ctx_801779D8.x, D_ctx_801779D8.y, D_ctx_801779D8.z, D_ctx_801779E8.x, D_ctx_801779E8.y, - D_ctx_801779E8.z); + func_play_800B6F50(gPlayerCamEye.x, gPlayerCamEye.y, gPlayerCamEye.z, gPlayerCamAt.x, gPlayerCamAt.y, + gPlayerCamAt.z); func_bg_8003DAF0(); } func_bg_8003E1E8(); func_bg_80040450(); Matrix_Push(&gGfxMatrix); - Matrix_LookAt(gGfxMatrix, D_ctx_801779D8.x, D_ctx_801779D8.y, D_ctx_801779D8.z, D_ctx_801779E8.x, D_ctx_801779E8.y, - D_ctx_801779E8.z, sp6C.x, sp6C.y, sp6C.z, 1); + Matrix_LookAt(gGfxMatrix, gPlayerCamEye.x, gPlayerCamEye.y, gPlayerCamEye.z, gPlayerCamAt.x, gPlayerCamAt.y, + gPlayerCamAt.z, sp6C.x, sp6C.y, sp6C.z, 1); if ((gLevelType == LEVELTYPE_PLANET) || (gCurrentLevel == LEVEL_BOLSE)) { if ((gCurrentLevel == LEVEL_TITANIA) && ((gPlayer[0].state_1C8 != PLAYERSTATE_1C8_2) || (gPlayer[0].unk_19C != 0))) { Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, 0.0f, D_ctx_8017847C, 0.0f, 1); + Matrix_Translate(gGfxMatrix, 0.0f, gCameraShakeY, 0.0f, 1); Matrix_SetGfxMtx(&gMasterDisp); Ground_801B58AC(&gMasterDisp, D_ctx_80177CC8); D_ctx_80177CC8 = 0.0f; Matrix_Pop(&gGfxMatrix); - } else if (D_80161A88 != 2) { + } else if (D_ctx_80161A88 != 2) { D_bg_8015F964 = 0; func_bg_80040CE4(); } @@ -1616,7 +1616,7 @@ void func_display_80057D00(void) { func_display_800564C0(opponent, 0); func_display_80057814(opponent); } - if ((D_80161A88 == 2) && (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_2)) { + if ((D_ctx_80161A88 == 2) && (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_2)) { Lights_SetOneLight(&gMasterDisp, gLight2x, -1 * gLight2y, gLight2z, gLight2R, gLight2G, gLight2B, gAmbientR, gAmbientG, gAmbientB); Matrix_Push(&gGfxMatrix); @@ -1631,11 +1631,11 @@ void func_display_80057D00(void) { } Lights_SetOneLight(&gMasterDisp, gLight1x, gLight1y, gLight1z, gLight1R, gLight1G, gLight1B, gAmbientR, gAmbientG, gAmbientB); - func_edisplay_80060714(1); + Object_Draw(1); TexturedLine_Draw(); D_display_80161410 = 1; func_beam_8003DA0C(); - if ((D_80161A88 == 2) && (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_2)) { + if ((D_ctx_80161A88 == 2) && (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_2)) { Matrix_Push(&gGfxMatrix); Matrix_Scale(gGfxMatrix, 1.0f, -1.0f, 1.0f, 1); D_display_80161410 = -1; @@ -1643,7 +1643,7 @@ void func_display_80057D00(void) { Matrix_Pop(&gGfxMatrix); } D_display_80161410 = -1; - if ((D_80161A88 == 2) && (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_2)) { + if ((D_ctx_80161A88 == 2) && (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_2)) { Matrix_Push(&gGfxMatrix); Matrix_Scale(gGfxMatrix, 1.0f, -1.0f, 1.0f, 1); for (i = 0, opponent = gPlayer; i < gCamCount; i++, opponent++) { @@ -1655,17 +1655,17 @@ void func_display_80057D00(void) { } } if (gCurrentLevel == LEVEL_AQUAS) { - func_edisplay_8006089C(0); + Effect_Draw(0); } - if ((D_80161A88 == 2) || (D_ctx_80177AC8 != 0)) { + if ((D_ctx_80161A88 == 2) || (D_ctx_80177AC8 != 0)) { D_bg_8015F964 = 1; - func_edisplay_8006089C(1); + Effect_Draw(1); func_bg_80040CE4(); } if ((gCurrentLevel != LEVEL_AQUAS) && (((gCurrentLevel != LEVEL_CORNERIA) && (gCurrentLevel != LEVEL_VENOM_ANDROSS)) || ((gPlayer[0].state_1C8 != PLAYERSTATE_1C8_7) && (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_2)))) { - func_edisplay_8006089C(0); + Effect_Draw(0); } D_display_80161410 = 1; for (i = 0, opponent = gPlayer; i < gCamCount; i++, opponent++) { @@ -1680,7 +1680,7 @@ void func_display_80057D00(void) { } if (((gCurrentLevel == LEVEL_CORNERIA) || (gCurrentLevel == LEVEL_VENOM_ANDROSS)) && ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_7) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_2))) { - func_edisplay_8006089C(0); + Effect_Draw(0); } BonusText_DrawAll(); Matrix_Pop(&gGfxMatrix); diff --git a/src/engine/fox_edata_info.c b/src/engine/fox_edata_info.c index aab57d35..3a2f8611 100644 --- a/src/engine/fox_edata_info.c +++ b/src/engine/fox_edata_info.c @@ -131,10 +131,10 @@ ObjectInfo D_edata_800CC124[0x190] = { /* OBJ_80_36, */ {(void*) func_edisplay_80059B20, 1, (ObjectFunc) func_enmy_800652CC, D_TI_60066E0, 100.0f, 0, 0, 40, 0, 0.0f, 0 }, /* OBJ_80_37, */ {(void*) func_edisplay_80059B20, 1, (ObjectFunc) func_enmy_800652CC, D_TI_600672C, 100.0f, 0, 0, 40, 0, 0.0f, 0 }, /* OBJ_80_38, */ {(void*) func_edisplay_80059B20, 1, (ObjectFunc) func_enmy_800652CC, D_TI_6006778, 100.0f, 0, 0, 40, 0, 0.0f, 0 }, - /* OBJ_80_39, */ {(void*) func_edisplay_80059AEC, 1, (ObjectFunc) func_enmy2_8006D350, D_edata_800CBF34, 6000.0f, 0, 0, 40, 0, 0.0f, 0 }, + /* OBJ_80_39, */ {(void*) Obj39_Draw, 1, (ObjectFunc) Obj39_Update, D_edata_800CBF34, 6000.0f, 0, 0, 40, 0, 0.0f, 0 }, /* OBJ_80_40, */ {(void*) func_edisplay_80059F68, 1, (ObjectFunc) func_enmy_80066D5C, D_CO_603E4A4, 1000.0f, 0, 0, 40, 0, 0.0f, 0 }, /* OBJ_80_41, */ {(void*) func_edisplay_80059FDC, 1, (ObjectFunc) func_enmy_80066EA8, D_CO_603E4DC, 300.0f, 0, 0, 40, 0, 0.0f, 0 }, - /* OBJ_80_42, */ {(void*) func_edisplay_80059BBC, 1, (ObjectFunc) func_enmy2_8006B95C, D_CO_603E514, 1000.0f, 0, 0, 40, 0, 0.0f, 0 }, + /* OBJ_80_42, */ {(void*) Obj42_Draw, 1, (ObjectFunc) Obj42_Update, D_CO_603E514, 1000.0f, 0, 0, 40, 0, 0.0f, 0 }, /* OBJ_80_43, */ {(void*) D_ZO_6024AC0, 0, (ObjectFunc) NULL, D_ZO_602B9EC, 200.0f, 0, 0, 40, 0, 0.0f, 0 }, /* OBJ_80_44, */ {(void*) D_ZO_600F560, 0, (ObjectFunc) NULL, D_ZO_602BA20, 1500.0f, 0, 0, 40, 0, 0.0f, 0 }, /* OBJ_80_45, */ {(void*) D_ZO_600EC90, 0, (ObjectFunc) NULL, D_ZO_602BAE4, 1500.0f, 0, 0, 40, 0, 0.0f, 0 }, @@ -146,7 +146,7 @@ ObjectInfo D_edata_800CC124[0x190] = { /* OBJ_80_51, */ {(void*) D_VE1_6006F50, 0, (ObjectFunc) NULL, D_VE1_601B584, 2500.0f, 0, 0, 40, 0, 0.0f, 0 }, /* OBJ_80_52, */ {(void*) D_VE1_6005780, 0, (ObjectFunc) Venom1_80193540, D_VE1_601B5F4, 2500.0f, 0, 0, 40, 0, 0.0f, 0 }, /* OBJ_80_53, */ {(void*) D_AQ_6003610, 0, (ObjectFunc) NULL, D_VE1_601B644, 2500.0f, 0, 0, 40, 0, 0.0f, 0 }, - /* OBJ_80_54, */ {(void*) D_CO_6000E00, 0, (ObjectFunc) func_enmy2_8006AA98, D_CO_603E0EC, 1000.0f, 0, 0, 40, 0, 0.0f, 0 }, + /* OBJ_80_54, */ {(void*) D_CO_6000E00, 0, (ObjectFunc) Obj54_Update, D_CO_603E0EC, 1000.0f, 0, 0, 40, 0, 0.0f, 0 }, /* OBJ_80_55, */ {(void*) D_CO_6013B50, 0, (ObjectFunc) NULL, D_CO_603E88C, 1000.0f, 0, 0, 41, 0, 0.0f, 0 }, /* OBJ_80_56, */ {(void*) Corneria_8018F31C, 2, (ObjectFunc) Corneria_8018F044, D_CO_603E8A8, 1000.0f, 0, 0, 39, 0, 0.0f, 0 }, /* OBJ_80_57, */ {(void*) Titania_8018F8B8, 1, (ObjectFunc) Titania_8018F4D8, D_TI_6006BF0, 800.0f, 0, 0, 40, 0, 0.0f, 0 }, @@ -203,7 +203,7 @@ ObjectInfo D_edata_800CC124[0x190] = { /* OBJ_80_108 */ {(void*) D_SY_60102C0, 0, (ObjectFunc) NULL, D_SY_6034588, 4000.0f, 0, 0, 41, 0, 0.0f, 0 }, /* OBJ_80_109 */ {(void*) D_SY_60036A0, 0, (ObjectFunc) SectorY_801A4E44, D_SY_6034664, 4000.0f, 0, 0, 41, 0, 0.0f, 0 }, /* OBJ_80_110 */ {(void*) D_SY_6005360, 0, (ObjectFunc) NULL, D_SY_6034770, 4000.0f, 0, 0, 41, 0, 0.0f, 0 }, - /* OBJ_80_111 */ {(void*) func_enmy2_80074F90, 1, (ObjectFunc) NULL, D_edata_800CBF34, 2000.0f, 0, 0, 0, 0, 0.0f, 0 }, + /* OBJ_80_111 */ {(void*) Obj111_Draw, 1, (ObjectFunc) NULL, D_edata_800CBF34, 2000.0f, 0, 0, 0, 0, 0.0f, 0 }, /* OBJ_80_112 */ {(void*) D_SY_600F6C0, 0, (ObjectFunc) SectorY_801A52B8, D_SY_60347F0, 4000.0f, 0, 0, 41, 0, 0.0f, 0 }, /* OBJ_80_113 */ {(void*) D_SY_601B610, 0, (ObjectFunc) NULL, D_edata_800CBF34, 2000.0f, 0, 0, 40, 0, 0.0f, 0 }, /* OBJ_80_114 */ {(void*) D_SY_601C6A0, 0, (ObjectFunc) NULL, D_edata_800CBF34, 2000.0f, 0, 0, 40, 0, 0.0f, 0 }, @@ -281,22 +281,22 @@ ObjectInfo D_edata_800CC124[0x190] = { /* OBJ_ACTOR_186 */ {(void*) func_edisplay_8005B7CC, 1, (ObjectFunc) Meteo_8018795C, D_ME_602F724, 200.0f, 0, 1, 39, 0, 1.0f, 1 }, /* OBJ_ACTOR_187 */ {(void*) D_ME_6018450, 0, (ObjectFunc) Meteo_801877C4, D_ME_602F740, 200.0f, 0, 1, 39, 0, 1.0f, 1 }, /* OBJ_ACTOR_188 */ {(void*) Aquas_801BEC74, 1, (ObjectFunc) Aquas_801BEC68, D_AQ_6030BE0, 200.0f, 0, 1, 39, 0, 1.0f, 1 }, - /* OBJ_ACTOR_189 */ {(void*) func_edisplay_8005A094, 1, (ObjectFunc) func_enmy2_8006C008, D_edata_800CBF34, 0.0f, 0, 0, 39, 0, 0.0f, 0 }, + /* OBJ_ACTOR_189 */ {(void*) Actor189_Draw, 1, (ObjectFunc) Actor189_Update, D_edata_800CBF34, 0.0f, 0, 0, 39, 0, 0.0f, 0 }, /* OBJ_ACTOR_190 */ {(void*) func_edisplay_8005B848, 1, (ObjectFunc) func_enmy_800656D4, D_edata_800CBFE4, 100.0f, 0, 1, 39, 0, 1.0f, 0 }, /* OBJ_ACTOR_191 */ {(void*) func_edisplay_8005B848, 1, (ObjectFunc) func_enmy_800656D4, D_edata_800CBFE4, 100.0f, 0, 1, 39, 0, 1.0f, 0 }, /* OBJ_ACTOR_192 */ {(void*) func_edisplay_8005B9A4, 1, (ObjectFunc) func_enmy_8006654C, D_CO_603E54C, 200.0f, 0, 1, 39, 0, 50.0f, 1 }, /* OBJ_ACTOR_193 */ {(void*) func_edisplay_8005BA30, 1, (ObjectFunc) func_enmy_800669A0, D_CO_603E598, 100.0f, 0, 1, 39, 0, 0.0f, 0 }, - /* OBJ_ACTOR_194 */ {(void*) func_enmy2_8006B74C, 1, (ObjectFunc) func_enmy2_8006B094, D_edata_800CC000, 200.0f, 0, 1, 39, 0, 0.0f, 1 }, + /* OBJ_ACTOR_194 */ {(void*) Actor194_Draw, 1, (ObjectFunc) Actor194_Update, D_edata_800CC000, 200.0f, 0, 1, 39, 0, 0.0f, 1 }, /* OBJ_ACTOR_195 */ {(void*) func_demo_8004FEC0, 1, (ObjectFunc) func_demo_8004F8AC, D_edata_800CBF34, 20000.0f, 0, 1, 39, 0, 0.0f, 0 }, - /* OBJ_ACTOR_196 */ {(void*) func_edisplay_80059BF0, 1, (ObjectFunc) func_enmy2_8006BB78, D_CO_603E5B4, 200.0f, 0, 1, 39, 0, 1.0f, 1 }, - /* OBJ_ACTOR_197 */ {(void*) func_360_80035448, 1, (ObjectFunc) func_360_800319AC, D_edata_800CC038, 20000.0f, 0, 1, 39, 1, 1.0f, 1 }, - /* OBJ_ACTOR_198 */ {(void*) func_360_80035448, 1, (ObjectFunc) func_hud_80092EC0, D_edata_800CC01C, 20000.0f, 0, 0, 39, 1, 0.0f, 0 }, + /* OBJ_ACTOR_196 */ {(void*) Actor196_Draw, 1, (ObjectFunc) Actor196_Update, D_CO_603E5B4, 200.0f, 0, 1, 39, 0, 1.0f, 1 }, + /* OBJ_ACTOR_ALLRANGE */ {(void*) ActorAllRange_Draw, 1, (ObjectFunc) ActorAllRange_Update, D_edata_800CC038, 20000.0f, 0, 1, 39, 1, 1.0f, 1 }, + /* OBJ_ACTOR_TEAM_BOSS */ {(void*) ActorAllRange_Draw, 1, (ObjectFunc) ActorTeamBoss_Update, D_edata_800CC01C, 20000.0f, 0, 0, 39, 1, 0.0f, 0 }, /* OBJ_ACTOR_199 */ {(void*) Andross_80188448, 1, (ObjectFunc) Andross_801880E4, D_edata_800CBF34, 20000.0f, 0, 0, 39, 1, 0.0f, 0 }, - /* OBJ_ACTOR_200 */ {(void*) func_enmy2_80074FF0, 1, (ObjectFunc) func_enmy2_80072594, D_edata_800CBF34, 2000.0f, 0, 1, 39, 0, 0.0f, 1 }, - /* OBJ_ACTOR_201 */ {(void*) func_edisplay_800598E8, 1, (ObjectFunc) func_enmy2_8006AC08, D_ME_602F684, 100.0f, 0, 1, 39, 0, 1.0f, 1 }, - /* OBJ_ACTOR_202 */ {(void*) func_edisplay_80059A24, 1, (ObjectFunc) func_enmy2_8006AD18, D_ME_602F6A0, 100.0f, 0, 1, 39, 0, 180.0f, 1 }, - /* OBJ_ACTOR_203 */ {(void*) SectorX_8018F884, 1, (ObjectFunc) SectorX_8018F330, D_edata_800CBF34, 1000.0f, 0, 0, 39, 0, 0.0f, 0 }, - /* OBJ_ACTOR_204 */ {(void*) SectorY_801A4CB0, 1, (ObjectFunc) SectorY_801A3BD4, D_SY_603405C, 1000.0f, 0, 0, 39, 0, 1.0f, 1 }, + /* OBJ_ACTOR_EVENT */ {(void*) ActorEvent_Draw, 1, (ObjectFunc) ActorEvent_Update, D_edata_800CBF34, 2000.0f, 0, 1, 39, 0, 0.0f, 1 }, + /* OBJ_ACTOR_201 */ {(void*) Actor201_Draw, 1, (ObjectFunc) Actor201_Update, D_ME_602F684, 100.0f, 0, 1, 39, 0, 1.0f, 1 }, + /* OBJ_ACTOR_202 */ {(void*) Actor202_Draw, 1, (ObjectFunc) Actor202_Update, D_ME_602F6A0, 100.0f, 0, 1, 39, 0, 180.0f, 1 }, + /* OBJ_ACTOR_SLIPPY_SX */ {(void*) SectorX_8018F884, 1, (ObjectFunc) SectorX_8018F330, D_edata_800CBF34, 1000.0f, 0, 0, 39, 0, 0.0f, 0 }, + /* OBJ_ACTOR_204 */ {(void*) SectorY_Actor204_Draw, 1, (ObjectFunc) SectorY_Actor204_Update, D_SY_603405C, 1000.0f, 0, 0, 39, 0, 1.0f, 1 }, /* OBJ_ACTOR_205 */ {(void*) Macbeth_801A12C4, 1, (ObjectFunc) Macbeth_8019C778, D_MA_60359C8, 20000.0f, 0, 0, 40, 1, 0.0f, 0 }, /* OBJ_ACTOR_206 */ {(void*) Macbeth_801A12C4, 1, (ObjectFunc) Macbeth_801AC438, D_MA_6035A48, 20000.0f, 0, 0, 40, 1, 0.0f, 0 }, /* OBJ_ACTOR_207 */ {(void*) Macbeth_801AC294, 2, (ObjectFunc) Macbeth_801A7E7C, D_MA_603677C, 20000.0f, 0, 0, 40, 1, 0.0f, 0 }, @@ -326,10 +326,10 @@ ObjectInfo D_edata_800CC124[0x190] = { /* OBJ_ACTOR_231 */ {(void*) Titania_8018BE84, 1, (ObjectFunc) Titania_8018B9D0, D_TI_6006858, 0.0f, 0, 0, 39, 1, 0.0f, 1 }, /* OBJ_ACTOR_232 */ {(void*) Titania_8018B6AC, 1, (ObjectFunc) Titania_8018B268, D_TI_6006890, 0.0f, 0, 0, 39, 1, 20.0f, 1 }, /* OBJ_ACTOR_233 */ {(void*) Titania_8018A1C0, 1, (ObjectFunc) Titania_80189CC8, D_TI_60068F0, 200.0f, 0, 0, 39, 1, 1.0f, 1 }, - /* OBJ_ACTOR_234 */ {(void*) func_enmy2_80077218, 1, (ObjectFunc) func_enmy2_800771CC, D_edata_800CBF34, 2000.0f, 0, 0, 39, 0, 0.0f, 5 }, + /* OBJ_ACTOR_234 */ {(void*) Actor234_Draw, 1, (ObjectFunc) Actor234_Update, D_edata_800CBF34, 2000.0f, 0, 0, 39, 0, 0.0f, 5 }, /* OBJ_ACTOR_235 */ {(void*) Zoness_80190430, 2, (ObjectFunc) Zoness_801904CC, D_ZO_602C294, 1000.0f, 0, 1, 40, 0, 1.0f, 1 }, /* OBJ_ACTOR_236 */ {(void*) Zoness_80190F08, 1, (ObjectFunc) Zoness_80190A00, D_ZO_602BC58, 5000.0f, 0, 0, 40, 0, 0.0f, 0 }, - /* OBJ_ACTOR_237 */ {(void*) func_enmy2_8006A978, 1, (ObjectFunc) func_enmy2_8006A96C, D_edata_800CBF34, 200.0f, 0, 0, 40, 0, 0.0f, 2 }, + /* OBJ_ACTOR_237 */ {(void*) Actor237_Draw, 1, (ObjectFunc) Actor237_Update, D_edata_800CBF34, 200.0f, 0, 0, 40, 0, 0.0f, 2 }, /* OBJ_ACTOR_238 */ {(void*) Zoness_801914C4, 2, (ObjectFunc) Zoness_80191010, D_edata_800CBE8C, 200.0f, 0, 1, 40, 0, 1.0f, 1 }, /* OBJ_ACTOR_239 */ {(void*) NULL, 1, (ObjectFunc) NULL, D_edata_800CBF34, 1000.0f, 0, 0, 0, 0, 0.0f, 0 }, /* OBJ_ACTOR_240 */ {(void*) Zoness_80191B4C, 1, (ObjectFunc) Zoness_80191680, D_edata_800CBE8C, 1500.0f, 0, 1, 40, 0, 20.0f, 0 }, @@ -383,7 +383,7 @@ ObjectInfo D_edata_800CC124[0x190] = { /* OBJ_ACTOR_288 */ {(void*) NULL, 1, (ObjectFunc) Andross_801893B8, D_edata_800CBF34, 1000.0f, 0, 0, 20, 1, 0.0f, 0 }, /* OBJ_ACTOR_289 */ {(void*) func_edata_800596B0, 1, (ObjectFunc) Andross_80189470, D_edata_800CBF34, 1000.0f, 0, 0, 20, 1, 0.0f, 0 }, /* OBJ_ACTOR_290 */ {(void*) NULL, 1, (ObjectFunc) Andross_8018933C, D_edata_800CBF34, 1000.0f, 0, 0, 20, 0, 0.0f, 0 }, - /* OBJ_ACTOR_291 */ {(void*) func_enmy_80067874, 1, (ObjectFunc) func_enmy_8006753C, D_edata_800CBEA8, 1000.0f, 0, 0, 0, 0, 1.0f, 0 }, + /* OBJ_ACTOR_SUPPLIES */ {(void*) ActorSupplies_Draw, 1, (ObjectFunc) ActorSupplies_Update, D_edata_800CBEA8, 1000.0f, 0, 0, 0, 0, 1.0f, 0 }, /* OBJ_BOSS_292 */ {(void*) Corneria_8018AA74, 2, (ObjectFunc) Corneria_80189058, D_CO_603E620, 20000.0f, 0, 0, 40, 1, 0.0f, 10 }, /* OBJ_BOSS_293 */ {(void*) Corneria_8018ECAC, 1, (ObjectFunc) Corneria_8018C19C, D_CO_603E840, 20000.0f, 0, 0, 40, 0, 0.0f, 10 }, /* OBJ_BOSS_294 */ {(void*) Corneria_8018ED78, 1, (ObjectFunc) Corneria_8018DDAC, D_CO_603E714, 20000.0f, 0, 0, 40, 0, 0.0f, 10 }, @@ -391,8 +391,8 @@ ObjectInfo D_edata_800CC124[0x190] = { /* OBJ_BOSS_296 */ {(void*) Corneria_8018EF90, 1, (ObjectFunc) Corneria_8018E76C, D_CO_603E7C4, 20000.0f, 0, 0, 40, 0, 0.0f, 10 }, /* OBJ_BOSS_297 */ {(void*) Meteo_8018BACC, 1, (ObjectFunc) Meteo_8018978C, D_ME_602F75C, 20000.0f, 0, 0, 40, 0, 0.0f, 10 }, /* OBJ_BOSS_298 */ {(void*) Meteo_801887D0, 1, (ObjectFunc) Meteo_80188344, D_ME_602FA50, 20000.0f, 0, 0, 40, 0, 0.0f, 10 }, - /* OBJ_BOSS_299 */ {(void*) func_boss_80042FC4, 2, (ObjectFunc) func_boss_80042FB8, D_edata_800CBF34, 20000.0f, 0, 0, 40, 0, 0.0f, 10 }, - /* OBJ_BOSS_300 */ {(void*) func_boss_80042FE8, 1, (ObjectFunc) func_boss_80042FDC, D_edata_800CBF34, 20000.0f, 0, 0, 40, 0, 0.0f, 10 }, + /* OBJ_BOSS_299 */ {(void*) Boss299_Draw, 2, (ObjectFunc) Boss299_Update, D_edata_800CBF34, 20000.0f, 0, 0, 40, 0, 0.0f, 10 }, + /* OBJ_BOSS_300 */ {(void*) Boss300_Draw, 1, (ObjectFunc) Boss300_Update, D_edata_800CBF34, 20000.0f, 0, 0, 40, 0, 0.0f, 10 }, /* OBJ_BOSS_301 */ {(void*) Aquas_801BEC5C, 1, (ObjectFunc) Aquas_801BEC50, D_AQ_6030B10, 0.0f, 0, 0, 40, 0, 0.0f, 10 }, /* OBJ_BOSS_A6 */ {(void*) Area6_8018C54C, 1, (ObjectFunc) Area6_80187944, D_A6_6028454, 2000.0f, 0, 0, 40, 0, 0.0f, 10 }, /* OBJ_BOSS_303 */ {(void*) SectorX_80193434, 2, (ObjectFunc) SectorX_80190078, D_SX_6032550, 20000.0f, 0, 0, 20, 0, 0.0f, 10 }, @@ -414,12 +414,12 @@ ObjectInfo D_edata_800CC124[0x190] = { /* OBJ_BOSS_319 */ {(void*) Venom1_801985E4, 1, (ObjectFunc) Venom1_80194398,D_VE1_8019A9B8, 3000.0f, 0, 0, 40, 1, 0.0f, 10 }, /* OBJ_BOSS_320 */ {(void*) Andross_801928C8, 2, (ObjectFunc) Andross_8018DBF0, D_ANDROSS_C038DC0, 10000.0f, 0, 0, 40, 0, 0.0f, 10 }, /* OBJ_BOSS_321 */ {(void*) Andross_8018B8C0, 1, (ObjectFunc) Andross_80189B70, D_ANDROSS_C038F24, 10000.0f, 0, 0, 40, 0, 0.0f, 10 }, - /* OBJ_ITEM_LASERS */ {(void*) func_edisplay_8005CC9C, 1, (ObjectFunc) func_enmy_80067F6C, D_edata_800CBFA8, 700.0f, 0, 0, 0, 0, 0.0f, 0 }, - /* OBJ_ITEM_CHECKPOINT */ {(void*) func_edisplay_8005C5F0, 1, (ObjectFunc) func_enmy_80068914, D_edata_800CBF38, 700.0f, 0, 0, 0, 0, 0.0f, 0 }, - /* OBJ_ITEM_SILVER_RING */ {(void*) func_edisplay_8005C900, 1, (ObjectFunc) func_enmy_80068020, D_edata_800CBF54, 700.0f, 0, 0, 0, 0, 0.0f, 0 }, - /* OBJ_ITEM_SILVER_STAR */ {(void*) func_edisplay_8005C9C0, 1, (ObjectFunc) func_enmy_800685D8, D_edata_800CBF54, 700.0f, 0, 0, 0, 0, 0.0f, 0 }, - /* OBJ_ITEM_METEO_WARP */ {(void*) func_edisplay_8005CDA8, 1, (ObjectFunc) func_enmy_80068688, D_edata_800CBF70, 700.0f, 0, 0, 0, 0, 0.0f, 0 }, - /* OBJ_ITEM_BOMB */ {(void*) func_edisplay_8005CB44, 1, (ObjectFunc) func_enmy_80067BEC, D_edata_800CBFC8, 700.0f, 0, 0, 0, 0, 0.0f, 0 }, + /* OBJ_ITEM_LASERS */ {(void*) ItemLasers_Draw, 1, (ObjectFunc) ItemLasers_Update, D_edata_800CBFA8, 700.0f, 0, 0, 0, 0, 0.0f, 0 }, + /* OBJ_ITEM_CHECKPOINT */ {(void*) ItemCheckpoint_Draw, 1, (ObjectFunc) ItemCheckpoint_Update, D_edata_800CBF38, 700.0f, 0, 0, 0, 0, 0.0f, 0 }, + /* OBJ_ITEM_SILVER_RING */ {(void*) ItemSilverRing_Draw, 1, (ObjectFunc) ItemSupplyRing_Update, D_edata_800CBF54, 700.0f, 0, 0, 0, 0, 0.0f, 0 }, + /* OBJ_ITEM_SILVER_STAR */ {(void*) ItemSilverStar_Draw, 1, (ObjectFunc) ItemSilverStar_Update, D_edata_800CBF54, 700.0f, 0, 0, 0, 0, 0.0f, 0 }, + /* OBJ_ITEM_METEO_WARP */ {(void*) ItemMeteoWarp_Draw, 1, (ObjectFunc) ItemMeteoWarp_Update, D_edata_800CBF70, 700.0f, 0, 0, 0, 0, 0.0f, 0 }, + /* OBJ_ITEM_BOMB */ {(void*) ItemBomb_Draw, 1, (ObjectFunc) ItemPickup_Update, D_edata_800CBFC8, 700.0f, 0, 0, 0, 0, 0.0f, 0 }, /* OBJ_ITEM_328 */ {(void*) NULL, 1, (ObjectFunc) func_enmy_80068C88, D_edata_800CBF8C, 1500.0f, 0, 0, 0, 0, 0.0f, 0 }, /* OBJ_ITEM_329 */ {(void*) NULL, 1, (ObjectFunc) func_enmy_80068C88, D_edata_800CBF8C, 1500.0f, 0, 0, 0, 0, 0.0f, 0 }, /* OBJ_ITEM_330 */ {(void*) NULL, 1, (ObjectFunc) func_enmy_80068C88, D_edata_800CBF8C, 1500.0f, 0, 0, 0, 0, 0.0f, 0 }, @@ -427,10 +427,10 @@ ObjectInfo D_edata_800CC124[0x190] = { /* OBJ_ITEM_332 */ {(void*) NULL, 1, (ObjectFunc) func_enmy_80068C88, D_edata_800CBF8C, 1500.0f, 0, 0, 0, 0, 0.0f, 0 }, /* OBJ_ITEM_333 */ {(void*) NULL, 1, (ObjectFunc) func_enmy_80068C88, D_edata_800CBF8C, 1500.0f, 0, 0, 0, 0, 0.0f, 0 }, /* OBJ_ITEM_334 */ {(void*) NULL, 1, (ObjectFunc) func_enmy_80068C48, D_edata_800CBF18, 700.0f, 0, 0, 0, 0, 0.0f, 0 }, - /* OBJ_ITEM_1UP */ {(void*) D_1022120, 0, (ObjectFunc) func_enmy_80067B1C, D_edata_800CBE8C, 700.0f, 0, 0, 0, 0, 0.0f, 0 }, - /* OBJ_ITEM_GOLD_RING */ {(void*) func_edisplay_8005CA80, 1, (ObjectFunc) func_enmy_800685F8, D_edata_800CBF54, 700.0f, 0, 0, 0, 0, 0.0f, 0 }, - /* OBJ_ITEM_WING_REPAIR */ {(void*) D_arwing_3007650, 0, (ObjectFunc) func_enmy_80068618, D_edata_800CBFA8, 700.0f, 0, 0, 0, 0, 0.0f, 0 }, - /* OBJ_ITEM_TRAINING_RING */ {(void*) gItemTrainingRingDL, 0, (ObjectFunc) Training_80198968, D_TR_6009CFC, 700.0f, 0, 0, 0, 0, 0.0f, 0 }, + /* OBJ_ITEM_1UP */ {(void*) D_1022120, 0, (ObjectFunc) Item1up_Update, D_edata_800CBE8C, 700.0f, 0, 0, 0, 0, 0.0f, 0 }, + /* OBJ_ITEM_GOLD_RING */ {(void*) ItemGoldRing_Draw, 1, (ObjectFunc) ItemGoldRing_Update, D_edata_800CBF54, 700.0f, 0, 0, 0, 0, 0.0f, 0 }, + /* OBJ_ITEM_WING_REPAIR */ {(void*) D_arwing_3007650, 0, (ObjectFunc) ItemWingRepair_Update, D_edata_800CBFA8, 700.0f, 0, 0, 0, 0, 0.0f, 0 }, + /* OBJ_ITEM_TRAINING_RING */ {(void*) gItemTrainingRingDL, 0, (ObjectFunc) Training_ItemRing_Update, D_TR_6009CFC, 700.0f, 0, 0, 0, 0, 0.0f, 0 }, /* OBJ_EFFECT_339 */ {(void*) func_effect_8007D55C, 1, (ObjectFunc) func_effect_8007D2F4, NULL, -200.0f, 1, 2, 0, 0, 0.0f, 0 }, /* OBJ_EFFECT_340 */ {(void*) func_effect_8007D55C, 1, (ObjectFunc) func_effect_8007D748, NULL, -200.0f, 1, 2, 0, 0, 0.0f, 0 }, /* OBJ_EFFECT_341 */ {(void*) func_effect_8007D55C, 1, (ObjectFunc) func_effect_8007D8A8, NULL, -200.0f, 1, 2, 0, 0, 0.0f, 0 }, diff --git a/src/engine/fox_edisplay.c b/src/engine/fox_edisplay.c index a5bfcfe7..fa7bb842 100644 --- a/src/engine/fox_edisplay.c +++ b/src/engine/fox_edisplay.c @@ -59,7 +59,7 @@ void func_edisplay_80059850(Object_4C* obj4C) { void func_edisplay_800598DC(s32 arg0) { } -void func_edisplay_800598E8(Actor* actor) { +void Actor201_Draw(Actor* actor) { RCP_SetupDL_60(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); gSPDisplayList(gMasterDisp++, D_MA_6025B50); RCP_SetupDL_29(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); @@ -88,7 +88,7 @@ f32 D_edisplay_800CFA2C[] = { 1.0f, 1.0f, 0.95f, 0.9f, 0.85f, 0.8f, 0.75f, 0.7f, 0.65f, 0.6f, }; -void func_edisplay_80059A24(Actor* actor) { +void Actor202_Draw(Actor* actor) { Vec3f sp30[30]; f32 temp = D_edisplay_800CF9B0[actor->unk_0B6] - 114.0f; @@ -98,7 +98,7 @@ void func_edisplay_80059A24(Actor* actor) { Animation_DrawSkeleton(1, D_ME_601E9D0, sp30, NULL, func_edisplay_800599A4, &actor->index, &gIdentityMatrix); } -void func_edisplay_80059AEC(Object_80* obj80) { +void Obj39_Draw(Object_80* obj80) { gSPDisplayList(gMasterDisp++, D_ME_601AE40); } @@ -114,11 +114,11 @@ void func_edisplay_80059B20(Object_80* obj80) { void func_edisplay_80059BB0(void* arg0) { } -void func_edisplay_80059BBC(Object_80* obj80) { +void Obj42_Draw(Object_80* obj80) { gSPDisplayList(gMasterDisp++, D_CO_6023AC0); } -void func_edisplay_80059BF0(Actor* actor) { +void Actor196_Draw(Actor* actor) { if (actor->unk_0B6 != 0) { gSPDisplayList(gMasterDisp++, D_CO_6032BC0); } @@ -169,13 +169,13 @@ void func_edisplay_80059C40(Object_4C* obj4C) { RCP_SetupDL_60(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); } -void func_edisplay_80059F68(Item* item) { +void func_edisplay_80059F68(Object_80* obj80) { Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -95.0f, 1); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_CO_602DA20); } -void func_edisplay_80059FDC(Item* item) { +void func_edisplay_80059FDC(Object_80* obj80) { gSPDisplayList(gMasterDisp++, D_CO_6035DA0); } @@ -236,7 +236,7 @@ Gfx* D_edisplay_800CFC64[] = { D_AQ_6023940, D_AQ_6023D70, D_AQ_60249C0, D_AQ_60 Gfx* D_edisplay_800CFC7C[] = { D_ZO_601B570, D_ZO_601B710, D_ZO_60209B0, D_ZO_6020B70, D_ZO_6020D50, D_ZO_601B8F0, D_ZO_601B3B0, D_ZO_601B1C0, D_ZO_6011660 }; -void func_edisplay_8005A094(Actor* actor) { +void Actor189_Draw(Actor* actor) { switch (actor->state) { case 0: Matrix_Translate(gGfxMatrix, 18.0f, 15.0f, -15.0f, 1); @@ -291,11 +291,11 @@ void func_edisplay_8005A094(Actor* actor) { } else { if (gBosses[0].fwork[3] < 4800.0f) { RCP_SetupDL(&gMasterDisp, 0x1E); - gDPSetFogColor(gMasterDisp++, 0x40, 0x20, 0x20, gFogAlpha); + gDPSetFogColor(gMasterDisp++, 64, 32, 32, gFogAlpha); gSPFogPosition(gMasterDisp++, gFogNear, gFogFar); } else { RCP_SetupDL(&gMasterDisp, 0x1E); - gDPSetFogColor(gMasterDisp++, 0x10, 0x10, 0x10, gFogAlpha); + gDPSetFogColor(gMasterDisp++, 16, 16, 16, gFogAlpha); gSPFogPosition(gMasterDisp++, gFogNear, gFogFar); } Graphics_SetScaleMtx(actor->scale); @@ -413,7 +413,7 @@ void func_edisplay_8005A094(Actor* actor) { break; default: if (actor->state > 9) { - if (actor->state == 0x24) { + if (actor->state == 36) { gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK); } gSPDisplayList(gMasterDisp++, D_edisplay_800CFA54[actor->state - 10]); @@ -635,8 +635,8 @@ void func_edisplay_8005BAB4(ObjectId objId, s32 index) { RCP_SetupDL(&gMasterDisp, 0x40); break; case OBJ_ACTOR_195: - case OBJ_ACTOR_198: - case OBJ_ACTOR_200: + case OBJ_ACTOR_TEAM_BOSS: + case OBJ_ACTOR_EVENT: switch (gActors[index].unk_0B4) { case 3: Matrix_Scale(gGfxMatrix, 2.3f, 0.0f, 2.3f, 1); @@ -683,7 +683,7 @@ void func_edisplay_8005BAB4(ObjectId objId, s32 index) { case OBJ_BOSS_295: case OBJ_BOSS_296: COS_DEG(gBosses[index].obj.rot.z); - if (D_80161A88 == 2) { + if (D_ctx_80161A88 == 2) { gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, 90); } else { gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, 150); @@ -760,7 +760,7 @@ void func_edisplay_8005BAB4(ObjectId objId, s32 index) { } } -void func_edisplay_8005C5F0(Item* item) { +void ItemCheckpoint_Draw(Item* item) { s32 i; if ((gGameFrameCount & 0x18) && (item->state == 0)) { @@ -791,7 +791,7 @@ void func_edisplay_8005C5F0(Item* item) { gSPClearGeometryMode(gMasterDisp++, G_TEXTURE_GEN); } -void func_edisplay_8005C900(Item* item) { +void ItemSilverRing_Draw(Item* item) { RCP_SetupDL(&gMasterDisp, 0x1D); gSPTexture(gMasterDisp++, 3000, 0, 0, G_TX_RENDERTILE, G_ON); gSPSetGeometryMode(gMasterDisp++, G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR); @@ -800,7 +800,7 @@ void func_edisplay_8005C900(Item* item) { gSPClearGeometryMode(gMasterDisp++, G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR); } -void func_edisplay_8005C9C0(Item* item) { +void ItemSilverStar_Draw(Item* item) { RCP_SetupDL(&gMasterDisp, 0x1D); gSPTexture(gMasterDisp++, 3000, 0, 0, G_TX_RENDERTILE, G_ON); gSPSetGeometryMode(gMasterDisp++, G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR); @@ -809,7 +809,7 @@ void func_edisplay_8005C9C0(Item* item) { gSPClearGeometryMode(gMasterDisp++, G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR); } -void func_edisplay_8005CA80(Item* item) { +void ItemGoldRing_Draw(Item* item) { RCP_SetupDL(&gMasterDisp, 0x1D); gSPTexture(gMasterDisp++, 1900, 1700, 0, G_TX_RENDERTILE, G_ON); gSPSetGeometryMode(gMasterDisp++, G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR); @@ -818,7 +818,7 @@ void func_edisplay_8005CA80(Item* item) { gSPClearGeometryMode(gMasterDisp++, G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR); } -void func_edisplay_8005CB44(Item* item) { +void ItemBomb_Draw(Item* item) { if (gCurrentLevel == LEVEL_AQUAS) { Graphics_SetScaleMtx(item->scale); gSPDisplayList(gMasterDisp++, D_blue_marine_3005980); @@ -835,7 +835,7 @@ void func_edisplay_8005CB44(Item* item) { } } -void func_edisplay_8005CC9C(Item* item) { +void ItemLasers_Draw(Item* item) { Graphics_SetScaleMtx(item->scale * 0.1f); RCP_SetupDL(&gMasterDisp, 0x1D); gSPTexture(gMasterDisp++, 2000, 2000, 0, G_TX_RENDERTILE, G_ON); @@ -847,7 +847,7 @@ void func_edisplay_8005CC9C(Item* item) { gSPDisplayList(gMasterDisp++, D_101A8E0); } -void func_edisplay_8005CDA8(Item* item) { +void ItemMeteoWarp_Draw(Item* item) { s32 i; item->obj.rot.y = (Math_Atan2F(gPlayer[gPlayerNum].camEye.x - item->obj.pos.x, @@ -941,9 +941,9 @@ void func_edisplay_8005D3CC(Object* obj, f32 xRot, f32 yRot, f32 zRot, s32 drawT } void Object_80_Draw(Object_80* obj80, s32 arg1) { - obj80->obj.pos.y += D_ctx_8017847C; + obj80->obj.pos.y += gCameraShakeY; func_edisplay_8005D008(&obj80->obj, obj80->info.drawType); - obj80->obj.pos.y -= D_ctx_8017847C; + obj80->obj.pos.y -= gCameraShakeY; if (obj80->info.drawType == 0) { if ((obj80->obj.id == OBJ_80_19) || (obj80->obj.id == OBJ_80_55) || (obj80->obj.id == OBJ_80_9) || (obj80->obj.id == OBJ_80_50)) { @@ -978,9 +978,9 @@ void Object_80_Draw(Object_80* obj80, s32 arg1) { void Object_4C_Draw(Object_4C* obj4C, s32 arg1) { if (arg1 >= 0) { - obj4C->obj.pos.y += D_ctx_8017847C; + obj4C->obj.pos.y += gCameraShakeY; func_edisplay_8005D008(&obj4C->obj, 0); - obj4C->obj.pos.y -= D_ctx_8017847C; + obj4C->obj.pos.y -= gCameraShakeY; if (obj4C->info.drawType == 0) { gSPDisplayList(gMasterDisp++, obj4C->info.dList); } else if (obj4C->info.draw != NULL) { @@ -989,26 +989,26 @@ void Object_4C_Draw(Object_4C* obj4C, s32 arg1) { } } -void Actor_Draw2(Actor* actor) { +void Actor_DrawOnRails(Actor* actor) { Vec3f sp34 = { 0.0f, 0.0f, 0.0f }; if (actor->info.draw != NULL) { switch (actor->obj.id) { case OBJ_ACTOR_194: - func_enmy2_8006B74C(actor); + Actor194_Draw(actor); return; case OBJ_ACTOR_236: Zoness_80190F08(actor); return; } - if ((actor->obj.id == OBJ_ACTOR_200) && (actor->unk_0B4 == 200)) { - func_enmy2_8006B74C(actor); + if ((actor->obj.id == OBJ_ACTOR_EVENT) && (actor->unk_0B4 == EINFO_200)) { + Actor194_Draw(actor); } else { if (actor->info.unk_19 != 0) { - actor->obj.pos.y += D_ctx_8017847C; + actor->obj.pos.y += gCameraShakeY; func_edisplay_8005D008(&actor->obj, actor->info.drawType); - actor->obj.pos.y -= D_ctx_8017847C; - } else if ((actor->obj.id == OBJ_ACTOR_200) && (actor->unk_0B4 != 31)) { + actor->obj.pos.y -= gCameraShakeY; + } else if ((actor->obj.id == OBJ_ACTOR_EVENT) && (actor->unk_0B4 != EINFO_31)) { func_edisplay_8005D3CC(&actor->obj, actor->vwork[29].x, actor->vwork[29].y, actor->vwork[29].z + actor->unk_0F4.z, actor->info.drawType); } else { @@ -1020,7 +1020,8 @@ void Actor_Draw2(Actor* actor) { } else { actor->info.draw(&actor->obj); func_edisplay_8005F1EC(actor->sfxSource); - if (((actor->obj.id == OBJ_ACTOR_198) || ((actor->obj.id == OBJ_ACTOR_203) && (actor->unk_0B6 > 0))) && + if (((actor->obj.id == OBJ_ACTOR_TEAM_BOSS) || + ((actor->obj.id == OBJ_ACTOR_SLIPPY_SX) && (actor->unk_0B6 > 0))) && (D_display_80161410 > 0)) { Matrix_MultVec3f(gGfxMatrix, &sp34, &D_ctx_80177E98[actor->aiType]); } @@ -1036,7 +1037,7 @@ void Actor_Draw2(Actor* actor) { } } -void Actor_Draw1(Actor* actor) { +void Actor_DrawAllRange(Actor* actor) { s32 var_v1; Vec3f sp50 = { 0.0f, 0.0f, 0.0f }; f32 var_fa1; @@ -1054,7 +1055,7 @@ void Actor_Draw1(Actor* actor) { Matrix_Pop(&gGfxMatrix); var_fv0 = 0.0f; var_fv1 = -12000.0f; - if ((actor->obj.id == OBJ_ACTOR_197) && (actor->aiType >= 100)) { + if ((actor->obj.id == OBJ_ACTOR_ALLRANGE) && (actor->aiType >= AI360_GREAT_FOX)) { var_fv0 = 1000.0f; var_fv1 = -25000.0f; } @@ -1066,8 +1067,8 @@ void Actor_Draw1(Actor* actor) { Matrix_RotateZ(gCalcMatrix, actor->obj.rot.z * M_DTOR, 1); actor->info.draw(&actor->obj); D_edisplay_801615EC = 1; - if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_3) && (actor->obj.id == OBJ_ACTOR_197) && - (actor->aiType == 200)) { + if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_3) && (actor->obj.id == OBJ_ACTOR_ALLRANGE) && + (actor->aiType == AI360_MISSILE)) { D_ctx_80177E98[0] = D_edisplay_801615E0; } } @@ -1077,7 +1078,7 @@ void Actor_Draw1(Actor* actor) { Matrix_Translate(gGfxMatrix, actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 1); Matrix_MultVec3f(gGfxMatrix, &sp50, &D_edisplay_801615E0); if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_2) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_0) || - ((actor->obj.id == OBJ_ACTOR_197) && (actor->aiType >= 100)) || + ((actor->obj.id == OBJ_ACTOR_ALLRANGE) && (actor->aiType >= AI360_GREAT_FOX)) || ((actor->obj.id == OBJ_ACTOR_195) && (actor->info.bonus != 0))) { var_ft5 = var_fv0 = 3000.0f; var_fv1 = -29000.0f; @@ -1099,9 +1100,10 @@ void Actor_Draw1(Actor* actor) { actor->info.draw(&actor->obj); D_edisplay_801615EC = 1; if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_3) && - (((actor->obj.id == OBJ_ACTOR_197) && - ((actor->aiType < 4) || (actor->aiType == 8) || (actor->aiType == 9))) || - (actor->obj.id == OBJ_ACTOR_198))) { + (((actor->obj.id == OBJ_ACTOR_ALLRANGE) && + ((actor->aiType <= AI360_PEPPY) || (actor->aiType == AI360_KATT) || + (actor->aiType == AI360_BILL))) || + (actor->obj.id == OBJ_ACTOR_TEAM_BOSS))) { D_ctx_80177E98[actor->aiType] = D_edisplay_801615E0; } } @@ -1137,9 +1139,9 @@ void Boss_Draw(Boss* boss, s32 arg1) { Vec3f sp30 = { 0.0f, 0.0f, 0.0f }; if (boss->info.unk_19 != 0) { - boss->obj.pos.y += boss->unk_068 + D_ctx_8017847C; + boss->obj.pos.y += boss->unk_068 + gCameraShakeY; func_edisplay_8005D1F0(&boss->obj, boss->info.drawType); - boss->obj.pos.y -= boss->unk_068 + D_ctx_8017847C; + boss->obj.pos.y -= boss->unk_068 + gCameraShakeY; } else { func_edisplay_8005D1F0(&boss->obj, boss->info.drawType); } @@ -1190,16 +1192,16 @@ void Boss_Draw(Boss* boss, s32 arg1) { } } -void Effect_Draw1(Effect* effect, s32 arg1) { +void Effect_DrawOnRails(Effect* effect, s32 arg1) { if ((arg1 < 0) && (effect->obj.pos.y < 7.0f)) { return; } if ((effect->obj.id == OBJ_EFFECT_353) || (effect->obj.id == OBJ_EFFECT_369)) { func_edisplay_8005D3CC(&effect->obj, effect->unk_60.x, effect->unk_60.y, effect->unk_60.z, 0); } else if (effect->info.unk_14 == -1) { - effect->obj.pos.y += D_ctx_8017847C; + effect->obj.pos.y += gCameraShakeY; func_edisplay_8005D008(&effect->obj, 0); - effect->obj.pos.y -= D_ctx_8017847C; + effect->obj.pos.y -= gCameraShakeY; } else { func_edisplay_8005D008(&effect->obj, 0); } @@ -1208,14 +1210,14 @@ void Effect_Draw1(Effect* effect, s32 arg1) { } } -void Effect_Draw2(Effect* effect) { +void Effect_DrawAllRange(Effect* effect) { Vec3f sp4C = { 0.0f, 0.0f, 0.0f }; Vec3f sp40; f32 var_fv0; u8 sp3B = 0; if (effect->info.unk_14 == -1) { - Matrix_Translate(gGfxMatrix, effect->obj.pos.x, effect->obj.pos.y + D_ctx_8017847C, + Matrix_Translate(gGfxMatrix, effect->obj.pos.x, effect->obj.pos.y + gCameraShakeY, effect->obj.pos.z + D_ctx_80177D20, 1); } else { Matrix_Translate(gGfxMatrix, effect->obj.pos.x, effect->obj.pos.y, effect->obj.pos.z + D_ctx_80177D20, 1); @@ -1291,7 +1293,7 @@ void func_edisplay_8005EA24(Actor* actor) { Matrix_RotateY(gGfxMatrix, (actor->obj.rot.y + 180.0f) * M_DTOR, 1); Matrix_RotateZ(gGfxMatrix, actor->obj.rot.z * M_DTOR, 1); Matrix_SetGfxMtx(&gMasterDisp); - if (actor->aiType < 4) { + if (actor->aiType <= AI360_PEPPY) { Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, 30.0f, 1); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_1032780); @@ -1301,7 +1303,7 @@ void func_edisplay_8005EA24(Actor* actor) { } else { gSPDisplayList(gMasterDisp++, D_KA_600DBC0); } - } else if ((actor->aiType < 8) || (gCurrentLevel != LEVEL_FORTUNA)) { + } else if ((actor->aiType < AI360_KATT) || (gCurrentLevel != LEVEL_FORTUNA)) { gSPDisplayList(gMasterDisp++, D_STAR_WOLF_F014310); } else if (gCurrentLevel == LEVEL_FORTUNA) { gSPDisplayList(gMasterDisp++, D_FO_6009F90); @@ -1313,7 +1315,7 @@ void func_edisplay_8005EA24(Actor* actor) { void func_edisplay_8005ECD8(s32 index, Object* obj) { RCP_SetupDL(&gMasterDisp, 0x42); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 0, 0, 0, 180); - if (obj->id == OBJ_ACTOR_197) { + if (obj->id == OBJ_ACTOR_ALLRANGE) { func_edisplay_8005EA24(&gActors[index]); } else { switch (obj->id) { @@ -1327,14 +1329,14 @@ void func_edisplay_8005ECD8(s32 index, Object* obj) { obj->pos.z + D_ctx_80177D20, 1); break; case OBJ_BOSS_316: - Matrix_Translate(gGfxMatrix, obj->pos.x, gGroundLevel + 2.0f + D_ctx_8017847C, obj->pos.z, 1); + Matrix_Translate(gGfxMatrix, obj->pos.x, gGroundLevel + 2.0f + gCameraShakeY, obj->pos.z, 1); break; default: Matrix_Translate(gGfxMatrix, obj->pos.x, gGroundLevel + 2.0f, obj->pos.z + D_ctx_80177D20, 1); break; } - if ((D_ctx_801784AC != 4) || (obj->id == OBJ_ACTOR_200) || (obj->id == OBJ_ACTOR_195) || - (obj->id == OBJ_ACTOR_198)) { + if ((D_ctx_801784AC != 4) || (obj->id == OBJ_ACTOR_EVENT) || (obj->id == OBJ_ACTOR_195) || + (obj->id == OBJ_ACTOR_TEAM_BOSS)) { Matrix_Scale(gGfxMatrix, 1.0f, 0.0f, 1.0f, 1); Matrix_RotateY(gGfxMatrix, obj->rot.y * M_DTOR, 1); } @@ -1348,7 +1350,7 @@ void func_edisplay_8005ECD8(s32 index, Object* obj) { } } -void func_edisplay_8005F030(f32* sfxSrc) { +void Object_ClampSfxSource(f32* sfxSrc) { if (sfxSrc[0] > 5000.0f) { sfxSrc[0] = 5000.0f; } @@ -1378,15 +1380,15 @@ void func_edisplay_8005F0E8(f32* sfxSrc, Vec3f* pos) { } else { Matrix_RotateY(gCalcMatrix, gPlayer[0].unk_058, 0); Matrix_RotateX(gCalcMatrix, gPlayer[0].unk_05C, 1); - sp2C.x = pos->x - D_ctx_801779D8.x; - sp2C.y = pos->y - D_ctx_801779D8.y; - sp2C.z = pos->z + D_ctx_80177D20 - D_ctx_801779D8.z; + sp2C.x = pos->x - gPlayerCamEye.x; + sp2C.y = pos->y - gPlayerCamEye.y; + sp2C.z = pos->z + D_ctx_80177D20 - gPlayerCamEye.z; Matrix_MultVec3f(gCalcMatrix, &sp2C, &sp20); sfxSrc[0] = sp20.x; sfxSrc[1] = sp20.y; sfxSrc[2] = sp20.z; } - func_edisplay_8005F030(sfxSrc); + Object_ClampSfxSource(sfxSrc); } void func_edisplay_8005F1EC(f32* sfxSrc) { @@ -1402,7 +1404,7 @@ void func_edisplay_8005F1EC(f32* sfxSrc) { sfxSrc[1] = sp20.y; sfxSrc[2] = sp20.z; } - func_edisplay_8005F030(sfxSrc); + Object_ClampSfxSource(sfxSrc); } void func_edisplay_8005F290(f32* sfxSrc, Vec3f* pos) { @@ -1413,7 +1415,7 @@ void func_edisplay_8005F290(f32* sfxSrc, Vec3f* pos) { sfxSrc[1] = pos->y; sfxSrc[2] = pos->z; } - func_edisplay_8005F030(sfxSrc); + Object_ClampSfxSource(sfxSrc); } void Object_58_Draw(Object_58* obj58) { @@ -1438,7 +1440,7 @@ void Object_58_Draw(Object_58* obj58) { sp38 = 0.9f; } if ((gLevelType == LEVELTYPE_PLANET) || (gCurrentLevel == LEVEL_BOLSE)) { - Matrix_Translate(gGfxMatrix, obj58->obj.pos.x, obj58->obj.pos.y + D_ctx_8017847C, obj58->obj.pos.z, 1); + Matrix_Translate(gGfxMatrix, obj58->obj.pos.x, obj58->obj.pos.y + gCameraShakeY, obj58->obj.pos.z, 1); } else { Matrix_Translate(gGfxMatrix, obj58->obj.pos.x, obj58->obj.pos.y, obj58->obj.pos.z, 1); } @@ -1636,7 +1638,7 @@ void Object_DrawAll(s32 arg0) { func_edisplay_8005F670(&actor->obj.pos); } func_edisplay_800597C0(arg0); - Actor_Draw2(actor); + Actor_DrawOnRails(actor); Matrix_Pop(&gGfxMatrix); if (actor->unk_0C9 != 0) { Matrix_Push(&gGfxMatrix); @@ -1646,7 +1648,7 @@ void Object_DrawAll(s32 arg0) { break; case LEVELMODE_ALL_RANGE: Matrix_Push(&gGfxMatrix); - Actor_Draw1(actor); + Actor_DrawAllRange(actor); Matrix_Pop(&gGfxMatrix); if ((actor->unk_0C9 != 0) && (D_edisplay_801615EC != 0) && ((D_edisplay_801615E0.z > -4000.0f) || (gCurrentLevel != LEVEL_KATINA))) { @@ -1674,7 +1676,7 @@ void Object_DrawAll(s32 arg0) { gAmbientB); } -void func_edisplay_8006046C(s32 arg0) { +void Effect_DrawAll(s32 arg0) { s32 i; Boss* boss; Effect* effect; @@ -1688,11 +1690,11 @@ void func_edisplay_8006046C(s32 arg0) { } if (gLevelMode == LEVELMODE_ALL_RANGE) { Matrix_Push(&gGfxMatrix); - Effect_Draw2(effect); + Effect_DrawAllRange(effect); Matrix_Pop(&gGfxMatrix); } else { Matrix_Push(&gGfxMatrix); - Effect_Draw1(effect, arg0); + Effect_DrawOnRails(effect, arg0); Matrix_Pop(&gGfxMatrix); func_edisplay_8005F1EC(effect->sfxSource); if (effect->obj.id == OBJ_EFFECT_374) { @@ -1718,10 +1720,10 @@ void func_edisplay_8006046C(s32 arg0) { } } -void func_edisplay_80060714(s32 arg0) { +void Object_Draw(s32 arg0) { D_display_80161410 = 1; Object_DrawAll(1); - if ((D_80161A88 == 2) && (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_2)) { + if ((D_ctx_80161A88 == 2) && (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_2)) { D_display_80161410 = -1; Lights_SetOneLight(&gMasterDisp, gLight1x, -1 * gLight1y, gLight1z, gLight1R, gLight1G, gLight1B, gAmbientR, gAmbientG, gAmbientB); @@ -1734,15 +1736,15 @@ void func_edisplay_80060714(s32 arg0) { } } -void func_edisplay_8006089C(u8 arg0) { +void Effect_Draw(u8 arg0) { if (arg0 == 0) { D_display_80161410 = 1; - func_edisplay_8006046C(1); - } else if ((D_80161A88 == 2) && (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_2)) { + Effect_DrawAll(1); + } else if ((D_ctx_80161A88 == 2) && (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_2)) { D_display_80161410 = -1; Matrix_Push(&gGfxMatrix); Matrix_Scale(gGfxMatrix, 1.0f, -1.0f, 1.0f, 1); - func_edisplay_8006046C(-1); + Effect_DrawAll(-1); Matrix_Pop(&gGfxMatrix); } D_display_80161410 = 1; @@ -1814,10 +1816,10 @@ void TexturedLine_Draw(void) { } } -void func_edisplay_80060D94(s32 arg0) { - TexturedLine* texLine = &gTexturedLines[arg0]; +void TexturedLine_DrawPath(s32 index) { + TexturedLine* texLine = &gTexturedLines[index]; - if (texLine->unk_2F == 0xFF) { + if (texLine->unk_2F == 255) { RCP_SetupDL(&gMasterDisp, 5); } else { RCP_SetupDL(&gMasterDisp, 0xE); diff --git a/src/engine/fox_effect.c b/src/engine/fox_effect.c index 5150e0db..c1c712ce 100644 --- a/src/engine/fox_effect.c +++ b/src/engine/fox_effect.c @@ -332,7 +332,7 @@ static f32 D_800D1534[][10] = { void func_effect_800780F8(Effect* effect) { s32 i; - if (effect->unk_4A >= 0xB) { + if (effect->unk_4A >= 11) { if (!((effect->index + gGameFrameCount) & 1)) { gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 128, 128, 32); } else { @@ -512,7 +512,7 @@ void func_effect_80078D60(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 scal effect->state = 2; } - effect->timer_50 = 0xE; + effect->timer_50 = 14; Object_SetInfo(&effect->info, effect->obj.id); } @@ -875,7 +875,7 @@ void func_effect_8007A28C(Effect* effect) { effect->obj.rot.y += 1.0f; Math_SmoothStepToF(&effect->scale2, effect->scale1, 0.05f, 1.5f, 0.001f); - if (effect->timer_50 >= 0xB) { + if (effect->timer_50 >= 11) { D_ctx_801779A8[0] = 60.0f; } if (effect->timer_50 == 48) { @@ -1034,7 +1034,7 @@ void func_effect_8007A994(Effect* effect) { } effect->unk_44 -= effect->unk_46; - if (effect->unk_44 < 0x15) { + if (effect->unk_44 <= 20) { Object_Kill(&effect->obj, effect->sfxSource); } effect->unk_4A++; @@ -1078,7 +1078,7 @@ void func_effect_8007AC0C(Effect* effect, f32 xPos, f32 unused_posY, f32 zPos, f effect->obj.pos.y = gGroundLevel; effect->obj.pos.z = zPos; - effect->unk_44 = 0xB4; + effect->unk_44 = 180; effect->scale2 = scale2; effect->scale1 = scale1; effect->obj.rot.y = yRot; @@ -1108,7 +1108,7 @@ void func_effect_8007AD58(Effect* effect, f32 xPos, f32 unused_posY, f32 zPos, f effect->obj.pos.y = gGroundLevel; effect->obj.pos.z = zPos; - effect->unk_44 = 0xB4; + effect->unk_44 = 180; effect->scale2 = scale2; effect->scale1 = scale1; effect->obj.rot.y = yRot; @@ -1193,7 +1193,7 @@ void func_effect_8007B180(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 scal effect->obj.pos.y = yPos; effect->obj.pos.z = zPos; - effect->unk_44 = 0xFF; + effect->unk_44 = 255; effect->scale1 = scale1; Object_SetInfo(&effect->info, effect->obj.id); AUDIO_PLAY_SFX(0x1100000C, effect->sfxSource, 0); @@ -1438,12 +1438,12 @@ void func_effect_8007BB14(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 scal effect->unk_48 = -effect->unk_48; } - effect->unk_4A = 0xB4; + effect->unk_4A = 180; effect->unk_46 = 8; if (scale2 > 15.0f) { effect->unk_46 = 5; - effect->unk_4A = 0x50; + effect->unk_4A = 80; } effect->scale2 = scale2 * 0.25f; @@ -1629,7 +1629,7 @@ void func_effect_8007C3B4(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 xVel effect->unk_4C = RAND_INT(12.0f); effect->obj.rot.z = RAND_FLOAT(360.0f); Object_SetInfo(&effect->info, effect->obj.id); - effect->unk_44 = 0xFF; + effect->unk_44 = 255; } void func_effect_8007C484(f32 xPos, f32 yPos, f32 zPos, f32 xVel, f32 yVel, f32 zVel, f32 scale2, s32 arg7) { @@ -1841,7 +1841,7 @@ void func_effect_8007CD7C(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 scal if (Rand_ZeroOne() < 0.5f) { effect->unk_48 = -effect->unk_48; } - effect->unk_4A = 0xFF; + effect->unk_4A = 255; effect->scale2 = scale2; effect->obj.rot.z = RAND_FLOAT(360.0f); @@ -2009,7 +2009,7 @@ void func_effect_8007D2F4(Effect* effect) { D_ctx_80178370 = effect->obj.pos.x; D_ctx_80178374 = effect->obj.pos.y; D_ctx_80178378 = effect->obj.pos.z; - D_ctx_80178360 = 0xFF; + D_ctx_80178360 = 255; D_ctx_80178364 = 50; D_ctx_80178368 = 0; } @@ -2097,7 +2097,7 @@ void func_effect_8007D748(Effect* effect) { D_ctx_80178370 = effect->obj.pos.x; D_ctx_80178374 = effect->obj.pos.y; D_ctx_80178378 = effect->obj.pos.z; - D_ctx_80178360 = 0xFF; + D_ctx_80178360 = 255; D_ctx_80178364 = 50; D_ctx_80178368 = 0; } @@ -2188,7 +2188,7 @@ void func_effect_8007DB70(Effect* effect) { func_effect_8007D0E0(effect->obj.pos.x, effect->obj.pos.y + 30.0f, effect->obj.pos.z, 7.0f); func_effect_8007BFFC(effect->obj.pos.x, effect->obj.pos.y + 30.0f, effect->obj.pos.z, 0.0f, 0.0f, 0.0f, 4.0f, 5); - if ((effect->obj.pos.y < (gGroundLevel + 10.0f)) || (D_80161A88 != 2)) { + if ((effect->obj.pos.y < (gGroundLevel + 10.0f)) || (D_ctx_80161A88 != 2)) { func_beam_800365E4(effect->obj.pos.x, 3.0f, effect->obj.pos.z, effect->obj.pos.x, effect->obj.pos.z, 0.0f, 0.0f, 90.0f, 5.0f, 0, 0); break; @@ -2374,7 +2374,7 @@ void func_effect_8007E6B8(Effect* effect, u32 objId, f32 xPos, f32 yPos, f32 zPo effect->obj.pos.y = yPos; effect->obj.pos.z = zPos; - Object_SetInfo(&effect->info, objId & 0xFFFF); + Object_SetInfo(&effect->info, effect->obj.id); sp50 = Math_Atan2F(gPlayer[0].pos.x - xPos, gPlayer[0].unk_138 - zPos); temp_ft4 = sqrtf(SQ(gPlayer[0].pos.x - xPos) + SQ(gPlayer[0].unk_138 - zPos)); sp54 = -Math_Atan2F(gPlayer[0].pos.y - yPos, temp_ft4); @@ -2644,7 +2644,7 @@ void func_effect_8007F438(Effect* effect) { } if (effect->unk_46 == 0) { - effect->unk_46 = 0x1E; + effect->unk_46 = 30; effect->unk_44 += 1; effect->unk_44 &= 1; } else { @@ -2730,7 +2730,7 @@ void func_effect_8007F6B0(Effect* effect) { } else if (gCurrentLevel == LEVEL_FORTUNA) { func_effect_8007BC7C(effect->obj.pos.x + sin, yPos, effect->obj.pos.z + cos, 20.0f); } else if (gCurrentLevel == LEVEL_TITANIA) { - func_effect_8007A900(effect->obj.pos.x + sin, yPos, effect->obj.pos.z + cos, 10.0f, 0xFF, 0xF, 0); + func_effect_8007A900(effect->obj.pos.x + sin, yPos, effect->obj.pos.z + cos, 10.0f, 255, 15, 0); } } } @@ -2775,7 +2775,7 @@ void func_effect_8007F958(Effect* effect) { if (gCurrentLevel == LEVEL_FORTUNA) { func_effect_8007BC7C(effect->obj.pos.x + sin, yPos, effect->obj.pos.z + cos, 8.0f); } else if (gCurrentLevel == LEVEL_TITANIA) { - func_effect_8007A900(effect->obj.pos.x + sin, yPos, effect->obj.pos.z + cos, 8.0f, 0xFF, 0xF, 0); + func_effect_8007A900(effect->obj.pos.x + sin, yPos, effect->obj.pos.z + cos, 8.0f, 255, 15, 0); } } } @@ -2899,7 +2899,7 @@ void func_effect_8007FE88(Effect* effect) { } } else if (effect->obj.pos.y < gGroundLevel) { Object_Kill(&effect->obj, effect->sfxSource); - if (D_80161A88 != 2) { + if (D_ctx_80161A88 != 2) { effect->obj.pos.y = gGroundLevel; func_effect_8007D074(effect->obj.pos.x, effect->obj.pos.y, effect->obj.pos.z, 2.0f); } @@ -3030,7 +3030,7 @@ void func_effect_8008040C(Effect* effect) { } } else if (effect->obj.pos.y < gGroundLevel) { Object_Kill(&effect->obj, effect->sfxSource); - if (D_80161A88 != 2) { + if (D_ctx_80161A88 != 2) { effect->obj.pos.y = gGroundLevel; func_effect_8007D074(effect->obj.pos.x, effect->obj.pos.y, effect->obj.pos.z, 2.0f); } @@ -3093,9 +3093,9 @@ void func_effect_80080ACC(Effect* effect) { temp_ft2 = (((f32) effect->unk_44 / (f32) effect->unk_46) * 255.0f); effect->unk_48 = temp_ft2; if (temp_ft2 >= 256) { - effect->unk_48 = 0xFF; + effect->unk_48 = 255; } - if (effect->unk_48 < 0x20) { + if (effect->unk_48 < 32) { Object_Kill(&effect->obj, effect->sfxSource); } break; @@ -3147,11 +3147,11 @@ void func_effect_80080D04(Effect* effect) { switch (effect->unk_7A) { case 0: - if (effect->unk_44 != 0x40) { + if (effect->unk_44 != 64) { RCP_SetupDL(&gMasterDisp, effect->unk_44); } gSPDisplayList(gMasterDisp++, effect->unk_74); - if (effect->unk_44 != 0x40) { + if (effect->unk_44 != 64) { RCP_SetupDL(&gMasterDisp, 0x40); } break; @@ -3161,7 +3161,7 @@ void func_effect_80080D04(Effect* effect) { effect->unk_48 = effect->unk_46; } - if (effect->unk_44 != 0x40) { + if (effect->unk_44 != 64) { RCP_SetupDL(&gMasterDisp, effect->unk_44); } @@ -3177,7 +3177,7 @@ void func_effect_80080D04(Effect* effect) { gSPDisplayList(gMasterDisp++, effect->unk_74); } - if (effect->unk_44 != 0x40) { + if (effect->unk_44 != 64) { RCP_SetupDL(&gMasterDisp, 0x40); } break; @@ -3325,7 +3325,7 @@ void func_effect_8008165C(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 scal switch (effect->state) { case 4: - effect->unk_4A = 0xFF; + effect->unk_4A = 255; effect->unk_46 = 1; break; @@ -3337,12 +3337,12 @@ void func_effect_8008165C(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 scal effect->unk_46 = 5; effect->unk_44 = RAND_FLOAT_CENTERED(20.0f) * 1.5f; effect->info.unk_14 = 0; - effect->unk_4A = 0xFF; + effect->unk_4A = 255; break; case 6: - effect->unk_4A = 0xFF; - effect->unk_46 = 0xA; + effect->unk_4A = 255; + effect->unk_46 = 10; break; case 7: @@ -3575,7 +3575,7 @@ void func_effect_80081C5C(Effect* effect) { Object_Kill(&effect->obj, effect->sfxSource); func_effect_8007D0E0(effect->obj.pos.x, effect->obj.pos.y, effect->obj.pos.z, 5.0f); } else if (fabsf(gPlayer[0].unk_138 - effect->obj.pos.z) < 1000.0f) { - func_enmy2_8006F0D8(effect->obj.pos.x, effect->obj.pos.y, effect->obj.pos.z, 15.0f); + ActorEvent_8006F0D8(effect->obj.pos.x, effect->obj.pos.y, effect->obj.pos.z, 15.0f); Object_Kill(&effect->obj, effect->sfxSource); } sp84 = 50.0f; @@ -3677,8 +3677,8 @@ void func_effect_80081C5C(Effect* effect) { gEffects[ARRAY_COUNT(gEffects) - 1].obj.status = gEffects[ARRAY_COUNT(gEffects) - 2].obj.status = OBJ_FREE; func_effect_80081BEC(effect->obj.pos.x, effect->obj.pos.y, effect->obj.pos.z, 1.0f, 10); - D_ctx_80178348 = D_ctx_80178350 = D_ctx_80178354 = 0xFF; - D_ctx_80178340 = D_ctx_80178358 = 0xFF; + D_ctx_80178348 = D_ctx_80178350 = D_ctx_80178354 = 255; + D_ctx_80178340 = D_ctx_80178358 = 255; D_ctx_80178358 = 0; D_ctx_8017835C = 25; effect->timer_50 = 10; @@ -3748,11 +3748,11 @@ void func_effect_80081C5C(Effect* effect) { case 0: D_ctx_801779A8[0] = 50.0f; if (effect->unk_46 == 10) { - D_ctx_80178348 = D_ctx_80178350 = D_ctx_80178354 = 0xFF; - D_ctx_80178340 = D_ctx_80178358 = 0xFF; + D_ctx_80178348 = D_ctx_80178350 = D_ctx_80178354 = 255; + D_ctx_80178340 = D_ctx_80178358 = 255; D_ctx_80178358 = 0; D_ctx_8017835C = 25; - D_ctx_80178480 = 50; + gCameraShake = 50; } if (effect->unk_46 == 0) { D_ctx_80178348 = (D_ctx_80178350 = (D_ctx_80178354 = (D_ctx_80178340 = 0))); @@ -4067,7 +4067,7 @@ void func_effect_80083C70(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 xVel s32 arg8) { Effect_Initialize(effect); effect->obj.status = OBJ_INIT; - effect->obj.id = 0x18F; + effect->obj.id = OBJ_EFFECT_399; effect->obj.pos.x = xPos; effect->unk_60.x = xPos; effect->unk_60.y = yPos; diff --git a/src/engine/fox_enmy.c b/src/engine/fox_enmy.c index 115c6cc9..938296e4 100644 --- a/src/engine/fox_enmy.c +++ b/src/engine/fox_enmy.c @@ -29,32 +29,32 @@ ObjectInit* D_enmy_800CFDA0[] = { D_FO_600EAD4, NULL, D_KA_6011044, D_BO_600FF74, D_SZ_6006EB4, D_VE2_6014D94, D_versus_302DE3C, }; static s32 D_enmy_800CFDF4[] = { - OBJ_80_0, - OBJ_ITEM_SILVER_RING, - OBJ_ITEM_SILVER_RING, - OBJ_ITEM_SILVER_RING, - OBJ_ITEM_SILVER_RING, - OBJ_ITEM_BOMB, - OBJ_ITEM_BOMB, - OBJ_ITEM_BOMB, - OBJ_ITEM_BOMB, - OBJ_ITEM_LASERS, - OBJ_ITEM_LASERS, - OBJ_ITEM_LASERS, - OBJ_ITEM_LASERS, - OBJ_ITEM_1UP, - OBJ_ITEM_GOLD_RING, - OBJ_ITEM_GOLD_RING, - OBJ_ITEM_GOLD_RING, - OBJ_ITEM_GOLD_RING, - OBJ_ITEM_GOLD_RING, - OBJ_ITEM_LASERS, - OBJ_ITEM_BOMB, - OBJ_ITEM_SILVER_RING, - OBJ_ITEM_SILVER_RING, - OBJ_ITEM_WING_REPAIR, - OBJ_80_0, - OBJ_ITEM_SILVER_STAR, + /* 0 */ OBJ_80_0, + /* 1 */ OBJ_ITEM_SILVER_RING, + /* 2 */ OBJ_ITEM_SILVER_RING, + /* 3 */ OBJ_ITEM_SILVER_RING, + /* 4 */ OBJ_ITEM_SILVER_RING, + /* 5 */ OBJ_ITEM_BOMB, + /* 6 */ OBJ_ITEM_BOMB, + /* 7 */ OBJ_ITEM_BOMB, + /* 8 */ OBJ_ITEM_BOMB, + /* 9 */ OBJ_ITEM_LASERS, + /* 10 */ OBJ_ITEM_LASERS, + /* 11 */ OBJ_ITEM_LASERS, + /* 12 */ OBJ_ITEM_LASERS, + /* 13 */ OBJ_ITEM_1UP, + /* 14 */ OBJ_ITEM_GOLD_RING, + /* 15 */ OBJ_ITEM_GOLD_RING, + /* 16 */ OBJ_ITEM_GOLD_RING, + /* 17 */ OBJ_ITEM_GOLD_RING, + /* 18 */ OBJ_ITEM_GOLD_RING, + /* 19 */ OBJ_ITEM_LASERS, + /* 20 */ OBJ_ITEM_BOMB, + /* 21 */ OBJ_ITEM_SILVER_RING, + /* 22 */ OBJ_ITEM_SILVER_RING, + /* 23 */ OBJ_ITEM_WING_REPAIR, + /* 24 */ OBJ_80_0, + /* 25 */ OBJ_ITEM_SILVER_STAR, }; static f32 D_enmy_800CFE5C[] = { 0.0f, 1.0f, 0.5f, 0.33f, 0.25f, 1.0f, 0.5f, 0.33f, 0.25f, 1.0f, 0.5f, 0.33f, 0.25f, @@ -382,10 +382,10 @@ void func_enmy_80061F0C(Actor* actor, ObjectInit* objInit, s32 arg2) { actor->obj.rot.y = actor->unk_0F4.y = objInit->rot.y; actor->obj.rot.x = actor->unk_0F4.x = objInit->rot.x; actor->unk_0F4.z = objInit->rot.z; - actor->obj.id = OBJ_ACTOR_200; + actor->obj.id = OBJ_ACTOR_EVENT; actor->timer_0C2 = 10; actor->unk_0B4 = 4095; - actor->aiType = objInit->id - OBJ_UNK_1000; + actor->aiType = objInit->id - ACTOR_EVENT_ID; Object_SetInfo(&actor->info, actor->obj.id); actor->info.unk_10 = 3000.0f; @@ -434,7 +434,7 @@ void Object_Load(ObjectInit* objInit, f32 arg1, f32 arg2, f32 arg3, f32 arg4) { break; } } - } else if (objInit->id == OBJ_ACTOR_198) { + } else if (objInit->id == OBJ_ACTOR_TEAM_BOSS) { for (i = 0; i < 3; i++) { if (gActors[i].obj.status == OBJ_FREE) { Actor_Load(&gActors[i], objInit); @@ -571,7 +571,7 @@ void func_enmy_80062664(void) { for (i = 0, objInit = &D_ctx_80178310[D_ctx_80177DC8]; i < 10000; i++, D_ctx_80177DC8++, objInit++) { if ((objInit->id > OBJ_INVALID) && D_ctx_80177D20 <= objInit->zPos1 && objInit->zPos1 <= D_ctx_80177D20 + 200.0f) { - if ((gCurrentLevel == LEVEL_VENOM_1) && (objInit->id >= OBJ_UNK_1000)) { + if ((gCurrentLevel == LEVEL_VENOM_1) && (objInit->id >= ACTOR_EVENT_ID)) { if (((objInit->rot.y < 180.0f) && (objInit->xPos < gPlayer[0].unk_0AC)) || ((objInit->rot.y > 180.0f) && (gPlayer[0].unk_0AC < objInit->xPos))) { Object_Load(objInit, var_fs1, var_fs2, var_fs3, var_fs4); @@ -889,7 +889,7 @@ s32 func_enmy_8006351C(s32 index, Vec3f* pos, Vec3f* arg2, s32 arg3) { for (i = 0; i < ARRAY_COUNT(gActors); i++, actor++) { if ((actor->obj.status >= OBJ_ACTIVE) && (fabsf(pos->x - actor->obj.pos.x) < 1000.0f) && (fabsf(pos->z - actor->obj.pos.z) < 1500.0f) && (index != i) && (actor->info.unk_16 != 2) && - ((actor->obj.id != OBJ_ACTOR_197) || (actor->aiType >= 4)) && (actor->timer_0C2 == 0)) { + !((actor->obj.id == OBJ_ACTOR_ALLRANGE) && (actor->aiType <= AI360_PEPPY)) && (actor->timer_0C2 == 0)) { if (actor->obj.id == OBJ_ACTOR_180) { if (func_enmy_8006326C(pos, arg2, actor->obj.id, &actor->obj)) { return 2; @@ -910,8 +910,9 @@ s32 func_enmy_8006351C(s32 index, Vec3f* pos, Vec3f* arg2, s32 arg3) { actor->unk_0D0 = 1; actor->damage = 10; actor->unk_0D2 = -1; - if (!(((actor->obj.id == OBJ_ACTOR_200) && (actor->iwork[12] != 0)) || - ((actor->obj.id == OBJ_ACTOR_197) && ((actor->aiType < 10) || (actor->aiType >= 100))))) { + if (!(((actor->obj.id == OBJ_ACTOR_EVENT) && (actor->iwork[12] != 0)) || + ((actor->obj.id == OBJ_ACTOR_ALLRANGE) && + ((actor->aiType < AI360_10) || (actor->aiType >= AI360_GREAT_FOX))))) { actor->health = 0; } actor->unk_0D8.x = pos->x; @@ -1019,14 +1020,14 @@ void Object_Init(s32 index, ObjectId objId) { case OBJ_80_54: AUDIO_PLAY_SFX(0x11000000, gObjects80[index].sfxSource, 0); break; - case OBJ_ACTOR_198: - func_hud_80092D48(&gActors[index]); + case OBJ_ACTOR_TEAM_BOSS: + ActorTeamBoss_Init(&gActors[index]); break; case OBJ_ACTOR_235: gActors[index].fwork[10] = fabsf(Math_ModF(gActors[index].obj.pos.x, 100.0f)); break; case OBJ_ACTOR_247: - Zoness_8019D060(&gActors[index]); + Zoness_Actor247_Init(&gActors[index]); break; case OBJ_EFFECT_368: if (gCurrentLevel == LEVEL_TITANIA) { @@ -1178,13 +1179,13 @@ void Object_Init(s32 index, ObjectId objId) { gActors[index].unk_0C9 = 1; break; case OBJ_BOSS_320: - Andross_8018D16C(&gBosses[index]); + Andross_Boss320_Init(&gBosses[index]); break; case OBJ_BOSS_316: - Katina_80193CA4(&gBosses[index]); + Katina_Boss316_Init(&gBosses[index]); break; case OBJ_BOSS_314: - SectorY_80197CC4(&gBosses[index]); + SectorY_Boss314_Init(&gBosses[index]); break; case OBJ_ACTOR_205: case OBJ_ACTOR_206: @@ -1227,25 +1228,25 @@ void Object_Init(s32 index, ObjectId objId) { AUDIO_PLAY_SFX(0x31000016, gActors[index].sfxSource, 4); break; case OBJ_BOSS_297: - Meteo_80188A40(&gBosses[index]); + Meteo_Boss297_Init(&gBosses[index]); break; case OBJ_BOSS_299: - func_boss_80042FAC(&gBosses[index]); + Boss299_Init(&gBosses[index]); break; case OBJ_BOSS_300: - func_boss_80042FD0(&gBosses[index]); + Boss300_Init(&gBosses[index]); break; case OBJ_BOSS_292: - Corneria_801878D8(&gBosses[index]); + Corneria_Boss292_Init(&gBosses[index]); break; case OBJ_BOSS_293: - Corneria_8018BE7C(&gBosses[index]); + Corneria_Boss293_Init(&gBosses[index]); break; case OBJ_BOSS_A6: - Area6_80187754(&gBosses[index]); + Area6_BossA6_Init(&gBosses[index]); break; case OBJ_ACTOR_231: - Titania_8018B96C(&gActors[index]); + Titania_Actor231_Init(&gActors[index]); break; case OBJ_ACTOR_232: Titania_8018ADC4(&gActors[index]); @@ -1266,7 +1267,7 @@ void Object_Init(s32 index, ObjectId objId) { Titania_8018EFF0(&gObjects4C[index]); break; case OBJ_BOSS_306: - Titania_8018FA48(&gBosses[index]); + Titania_Boss306_Init(&gBosses[index]); break; case OBJ_ACTOR_240: Zoness_801915A4(&gActors[index]); @@ -1275,7 +1276,7 @@ void Object_Init(s32 index, ObjectId objId) { Zoness_80191BB8(&gActors[index]); break; case OBJ_BOSS_ZO: - Zoness_801932AC(&gBosses[index]); + Zoness_BossZo_Init(&gBosses[index]); break; case OBJ_ACTOR_250: Zoness_8019B1F0(&gActors[index]); @@ -1296,7 +1297,7 @@ void Object_Init(s32 index, ObjectId objId) { Aquas_801AF9FC(&gActors[index]); break; case OBJ_BOSS_AQ: - Aquas_801B10F8(&gBosses[index]); + Aquas_BossAq_Init(&gBosses[index]); break; case OBJ_ACTOR_259: Aquas_801B6344(&gActors[index]); @@ -1311,7 +1312,7 @@ void Object_Init(s32 index, ObjectId objId) { Titania_8018F0D8(&gObjects80[index]); break; case OBJ_BOSS_319: - Venom1_801935CC(&gBosses[index]); + Venom1_Boss319_Init(&gBosses[index]); break; case OBJ_ACTOR_280: Venom1_8019250C(&gActors[index]); @@ -1361,7 +1362,7 @@ void func_enmy_80065380(Actor* actor, f32 xPos, f32 yPos, f32 zPos, f32 arg4, f3 actor->obj.pos.x = xPos; actor->obj.pos.y = yPos; actor->obj.pos.z = zPos; - actor->unk_046 = 0xFF; + actor->unk_046 = 255; actor->unk_048 = 900; actor->obj.rot.z = RAND_FLOAT(360.0f); actor->obj.rot.y = RAND_FLOAT(360.0f); @@ -1582,16 +1583,16 @@ void func_enmy_800656D4(Actor* actor) { func_effect_8007D2C8(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 3.0f); Object_Kill(&actor->obj, actor->sfxSource); if (actor->unk_0D0 != 0) { - actor->unk_044 = 2; + actor->itemDrop = DROP_SILVER_RING_50p; if ((gCurrentLevel == LEVEL_CORNERIA)) { if (gLevelMode == LEVELMODE_ALL_RANGE) { - actor->unk_044 = 2; + actor->itemDrop = DROP_SILVER_RING_50p; } else { - actor->unk_044 = 4; + actor->itemDrop = DROP_SILVER_RING_25p; } } if (gCurrentLevel == LEVEL_AREA_6) { - actor->unk_044 = 22; + actor->itemDrop = DROP_SILVER_RING_10p; } func_enmy_80066254(actor); } @@ -1615,7 +1616,7 @@ void func_enmy_800660F0(Actor* actor) { if (item->obj.status == OBJ_FREE) { Item_Initialize(item); item->obj.status = OBJ_INIT; - item->obj.id = D_enmy_800CFDF4[actor->unk_044]; + item->obj.id = D_enmy_800CFDF4[actor->itemDrop]; item->obj.pos.x = actor->obj.pos.x; item->obj.pos.y = actor->obj.pos.y; item->obj.pos.z = actor->obj.pos.z; @@ -1647,12 +1648,12 @@ void func_enmy_80066254(Actor* actor) { !((D_versus_80178768[0] == 0) && (D_versus_80178768[1] == 0) && (D_versus_80178768[2] == 0))) { D_ctx_80177C30[actor->unk_0D4 - 1] += actor->info.bonus; } - } else if ((actor->obj.id != OBJ_ACTOR_197) || (actor->unk_0B6 != 1)) { + } else if ((actor->obj.id != OBJ_ACTOR_ALLRANGE) || (actor->unk_0B6 != 1)) { if ((actor->unk_0D4 == 1) && (actor->info.bonus != 0)) { gHitCount += actor->info.bonus; D_ctx_80177850 = 15; - if ((gLevelMode == LEVELMODE_ALL_RANGE) && (D_play_80161A62 != 0)) { - switch (D_play_80161A62) { + if ((gLevelMode == LEVELMODE_ALL_RANGE) && (gDropHitCountItem != 0)) { + switch (gDropHitCountItem) { case 9: if (gCurrentLevel == LEVEL_KATINA) { Radio_PlayMessage(gMsg_ID_18031, RCID_BILL); @@ -1661,22 +1662,22 @@ void func_enmy_80066254(Actor* actor) { case 4: case 19: case 29: - actor->unk_044 = 14; + actor->itemDrop = DROP_GOLD_RING_1; break; case 14: - actor->unk_044 = 9; + actor->itemDrop = DROP_LASERS; break; } - D_play_80161A62 = 0; + gDropHitCountItem = 0; } - if (actor->obj.id == OBJ_ACTOR_197) { - if ((actor->aiType >= 4) && (actor->aiType < 8)) { + if (actor->obj.id == OBJ_ACTOR_ALLRANGE) { + if ((actor->aiType >= AI360_WOLF) && (actor->aiType < AI360_KATT)) { func_360_8002E3E0(actor); } } } - if (actor->unk_044) { - if (D_enmy_800CFE5C[actor->unk_044] < 0.0f) { + if (actor->itemDrop) { + if (D_enmy_800CFE5C[actor->itemDrop] < 0.0f) { otherActor = gActors; for (i = 0, otherActor = gActors; i < ARRAY_COUNT(gActors); i++, otherActor++) { if ((otherActor->obj.status != OBJ_FREE) && (otherActor->index != actor->index) && @@ -1686,7 +1687,7 @@ void func_enmy_80066254(Actor* actor) { } func_enmy_800660F0(actor); AUDIO_PLAY_SFX(0x4900000C, gDefaultSfxSource, 4); - } else if (actor->unk_044 == 24) { + } else if (actor->itemDrop == DROP_TEAM_MESG) { if (gTeamShields[3] > 0) { Radio_PlayMessage(gMsg_ID_20261, RCID_PEPPY); } else if (gTeamShields[2] > 0) { @@ -1694,7 +1695,7 @@ void func_enmy_80066254(Actor* actor) { } else if (gTeamShields[1] > 0) { Radio_PlayMessage(gMsg_ID_20262, RCID_FALCO); } - } else if (Rand_ZeroOne() <= D_enmy_800CFE5C[actor->unk_044]) { + } else if (Rand_ZeroOne() <= D_enmy_800CFE5C[actor->itemDrop]) { func_enmy_800660F0(actor); } } @@ -1718,15 +1719,15 @@ void func_enmy_8006654C(Actor* actor) { if (Animation_GetFrameCount(&D_CO_6029528) < actor->unk_0B6) { actor->unk_0B6 = 0; } - if ((actor->obj.rot.z < 15.0f) && (actor->unk_0B6 < 0x14)) { + if ((actor->obj.rot.z < 15.0f) && (actor->unk_0B6 < 20)) { actor->obj.rot.z += 1.0f; } - if ((actor->obj.rot.z > -15.0f) && (actor->unk_0B6 >= 0x15)) { + if ((actor->obj.rot.z > -15.0f) && (actor->unk_0B6 > 20)) { actor->obj.rot.z -= 1.0f; } - if ((actor->unk_0B6 == 0x14) || (actor->unk_0B6 == 0x28)) { + if ((actor->unk_0B6 == 20) || (actor->unk_0B6 == 40)) { actor->state++; - actor->timer_0BC = 0x14; + actor->timer_0BC = 20; } break; case 1: @@ -1767,7 +1768,7 @@ void func_enmy_8006684C(Actor* actor) { actor->vel.y = 0.0f; if (actor->timer_0BE == 1) { Object_Kill(&actor->obj, actor->sfxSource); - actor->unk_044 = 1; + actor->itemDrop = DROP_SILVER_RING; func_enmy_80066254(actor); AUDIO_PLAY_SFX(0x2903B009, actor->sfxSource, 4); BonusText_Display(actor->obj.pos.x, actor->obj.pos.y + 250.0f, actor->obj.pos.z, 3); @@ -1859,7 +1860,7 @@ void func_enmy_80066D5C(Object_80* obj80) { obj80->unk_44 = 40; func_enmy_80066A8C(obj80); obj80->state = 0; - D_ctx_80178480 = 25; + gCameraShake = 25; AUDIO_PLAY_SFX(0x19130003, obj80->sfxSource, 4); } break; @@ -1982,7 +1983,7 @@ void func_enmy_800674B4(f32 xPos, f32 yPos, f32 zPos, f32 xRot, f32 yRot, f32 ar } } -void func_enmy_8006753C(Actor* actor) { +void ActorSupplies_Update(Actor* actor) { Player* player = &gPlayer[0]; s32 i; @@ -2004,13 +2005,13 @@ void func_enmy_8006753C(Actor* actor) { func_effect_8007D2C8(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 5.0f); if (((player[0].wings.rightState <= WINGSTATE_BROKEN) || (player[0].wings.leftState <= WINGSTATE_BROKEN)) && (player[0].form != FORM_LANDMASTER)) { - actor->unk_044 = 23; + actor->itemDrop = DROP_WING_REPAIR; } else if (gPlayer[0].shields < 128) { - actor->unk_044 = 25; + actor->itemDrop = DROP_SILVER_STAR; } else if ((gLaserStrength[0] == LASERS_SINGLE) && (player[0].form != FORM_LANDMASTER)) { - actor->unk_044 = 9; + actor->itemDrop = DROP_LASERS; } else { - actor->unk_044 = 5; + actor->itemDrop = DROP_BOMB; } func_enmy_80066254(actor); for (i = 0; i < 6; i++) { @@ -2031,7 +2032,7 @@ void func_enmy_8006753C(Actor* actor) { gRadarMarks[63].unk_10 = 0.0f; } -void func_enmy_80067874(Actor* actor) { +void ActorSupplies_Draw(Actor* actor) { s32 i; Lights_SetOneLight(&gMasterDisp, -60, -60, 60, 150, 150, 150, 20, 20, 20); @@ -2065,7 +2066,7 @@ void func_enmy_80067A40(void) { } } -void func_enmy_80067B1C(Item* item) { +void Item1up_Update(Item* item) { func_enmy_80066EF0(item); func_enmy_800671D0(item); if (item->collected) { @@ -2080,7 +2081,7 @@ void func_enmy_80067B1C(Item* item) { } } -void func_enmy_80067BEC(Item* item) { +void ItemPickup_Update(Item* item) { func_enmy_80066EF0(item); func_enmy_800671D0(item); if (item->state == 0) { @@ -2134,7 +2135,7 @@ void func_enmy_80067BEC(Item* item) { } } -void func_enmy_80067F6C(Item* item) { +void ItemLasers_Update(Item* item) { if (!gVersusMode && ((gPlayer[0].wings.leftState <= WINGSTATE_BROKEN) || (gPlayer[0].wings.rightState <= WINGSTATE_BROKEN))) { item->obj.id = OBJ_ITEM_WING_REPAIR; @@ -2142,11 +2143,11 @@ void func_enmy_80067F6C(Item* item) { item->timer_48 = 2000; AUDIO_PLAY_SFX(0x1900302B, item->sfxSource, 0); } else { - func_enmy_80067BEC(item); + ItemPickup_Update(item); } } -void func_enmy_80068020(Item* item) { +void ItemSupplyRing_Update(Item* item) { Vec3f sp4C; Vec3f sp40; @@ -2159,7 +2160,7 @@ void func_enmy_80068020(Item* item) { item->state = 1; item->timer_48 = 50; if (item->obj.id == OBJ_ITEM_SILVER_RING) { - gPlayer[item->playerNum].heal += 0x20; + gPlayer[item->playerNum].heal += 32; func_enmy_80060F30(gPlayer[item->playerNum].sfxSource, 0x4900200E, item->playerNum); } else if (item->obj.id == OBJ_ITEM_GOLD_RING) { gGoldRingCount[0]++; @@ -2170,15 +2171,15 @@ void func_enmy_80068020(Item* item) { if (gCurrentLevel != LEVEL_TRAINING) { gLifeCount[item->playerNum]++; } - gPlayer[item->playerNum].heal += 0x20; + gPlayer[item->playerNum].heal += 32; BonusText_Display(gPlayer[item->playerNum].pos.x, gPlayer[item->playerNum].pos.y, gPlayer[item->playerNum].unk_138, BONUS_TEXT_1UP); } else { - gPlayer[item->playerNum].heal += 0x20; + gPlayer[item->playerNum].heal += 32; func_enmy_80060F30(gPlayer[item->playerNum].sfxSource, 0x49003013, item->playerNum); } } else { - gPlayer[item->playerNum].heal += 0x80; + gPlayer[item->playerNum].heal += 128; func_enmy_80060F30(gPlayer[item->playerNum].sfxSource, 0x4900200D, item->playerNum); } } @@ -2223,15 +2224,15 @@ void func_enmy_80068020(Item* item) { } } -void func_enmy_800685D8(Item* item) { - func_enmy_80068020(item); +void ItemSilverStar_Update(Item* item) { + ItemSupplyRing_Update(item); } -void func_enmy_800685F8(Item* item) { - func_enmy_80068020(item); +void ItemGoldRing_Update(Item* item) { + ItemSupplyRing_Update(item); } -void func_enmy_80068618(Item* item) { +void ItemWingRepair_Update(Item* item) { func_enmy_80066EF0(item); func_enmy_800671D0(item); if (item->collected) { @@ -2243,7 +2244,7 @@ void func_enmy_80068618(Item* item) { } } -void func_enmy_80068688(Item* item) { +void ItemMeteoWarp_Update(Item* item) { func_enmy_80066EF0(item); if (item->state > 0) { if (item->state == 1) { @@ -2285,7 +2286,7 @@ void func_enmy_80068688(Item* item) { } } -void func_enmy_80068914(Item* item) { +void ItemCheckpoint_Update(Item* item) { s32 i; func_enmy_80066EF0(item); @@ -2320,7 +2321,7 @@ void func_enmy_80068914(Item* item) { gPlayer[item->playerNum].heal = 128; item->state++; item->timer_48 = 15; - D_80161A8C = D_80161A88; + D_ctx_80161A8C = D_ctx_80161A88; D_ctx_80177CB0 = -item->obj.pos.z; D_ctx_80177CB0 -= 250.0f; D_ctx_80177CA0 = D_ctx_80177DC8; @@ -2361,13 +2362,13 @@ void func_enmy_80068C88(Item* item) { case OBJ_ITEM_333: break; case OBJ_ITEM_328: - gPlayer[0].unk_228 = 0x30; + gPlayer[0].flags_228 = 0x30; break; case OBJ_ITEM_329: - gPlayer[0].unk_228 = 0x20; + gPlayer[0].flags_228 = 0x20; break; case OBJ_ITEM_330: - gPlayer[0].unk_228 = 0x10; + gPlayer[0].flags_228 = 0x10; break; } } @@ -2435,12 +2436,12 @@ void func_enmy_80068FE0(Object_4C* obj4C) { } } -void func_enmy_800690D0(s32 index, ObjectId objId) { +void Object_Dying(s32 index, ObjectId objId) { switch (objId) { - case OBJ_ACTOR_200: - func_enmy2_8007717C(&gActors[index]); + case OBJ_ACTOR_EVENT: + ActorEvent_Dying(&gActors[index]); break; - case OBJ_ACTOR_197: + case OBJ_ACTOR_ALLRANGE: if (gCurrentLevel == LEVEL_VENOM_ANDROSS) { Andross_801888F4(&gActors[index]); } else { @@ -2451,7 +2452,7 @@ void func_enmy_800690D0(s32 index, ObjectId objId) { func_enmy2_800763A4(&gActors[index]); break; case OBJ_ACTOR_194: - func_enmy2_8006B0A0(&gActors[index]); + Actor194_Init(&gActors[index]); break; case OBJ_ACTOR_186: Meteo_80187B08(&gActors[index]); @@ -2486,12 +2487,12 @@ void func_enmy_800693E8(Actor* actor) { actor->obj.pos.y += actor->vel.y; actor->vel.y -= actor->gravity; - if ((D_80161AB8 != 0) && (actor->obj.id != OBJ_ACTOR_198) && - ((gCurrentLevel != LEVEL_MACBETH) || (actor->obj.id == OBJ_ACTOR_200))) { + if ((D_ctx_80161AB8 != 0) && (actor->obj.id != OBJ_ACTOR_TEAM_BOSS) && + ((gCurrentLevel != LEVEL_MACBETH) || (actor->obj.id == OBJ_ACTOR_EVENT))) { f32 var_fv0 = 4000.0f; if ((actor->obj.id == OBJ_ACTOR_236) || (gCurrentLevel == LEVEL_MACBETH) || - ((actor->obj.id == OBJ_ACTOR_200) && (actor->unk_0B4 == 56))) { + ((actor->obj.id == OBJ_ACTOR_EVENT) && (actor->unk_0B4 == 56))) { var_fv0 = 8000.0f; } else if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_8) { var_fv0 = 100000.0f; @@ -2512,7 +2513,7 @@ void func_enmy_800693E8(Actor* actor) { case OBJ_ACTOR_194: D_ctx_80176550[actor->unk_046] = 0; break; - case OBJ_ACTOR_200: + case OBJ_ACTOR_EVENT: if ((actor->unk_0B4 >= 200) && (actor->unk_0B4 < 300)) { D_ctx_80176550[actor->unk_046] = 0; } else if ((actor->unk_0B4 == 38) && (actor->unk_046 != 2)) { @@ -2532,7 +2533,7 @@ void func_enmy_80069658(Boss* boss) { boss->obj.pos.y += boss->vel.y; boss->obj.pos.z += boss->vel.z; boss->vel.y -= boss->gravity; - if ((D_80161AB8 != 0) && ((boss->obj.pos.z + D_ctx_80177D20) > (boss->info.unk_10 - gPlayer[0].camEye.z))) { + if ((D_ctx_80161AB8 != 0) && ((boss->obj.pos.z + D_ctx_80177D20) > (boss->info.unk_10 - gPlayer[0].camEye.z))) { if (gPlayer[0].camEye.z) {} // fake Object_Kill(&boss->obj, boss->sfxSource); } @@ -2563,7 +2564,7 @@ void func_enmy_800696F8(Object_80* obj80) { } void func_enmy_80069858(Object_4C* obj4C) { - if (D_80161AB8 != 0) { + if (D_ctx_80161AB8 != 0) { f32 temp_fv0 = fabsf(obj4C->obj.pos.x - gPlayer[0].camEye.x); f32 var_fa0 = 500.0f; @@ -2583,7 +2584,7 @@ void func_enmy_80069924(Effect* effect) { effect->obj.pos.x += effect->vel.x; effect->obj.pos.y += effect->vel.y; effect->obj.pos.z += effect->vel.z; - if (D_80161AB8 != 0) { + if (D_ctx_80161AB8 != 0) { if ((gPlayer[0].camEye.z + effect->info.unk_10) < (effect->obj.pos.z + D_ctx_80177D20)) { Object_Kill(&effect->obj, effect->sfxSource); } else if ((fabsf(effect->obj.pos.y - gPlayer[0].camEye.y) > 25000.0f) || @@ -2594,7 +2595,7 @@ void func_enmy_80069924(Effect* effect) { } void func_enmy_80069A10(Item* item) { - if (D_80161AB8 != 0) { + if (D_ctx_80161AB8 != 0) { f32 temp = (0.0f - gPlayer[0].camEye.z); if ((item->info.unk_10 - temp) < (item->obj.pos.z + D_ctx_80177D20)) { @@ -2659,7 +2660,7 @@ void Actor_Update(Actor* actor) { case OBJ_DYING: func_enmy_800693E8(actor); if (actor->obj.status != OBJ_FREE) { - func_enmy_800690D0(actor->index, actor->obj.id); + Object_Dying(actor->index, actor->obj.id); } break; } @@ -2702,7 +2703,7 @@ void Boss_Update(Boss* boss) { case OBJ_DYING: func_enmy_80069658(boss); if (boss->obj.status != OBJ_FREE) { - func_enmy_800690D0(boss->index, boss->obj.id); + Object_Dying(boss->index, boss->obj.id); } break; } @@ -2742,7 +2743,7 @@ void Object_4C_Update(Object_4C* obj4C) { break; case OBJ_DYING: func_enmy_80069858(obj4C); - func_enmy_800690D0(obj4C->index, obj4C->obj.id); + Object_Dying(obj4C->index, obj4C->obj.id); break; } } @@ -2860,12 +2861,12 @@ void Object_UpdateAll(void) { Item* item; Effect* effect; - D_80161AB8 = 0; + D_ctx_80161AB8 = 0; if ((gLevelMode == LEVELMODE_ON_RAILS) && ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_1) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_3) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_4) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_8) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_9) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_6))) { - D_80161AB8 = 1; + D_ctx_80161AB8 = 1; } if (gLevelMode != LEVELMODE_ALL_RANGE) { if ((D_ctx_80178488 != 0) && (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_2)) { diff --git a/src/engine/fox_enmy2.c b/src/engine/fox_enmy2.c index 7a981ad3..e8f103f3 100644 --- a/src/engine/fox_enmy2.c +++ b/src/engine/fox_enmy2.c @@ -25,7 +25,7 @@ s32 D_enmy2_800CFF80[4] = { 0, 0, 0, 0 }; s32 D_enmy2_800CFF90 = 0; s32 D_enmy2_80161690; -void func_enmy2_8006A7B0(u16* msg, s32 character) { +void ActorEvent_SetMessage(u16* msg, s32 character) { PRINTF("Enm->obj.pos.y + tmp_xyz.y=<%10.3f>\n"); if ((gRadioState == 0) || (D_ctx_80177D68 != character)) { Radio_PlayMessage(msg, character); @@ -69,13 +69,13 @@ void func_enmy2_8006A900(f32 xPos, f32 yPos, f32 zPos, f32 arg3) { } } -void func_enmy2_8006A96C(Actor* actor) { +void Actor237_Update(Actor* this) { } -void func_enmy2_8006A978(Actor* actor) { +void Actor237_Draw(Actor* this) { } -void func_enmy2_8006A984(Effect* effect, f32 xPos, f32 yPos, f32 zPos) { +void Ovj54_8006A984(Effect* effect, f32 xPos, f32 yPos, f32 zPos) { Effect_Initialize(effect); effect->obj.status = OBJ_INIT; effect->obj.id = OBJ_EFFECT_365; @@ -92,144 +92,143 @@ void func_enmy2_8006A984(Effect* effect, f32 xPos, f32 yPos, f32 zPos) { Object_SetInfo(&effect->info, effect->obj.id); } -void func_enmy2_8006AA3C(f32 xPos, f32 yPos, f32 zPos) { +void Obj54_8006AA3C(f32 xPos, f32 yPos, f32 zPos) { s32 i; for (i = 0; i < ARRAY_COUNT(gEffects); i++) { if (gEffects[i].obj.status == OBJ_FREE) { - func_enmy2_8006A984(&gEffects[i], xPos, yPos, zPos); + Ovj54_8006A984(&gEffects[i], xPos, yPos, zPos); break; } } } -void func_enmy2_8006AA98(Object_80* obj80) { +void Obj54_Update(Object_80* this) { Vec3f sp24; Vec3f sp18; Texture_Scroll(D_CO_60038F8, 32, 32, 1); if ((gGameFrameCount % 4) == 0) { - Matrix_RotateY(gCalcMatrix, obj80->obj.rot.y * M_DTOR, 0); + Matrix_RotateY(gCalcMatrix, this->obj.rot.y * M_DTOR, 0); sp18.x = RAND_FLOAT_CENTERED(700.0f); sp18.y = RAND_FLOAT(50.0f); sp18.z = 700.0f; Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp18, &sp24); - func_enmy2_8006AA3C(obj80->obj.pos.x + sp24.x, obj80->obj.pos.y + sp24.y + 50.0f, obj80->obj.pos.z + sp24.z); + Obj54_8006AA3C(this->obj.pos.x + sp24.x, this->obj.pos.y + sp24.y + 50.0f, this->obj.pos.z + sp24.z); } } -bool func_enmy2_8006ABA4(Actor* actor) { - if ((fabsf(actor->obj.pos.x - gPlayer[0].pos.x) < 700.0f) && - (fabsf(actor->obj.pos.y - gPlayer[0].pos.y) < 700.0f)) { +bool Actor201_8006ABA4(Actor* this) { + if ((fabsf(this->obj.pos.x - gPlayer[0].pos.x) < 700.0f) && (fabsf(this->obj.pos.y - gPlayer[0].pos.y) < 700.0f)) { return true; } return false; } -void func_enmy2_8006AC08(Actor* actor) { +void Actor201_Update(Actor* this) { f32 sp2C; - if (func_enmy2_8006ABA4(actor) && (actor->timer_0BC == 0)) { - func_effect_8007F11C(OBJ_EFFECT_353, actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, D_ctx_80177828); - actor->timer_0BC = 20; + if (Actor201_8006ABA4(this) && (this->timer_0BC == 0)) { + func_effect_8007F11C(OBJ_EFFECT_353, this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, D_ctx_80177828); + this->timer_0BC = 20; } - sp2C = actor->obj.pos.z + D_ctx_80177D20; - actor->obj.rot.y = Math_RadToDeg(Math_Atan2F(gPlayer[0].camEye.x - actor->obj.pos.x, gPlayer[0].camEye.z - sp2C)); - actor->obj.rot.x = - -Math_RadToDeg(Math_Atan2F(gPlayer[0].camEye.y - actor->obj.pos.y, - sqrtf(SQ(gPlayer[0].camEye.z - sp2C) + SQ(gPlayer[0].camEye.x - actor->obj.pos.x)))); + sp2C = this->obj.pos.z + D_ctx_80177D20; + this->obj.rot.y = Math_RadToDeg(Math_Atan2F(gPlayer[0].camEye.x - this->obj.pos.x, gPlayer[0].camEye.z - sp2C)); + this->obj.rot.x = + -Math_RadToDeg(Math_Atan2F(gPlayer[0].camEye.y - this->obj.pos.y, + sqrtf(SQ(gPlayer[0].camEye.z - sp2C) + SQ(gPlayer[0].camEye.x - this->obj.pos.x)))); } -void func_enmy2_8006AD18(Actor* actor) { +void Actor202_Update(Actor* this) { bool sp34; - actor->gravity = 1.5f; + this->gravity = 1.5f; sp34 = false; - actor->obj.rot.y = Math_RadToDeg( - Math_Atan2F(gPlayer[gPlayerNum].pos.x - actor->obj.pos.x, gPlayer[gPlayerNum].unk_138 - actor->obj.pos.z)); - if (actor->obj.pos.y < -500.0f) { - actor->obj.pos.y = -500.0f; - actor->vel.y = 0.0f; - actor->vel.x = 0.0f; - actor->vel.z = 0.0f; + this->obj.rot.y = Math_RadToDeg( + Math_Atan2F(gPlayer[gPlayerNum].pos.x - this->obj.pos.x, gPlayer[gPlayerNum].unk_138 - this->obj.pos.z)); + if (this->obj.pos.y < -500.0f) { + this->obj.pos.y = -500.0f; + this->vel.y = 0.0f; + this->vel.x = 0.0f; + this->vel.z = 0.0f; sp34 = true; - actor->iwork[1] = true; + this->iwork[1] = true; } if (!(gGameFrameCount & 0x1F)) { - func_effect_8007F11C(OBJ_EFFECT_353, actor->obj.pos.x, actor->obj.pos.y + 180.0f, actor->obj.pos.z, + func_effect_8007F11C(OBJ_EFFECT_353, this->obj.pos.x, this->obj.pos.y + 180.0f, this->obj.pos.z, D_ctx_80177828); } - switch (actor->state) { + switch (this->state) { case 0: - actor->unk_0B6++; + this->unk_0B6++; - if (actor->unk_0B6 >= 30) { - actor->unk_0B6 = 0; + if (this->unk_0B6 >= 30) { + this->unk_0B6 = 0; } - if (actor->unk_0B6 == 0x15) { - actor->state = 1; + if (this->unk_0B6 == 21) { + this->state = 1; - actor->vel.y = 40.0f; - actor->vel.z = -40.0f; - actor->vel.x = 10.0f; + this->vel.y = 40.0f; + this->vel.z = -40.0f; + this->vel.x = 10.0f; - actor->iwork[0] = 1 - actor->iwork[0]; + this->iwork[0] = 1 - this->iwork[0]; - if (actor->iwork[0]) { - actor->vel.x *= -1.0f; + if (this->iwork[0]) { + this->vel.x *= -1.0f; } - if (actor->iwork[1]) { - actor->vel.x = 0.0f; - actor->vel.z = -20.0f; + if (this->iwork[1]) { + this->vel.x = 0.0f; + this->vel.z = -20.0f; } } break; case 1: - if (actor->vel.y > 10.0f) { - actor->unk_0B6++; - if (actor->unk_0B6 >= 30) { - actor->unk_0B6 = 29; + if (this->vel.y > 10.0f) { + this->unk_0B6++; + if (this->unk_0B6 >= 30) { + this->unk_0B6 = 29; } } else { - actor->unk_0B6--; - if (actor->unk_0B6 < 0) { - actor->unk_0B6 = 0; + this->unk_0B6--; + if (this->unk_0B6 < 0) { + this->unk_0B6 = 0; } } if (sp34) { - actor->state = 0; + this->state = 0; } break; } - if (actor->unk_0D0 != 0) { - actor->health -= 10; - if ((actor->health <= 0) || (actor->unk_0D0 >= 2)) { - func_effect_8007D2C8(actor->obj.pos.x, actor->obj.pos.y + 180.0f, actor->obj.pos.z, 10.0f); - func_effect_8007BFFC(actor->obj.pos.x, actor->obj.pos.y + 180.0f, actor->obj.pos.z, actor->vel.x, - actor->vel.y, actor->vel.z, 8.0f, 30); - Object_Kill(&actor->obj, actor->sfxSource); - func_effect_8007A6F0(&actor->obj.pos, 0x2903A008); - gHitCount += actor->info.bonus; + if (this->unk_0D0 != 0) { + this->health -= 10; + if ((this->health <= 0) || (this->unk_0D0 >= 2)) { + func_effect_8007D2C8(this->obj.pos.x, this->obj.pos.y + 180.0f, this->obj.pos.z, 10.0f); + func_effect_8007BFFC(this->obj.pos.x, this->obj.pos.y + 180.0f, this->obj.pos.z, this->vel.x, this->vel.y, + this->vel.z, 8.0f, 30); + Object_Kill(&this->obj, this->sfxSource); + func_effect_8007A6F0(&this->obj.pos, 0x2903A008); + gHitCount += this->info.bonus; D_ctx_80177850 = 15; } else { - actor->unk_0D0 = 0; - actor->timer_0C6 = 20; - AUDIO_PLAY_SFX(0x2903300E, actor->sfxSource, 4); - func_effect_8007D1E0(actor->obj.pos.x, actor->obj.pos.y + 180.0f, actor->obj.pos.z, 5.0f); + this->unk_0D0 = 0; + this->timer_0C6 = 20; + AUDIO_PLAY_SFX(0x2903300E, this->sfxSource, 4); + func_effect_8007D1E0(this->obj.pos.x, this->obj.pos.y + 180.0f, this->obj.pos.z, 5.0f); } } } -void func_enmy2_8006B094(Actor* actor) { +void Actor194_Update(Actor* this) { } static s16 D_800CFF94[16] = { @@ -241,57 +240,57 @@ static f32 D_800CFFC4[16] = { }; static Gfx* D_800D0004[3] = { D_ENMY_SPACE_4000170, D_ENMY_SPACE_40084D0, D_ENMY_SPACE_400A630 }; -void func_enmy2_8006B0A0(Actor* actor) { +void Actor194_Init(Actor* this) { Vec3f sp34; s32 temp_hi; - actor->unk_04E++; + this->unk_04E++; - if (actor->unk_04E >= 100) { - actor->unk_04E = 0; + if (this->unk_04E >= 100) { + this->unk_04E = 0; } - D_ctx_80176558[actor->unk_046][actor->unk_04E] = actor->obj.pos.x; - D_ctx_80176878[actor->unk_046][actor->unk_04E] = actor->obj.pos.y; - D_ctx_80176B98[actor->unk_046][actor->unk_04E] = actor->obj.pos.z; - D_ctx_80176EB8[actor->unk_046][actor->unk_04E] = actor->obj.rot.x; - D_ctx_801771D8[actor->unk_046][actor->unk_04E] = actor->obj.rot.y; - D_ctx_80177500[actor->unk_046][actor->unk_04E] = actor->obj.rot.z; + D_ctx_80176558[this->unk_046][this->unk_04E] = this->obj.pos.x; + D_ctx_80176878[this->unk_046][this->unk_04E] = this->obj.pos.y; + D_ctx_80176B98[this->unk_046][this->unk_04E] = this->obj.pos.z; + D_ctx_80176EB8[this->unk_046][this->unk_04E] = this->obj.rot.x; + D_ctx_801771D8[this->unk_046][this->unk_04E] = this->obj.rot.y; + D_ctx_80177500[this->unk_046][this->unk_04E] = this->obj.rot.z; - actor->obj.rot.x -= 10.0f; - actor->obj.rot.y += 3.0f; - actor->obj.rot.z += 5.0f; + this->obj.rot.x -= 10.0f; + this->obj.rot.y += 3.0f; + this->obj.rot.z += 5.0f; - Math_Vec3fFromAngles(&sp34, actor->obj.rot.x, actor->obj.rot.y, 40.0f); + Math_Vec3fFromAngles(&sp34, this->obj.rot.x, this->obj.rot.y, 40.0f); - actor->vel.x = sp34.x; - actor->vel.y = sp34.y; - actor->vel.z = sp34.z; + this->vel.x = sp34.x; + this->vel.y = sp34.y; + this->vel.z = sp34.z; - if ((actor->timer_0BC == 0) && !(gGameFrameCount & 3)) { - temp_hi = (D_800CFF94[actor->unk_04A] + actor->unk_04E) % 100; - if (actor->unk_04A == 0) { - func_effect_8007D2C8(D_ctx_80176558[actor->unk_046][temp_hi], D_ctx_80176878[actor->unk_046][temp_hi], - D_ctx_80176B98[actor->unk_046][temp_hi], 7.0f); + if ((this->timer_0BC == 0) && !(gGameFrameCount & 3)) { + temp_hi = (D_800CFF94[this->unk_04A] + this->unk_04E) % 100; + if (this->unk_04A == 0) { + func_effect_8007D2C8(D_ctx_80176558[this->unk_046][temp_hi], D_ctx_80176878[this->unk_046][temp_hi], + D_ctx_80176B98[this->unk_046][temp_hi], 7.0f); } else { - func_effect_8007D2C8(D_ctx_80176558[actor->unk_046][temp_hi], D_ctx_80176878[actor->unk_046][temp_hi], - D_ctx_80176B98[actor->unk_046][temp_hi], 4.0f); + func_effect_8007D2C8(D_ctx_80176558[this->unk_046][temp_hi], D_ctx_80176878[this->unk_046][temp_hi], + D_ctx_80176B98[this->unk_046][temp_hi], 4.0f); } - AUDIO_PLAY_SFX(0x2903B009, actor->sfxSource, 4); - actor->unk_04A++; + AUDIO_PLAY_SFX(0x2903B009, this->sfxSource, 4); + this->unk_04A++; - if (actor->unk_04A > 15) { - Object_Kill(&actor->obj, actor->sfxSource); - D_ctx_80176550[actor->unk_046] = 0; - gHitCount += actor->info.bonus; + if (this->unk_04A > 15) { + Object_Kill(&this->obj, this->sfxSource); + D_ctx_80176550[this->unk_046] = 0; + gHitCount += this->info.bonus; D_ctx_80177850 = 15; } } } -void func_enmy2_8006B46C(Actor* actor, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6, u8 arg7, f32 arg8, - s32 arg9) { +void Actor194_8006B46C(Actor* this, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6, u8 arg7, f32 arg8, + s32 arg9) { Vec3f sp34 = { 0.0f, 0.0f, 0.0f }; Matrix_Push(&gGfxMatrix); @@ -308,11 +307,11 @@ void func_enmy2_8006B46C(Actor* actor, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f if (arg7 != 1) { RCP_SetupDL_29(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); - if ((arg7 == 0) && (actor->timer_0CA[0] != 0)) { - sp34.y += actor->info.unk_1C; + if ((arg7 == 0) && (this->timer_0CA[0] != 0)) { + sp34.y += this->info.unk_1C; Matrix_MultVec3f(gGfxMatrix, &sp34, D_display_80161578); if (D_display_80161578->z > -500.0f) { - actor->timer_0CA[0] = 0; + this->timer_0CA[0] = 0; } } } else { @@ -329,33 +328,33 @@ void func_enmy2_8006B46C(Actor* actor, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f RCP_SetupDL_29(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); } -void func_enmy2_8006B74C(Actor* actor) { +void Actor194_Draw(Actor* this) { s16 var_s0; s16 temp_hi; - for (var_s0 = actor->unk_04A; var_s0 < 16; var_s0++) { - temp_hi = (D_800CFF94[var_s0] + actor->unk_04E) % 100; - func_enmy2_8006B46C(actor, D_ctx_80176558[actor->unk_046][temp_hi], D_ctx_80176878[actor->unk_046][temp_hi], - D_ctx_80176B98[actor->unk_046][temp_hi], D_ctx_80176EB8[actor->unk_046][temp_hi], - D_ctx_801771D8[actor->unk_046][temp_hi], D_ctx_80177500[actor->unk_046][temp_hi], - D_800CFFB4[var_s0], D_800CFFC4[var_s0], actor->timer_0C6 & 1); + for (var_s0 = this->unk_04A; var_s0 < 16; var_s0++) { + temp_hi = (D_800CFF94[var_s0] + this->unk_04E) % 100; + Actor194_8006B46C(this, D_ctx_80176558[this->unk_046][temp_hi], D_ctx_80176878[this->unk_046][temp_hi], + D_ctx_80176B98[this->unk_046][temp_hi], D_ctx_80176EB8[this->unk_046][temp_hi], + D_ctx_801771D8[this->unk_046][temp_hi], D_ctx_80177500[this->unk_046][temp_hi], + D_800CFFB4[var_s0], D_800CFFC4[var_s0], this->timer_0C6 & 1); } } -void func_enmy2_8006B95C(Object_80* obj80) { - obj80->obj.pos.x += obj80->vel.x; - obj80->obj.pos.y += obj80->vel.y; - obj80->obj.pos.z += obj80->vel.z; +void Obj42_Update(Object_80* this) { + this->obj.pos.x += this->vel.x; + this->obj.pos.y += this->vel.y; + this->obj.pos.z += this->vel.z; - switch (obj80->state) { + switch (this->state) { case 0: - obj80->vel.y -= 1.0f; + this->vel.y -= 1.0f; - if (obj80->obj.pos.y < gGroundLevel + 40.0f) { - obj80->obj.pos.y = gGroundLevel + 40.0f; - AUDIO_PLAY_SFX(0x19130003, obj80->sfxSource, 0); - obj80->state = 2; - obj80->vel.y = 0.0f; + if (this->obj.pos.y < gGroundLevel + 40.0f) { + this->obj.pos.y = gGroundLevel + 40.0f; + AUDIO_PLAY_SFX(0x19130003, this->sfxSource, 0); + this->state = 2; + this->vel.y = 0.0f; } break; @@ -363,7 +362,7 @@ void func_enmy2_8006B95C(Object_80* obj80) { break; case 1: - obj80->obj.rot.x += 10.0f; + this->obj.rot.x += 10.0f; break; } } @@ -395,97 +394,96 @@ void func_enmy2_8006BB1C(f32 xPos, f32 yPos, f32 zPos) { } } -void func_enmy2_8006BB78(Actor* actor) { +void Actor196_Update(Actor* this) { Vec3f sp44; - switch (actor->state) { + switch (this->state) { case 0: - actor->fwork[10] = RAND_FLOAT_CENTERED(1000.0f); - actor->state = 1; + this->fwork[10] = RAND_FLOAT_CENTERED(1000.0f); + this->state = 1; break; case 1: - switch (actor->unk_046) { + switch (this->unk_046) { case 0: - actor->fwork[0] += 2.0f; - if (actor->fwork[0] > 10.0f) { - actor->unk_046 = 1; + this->fwork[0] += 2.0f; + if (this->fwork[0] > 10.0f) { + this->unk_046 = 1; } break; case 1: - actor->fwork[0] -= 2.0f; - if (actor->fwork[0] < -10.0f) { - actor->unk_046 = 0; + this->fwork[0] -= 2.0f; + if (this->fwork[0] < -10.0f) { + this->unk_046 = 0; } break; } - Math_Vec3fFromAngles(&sp44, actor->obj.rot.x, actor->obj.rot.y, 10.0f); - actor->vel.x = sp44.x; - actor->vel.y = sp44.y; - actor->vel.z = sp44.z; - if (fabsf((actor->obj.pos.z + actor->fwork[10]) - gPlayer[0].unk_138) < 3000.0f) { - actor->state = 2; - actor->timer_0BC = 20; - actor->vel.z = 0.0f; - actor->vel.x = 0.0f; + Math_Vec3fFromAngles(&sp44, this->obj.rot.x, this->obj.rot.y, 10.0f); + this->vel.x = sp44.x; + this->vel.y = sp44.y; + this->vel.z = sp44.z; + if (fabsf((this->obj.pos.z + this->fwork[10]) - gPlayer[0].unk_138) < 3000.0f) { + this->state = 2; + this->timer_0BC = 20; + this->vel.z = 0.0f; + this->vel.x = 0.0f; } break; case 2: - if (actor->timer_0BC == 0) { - actor->state = 3; - actor->unk_0B6 = 1; - actor->obj.pos.y += 30.0f; - actor->timer_0BC = 30; - actor->vel.y = 30.0f; - actor->gravity = 1.0f; + if (this->timer_0BC == 0) { + this->state = 3; + this->unk_0B6 = 1; + this->obj.pos.y += 30.0f; + this->timer_0BC = 30; + this->vel.y = 30.0f; + this->gravity = 1.0f; } break; case 3: - if (actor->timer_0BC == 1) { - func_effect_8007F11C(OBJ_EFFECT_353, actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, - D_ctx_80177828); + if (this->timer_0BC == 1) { + func_effect_8007F11C(OBJ_EFFECT_353, this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, D_ctx_80177828); } - if (actor->vel.y < 12.0f) { - Math_SmoothStepToF(&actor->obj.rot.x, 180.0f, 0.1f, 7.0f, 0.01f); + if (this->vel.y < 12.0f) { + Math_SmoothStepToF(&this->obj.rot.x, 180.0f, 0.1f, 7.0f, 0.01f); } - if (actor->obj.pos.y < (gGroundLevel + 10.0f)) { - actor->obj.pos.y = gGroundLevel; - actor->state = 4; - actor->unk_0B6 = 0; - actor->vel.y = 0.0f; - actor->gravity = 0.0f; - actor->obj.rot.x = 0.0f; + if (this->obj.pos.y < (gGroundLevel + 10.0f)) { + this->obj.pos.y = gGroundLevel; + this->state = 4; + this->unk_0B6 = 0; + this->vel.y = 0.0f; + this->gravity = 0.0f; + this->obj.rot.x = 0.0f; } break; case 4: - if (actor->timer_0BC == 0) { - actor->state = 0; - actor->obj.rot.y = RAND_FLOAT(360.0f); + if (this->timer_0BC == 0) { + this->state = 0; + this->obj.rot.y = RAND_FLOAT(360.0f); } break; } - if ((actor->obj.pos.y <= (gGroundLevel + 10.0f)) && !(gGameFrameCount & 7)) { - func_enmy2_8006BB1C(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z); + if ((this->obj.pos.y <= (gGroundLevel + 10.0f)) && !(gGameFrameCount & 7)) { + func_enmy2_8006BB1C(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z); } if (!(gGameFrameCount & 7)) { - func_enmy2_8006A900(RAND_FLOAT_CENTERED(50.0f) + actor->obj.pos.x, actor->obj.pos.y + 10.0f, - RAND_FLOAT_CENTERED(50.0f) + actor->obj.pos.z, 0.5f); + func_enmy2_8006A900(RAND_FLOAT_CENTERED(50.0f) + this->obj.pos.x, this->obj.pos.y + 10.0f, + RAND_FLOAT_CENTERED(50.0f) + this->obj.pos.z, 0.5f); } - if ((actor->unk_0D0 != 0) && (actor->unk_0B6 != 0)) { - func_effect_8007BFFC(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 0.0f, actor->vel.y, 0.0f, 3.0f, 5); - Object_Kill(&actor->obj, actor->sfxSource); - actor->unk_044 = 1; - func_enmy_80066254(actor); + if ((this->unk_0D0 != 0) && (this->unk_0B6 != 0)) { + func_effect_8007BFFC(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 0.0f, this->vel.y, 0.0f, 3.0f, 5); + Object_Kill(&this->obj, this->sfxSource); + this->itemDrop = DROP_SILVER_RING; + func_enmy_80066254(this); } - actor->unk_0D0 = 0; + this->unk_0D0 = 0; } static f32 D_800D001C[5] = { 0.0f, 30.0f, 60.0f, -60.0f, -30.0f }; // could be in-function @@ -498,123 +496,123 @@ void func_enmy2_8006BF7C(f32 xPos, f32 yPos, f32 zPos) { } static Vec3f D_800D0030 = { 0.0f, -10.0f, 0.0f }; // could be in-function -void func_enmy2_8006C008(Actor* actor) { +void Actor189_Update(Actor* this) { f32 sp4C; f32 sp48; f32 sp44; s32 sp40; - switch (actor->state) { + switch (this->state) { case 40: - if (actor->unk_04A & 4) { - actor->obj.pos.x = gPlayer[0].pos.x + actor->fwork[3]; - actor->obj.pos.z = gPlayer[0].unk_138 + actor->fwork[4]; + if (this->unk_04A & 4) { + this->obj.pos.x = gPlayer[0].pos.x + this->fwork[3]; + this->obj.pos.z = gPlayer[0].unk_138 + this->fwork[4]; } - actor->obj.rot.x += actor->fwork[0]; - actor->obj.rot.y += actor->fwork[1]; - actor->obj.rot.z += actor->fwork[2]; + this->obj.rot.x += this->fwork[0]; + this->obj.rot.y += this->fwork[1]; + this->obj.rot.z += this->fwork[2]; - if (((actor->unk_04A & 1) == 1) && !(actor->timer_0BC & 3)) { - func_effect_8007D0E0(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, actor->scale); + if (((this->unk_04A & 1) == 1) && !(this->timer_0BC & 3)) { + func_effect_8007D0E0(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, this->scale); } - if ((actor->fwork[5] + actor->obj.pos.y) < 0.0f) { - if (actor->iwork[0] >= 2) { - actor->fwork[2] = 0.0f; - actor->fwork[1] = 0.0f; - actor->fwork[0] = 0.0f; - actor->vel.x = 0.0f; - actor->vel.y = 0.0f; - actor->vel.z = 0.0f; - actor->gravity = 0.0f; + if ((this->fwork[5] + this->obj.pos.y) < 0.0f) { + if (this->iwork[0] >= 2) { + this->fwork[2] = 0.0f; + this->fwork[1] = 0.0f; + this->fwork[0] = 0.0f; + this->vel.x = 0.0f; + this->vel.y = 0.0f; + this->vel.z = 0.0f; + this->gravity = 0.0f; } else { - if (actor->unk_04A & 4) { - switch (actor->unk_046) { + if (this->unk_04A & 4) { + switch (this->unk_046) { case 2: - AUDIO_PLAY_SFX(0x19000024, actor->sfxSource, 4); + AUDIO_PLAY_SFX(0x19000024, this->sfxSource, 4); break; case 25: - AUDIO_PLAY_SFX(0x29003031, actor->sfxSource, 4); + AUDIO_PLAY_SFX(0x29003031, this->sfxSource, 4); break; } } - Math_SmoothStepToF(&actor->fwork[0], 0.0f, 0.8f, 1.0f, 0.01f); - Math_SmoothStepToF(&actor->fwork[1], 0.0f, 0.8f, 1.0f, 0.01f); - Math_SmoothStepToF(&actor->fwork[2], 0.0f, 0.8f, 1.0f, 0.01f); - Math_SmoothStepToF(&actor->vel.x, 0.0f, 0.5f, 1.0f, 0.01f); - actor->obj.pos.y = 0.0f; - actor->iwork[0] += 1; - if (actor->vel.y < 0.0f) { - if (actor->unk_04A & 2) { - actor->vel.y = actor->vel.y * -0.05f; + Math_SmoothStepToF(&this->fwork[0], 0.0f, 0.8f, 1.0f, 0.01f); + Math_SmoothStepToF(&this->fwork[1], 0.0f, 0.8f, 1.0f, 0.01f); + Math_SmoothStepToF(&this->fwork[2], 0.0f, 0.8f, 1.0f, 0.01f); + Math_SmoothStepToF(&this->vel.x, 0.0f, 0.5f, 1.0f, 0.01f); + this->obj.pos.y = 0.0f; + this->iwork[0] += 1; + if (this->vel.y < 0.0f) { + if (this->unk_04A & 2) { + this->vel.y = this->vel.y * -0.05f; } else { - actor->vel.y = actor->vel.y * -0.3f; + this->vel.y = this->vel.y * -0.3f; } } } - actor->unk_04A &= ~4; + this->unk_04A &= ~4; } break; case 45: - actor->obj.rot.y += actor->fwork[0]; - actor->obj.rot.z += actor->fwork[1]; + this->obj.rot.y += this->fwork[0]; + this->obj.rot.z += this->fwork[1]; break; case 46: - actor->obj.rot.x += actor->fwork[0]; - actor->obj.rot.y += actor->fwork[1]; - actor->obj.rot.z += actor->fwork[2]; + this->obj.rot.x += this->fwork[0]; + this->obj.rot.y += this->fwork[1]; + this->obj.rot.z += this->fwork[2]; - Ground_801B6E20(actor->obj.pos.x, actor->obj.pos.z + D_ctx_80177D20, &sp4C, &sp48, &sp4C); + Ground_801B6E20(this->obj.pos.x, this->obj.pos.z + D_ctx_80177D20, &sp4C, &sp48, &sp4C); - if (actor->obj.pos.y < sp48) { - actor->obj.pos.y = sp48; - actor->iwork[2]++; - if (actor->iwork[2] >= 2) { - actor->vel.x = 0.0f; - actor->vel.y = 0.0f; - actor->vel.z = 0.0f; - actor->fwork[0] = 0.0f; - actor->fwork[1] = 0.0f; - actor->fwork[2] = 0.0f; - actor->gravity = 0.0f; + if (this->obj.pos.y < sp48) { + this->obj.pos.y = sp48; + this->iwork[2]++; + if (this->iwork[2] >= 2) { + this->vel.x = 0.0f; + this->vel.y = 0.0f; + this->vel.z = 0.0f; + this->fwork[0] = 0.0f; + this->fwork[1] = 0.0f; + this->fwork[2] = 0.0f; + this->gravity = 0.0f; } else { - actor->vel.y = -actor->vel.y * 0.3f; + this->vel.y = -this->vel.y * 0.3f; } } break; case 47: - Ground_801B6E20(actor->obj.pos.x, actor->obj.pos.z + D_ctx_80177D20, &sp4C, &sp48, &sp4C); + Ground_801B6E20(this->obj.pos.x, this->obj.pos.z + D_ctx_80177D20, &sp4C, &sp48, &sp4C); - if (actor->obj.pos.y < actor->fwork[3] + (-100.0f + sp48)) { - actor->obj.pos.y = actor->fwork[3] + sp48; - actor->iwork[0] = 0; - actor->iwork[2] = 1; - actor->vel.x = 0.0f; - actor->vel.y = 0.0f; - actor->vel.z = 0.0f; - actor->gravity = 0.0f; - actor->fwork[0] = 0.0f; - actor->fwork[1] = 0.0f; - actor->fwork[2] = 0.0f; + if (this->obj.pos.y < this->fwork[3] + (-100.0f + sp48)) { + this->obj.pos.y = this->fwork[3] + sp48; + this->iwork[0] = 0; + this->iwork[2] = 1; + this->vel.x = 0.0f; + this->vel.y = 0.0f; + this->vel.z = 0.0f; + this->gravity = 0.0f; + this->fwork[0] = 0.0f; + this->fwork[1] = 0.0f; + this->fwork[2] = 0.0f; } - actor->obj.rot.x += actor->fwork[0]; - actor->obj.rot.y += actor->fwork[1]; - actor->obj.rot.z += actor->fwork[2]; + this->obj.rot.x += this->fwork[0]; + this->obj.rot.y += this->fwork[1]; + this->obj.rot.z += this->fwork[2]; - if ((actor->iwork[0] == 1) && !(gGameFrameCount & 7)) { - func_effect_8007D0E0(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 2.0f); + if ((this->iwork[0] == 1) && !(gGameFrameCount & 7)) { + func_effect_8007D0E0(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 2.0f); } - if (actor->iwork[2] == 1) { - if ((actor->iwork[1] == 1) && ((actor->unk_048 == 8) || (actor->unk_048 == 9))) { - func_effect_8007D2C8(actor->obj.pos.x, sp48 + 20.0f, actor->obj.pos.z, 8.0f); + if (this->iwork[2] == 1) { + if ((this->iwork[1] == 1) && ((this->unk_048 == 8) || (this->unk_048 == 9))) { + func_effect_8007D2C8(this->obj.pos.x, sp48 + 20.0f, this->obj.pos.z, 8.0f); } - Object_Kill(&actor->obj, actor->sfxSource); + Object_Kill(&this->obj, this->sfxSource); } break; @@ -624,200 +622,192 @@ void func_enmy2_8006C008(Actor* actor) { case 52: case 53: case 55: - if (((actor->timer_0BC == 0) || (func_enmy_8006351C(actor->index, &actor->obj.pos, &D_800D0030, 1) != 0) || - (actor->obj.pos.y < (gGroundLevel + 10.0f))) && - (actor->timer_0BE == 0)) { - func_effect_8007B8F8(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z + 50.0f, - actor->scale * 10.0f); - Object_Kill(&actor->obj, actor->sfxSource); - func_effect_8007A6F0(&actor->obj.pos, 0x2903A008); + if (((this->timer_0BC == 0) || (func_enmy_8006351C(this->index, &this->obj.pos, &D_800D0030, 1) != 0) || + (this->obj.pos.y < (gGroundLevel + 10.0f))) && + (this->timer_0BE == 0)) { + func_effect_8007B8F8(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z + 50.0f, this->scale * 10.0f); + Object_Kill(&this->obj, this->sfxSource); + func_effect_8007A6F0(&this->obj.pos, 0x2903A008); } break; case 56: - Math_SmoothStepToF(&actor->scale, 0.0f, 0.1f, 2.0f, 0.0001f); - if (((actor->timer_0BC == 0) || (func_enmy_8006351C(actor->index, &actor->obj.pos, &D_800D0030, 1) != 0) || - (actor->obj.pos.y < (gGroundLevel + 10.0f))) && - (actor->timer_0BE == 0)) { - func_effect_8007B8F8(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z + 50.0f, - actor->scale * 10.0f); - Object_Kill(&actor->obj, actor->sfxSource); - func_effect_8007A6F0(&actor->obj.pos, 0x2903A008); + Math_SmoothStepToF(&this->scale, 0.0f, 0.1f, 2.0f, 0.0001f); + if (((this->timer_0BC == 0) || (func_enmy_8006351C(this->index, &this->obj.pos, &D_800D0030, 1) != 0) || + (this->obj.pos.y < (gGroundLevel + 10.0f))) && + (this->timer_0BE == 0)) { + func_effect_8007B8F8(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z + 50.0f, this->scale * 10.0f); + Object_Kill(&this->obj, this->sfxSource); + func_effect_8007A6F0(&this->obj.pos, 0x2903A008); } break; case 58: - if (actor->unk_046 == 0) { - actor->unk_046++; - actor->fwork[0] = RAND_FLOAT_CENTERED(30.0f); - actor->fwork[1] = RAND_FLOAT_CENTERED(30.0f); - actor->fwork[2] = RAND_FLOAT_CENTERED(30.0f); + if (this->unk_046 == 0) { + this->unk_046++; + this->fwork[0] = RAND_FLOAT_CENTERED(30.0f); + this->fwork[1] = RAND_FLOAT_CENTERED(30.0f); + this->fwork[2] = RAND_FLOAT_CENTERED(30.0f); } - actor->obj.rot.x += actor->fwork[0]; - actor->obj.rot.y += actor->fwork[1]; - actor->obj.rot.z += actor->fwork[2]; + this->obj.rot.x += this->fwork[0]; + this->obj.rot.y += this->fwork[1]; + this->obj.rot.z += this->fwork[2]; - if (((actor->timer_0BC == 0) || (func_enmy_8006351C(actor->index, &actor->obj.pos, &D_800D0030, 1) != 0) || - (actor->obj.pos.y < (gGroundLevel + 10.0f))) && - (actor->timer_0BE == 0)) { - func_effect_8007B8F8(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z + 50.0f, - actor->scale * 10.0f); - Object_Kill(&actor->obj, actor->sfxSource); - func_effect_8007A6F0(&actor->obj.pos, 0x2903A008); + if (((this->timer_0BC == 0) || (func_enmy_8006351C(this->index, &this->obj.pos, &D_800D0030, 1) != 0) || + (this->obj.pos.y < (gGroundLevel + 10.0f))) && + (this->timer_0BE == 0)) { + func_effect_8007B8F8(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z + 50.0f, this->scale * 10.0f); + Object_Kill(&this->obj, this->sfxSource); + func_effect_8007A6F0(&this->obj.pos, 0x2903A008); } break; case 54: - if (((actor->timer_0BC == 0) || (func_enmy_8006351C(actor->index, &actor->obj.pos, &D_800D0030, 1) != 0) || - (actor->obj.pos.y < (gGroundLevel + 10.0f))) && - (actor->timer_0BE == 0)) { - func_effect_8007B8F8(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z + 70.0f, - actor->scale * 20.0f); - func_effect_8007B8F8(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z + 70.0f, - actor->scale * 20.0f); - Object_Kill(&actor->obj, actor->sfxSource); - func_effect_8007A6F0(&actor->obj.pos, 0x2903A008); + if (((this->timer_0BC == 0) || (func_enmy_8006351C(this->index, &this->obj.pos, &D_800D0030, 1) != 0) || + (this->obj.pos.y < (gGroundLevel + 10.0f))) && + (this->timer_0BE == 0)) { + func_effect_8007B8F8(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z + 70.0f, this->scale * 20.0f); + func_effect_8007B8F8(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z + 70.0f, this->scale * 20.0f); + Object_Kill(&this->obj, this->sfxSource); + func_effect_8007A6F0(&this->obj.pos, 0x2903A008); } break; case 50: - if ((actor->iwork[0] == 2) && (actor->timer_0BC == 0)) { - func_effect_8007D2C8(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 5.0f); - actor->timer_0BC = 4; + if ((this->iwork[0] == 2) && (this->timer_0BC == 0)) { + func_effect_8007D2C8(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 5.0f); + this->timer_0BC = 4; } - actor->obj.rot.x += actor->fwork[0]; - actor->obj.rot.y += actor->fwork[1]; - actor->obj.rot.z += actor->fwork[2]; - if (func_enmy_8006351C(actor->index, &actor->obj.pos, &D_tank_800C9F2C, 1) != 0) { - actor->vel.x *= -0.7f; + this->obj.rot.x += this->fwork[0]; + this->obj.rot.y += this->fwork[1]; + this->obj.rot.z += this->fwork[2]; + if (func_enmy_8006351C(this->index, &this->obj.pos, &D_tank_800C9F2C, 1) != 0) { + this->vel.x *= -0.7f; } - if (actor->obj.pos.y < gGroundLevel) { - Object_Kill(&actor->obj, actor->sfxSource); + if (this->obj.pos.y < gGroundLevel) { + Object_Kill(&this->obj, this->sfxSource); } break; case 57: - actor->obj.rot.x += actor->fwork[0]; - actor->obj.rot.y += actor->fwork[1]; - actor->obj.rot.z += actor->fwork[2]; + this->obj.rot.x += this->fwork[0]; + this->obj.rot.y += this->fwork[1]; + this->obj.rot.z += this->fwork[2]; - if (func_enmy_8006351C(actor->index, &actor->obj.pos, &D_tank_800C9F2C, 1) != 0) { - actor->vel.x *= -0.7f; + if (func_enmy_8006351C(this->index, &this->obj.pos, &D_tank_800C9F2C, 1) != 0) { + this->vel.x *= -0.7f; } - if (actor->obj.pos.y < gGroundLevel) { - if (actor->iwork[0] >= 3) { - actor->vel.y = 0.0f; - actor->gravity = 0.0f; - actor->fwork[2] = 0.0f; - actor->fwork[1] = 0.0f; - actor->fwork[0] = 0.0f; + if (this->obj.pos.y < gGroundLevel) { + if (this->iwork[0] >= 3) { + this->vel.y = 0.0f; + this->gravity = 0.0f; + this->fwork[2] = 0.0f; + this->fwork[1] = 0.0f; + this->fwork[0] = 0.0f; } else { - actor->iwork[0]++; - actor->vel.y = -actor->vel.y * 0.7f; - actor->obj.pos.y = gGroundLevel; - actor->fwork[0] *= 0.5f; - actor->fwork[1] *= 0.5f; - actor->fwork[2] *= 0.5f; + this->iwork[0]++; + this->vel.y = -this->vel.y * 0.7f; + this->obj.pos.y = gGroundLevel; + this->fwork[0] *= 0.5f; + this->fwork[1] *= 0.5f; + this->fwork[2] *= 0.5f; } } break; default: - if (actor->unk_046 == 0) { - actor->unk_046++; - actor->fwork[10] = RAND_FLOAT_CENTERED(30.0f); - actor->fwork[11] = RAND_FLOAT_CENTERED(30.0f); - actor->fwork[12] = RAND_FLOAT_CENTERED(30.0f); + if (this->unk_046 == 0) { + this->unk_046++; + this->fwork[10] = RAND_FLOAT_CENTERED(30.0f); + this->fwork[11] = RAND_FLOAT_CENTERED(30.0f); + this->fwork[12] = RAND_FLOAT_CENTERED(30.0f); } - actor->obj.rot.x += actor->fwork[10]; - actor->obj.rot.y += actor->fwork[11]; - actor->obj.rot.z += actor->fwork[12]; + this->obj.rot.x += this->fwork[10]; + this->obj.rot.y += this->fwork[11]; + this->obj.rot.z += this->fwork[12]; - if (actor->state == 0x46) { - if ((actor->timer_0BC == 0) || - (func_enmy_8006351C(actor->index, &actor->obj.pos, &D_800D0030, 1) != 0) || - (actor->obj.pos.y < (gGroundLevel + 10.0f))) { - Object_Kill(&actor->obj, actor->sfxSource); + if (this->state == 70) { + if ((this->timer_0BC == 0) || (func_enmy_8006351C(this->index, &this->obj.pos, &D_800D0030, 1) != 0) || + (this->obj.pos.y < (gGroundLevel + 10.0f))) { + Object_Kill(&this->obj, this->sfxSource); } - } else if (actor->state == 0x27) { - if (((actor->timer_0BC == 0) || - (func_enmy_8006351C(actor->index, &actor->obj.pos, &D_800D0030, 1) != 0) || - (actor->obj.pos.y < (gGroundLevel + 10.0f))) && - (actor->timer_0BE == 0)) { - func_effect_8007D0E0(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 10.0f); - Object_Kill(&actor->obj, actor->sfxSource); - func_effect_8007A6F0(&actor->obj.pos, 0x2903A008); + } else if (this->state == 39) { + if (((this->timer_0BC == 0) || (func_enmy_8006351C(this->index, &this->obj.pos, &D_800D0030, 1) != 0) || + (this->obj.pos.y < (gGroundLevel + 10.0f))) && + (this->timer_0BE == 0)) { + func_effect_8007D0E0(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 10.0f); + Object_Kill(&this->obj, this->sfxSource); + func_effect_8007A6F0(&this->obj.pos, 0x2903A008); } - } else if (((actor->state >= 0x29) && (actor->state < 0x2D)) || (actor->state == 0x3B)) { - if (((actor->timer_0BC == 0) || - (func_enmy_8006351C(actor->index, &actor->obj.pos, &D_800D0030, 1) != 0)) && - (actor->timer_0BE == 0)) { - func_effect_8007D0E0(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 2.0f * actor->scale); - Object_Kill(&actor->obj, actor->sfxSource); - func_effect_8007A6F0(&actor->obj.pos, 0x2903A008); + } else if (((this->state >= 41) && (this->state < 45)) || (this->state == 59)) { + if (((this->timer_0BC == 0) || + (func_enmy_8006351C(this->index, &this->obj.pos, &D_800D0030, 1) != 0)) && + (this->timer_0BE == 0)) { + func_effect_8007D0E0(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 2.0f * this->scale); + Object_Kill(&this->obj, this->sfxSource); + func_effect_8007A6F0(&this->obj.pos, 0x2903A008); } - if (func_play_800A73E4(&sp44, &sp40, actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z)) { - func_effect_8007B228(actor->obj.pos.x, sp44, actor->obj.pos.z, 2.0f); - Object_Kill(&actor->obj, actor->sfxSource); + if (func_play_800A73E4(&sp44, &sp40, this->obj.pos.x, this->obj.pos.y, this->obj.pos.z)) { + func_effect_8007B228(this->obj.pos.x, sp44, this->obj.pos.z, 2.0f); + Object_Kill(&this->obj, this->sfxSource); } - } else if (actor->state >= 0xA) { - if (!(actor->timer_0BC & 3)) { - func_effect_8007D0E0(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, actor->scale); + } else if (this->state >= 10) { + if (!(this->timer_0BC & 3)) { + func_effect_8007D0E0(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, this->scale); } - if (((actor->timer_0BC == 0) || - (func_enmy_8006351C(actor->index, &actor->obj.pos, &D_800D0030, 1) != 0) || - (actor->obj.pos.y < (gGroundLevel + 10.0f))) && - (actor->timer_0BE == 0)) { - func_effect_8007BFFC(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, actor->vel.x, - actor->vel.y, actor->vel.z, actor->scale * 1.5f, 4); - Object_Kill(&actor->obj, actor->sfxSource); - func_effect_8007A6F0(&actor->obj.pos, 0x2903A008); + if (((this->timer_0BC == 0) || (func_enmy_8006351C(this->index, &this->obj.pos, &D_800D0030, 1) != 0) || + (this->obj.pos.y < (gGroundLevel + 10.0f))) && + (this->timer_0BE == 0)) { + func_effect_8007BFFC(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, this->vel.x, this->vel.y, + this->vel.z, this->scale * 1.5f, 4); + Object_Kill(&this->obj, this->sfxSource); + func_effect_8007A6F0(&this->obj.pos, 0x2903A008); } } else { - if ((actor->state == 3) && !(actor->timer_0BC & 7)) { - func_effect_8007D0E0(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 1.5f); + if ((this->state == 3) && !(this->timer_0BC & 7)) { + func_effect_8007D0E0(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 1.5f); } - if ((func_enmy_8006351C(actor->index, &actor->obj.pos, &D_800D0030, 1) != 0) || - (actor->obj.pos.y < (gGroundLevel + 10.0f))) { + if ((func_enmy_8006351C(this->index, &this->obj.pos, &D_800D0030, 1) != 0) || + (this->obj.pos.y < (gGroundLevel + 10.0f))) { if (gLevelType == LEVELTYPE_SPACE) { - func_effect_8007D0E0(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 2.0f); - Object_Kill(&actor->obj, actor->sfxSource); + func_effect_8007D0E0(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 2.0f); + Object_Kill(&this->obj, this->sfxSource); return; } - actor->vel.y *= -0.2f; - actor->obj.pos.y += actor->vel.y * 5.0f; - actor->iwork[0]++; + this->vel.y *= -0.2f; + this->obj.pos.y += this->vel.y * 5.0f; + this->iwork[0]++; - if (actor->iwork[0] >= 2) { - Object_Kill(&actor->obj, actor->sfxSource); + if (this->iwork[0] >= 2) { + Object_Kill(&this->obj, this->sfxSource); } - if ((actor->state != 2) && (actor->state != 4)) { - func_enmy2_8006BF7C(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z); + if ((this->state != 2) && (this->state != 4)) { + func_enmy2_8006BF7C(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z); } else if (gCurrentLevel == LEVEL_FORTUNA) { - func_effect_8007BC7C(RAND_FLOAT_CENTERED(10.0f) + actor->obj.pos.x, actor->obj.pos.y, - actor->obj.pos.z, 1.0f); - func_effect_8007BC7C(RAND_FLOAT_CENTERED(10.0f) + actor->obj.pos.x, actor->obj.pos.y, - actor->obj.pos.z, 1.0f); - func_effect_8007BC7C(RAND_FLOAT_CENTERED(10.0f) + actor->obj.pos.x, actor->obj.pos.y, - actor->obj.pos.z, 1.0f); + func_effect_8007BC7C(RAND_FLOAT_CENTERED(10.0f) + this->obj.pos.x, this->obj.pos.y, + this->obj.pos.z, 1.0f); + func_effect_8007BC7C(RAND_FLOAT_CENTERED(10.0f) + this->obj.pos.x, this->obj.pos.y, + this->obj.pos.z, 1.0f); + func_effect_8007BC7C(RAND_FLOAT_CENTERED(10.0f) + this->obj.pos.x, this->obj.pos.y, + this->obj.pos.z, 1.0f); } } - if (actor->state == 4) { - if ((gCurrentLevel == LEVEL_KATINA) && (actor->timer_0BC == 0)) { - Object_Kill(&actor->obj, actor->sfxSource); + if (this->state == 4) { + if ((gCurrentLevel == LEVEL_KATINA) && (this->timer_0BC == 0)) { + Object_Kill(&this->obj, this->sfxSource); } } else { - if (actor->timer_0BC & 1) { - func_effect_8007D24C(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 1.0f); + if (this->timer_0BC & 1) { + func_effect_8007D24C(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 1.0f); } - if ((gLevelType == LEVELTYPE_SPACE) && (actor->timer_0BC == 0)) { - Object_Kill(&actor->obj, actor->sfxSource); + if ((gLevelType == LEVELTYPE_SPACE) && (this->timer_0BC == 0)) { + Object_Kill(&this->obj, this->sfxSource); } } } @@ -837,9 +827,9 @@ void func_enmy2_8006D0F4(Actor* actor) { s32 count; Hitbox* hitbox; - D_80161A7C = 110; - D_80161A80 = 110; - D_80161A84 = 110; + D_ctx_80161A7C = 110; + D_ctx_80161A80 = 110; + D_ctx_80161A84 = 110; D_ctx_80178544 = 40; for (i = 0; i < ARRAY_COUNT(gObjects80); i++) { @@ -864,9 +854,9 @@ void func_enmy2_8006D0F4(Actor* actor) { hitbox = (Hitbox*) hitboxData; if (func_play_800A78C4(hitbox, gObjects80[i].obj.pos.x, gObjects80[i].obj.pos.y, gObjects80[i].obj.pos.z, temp_fs0, temp_fs1, temp_fs2)) { - D_80161A7C = 10; - D_80161A80 = 10; - D_80161A84 = 10; + D_ctx_80161A7C = 10; + D_ctx_80161A80 = 10; + D_ctx_80161A84 = 10; actor->unk_0C8 = 5; } hitboxData += 6; @@ -876,8 +866,8 @@ void func_enmy2_8006D0F4(Actor* actor) { } } -void func_enmy2_8006D350(Object_80* obj80) { - obj80->obj.rot.z += 1.0f; +void Obj39_Update(Object_80* this) { + this->obj.rot.z += 1.0f; } static UnkStruct_D003C D_800D003C[108] = { @@ -996,7 +986,7 @@ static u8 D_800D0DBC[6][4] = { { 80, 255, 80, 255 }, { 255, 80, 80, 255 }, { 255, 255, 80, 255 }, }; -void func_enmy2_8006D36C(Actor* actor) { +void ActorEvent_ProcessScript(Actor* this) { u16** levelScripts; u16* actorScript; u16* msg; @@ -1051,527 +1041,527 @@ void func_enmy2_8006D36C(Actor* actor) { levelScripts = SEGMENTED_TO_VIRTUAL(D_CO_603D9E8); break; } - actorScript = SEGMENTED_TO_VIRTUAL(levelScripts[actor->aiType]); + actorScript = SEGMENTED_TO_VIRTUAL(levelScripts[this->aiType]); - switch (actorScript[actor->aiIndex] & (0x7F << 9)) { - case EVOP_STOP_SCRIPT << 9: - actor->state = 200; - if (actor->info.unk_10 > 10000.0f) { - actor->info.unk_10 = 100.0f; + switch (EV_OPC_MASK(actorScript[this->aiIndex])) { + case EV_OPC(EVOP_STOP_SCRIPT): + this->state = EVSTATE_SCRIPT_END; + if (this->info.unk_10 > 10000.0f) { + this->info.unk_10 = 100.0f; } break; - case EVOP_INIT_ACTOR << 9: - Audio_KillSfxBySource(actor->sfxSource); - actor->unk_0B4 = actorScript[actor->aiIndex + 1]; + case EV_OPC(EVOP_INIT_ACTOR): + Audio_KillSfxBySource(this->sfxSource); + this->unk_0B4 = actorScript[this->aiIndex + 1]; - if (actor->unk_0B4 == 40) { - actor->timer_0C2 = 10000; + if (this->unk_0B4 == EINFO_40) { + this->timer_0C2 = 10000; } else { - actor->timer_0C2 = 0; + this->timer_0C2 = 0; } - actor->fwork[11] = 0.0f; - actor->fwork[12] = 0.0f; + this->fwork[11] = 0.0f; + this->fwork[12] = 0.0f; - if ((actor->unk_0B4 == 64) || (actor->unk_0B4 == 81)) { - actor->fwork[15] = 0.0f; - } else if (actor->unk_0B4 == 79) { - actor->info.drawType = 2; + if ((this->unk_0B4 == EINFO_64) || (this->unk_0B4 == EINFO_81)) { + this->fwork[15] = 0.0f; + } else if (this->unk_0B4 == EINFO_79) { + this->info.drawType = 2; } - actor->health = actorScript[actor->aiIndex] & 0x1FF; - actor->aiIndex += 2; + this->health = actorScript[this->aiIndex] & 0x1FF; + this->aiIndex += 2; - if ((actor->unk_0B4 >= 200) && (actor->unk_0B4 < 300)) { - actor->unk_046 = 100; - actor->info.hitbox = D_edata_800CBEC4; - actor->info.unk_1C = 1.0f; + if ((this->unk_0B4 >= EINFO_200) && (this->unk_0B4 < EINFO_300)) { + this->unk_046 = 100; + this->info.hitbox = D_edata_800CBEC4; + this->info.unk_1C = 1.0f; for (i = 0; i < 2; i++) { if (D_ctx_80176550[i] == 0) { D_ctx_80176550[i] = 1; - actor->unk_046 = i; + this->unk_046 = i; for (j = 0; j < 100; j++) { - D_ctx_80176878[i][j] = actor->obj.pos.y; - D_ctx_80176B98[i][j] = actor->obj.pos.z; + D_ctx_80176878[i][j] = this->obj.pos.y; + D_ctx_80176B98[i][j] = this->obj.pos.z; } - if (actor->unk_0B4 == 200) { - AUDIO_PLAY_SFX(0x11032049, actor->sfxSource, 4); + if (this->unk_0B4 == EINFO_200) { + AUDIO_PLAY_SFX(0x11032049, this->sfxSource, 4); } break; } } - if (actor->unk_046 == 100) { - Object_Kill(&actor->obj, actor->sfxSource); + if (this->unk_046 == 100) { + Object_Kill(&this->obj, this->sfxSource); } } - if ((actor->unk_0B4 == 2) || (actor->unk_0B4 == 43)) { - actor->unk_0C9 = 1; - actor->iwork[11] = 1; + if ((this->unk_0B4 == EINFO_2) || (this->unk_0B4 == EINFO_43)) { + this->unk_0C9 = 1; + this->iwork[11] = 1; } - if (actor->unk_0B4 == 81) { - actor->unk_0C9 = 1; + if (this->unk_0B4 == EINFO_81) { + this->unk_0C9 = 1; } if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_3) { - if (actor->unk_0B4 == 86) { - Audio_PlayFanfare(SEQ_ID_54, 20, 10, 10); + if (this->unk_0B4 == EINFO_86) { + Audio_PlayFanfare(SEQ_ID_KATT, 20, 10, 10); } - if (actor->unk_0B4 == 85) { - Audio_PlayFanfare(SEQ_ID_55, 20, 10, 10); + if (this->unk_0B4 == EINFO_85) { + Audio_PlayFanfare(SEQ_ID_BILL, 20, 10, 10); } } - if (actor->unk_0B4 == 103) { - actor->unk_0B6 = 0; + if (this->unk_0B4 == EINFO_103) { + this->unk_0B6 = 0; } - if (actor->unk_0B4 == 104) { - actor->unk_0B6 = Animation_GetFrameCount(&D_VE2_6014658) - 1; + if (this->unk_0B4 == EINFO_104) { + this->unk_0B6 = Animation_GetFrameCount(&D_VE2_6014658) - 1; } - if (actor->unk_0B4 < 200) { - actor->info.hitbox = SEGMENTED_TO_VIRTUAL(D_800D003C[actor->unk_0B4].hitbox); - actor->scale = D_800D003C[actor->unk_0B4].scale; - actor->info.unk_16 = D_800D003C[actor->unk_0B4].info_unk_16; - actor->info.unk_14 = D_800D003C[actor->unk_0B4].info_unk_14; - actor->info.unk_19 = D_800D003C[actor->unk_0B4].info_unk_19; - actor->info.unk_1C = D_800D003C[actor->unk_0B4].info_unk_1C; - actor->info.bonus = D_800D003C[actor->unk_0B4].bonus; + if (this->unk_0B4 < EINFO_200) { + this->info.hitbox = SEGMENTED_TO_VIRTUAL(D_800D003C[this->unk_0B4].hitbox); + this->scale = D_800D003C[this->unk_0B4].scale; + this->info.unk_16 = D_800D003C[this->unk_0B4].info_unk_16; + this->info.unk_14 = D_800D003C[this->unk_0B4].info_unk_14; + this->info.unk_19 = D_800D003C[this->unk_0B4].info_unk_19; + this->info.unk_1C = D_800D003C[this->unk_0B4].info_unk_1C; + this->info.bonus = D_800D003C[this->unk_0B4].bonus; - if (actor->unk_0B4 == 78) { - actor->info.damage = 0; + if (this->unk_0B4 == EINFO_78) { + this->info.damage = 0; } - actor->info.unk_10 = D_800D003C[actor->unk_0B4].info_unk_10; - actor->fwork[25] = D_800D003C[actor->unk_0B4].unk_10; + this->info.unk_10 = D_800D003C[this->unk_0B4].info_unk_10; + this->fwork[25] = D_800D003C[this->unk_0B4].unk_10; - switch (D_800D003C[actor->unk_0B4].sfx) { + switch (D_800D003C[this->unk_0B4].sfx) { case 1: - if (!((gCurrentLevel == LEVEL_SOLAR) || (actor->unk_0B4 == 6) || - ((gCurrentLevel == LEVEL_CORNERIA) && (actor->unk_0B4 == 8)))) { - AUDIO_PLAY_SFX(0x31000011, actor->sfxSource, 4); + if (!((gCurrentLevel == LEVEL_SOLAR) || (this->unk_0B4 == EINFO_6) || + ((gCurrentLevel == LEVEL_CORNERIA) && (this->unk_0B4 == EINFO_8)))) { + AUDIO_PLAY_SFX(0x31000011, this->sfxSource, 4); } break; case 2: - AUDIO_PLAY_SFX(0x3100000C, actor->sfxSource, 4); + AUDIO_PLAY_SFX(0x3100000C, this->sfxSource, 4); break; case 3: - AUDIO_PLAY_SFX(0x11030010, actor->sfxSource, 0); + AUDIO_PLAY_SFX(0x11030010, this->sfxSource, 0); break; case 4: - AUDIO_PLAY_SFX(0x31012039, actor->sfxSource, 4); + AUDIO_PLAY_SFX(0x31012039, this->sfxSource, 4); break; case 5: - AUDIO_PLAY_SFX(0x1900302B, actor->sfxSource, 0); + AUDIO_PLAY_SFX(0x1900302B, this->sfxSource, 0); break; case 6: - AUDIO_PLAY_SFX(0x31000014, actor->sfxSource, 4); + AUDIO_PLAY_SFX(0x31000014, this->sfxSource, 4); break; case 7: - AUDIO_PLAY_SFX(0x31000015, actor->sfxSource, 4); + AUDIO_PLAY_SFX(0x31000015, this->sfxSource, 4); break; } - if (gPlayer[0].unk_138 < actor->obj.pos.z) { - actor->info.unk_10 = 3000.0f; + if (gPlayer[0].unk_138 < this->obj.pos.z) { + this->info.unk_10 = 3000.0f; } - if (actor->info.unk_16 == 0) { - actor->obj.rot.z = actor->fwork[23] = actor->unk_0F4.z; - if (actor->unk_0B4 != 31) { - actor->unk_0F4.z = 0.0f; + if (this->info.unk_16 == 0) { + this->obj.rot.z = this->fwork[23] = this->unk_0F4.z; + if (this->unk_0B4 != EINFO_31) { + this->unk_0F4.z = 0.0f; } } } - func_enmy2_8006D36C(actor); + ActorEvent_ProcessScript(this); break; - case EVOP_105 << 9: - actor->iwork[12] = actorScript[actor->aiIndex + 1]; + case EV_OPC(EVOP_SET_IWORK_12): + this->iwork[12] = actorScript[this->aiIndex + 1]; - if (actor->iwork[12] < 4) { - D_enmy2_800CFF80[actor->iwork[12]] = actor->index; + if (this->iwork[12] < 4) { + D_enmy2_800CFF80[this->iwork[12]] = this->index; } - actor->aiIndex += 2; - func_enmy2_8006D36C(actor); + this->aiIndex += 2; + ActorEvent_ProcessScript(this); break; - case EVOP_113 << 9: - actor->iwork[15] = actorScript[actor->aiIndex + 1]; - actor->iwork[16] = actorScript[actor->aiIndex] & 0x1FF; - actor->aiIndex += 2; - func_enmy2_8006D36C(actor); + case EV_OPC(EVOP_ADD_TO_GROUP): + this->iwork[15] = actorScript[this->aiIndex + 1]; + this->iwork[16] = actorScript[this->aiIndex] & 0x1FF; + this->aiIndex += 2; + ActorEvent_ProcessScript(this); break; - case EVOP_3 << 9: - D_ctx_80177E78 = actor->index; - D_ctx_80177F10.x = actor->obj.pos.x; - D_ctx_80177F10.y = actor->obj.pos.y; - D_ctx_80177F10.z = actor->obj.pos.z; - D_ctx_80177E88.x = actor->obj.rot.x; - D_ctx_80177E88.y = actor->obj.rot.y; - D_ctx_80177E88.z = actor->obj.rot.z; - actor->aiIndex += 2; - func_enmy2_8006D36C(actor); + case EV_OPC(EVOP_SET_TO_IWORK_9): + D_ctx_80177E78 = this->index; + D_ctx_80177F10.x = this->obj.pos.x; + D_ctx_80177F10.y = this->obj.pos.y; + D_ctx_80177F10.z = this->obj.pos.z; + D_ctx_80177E88.x = this->obj.rot.x; + D_ctx_80177E88.y = this->obj.rot.y; + D_ctx_80177E88.z = this->obj.rot.z; + this->aiIndex += 2; + ActorEvent_ProcessScript(this); break; - case EVOP_112 << 9: - if (actorScript[actor->aiIndex + 1] == 14) { - actor->state = 10; - actor->fwork[11] = 0.0f; - actor->aiIndex += 2; + case EV_OPC(EVOP_SET_ACTION): + if (actorScript[this->aiIndex + 1] == EVACT_14) { + this->state = EVSTATE_10; + this->fwork[11] = 0.0f; + this->aiIndex += 2; break; } - if (actorScript[actor->aiIndex + 1] == 15) { - actor->info.hitbox = SEGMENTED_TO_VIRTUAL(D_edata_800CBEC4); - actor->state = 11; - actor->aiIndex += 2; + if (actorScript[this->aiIndex + 1] == EVACT_15) { + this->info.hitbox = SEGMENTED_TO_VIRTUAL(D_edata_800CBEC4); + this->state = EVSTATE_11; + this->aiIndex += 2; break; } - actor->unk_048 = actorScript[actor->aiIndex + 1]; + this->unk_048 = actorScript[this->aiIndex + 1]; - if (actor->unk_048 == 3) { - actor->timer_04C = 4; + if (this->unk_048 == EVACT_3) { + this->timer_04C = 4; } - if (actor->unk_048 == 13) { - actor->timer_0BE = 50; + if (this->unk_048 == EVACT_13) { + this->timer_0BE = 50; } - actor->aiIndex += 2; - func_enmy2_8006D36C(actor); + this->aiIndex += 2; + ActorEvent_ProcessScript(this); break; - case EVOP_116 << 9: - actor->unk_044 = actorScript[actor->aiIndex + 1]; - actor->aiIndex += 2; - func_enmy2_8006D36C(actor); + case EV_OPC(EVOP_DROP_ITEM): + this->itemDrop = actorScript[this->aiIndex + 1]; + this->aiIndex += 2; + ActorEvent_ProcessScript(this); break; - case EVOP_118 << 9: - Audio_SetBaseSfxReverb(actorScript[actor->aiIndex + 1]); - actor->aiIndex += 2; - func_enmy2_8006D36C(actor); + case EV_OPC(EVOP_SET_REVERB): + Audio_SetBaseSfxReverb(actorScript[this->aiIndex + 1]); + this->aiIndex += 2; + ActorEvent_ProcessScript(this); break; - case EVOP_PLAY_MSG << 9: - msg = Message_PtrFromId(actorScript[actor->aiIndex + 1]); + case EV_OPC(EVOP_PLAY_MSG): + msg = Message_PtrFromId(actorScript[this->aiIndex + 1]); if ((msg != NULL) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_3)) { - Radio_PlayMessage(msg, actorScript[actor->aiIndex] & 0x1FF); + Radio_PlayMessage(msg, actorScript[this->aiIndex] & 0x1FF); } - actor->aiIndex += 2; - func_enmy2_8006D36C(actor); + this->aiIndex += 2; + ActorEvent_ProcessScript(this); break; - case EVOP_119 << 9: - if ((D_80161A88 == 2) && (actorScript[actor->aiIndex + 1] != 2)) { + case EV_OPC(EVOP_SET_GROUND): + if ((D_ctx_80161A88 == 2) && (actorScript[this->aiIndex + 1] != 2)) { Audio_KillSfxBySourceAndId(gPlayer[0].sfxSource, 0x1100000B); } - D_80161A88 = actorScript[actor->aiIndex + 1]; - actor->aiIndex += 2; - func_enmy2_8006D36C(actor); - actor->obj.status = OBJ_FREE; + D_ctx_80161A88 = actorScript[this->aiIndex + 1]; + this->aiIndex += 2; + ActorEvent_ProcessScript(this); + this->obj.status = OBJ_FREE; break; - case EVOP_56 << 9: - D_enmy2_800CFF90 = actorScript[actor->aiIndex] & 0x1FF; - D_enmy2_80161690 = actorScript[actor->aiIndex + 1]; - actor->aiIndex += 2; - func_enmy2_8006D36C(actor); + case EV_OPC(EVOP_SET_CALL): + D_enmy2_800CFF90 = actorScript[this->aiIndex] & 0x1FF; + D_enmy2_80161690 = actorScript[this->aiIndex + 1]; + this->aiIndex += 2; + ActorEvent_ProcessScript(this); break; - case EVOP_57 << 9: - gTeamShields[actorScript[actor->aiIndex + 1]] = 0xFF; - actor->aiIndex += 2; - func_enmy2_8006D36C(actor); + case EV_OPC(EVOP_RESTORE_TEAM): + gTeamShields[actorScript[this->aiIndex + 1]] = 255; + this->aiIndex += 2; + ActorEvent_ProcessScript(this); break; - case EVOP_58 << 9: - func_8001D2FC(actor->sfxSource, actorScript[actor->aiIndex + 1]); - actor->aiIndex += 2; - func_enmy2_8006D36C(actor); + case EV_OPC(EVOP_PLAY_SFX): + Audio_PlayEventSfx(this->sfxSource, actorScript[this->aiIndex + 1]); + this->aiIndex += 2; + ActorEvent_ProcessScript(this); break; - case EVOP_59 << 9: - func_8001D3A0(actor->sfxSource, actorScript[actor->aiIndex + 1]); - actor->aiIndex += 2; - func_enmy2_8006D36C(actor); + case EV_OPC(EVOP_STOP_SFX): + Audio_StopEventSfx(this->sfxSource, actorScript[this->aiIndex + 1]); + this->aiIndex += 2; + ActorEvent_ProcessScript(this); break; - case EVOP_122 << 9: + case EV_OPC(EVOP_STOP_BGM): SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM, 50); SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_FANFARE, 50); - actor->aiIndex += 2; - func_enmy2_8006D36C(actor); + this->aiIndex += 2; + ActorEvent_ProcessScript(this); break; - case EVOP_121 << 9: - if (actor->iwork[12] == actorScript[actor->aiIndex + 1]) { - actor->unk_0D0 = 1; - actor->damage = actorScript[actor->aiIndex] & 0x1FF; - actor->unk_0D4 = 100; + case EV_OPC(EVOP_DAMAGE_TEAM): + if (this->iwork[12] == actorScript[this->aiIndex + 1]) { + this->unk_0D0 = 1; + this->damage = actorScript[this->aiIndex] & 0x1FF; + this->unk_0D4 = 100; } else { - gTeamDamage[actorScript[actor->aiIndex + 1]] = actorScript[actor->aiIndex] & 0x1FF; + gTeamDamage[actorScript[this->aiIndex + 1]] = actorScript[this->aiIndex] & 0x1FF; } - actor->aiIndex += 2; - func_enmy2_8006D36C(actor); + this->aiIndex += 2; + ActorEvent_ProcessScript(this); break; - case EVOP_MAKE_TEXLINE << 9: - actor->iwork[7] = 1; + case EV_OPC(EVOP_MAKE_TEXLINE): + this->iwork[7] = 1; for (i = 0; i < ARRAY_COUNT(gTexturedLines); i++) { if (gTexturedLines[i].mode == 0) { gTexturedLines[i].mode = 1; gTexturedLines[i].unk_28 = 3.0f; - gTexturedLines[i].unk_04.x = actor->obj.pos.x - actor->vel.x; - gTexturedLines[i].unk_04.y = actor->obj.pos.y - actor->vel.y; - gTexturedLines[i].unk_04.z = actor->obj.pos.z - actor->vel.z; - gTexturedLines[i].unk_2C = D_800D0DBC[actorScript[actor->aiIndex + 1]][0]; - gTexturedLines[i].unk_2D = D_800D0DBC[actorScript[actor->aiIndex + 1]][1]; - gTexturedLines[i].unk_2E = D_800D0DBC[actorScript[actor->aiIndex + 1]][2]; - gTexturedLines[i].unk_2F = D_800D0DBC[actorScript[actor->aiIndex + 1]][3]; - actor->iwork[8] = i; + gTexturedLines[i].unk_04.x = this->obj.pos.x - this->vel.x; + gTexturedLines[i].unk_04.y = this->obj.pos.y - this->vel.y; + gTexturedLines[i].unk_04.z = this->obj.pos.z - this->vel.z; + gTexturedLines[i].unk_2C = D_800D0DBC[actorScript[this->aiIndex + 1]][0]; + gTexturedLines[i].unk_2D = D_800D0DBC[actorScript[this->aiIndex + 1]][1]; + gTexturedLines[i].unk_2E = D_800D0DBC[actorScript[this->aiIndex + 1]][2]; + gTexturedLines[i].unk_2F = D_800D0DBC[actorScript[this->aiIndex + 1]][3]; + this->iwork[8] = i; break; } } - actor->aiIndex += 2; - func_enmy2_8006D36C(actor); + this->aiIndex += 2; + ActorEvent_ProcessScript(this); break; - case EVOP_STOP_TEXLINE << 9: - actor->iwork[7] = 0; - actor->aiIndex += 2; - func_enmy2_8006D36C(actor); + case EV_OPC(EVOP_STOP_TEXLINE): + this->iwork[7] = 0; + this->aiIndex += 2; + ActorEvent_ProcessScript(this); break; - case EVOP_40 << 9: - actor->state = 6; - actor->timer_0BC = actorScript[actor->aiIndex + 1]; - actor->fwork[24] = actorScript[actor->aiIndex] & 0x1FF; - actor->aiIndex += 2; + case EV_OPC(EVOP_SET_STATE_6): + this->state = EVSTATE_6; + this->timer_0BC = actorScript[this->aiIndex + 1]; + this->fwork[24] = actorScript[this->aiIndex] & 0x1FF; + this->aiIndex += 2; break; - case EVOP_41 << 9: - actor->state = 7; - actor->timer_0BC = actorScript[actor->aiIndex + 1]; - actor->fwork[24] = actorScript[actor->aiIndex] & 0x1FF; - actor->aiIndex += 2; + case EV_OPC(EVOP_SET_STATE_7): + this->state = EVSTATE_7; + this->timer_0BC = actorScript[this->aiIndex + 1]; + this->fwork[24] = actorScript[this->aiIndex] & 0x1FF; + this->aiIndex += 2; break; - case EVOP_42 << 9: - actor->state = 8; - actor->timer_0BC = actorScript[actor->aiIndex + 1]; - actor->fwork[24] = actorScript[actor->aiIndex] & 0x1FF; - actor->aiIndex += 2; + case EV_OPC(EVOP_SET_STATE_8): + this->state = EVSTATE_8; + this->timer_0BC = actorScript[this->aiIndex + 1]; + this->fwork[24] = actorScript[this->aiIndex] & 0x1FF; + this->aiIndex += 2; break; - case EVOP_43 << 9: - actor->state = 9; - actor->timer_0BC = actorScript[actor->aiIndex + 1]; - actor->fwork[24] = actorScript[actor->aiIndex] & 0x1FF; - actor->aiIndex += 2; + case EV_OPC(EVOP_SET_STATE_9): + this->state = EVSTATE_9; + this->timer_0BC = actorScript[this->aiIndex + 1]; + this->fwork[24] = actorScript[this->aiIndex] & 0x1FF; + this->aiIndex += 2; break; - case EVOP_45 << 9: - actor->state = 1; - actor->iwork[1] = D_enmy2_800CFF80[actorScript[actor->aiIndex] & 0x1FF]; - actor->fwork[17] = actorScript[actor->aiIndex + 1]; - actor->timer_0BC = 0; - actor->aiIndex += 2; + case EV_OPC(EVOP_SET_IWORK_1_TO_IWORK_12): + this->state = EVSTATE_1; + this->iwork[1] = D_enmy2_800CFF80[actorScript[this->aiIndex] & 0x1FF]; + this->fwork[17] = actorScript[this->aiIndex + 1]; + this->timer_0BC = 0; + this->aiIndex += 2; break; - case EVOP_44 << 9: - actor->state = 0xD; - actor->timer_0BC = actorScript[actor->aiIndex + 1]; - actor->fwork[24] = actorScript[actor->aiIndex] & 0x1FF; - actor->aiIndex += 2; + case EV_OPC(EVOP_SET_STATE_13): + this->state = EVSTATE_13; + this->timer_0BC = actorScript[this->aiIndex + 1]; + this->fwork[24] = actorScript[this->aiIndex] & 0x1FF; + this->aiIndex += 2; break; - case EVOP_46 << 9: - actor->state = 0xE; - actor->timer_0BC = actorScript[actor->aiIndex + 1]; - actor->fwork[24] = actorScript[actor->aiIndex] & 0x1FF; - actor->aiIndex += 2; + case EV_OPC(EVOP_SET_STATE_14): + this->state = EVSTATE_14; + this->timer_0BC = actorScript[this->aiIndex + 1]; + this->fwork[24] = actorScript[this->aiIndex] & 0x1FF; + this->aiIndex += 2; break; - case EVOP_47 << 9: - actor->state = 0xF; - actor->timer_0BC = actorScript[actor->aiIndex + 1]; - actor->fwork[24] = actorScript[actor->aiIndex] & 0x1FF; - actor->aiIndex += 2; + case EV_OPC(EVOP_SET_STATE_15): + this->state = EVSTATE_15; + this->timer_0BC = actorScript[this->aiIndex + 1]; + this->fwork[24] = actorScript[this->aiIndex] & 0x1FF; + this->aiIndex += 2; break; - case EVOP_BRANCH << 9: - actor->iwork[2] = actorScript[actor->aiIndex + 1]; - actor->iwork[3] = actorScript[actor->aiIndex] & 0x1FF; - actor->aiIndex += 2; - func_enmy2_8006D36C(actor); + case EV_OPC(EVOP_SET_TRIGGER): + this->iwork[2] = actorScript[this->aiIndex + 1]; + this->iwork[3] = actorScript[this->aiIndex] & 0x1FF; + this->aiIndex += 2; + ActorEvent_ProcessScript(this); break; - case EVOP_LOOP << 9: - if (actorScript[actor->aiIndex + 1] < actor->iwork[0]) { - actor->aiIndex += 2; - actor->iwork[0] = 0; - } else if ((actorScript[actor->aiIndex] & 0x1FF) < 200) { - actor->aiIndex = (actorScript[actor->aiIndex] & 0x1FF) * 2; - actor->iwork[0]++; + case EV_OPC(EVOP_LOOP): + if (actorScript[this->aiIndex + 1] < this->iwork[0]) { + this->aiIndex += 2; + this->iwork[0] = 0; + } else if ((actorScript[this->aiIndex] & 0x1FF) < 200) { + this->aiIndex = (actorScript[this->aiIndex] & 0x1FF) * 2; + this->iwork[0]++; } else { - actor->aiType = (actorScript[actor->aiIndex] & 0x1FF) - 200; - actor->aiIndex = 0; - actor->iwork[0] = 0; + this->aiType = (actorScript[this->aiIndex] & 0x1FF) - 200; + this->aiIndex = 0; + this->iwork[0] = 0; } - func_enmy2_8006D36C(actor); + ActorEvent_ProcessScript(this); break; - case EVOP_48 << 9: - actor->state = 1; - actor->timer_0BC = actorScript[actor->aiIndex + 1]; - actor->aiIndex += 2; + case EV_OPC(EVOP_SET_STATE_1): + this->state = EVSTATE_1; + this->timer_0BC = actorScript[this->aiIndex + 1]; + this->aiIndex += 2; break; - case EVOP_SET_SPEED << 9: - actor->fwork[0] = actorScript[actor->aiIndex] & 0x7F; - actor->fwork[1] = actor->fwork[0]; - actor->iwork[5] = actorScript[actor->aiIndex] & 0x180; - actor->timer_0BC = actorScript[actor->aiIndex + 1]; - actor->state = 1; - actor->aiIndex += 2; + case EV_OPC(EVOP_SET_SPEED): + this->fwork[0] = actorScript[this->aiIndex] & 0x7F; + this->fwork[1] = this->fwork[0]; + this->iwork[5] = EV_ZMODE_MASK(actorScript[this->aiIndex]); + this->timer_0BC = actorScript[this->aiIndex + 1]; + this->state = EVSTATE_1; + this->aiIndex += 2; break; - case EVOP_2 << 9: - actor->fwork[22] = actorScript[actor->aiIndex + 1] & 0xFF; - actor->aiIndex += 2; - func_enmy2_8006D36C(actor); + case EV_OPC(EVOP_SET_BASE_ZVEL): + this->fwork[22] = actorScript[this->aiIndex + 1] & 0xFF; + this->aiIndex += 2; + ActorEvent_ProcessScript(this); break; - case EVOP_SET_ACCEL << 9: - actor->fwork[1] = actorScript[actor->aiIndex] & 0x7F; - actor->iwork[5] = actorScript[actor->aiIndex] & 0x180; - actor->timer_0BC = actorScript[actor->aiIndex + 1]; - actor->state = 1; - actor->aiIndex += 2; + case EV_OPC(EVOP_SET_ACCEL): + this->fwork[1] = actorScript[this->aiIndex] & 0x7F; + this->iwork[5] = EV_ZMODE_MASK(actorScript[this->aiIndex]); + this->timer_0BC = actorScript[this->aiIndex + 1]; + this->state = EVSTATE_1; + this->aiIndex += 2; break; - case EVOP_4 << 9: - actor->timer_0C0 = actorScript[actor->aiIndex + 1]; - actor->iwork[13] = 1; - actor->aiIndex += 2; - func_enmy2_8006D36C(actor); + case EV_OPC(EVOP_SET_IWORK_13): + this->timer_0C0 = actorScript[this->aiIndex + 1]; + this->iwork[13] = 1; + this->aiIndex += 2; + ActorEvent_ProcessScript(this); break; - case EVOP_8 << 9: - actor->iwork[13] = 0; - actor->aiIndex += 2; - func_enmy2_8006D36C(actor); + case EV_OPC(EVOP_CLEAR_IWORK_13): + this->iwork[13] = 0; + this->aiIndex += 2; + ActorEvent_ProcessScript(this); break; - case EVOP_9 << 9: - actor->state = 2; - actor->fwork[2] = actorScript[actor->aiIndex] & 0x1FF; - actor->fwork[3] = actorScript[actor->aiIndex + 1] * 0.1f; - actor->aiIndex += 2; + case EV_OPC(EVOP_F4_PLUS_X): + this->state = EVSTATE_F4_PLUS_X; + this->fwork[2] = actorScript[this->aiIndex] & 0x1FF; + this->fwork[3] = actorScript[this->aiIndex + 1] * 0.1f; + this->aiIndex += 2; break; - case EVOP_10 << 9: - actor->state = 3; - actor->fwork[2] = actorScript[actor->aiIndex] & 0x1FF; - actor->fwork[3] = actorScript[actor->aiIndex + 1] * 0.1f; - actor->aiIndex += 2; + case EV_OPC(EVOP_F4_MINUS_X): + this->state = EVSTATE_F4_MINUS_X; + this->fwork[2] = actorScript[this->aiIndex] & 0x1FF; + this->fwork[3] = actorScript[this->aiIndex + 1] * 0.1f; + this->aiIndex += 2; break; - case EVOP_11 << 9: - actor->state = 4; - actor->fwork[2] = actorScript[actor->aiIndex] & 0x1FF; - actor->fwork[3] = actorScript[actor->aiIndex + 1] * 0.1f; - actor->aiIndex += 2; + case EV_OPC(EVOP_F4_PLUS_Y): + this->state = EVSTATE_F4_PLUS_Y; + this->fwork[2] = actorScript[this->aiIndex] & 0x1FF; + this->fwork[3] = actorScript[this->aiIndex + 1] * 0.1f; + this->aiIndex += 2; break; - case EVOP_12 << 9: - actor->state = 5; - actor->fwork[2] = actorScript[actor->aiIndex] & 0x1FF; - actor->fwork[3] = actorScript[actor->aiIndex + 1] * 0.1f; - actor->aiIndex += 2; + case EV_OPC(EVOP_F4_MINUS_Y): + this->state = EVSTATE_F4_MINUS_Y; + this->fwork[2] = actorScript[this->aiIndex] & 0x1FF; + this->fwork[3] = actorScript[this->aiIndex + 1] * 0.1f; + this->aiIndex += 2; break; - case EVOP_16 << 9: - actor->fwork[4] = actorScript[actor->aiIndex] & 0x1FF; - actor->fwork[5] = actorScript[actor->aiIndex + 1] * 0.1f; - actor->fwork[6] = 1.0f; - actor->aiIndex += 2; - func_enmy2_8006D36C(actor); + case EV_OPC(EVOP_ROT_PLUS_X): + this->fwork[4] = actorScript[this->aiIndex] & 0x1FF; + this->fwork[5] = actorScript[this->aiIndex + 1] * 0.1f; + this->fwork[6] = 1.0f; + this->aiIndex += 2; + ActorEvent_ProcessScript(this); break; - case EVOP_17 << 9: - actor->fwork[4] = actorScript[actor->aiIndex] & 0x1FF; - actor->fwork[5] = actorScript[actor->aiIndex + 1] * 0.1f; - actor->fwork[6] = -1.0f; - actor->aiIndex += 2; - func_enmy2_8006D36C(actor); + case EV_OPC(EVOP_ROT_MINUS_X): + this->fwork[4] = actorScript[this->aiIndex] & 0x1FF; + this->fwork[5] = actorScript[this->aiIndex + 1] * 0.1f; + this->fwork[6] = -1.0f; + this->aiIndex += 2; + ActorEvent_ProcessScript(this); break; - case EVOP_18 << 9: - actor->fwork[7] = actorScript[actor->aiIndex] & 0x1FF; - actor->fwork[8] = actorScript[actor->aiIndex + 1] * 0.1f; - actor->fwork[9] = 1.0f; - actor->aiIndex += 2; - func_enmy2_8006D36C(actor); + case EV_OPC(EVOP_ROT_PLUS_Y): + this->fwork[7] = actorScript[this->aiIndex] & 0x1FF; + this->fwork[8] = actorScript[this->aiIndex + 1] * 0.1f; + this->fwork[9] = 1.0f; + this->aiIndex += 2; + ActorEvent_ProcessScript(this); break; - case EVOP_19 << 9: - actor->fwork[7] = actorScript[actor->aiIndex] & 0x1FF; - actor->fwork[8] = actorScript[actor->aiIndex + 1] * 0.1f; - actor->fwork[9] = -1.0f; - actor->aiIndex += 2; - func_enmy2_8006D36C(actor); + case EV_OPC(EVOP_ROT_MINUS_Y): + this->fwork[7] = actorScript[this->aiIndex] & 0x1FF; + this->fwork[8] = actorScript[this->aiIndex + 1] * 0.1f; + this->fwork[9] = -1.0f; + this->aiIndex += 2; + ActorEvent_ProcessScript(this); break; - case EVOP_20 << 9: - actor->fwork[10] = actorScript[actor->aiIndex] & 0x1FF; - actor->fwork[11] = actorScript[actor->aiIndex + 1] * 0.1f; - actor->fwork[12] = 1.0f; - actor->aiIndex += 2; - func_enmy2_8006D36C(actor); + case EV_OPC(EVOP_ROT_PLUS_Z): + this->fwork[10] = actorScript[this->aiIndex] & 0x1FF; + this->fwork[11] = actorScript[this->aiIndex + 1] * 0.1f; + this->fwork[12] = 1.0f; + this->aiIndex += 2; + ActorEvent_ProcessScript(this); break; - case EVOP_21 << 9: - actor->fwork[10] = actorScript[actor->aiIndex] & 0x1FF; - actor->fwork[11] = actorScript[actor->aiIndex + 1] * 0.1f; - actor->fwork[12] = -1.0f; - actor->aiIndex += 2; - func_enmy2_8006D36C(actor); + case EV_OPC(EVOP_ROT_MINUS_Z): + this->fwork[10] = actorScript[this->aiIndex] & 0x1FF; + this->fwork[11] = actorScript[this->aiIndex + 1] * 0.1f; + this->fwork[12] = -1.0f; + this->aiIndex += 2; + ActorEvent_ProcessScript(this); break; - case EVOP_SET_ROTATE << 9: - actor->iwork[6] = 1; - actor->aiIndex += 2; - func_enmy2_8006D36C(actor); + case EV_OPC(EVOP_SET_ROTATE): + this->iwork[6] = 1; + this->aiIndex += 2; + ActorEvent_ProcessScript(this); break; - case EVOP_STOP_ROTATE << 9: - actor->iwork[6] = 0; - actor->aiIndex += 2; - func_enmy2_8006D36C(actor); + case EV_OPC(EVOP_STOP_ROTATE): + this->iwork[6] = 0; + this->aiIndex += 2; + ActorEvent_ProcessScript(this); break; } } -void func_enmy2_8006EA50(Actor* actor) { - if ((actor->iwork[7] != 0) && (gTexturedLines[actor->iwork[8]].mode != 0)) { - gTexturedLines[actor->iwork[8]].unk_10.x = actor->obj.pos.x; - gTexturedLines[actor->iwork[8]].unk_10.y = actor->obj.pos.y; - gTexturedLines[actor->iwork[8]].unk_10.z = actor->obj.pos.z; +void ActorEvent_UpdateTexLines(Actor* this) { + if ((this->iwork[7] != 0) && (gTexturedLines[this->iwork[8]].mode != 0)) { + gTexturedLines[this->iwork[8]].unk_10.x = this->obj.pos.x; + gTexturedLines[this->iwork[8]].unk_10.y = this->obj.pos.y; + gTexturedLines[this->iwork[8]].unk_10.z = this->obj.pos.z; } } -void func_enmy2_8006EAC4(Effect* effect, f32 xPos, f32 yPos, f32 zPos) { +void ActorEvent_8006EAC4(Effect* effect, f32 xPos, f32 yPos, f32 zPos) { Effect_Initialize(effect); effect->obj.status = OBJ_INIT; effect->obj.id = OBJ_EFFECT_374; @@ -1585,18 +1575,18 @@ void func_enmy2_8006EAC4(Effect* effect, f32 xPos, f32 yPos, f32 zPos) { AUDIO_PLAY_SFX(0x2900201D, effect->sfxSource, 4); } -void func_enmy2_8006EB64(f32 xPos, f32 yPos, f32 zPos) { +void ActorEvent_8006EB64(f32 xPos, f32 yPos, f32 zPos) { s32 i; for (i = 50; i < ARRAY_COUNT(gEffects); i++) { if (gEffects[i].obj.status == OBJ_FREE) { - func_enmy2_8006EAC4(&gEffects[i], xPos, yPos, zPos); + ActorEvent_8006EAC4(&gEffects[i], xPos, yPos, zPos); break; } } } -void func_enmy2_8006EBC0(Actor* actor, f32 xPos, f32 yPos, f32 zPos) { +void ActorEvent_8006EBC0(Actor* actor, f32 xPos, f32 yPos, f32 zPos) { Actor_Initialize(actor); actor->obj.status = OBJ_INIT; actor->obj.id = OBJ_ACTOR_225; @@ -1610,12 +1600,12 @@ void func_enmy2_8006EBC0(Actor* actor, f32 xPos, f32 yPos, f32 zPos) { AUDIO_PLAY_SFX(0x2900201D, actor->sfxSource, 4); } -void func_enmy2_8006EC60(f32 xPos, f32 yPos, f32 zPos) { +void ActorEvent_8006EC60(f32 xPos, f32 yPos, f32 zPos) { s32 i; for (i = 0; i < ARRAY_COUNT(gActors); i++) { if (gActors[i].obj.status == OBJ_FREE) { - func_enmy2_8006EBC0(&gActors[i], xPos, yPos, zPos); + ActorEvent_8006EBC0(&gActors[i], xPos, yPos, zPos); break; } } @@ -1650,12 +1640,12 @@ void func_enmy2_8006ECBC(PlayerShotId objId, PlayerShot* shot, s32 unk0E4, f32 x shot->playerNum = unk0E4 + 100; if (gLevelMode == LEVELMODE_ALL_RANGE) { - if (unk0E4 + 100 < 104) { + if (unk0E4 + 100 <= AI360_PEPPY + 100) { AUDIO_PLAY_SFX(0x2900000D, shot->sfxSource, 4); } else { AUDIO_PLAY_SFX(0x29002002, shot->sfxSource, 4); } - } else if ((unk0E4 < 60) && (gActors[unk0E4].obj.id == OBJ_ACTOR_200) && (gActors[unk0E4].iwork[12] > 0)) { + } else if ((unk0E4 < 60) && (gActors[unk0E4].obj.id == OBJ_ACTOR_EVENT) && (gActors[unk0E4].iwork[12] > 0)) { AUDIO_PLAY_SFX(0x2900000D, shot->sfxSource, 4); } else if (unk0E4 + 100 == 200) { shot->playerNum = 100; @@ -1691,7 +1681,7 @@ void func_enmy2_8006EFA0(s32 unk0E4, f32 xPos, f32 yPos, f32 zPos, f32 arg4, f32 } } -void func_enmy2_8006F044(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 arg4) { +void ActorEvent_8006F044(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 arg4) { Effect_Initialize(effect); effect->obj.status = OBJ_INIT; effect->obj.id = OBJ_EFFECT_347; @@ -1706,18 +1696,18 @@ void func_enmy2_8006F044(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 arg4) func_effect_8007A6F0(&effect->obj.pos, 0x2903B009); } -void func_enmy2_8006F0D8(f32 xPos, f32 yPos, f32 zPos, f32 arg3) { +void ActorEvent_8006F0D8(f32 xPos, f32 yPos, f32 zPos, f32 arg3) { s32 i; for (i = 0; i < ARRAY_COUNT(gEffects); i++) { if (gEffects[i].obj.status == OBJ_FREE) { - func_enmy2_8006F044(&gEffects[i], xPos, yPos, zPos, arg3); + ActorEvent_8006F044(&gEffects[i], xPos, yPos, zPos, arg3); break; } } } -void func_enmy2_8006F140(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 arg4) { +void ActorEvent_8006F140(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 arg4) { Effect_Initialize(effect); effect->obj.status = OBJ_INIT; effect->obj.id = OBJ_EFFECT_394; @@ -1735,18 +1725,18 @@ void func_enmy2_8006F140(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 arg4) func_effect_8007A6F0(&effect->obj.pos, 0x2903B009); } -void func_enmy2_8006F1EC(f32 xPos, f32 yPos, f32 zPos, f32 arg3) { +void ActorEvent_8006F1EC(f32 xPos, f32 yPos, f32 zPos, f32 arg3) { s32 i; for (i = 0; i < ARRAY_COUNT(gEffects); i++) { if (gEffects[i].obj.status == OBJ_FREE) { - func_enmy2_8006F140(&gEffects[i], xPos, yPos, zPos, arg3); + ActorEvent_8006F140(&gEffects[i], xPos, yPos, zPos, arg3); break; } } } -void func_enmy2_8006F254(Actor* actor) { +void ActorEvent_8006F254(Actor* actor) { Vec3f sp54; Vec3f sp48; @@ -1767,164 +1757,163 @@ void func_enmy2_8006F254(Actor* actor) { sp48.z, 1.0f); } -void func_enmy2_8006F40C(Actor* actor) { +void ActorEvent_ProcessActions(Actor* this) { s32 var_v1; Vec3f sp78; Vec3f sp6C; Object_4C* obj4C; - if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_3) && (actor->unk_0B4 != 0x34) && (actor->unk_0B4 != 0x67) && - (actor->unk_0B4 != 0x68) && (actor->unk_0B4 != 0x30) && (actor->unk_0B4 != 0x31) && (actor->unk_0B4 != 0x32)) { - switch (actor->unk_048) { - case 0: + if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_3) && (this->unk_0B4 != EINFO_52) && (this->unk_0B4 != EINFO_103) && + (this->unk_0B4 != EINFO_104) && (this->unk_0B4 != EINFO_48) && (this->unk_0B4 != EINFO_49) && + (this->unk_0B4 != EINFO_50)) { + switch (this->unk_048) { + case EVACT_0: break; - case 1: - func_enmy2_8006F254(actor); - actor->unk_048 = 0; + case EVACT_1: + ActorEvent_8006F254(this); + this->unk_048 = EVACT_0; break; - case 2: - if (actor->obj.pos.z < (gPlayer[0].unk_138 - 600.0f)) { - func_effect_8007F11C(OBJ_EFFECT_353, actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, + case EVACT_2: + if (this->obj.pos.z < (gPlayer[0].unk_138 - 600.0f)) { + func_effect_8007F11C(OBJ_EFFECT_353, this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, D_ctx_80177828); } - actor->unk_048 = 0; + this->unk_048 = EVACT_0; break; - case 3: - if (actor->timer_0BE == 0) { - actor->timer_0BE = 6; + case EVACT_3: + if (this->timer_0BE == 0) { + this->timer_0BE = 6; sp78.x = 0.0f; sp78.y = 0.0f; sp78.z = 100.0f; Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp78, &sp6C); - func_enmy2_8006EEFC(actor->index, actor->obj.pos.x + (sp6C.x * 1.5), - actor->obj.pos.y + (sp6C.y * 1.5), actor->obj.pos.z + (sp6C.z * 1.5), sp6C.x, - sp6C.y, sp6C.z, actor->unk_0F4.x, actor->unk_0F4.y, - actor->vwork[29].z + actor->unk_0F4.z); - actor->timer_0C2 = 2; - actor->timer_04C--; - if (actor->timer_04C <= 0) { - actor->unk_048 = 0; + func_enmy2_8006EEFC(this->index, this->obj.pos.x + (sp6C.x * 1.5), this->obj.pos.y + (sp6C.y * 1.5), + this->obj.pos.z + (sp6C.z * 1.5), sp6C.x, sp6C.y, sp6C.z, this->unk_0F4.x, + this->unk_0F4.y, this->vwork[29].z + this->unk_0F4.z); + this->timer_0C2 = 2; + this->timer_04C--; + if (this->timer_04C <= 0) { + this->unk_048 = EVACT_0; } } break; - case 4: - func_enmy2_8006EB64(actor->obj.pos.x, actor->obj.pos.y - 20.0f, actor->obj.pos.z); - actor->unk_048 = 0; + case EVACT_4: + ActorEvent_8006EB64(this->obj.pos.x, this->obj.pos.y - 20.0f, this->obj.pos.z); + this->unk_048 = EVACT_0; break; - case 5: - Matrix_RotateY(gCalcMatrix, actor->vwork[29].y * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, actor->vwork[29].x * M_DTOR, 1); - Matrix_RotateZ(gCalcMatrix, (actor->vwork[29].z + actor->unk_0F4.z) * M_DTOR, 1); - Matrix_RotateY(gCalcMatrix, actor->unk_0F4.y * M_DTOR, 1); - Matrix_RotateX(gCalcMatrix, actor->unk_0F4.x * M_DTOR, 1); + case EVACT_5: + Matrix_RotateY(gCalcMatrix, this->vwork[29].y * M_DTOR, 0); + Matrix_RotateX(gCalcMatrix, this->vwork[29].x * M_DTOR, 1); + Matrix_RotateZ(gCalcMatrix, (this->vwork[29].z + this->unk_0F4.z) * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, this->unk_0F4.y * M_DTOR, 1); + Matrix_RotateX(gCalcMatrix, this->unk_0F4.x * M_DTOR, 1); sp78.x = 0.0f; sp78.y = 0.0f; sp78.z = D_ctx_80177828; Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp78, &sp6C); - func_effect_8007F04C(OBJ_EFFECT_355, actor->obj.pos.x + sp6C.x, actor->obj.pos.y + sp6C.y, - actor->obj.pos.z + sp6C.z, actor->obj.rot.x, actor->obj.rot.y, actor->obj.rot.z, - actor->vwork[29].x, actor->vwork[29].y, actor->vwork[29].z + actor->unk_0F4.z, - sp6C.x, sp6C.y, sp6C.z, 1.0f); - actor->unk_048 = 0; + func_effect_8007F04C(OBJ_EFFECT_355, this->obj.pos.x + sp6C.x, this->obj.pos.y + sp6C.y, + this->obj.pos.z + sp6C.z, this->obj.rot.x, this->obj.rot.y, this->obj.rot.z, + this->vwork[29].x, this->vwork[29].y, this->vwork[29].z + this->unk_0F4.z, sp6C.x, + sp6C.y, sp6C.z, 1.0f); + this->unk_048 = EVACT_0; break; - case 6: - if (actor->obj.pos.z < (gPlayer[0].unk_138 - 600.0f)) { - func_effect_8007F11C(OBJ_EFFECT_355, actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, + case EVACT_6: + if (this->obj.pos.z < (gPlayer[0].unk_138 - 600.0f)) { + func_effect_8007F11C(OBJ_EFFECT_355, this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, D_ctx_80177828); } - actor->unk_048 = 0; + this->unk_048 = EVACT_0; break; - case 7: - if (actor->obj.pos.z < (gPlayer[0].unk_138 - 600.0f)) { - func_effect_8007F11C(OBJ_EFFECT_356, actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 60.0f); + case EVACT_7: + if (this->obj.pos.z < (gPlayer[0].unk_138 - 600.0f)) { + func_effect_8007F11C(OBJ_EFFECT_356, this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 60.0f); } - actor->unk_048 = 0; + this->unk_048 = EVACT_0; break; - case 8: + case EVACT_8: sp6C.x = gPlayer[0].pos.x; sp6C.y = gPlayer[0].pos.y; gPlayer[0].pos.x += RAND_FLOAT_CENTERED(300.0f); gPlayer[0].pos.y += RAND_FLOAT_CENTERED(300.0f); - func_effect_8007F11C(OBJ_EFFECT_353, actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, - D_ctx_80177828); + func_effect_8007F11C(OBJ_EFFECT_353, this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, D_ctx_80177828); gPlayer[0].pos.x = sp6C.x; gPlayer[0].pos.y = sp6C.y; - actor->unk_048 = 0; + this->unk_048 = EVACT_0; break; - case 9: + case EVACT_9: if (gCurrentLevel == LEVEL_AQUAS) { - func_enmy2_8006F1EC(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 12.0f); + ActorEvent_8006F1EC(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 12.0f); } else { - func_enmy2_8006F0D8(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 40.0f); + ActorEvent_8006F0D8(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 40.0f); } - Object_Kill(&actor->obj, actor->sfxSource); + Object_Kill(&this->obj, this->sfxSource); break; - case 10: + case EVACT_10: if (gCurrentLevel == LEVEL_AQUAS) { - func_enmy2_8006F1EC(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 6.0f); + ActorEvent_8006F1EC(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 6.0f); } else { - func_enmy2_8006F0D8(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 15.0f); + ActorEvent_8006F0D8(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 15.0f); } - Object_Kill(&actor->obj, actor->sfxSource); + Object_Kill(&this->obj, this->sfxSource); break; - case 11: - func_effect_8007BFFC(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, actor->vel.x, actor->vel.y, - actor->vel.z, actor->scale * 3.0f, 15); - func_enmy_80066254(actor); - Object_Kill(&actor->obj, actor->sfxSource); - func_effect_8007A6F0(&actor->obj.pos, 0x2903B009); + case EVACT_11: + func_effect_8007BFFC(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, this->vel.x, this->vel.y, + this->vel.z, this->scale * 3.0f, 15); + func_enmy_80066254(this); + Object_Kill(&this->obj, this->sfxSource); + func_effect_8007A6F0(&this->obj.pos, 0x2903B009); break; - case 12: - func_enmy_80066254(actor); - Object_Kill(&actor->obj, actor->sfxSource); + case EVACT_12: + func_enmy_80066254(this); + Object_Kill(&this->obj, this->sfxSource); break; - case 13: - if (actor->timer_0BE > 25) { - Math_SmoothStepToF(&actor->fwork[15], 90.0f, 0.2f, 8.0f, 0.01f); + case EVACT_13: + if (this->timer_0BE > 25) { + Math_SmoothStepToF(&this->fwork[15], 90.0f, 0.2f, 8.0f, 0.01f); } - if (actor->timer_0BE < 25) { - Math_SmoothStepToF(&actor->fwork[15], 0.0f, 0.2f, 8.0f, 0.01f); + if (this->timer_0BE < 25) { + Math_SmoothStepToF(&this->fwork[15], 0.0f, 0.2f, 8.0f, 0.01f); } - if (actor->timer_0BE == 30) { - func_enmy2_8006EC60(actor->obj.pos.x, actor->obj.pos.y - 50.0f, actor->obj.pos.z); + if (this->timer_0BE == 30) { + ActorEvent_8006EC60(this->obj.pos.x, this->obj.pos.y - 50.0f, this->obj.pos.z); } - if (actor->timer_0BE == 0) { - actor->unk_048 = 0; + if (this->timer_0BE == 0) { + this->unk_048 = EVACT_0; } break; - case 16: - func_effect_8007F11C(OBJ_EFFECT_353, actor->obj.pos.x + 190.0f, actor->obj.pos.y + 90.0f, - actor->obj.pos.z + 220.0f, D_ctx_80177828); - func_effect_8007F11C(OBJ_EFFECT_353, actor->obj.pos.x - 190.0f, actor->obj.pos.y + 90.0f, - actor->obj.pos.z + 220.0f, D_ctx_80177828); - actor->unk_048 = 0; + case EVACT_16: + func_effect_8007F11C(OBJ_EFFECT_353, this->obj.pos.x + 190.0f, this->obj.pos.y + 90.0f, + this->obj.pos.z + 220.0f, D_ctx_80177828); + func_effect_8007F11C(OBJ_EFFECT_353, this->obj.pos.x - 190.0f, this->obj.pos.y + 90.0f, + this->obj.pos.z + 220.0f, D_ctx_80177828); + this->unk_048 = EVACT_0; break; - case 17: - if (actor->obj.pos.z < (gPlayer[0].camEye.z - 600.0f)) { - func_effect_8007F20C(OBJ_EFFECT_353, actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, + case EVACT_17: + if (this->obj.pos.z < (gPlayer[0].camEye.z - 600.0f)) { + func_effect_8007F20C(OBJ_EFFECT_353, this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, D_ctx_80177828); } - actor->unk_048 = 0; + this->unk_048 = EVACT_0; break; - case 18: + case EVACT_18: for (var_v1 = 0, obj4C = gObjects4C; var_v1 < 40; var_v1++, obj4C++) { if ((obj4C->obj.status == OBJ_ACTIVE) && (obj4C->obj.id == OBJ_4C_175)) { @@ -1935,9 +1924,9 @@ void func_enmy2_8006F40C(Actor* actor) { f32 sp54; obj4C->obj.status = OBJ_FREE; - sp64 = obj4C->obj.pos.x - actor->obj.pos.x; - sp60 = obj4C->obj.pos.y - actor->obj.pos.y; - sp5C = obj4C->obj.pos.z - actor->obj.pos.z; + sp64 = obj4C->obj.pos.x - this->obj.pos.x; + sp60 = obj4C->obj.pos.y - this->obj.pos.y; + sp5C = obj4C->obj.pos.z - this->obj.pos.z; sp54 = Math_Atan2F(sp64, sp5C); sp54 = Math_RadToDeg(sp54); sp58 = -Math_Atan2F(sp60, sqrtf(SQ(sp64) + SQ(sp5C))); @@ -1948,67 +1937,66 @@ void func_enmy2_8006F40C(Actor* actor) { sp6C.y = 0.0f; sp6C.z = 50.0f; Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp6C, &sp78); - func_enmy2_8006EFA0(100, actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, sp78.x, sp78.y, + func_enmy2_8006EFA0(100, this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, sp78.x, sp78.y, sp78.z, sp58, sp54, 0.0f); break; } } - actor->unk_048 = 0; + this->unk_048 = EVACT_0; break; - case 19: - func_effect_80083D2C(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 40.0f); - actor->unk_048 = 0; + case EVACT_19: + func_effect_80083D2C(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 40.0f); + this->unk_048 = EVACT_0; break; } } } -void func_enmy2_8006FE28(Actor* actor) { - if ((fabsf(actor->obj.pos.x - gPlayer[0].pos.x) < 100.0f) && - (fabsf(actor->obj.pos.y - gPlayer[0].pos.y) < 100.0f) && - (fabsf(actor->obj.pos.z - gPlayer[0].unk_138) < 50.0f)) { +void ActorEvent_8006FE28(Actor* this) { + if ((fabsf(this->obj.pos.x - gPlayer[0].pos.x) < 100.0f) && (fabsf(this->obj.pos.y - gPlayer[0].pos.y) < 100.0f) && + (fabsf(this->obj.pos.z - gPlayer[0].unk_138) < 50.0f)) { func_enmy_80067A40(); - Audio_KillSfxBySourceAndId(actor->sfxSource, 0x1900302B); - Object_Kill(&actor->obj, actor->sfxSource); + Audio_KillSfxBySourceAndId(this->sfxSource, 0x1900302B); + Object_Kill(&this->obj, this->sfxSource); } } -void func_enmy2_8006FEEC(Actor* actor) { +void ActorEvent_8006FEEC(Actor* this) { s32 i; - if ((actor->unk_0D0 != 0) && (actor->health != 0)) { - actor->unk_0D0 = 0; - actor->timer_0C6 = 15; - actor->health -= actor->damage; + if ((this->unk_0D0 != 0) && (this->health != 0)) { + this->unk_0D0 = 0; + this->timer_0C6 = 15; + this->health -= this->damage; - if (actor->health <= 0) { + if (this->health <= 0) { for (i = 3; i < 11; i++) { - Zoness_801900FC(&actor->vwork[i], &actor->vwork[i + 11], RAND_FLOAT_CENTERED(20.0f), RAND_FLOAT(-10.0f), - RAND_FLOAT(10.0f), 41, actor->scale, 200, i); + Zoness_801900FC(&this->vwork[i], &this->vwork[i + 11], RAND_FLOAT_CENTERED(20.0f), RAND_FLOAT(-10.0f), + RAND_FLOAT(10.0f), 41, this->scale, 200, i); } - actor->unk_044 = 0; - func_enmy_80066254(actor); - Object_Kill(&actor->obj, actor->sfxSource); - func_effect_8007A6F0(&actor->obj.pos, 0x29018036); - func_effect_8007D2C8(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 4.0f); + this->itemDrop = DROP_NONE; + func_enmy_80066254(this); + Object_Kill(&this->obj, this->sfxSource); + func_effect_8007A6F0(&this->obj.pos, 0x29018036); + func_effect_8007D2C8(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 4.0f); } else { - AUDIO_PLAY_SFX(0x29033037, actor->sfxSource, 4); + AUDIO_PLAY_SFX(0x29033037, this->sfxSource, 4); } } } -bool func_enmy2_800700A4(Actor* actor) { - if ((actor->state != 12) && (actor->iwork[12] > 0) && (actor->iwork[12] < 4) && - (gTeamShields[actor->iwork[12]] <= 0)) { - actor->state = 12; - actor->iwork[2] = 0; - actor->fwork[10] = 360.0f; - actor->fwork[11] = 20.0f; - gTeamShields[actor->iwork[12]] = 1; +bool ActorEvent_800700A4(Actor* this) { + if ((this->state != EVSTATE_TEAM_RETREAT) && (this->iwork[12] > 0) && (this->iwork[12] < 4) && + (gTeamShields[this->iwork[12]] <= 0)) { + this->state = EVSTATE_TEAM_RETREAT; + this->iwork[2] = 0; + this->fwork[10] = 360.0f; + this->fwork[11] = 20.0f; + gTeamShields[this->iwork[12]] = 1; - switch (actor->iwork[12]) { + switch (this->iwork[12]) { case 1: Radio_PlayMessage(gMsg_ID_20220, RCID_FALCO); break; @@ -2019,267 +2007,268 @@ bool func_enmy2_800700A4(Actor* actor) { Radio_PlayMessage(gMsg_ID_20221, RCID_PEPPY); break; } - gTeamShields[actor->iwork[12]] = -1; - gTeamDamage[actor->iwork[12]] = 0; - actor->timer_0C2 = 5000; - actor->unk_0D0 = 0; + gTeamShields[this->iwork[12]] = -1; + gTeamDamage[this->iwork[12]] = 0; + this->timer_0C2 = 5000; + this->unk_0D0 = 0; return true; } return false; } -void func_enmy2_800701E0(Actor* actor) { +void ActorEvent_800701E0(Actor* this) { Vec3f sp3C; f32 var_fv1; f32 temp_fv1; - if (func_enmy2_800700A4(actor)) { + if (ActorEvent_800700A4(this)) { return; } - if ((actor->unk_0D0 != 0) && (actor->unk_0B4 == 0x43) && (actor->unk_0D2 == 0)) { - actor->unk_0D0 = 0; + if ((this->unk_0D0 != 0) && (this->unk_0B4 == EINFO_67) && (this->unk_0D2 == 0)) { + this->unk_0D0 = 0; } - if ((actor->unk_0D0 != 0) && (actor->unk_0B4 == 83) && (actor->timer_0C2 >= 2)) { - actor->unk_0D0 = 0; + if ((this->unk_0D0 != 0) && (this->unk_0B4 == EINFO_83) && (this->timer_0C2 >= 2)) { + this->unk_0D0 = 0; } - if ((actor->unk_0D0 != 0) && (((actor->unk_0B4 == 64) && (actor->unk_0D2 == 2)) || (actor->unk_0B4 != 64))) { - if (actor->iwork[12] >= 4) { - actor->damage = 0; + if ((this->unk_0D0 != 0) && + (((this->unk_0B4 == EINFO_64) && (this->unk_0D2 == 2)) || (this->unk_0B4 != EINFO_64))) { + if (this->iwork[12] >= 4) { + this->damage = 0; } - if ((actor->iwork[12] > 0) && (actor->iwork[12] < 4)) { - gTeamShields[actor->iwork[12]] -= actor->damage; - } else if ((actor->unk_0B4 == 83) && ((actor->damage == 30) || (actor->damage == 31))) { - actor->health = 0; + if ((this->iwork[12] > 0) && (this->iwork[12] < 4)) { + gTeamShields[this->iwork[12]] -= this->damage; + } else if ((this->unk_0B4 == EINFO_83) && ((this->damage == 30) || (this->damage == 31))) { + this->health = 0; } else { - actor->health -= actor->damage; + this->health -= this->damage; } - if (actor->health <= 0) { - if (actor->unk_0B4 == 106) { - BonusText_Display(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 3); + if (this->health <= 0) { + if (this->unk_0B4 == EINFO_106) { + BonusText_Display(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 3); if (1) {} gHitCount += 4; D_ctx_80177850 = 15; } - if (actor->unk_0B4 != 83) { - if ((actor->unk_0B4 == 6) && (gCurrentLevel == LEVEL_SOLAR)) { - AUDIO_PLAY_SFX(0x29018036, actor->sfxSource, 4); + if (this->unk_0B4 != EINFO_83) { + if ((this->unk_0B4 == EINFO_6) && (gCurrentLevel == LEVEL_SOLAR)) { + AUDIO_PLAY_SFX(0x29018036, this->sfxSource, 4); } else { - AUDIO_PLAY_SFX(0x2903700B, actor->sfxSource, 4); + AUDIO_PLAY_SFX(0x2903700B, this->sfxSource, 4); } - actor->obj.status = OBJ_DYING; + this->obj.status = OBJ_DYING; var_fv1 = 0.7f; if (gLevelType == LEVELTYPE_SPACE) { var_fv1 = 0.3f; } - if (((Rand_ZeroOne() < var_fv1) || (actor->iwork[12] != 0)) && (actor->info.unk_14 == 0) && - (actor->unk_0B4 != 13) && (actor->unk_0B4 != 14) && (actor->unk_0B4 != 61) && - (actor->damage <= 30) && (actor->unk_0B4 != 62) && (actor->unk_0B4 != 64) && - (actor->unk_0B4 != 72) && (actor->unk_0B4 != 68)) { - func_effect_8007D2C8(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, actor->scale * 4.0f); - actor->unk_0D0 = 0; + if (((Rand_ZeroOne() < var_fv1) || (this->iwork[12] != 0)) && (this->info.unk_14 == 0) && + (this->unk_0B4 != EINFO_13) && (this->unk_0B4 != EINFO_14) && (this->unk_0B4 != EINFO_61) && + (this->damage <= 30) && (this->unk_0B4 != EINFO_62) && (this->unk_0B4 != EINFO_64) && + (this->unk_0B4 != EINFO_72) && (this->unk_0B4 != EINFO_68)) { + func_effect_8007D2C8(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, this->scale * 4.0f); + this->unk_0D0 = 0; } - actor->timer_0C2 = 10; - actor->timer_0BE = 0; - actor->unk_046 = 0xFF; - actor->unk_048 = 900; - actor->unk_0C9 = 1; + this->timer_0C2 = 10; + this->timer_0BE = 0; + this->unk_046 = 255; + this->unk_048 = 900; + this->unk_0C9 = 1; if (gLevelType == LEVELTYPE_PLANET) { - actor->timer_04C = RAND_INT(2.9f); - if (actor->unk_0B4 == 2) { - actor->timer_04C = 1; - if (actor->obj.pos.x < actor->unk_0D8.x) { - func_play_800A69F8(1, actor->obj.pos.x + 20.0f, actor->obj.pos.y, actor->obj.pos.z); - actor->fwork[17] = 777.0f; + this->timer_04C = RAND_INT(2.9f); + if (this->unk_0B4 == EINFO_2) { + this->timer_04C = 1; + if (this->obj.pos.x < this->unk_0D8.x) { + func_play_800A69F8(1, this->obj.pos.x + 20.0f, this->obj.pos.y, this->obj.pos.z); + this->fwork[17] = 777.0f; } else { - func_play_800A69F8(0, actor->obj.pos.x - 20.0f, actor->obj.pos.y, actor->obj.pos.z); - actor->fwork[18] = 777.0f; + func_play_800A69F8(0, this->obj.pos.x - 20.0f, this->obj.pos.y, this->obj.pos.z); + this->fwork[18] = 777.0f; } } - actor->timer_0BC = 300; + this->timer_0BC = 300; if (gLevelMode != LEVELMODE_ALL_RANGE) { - actor->vel.x *= 0.5f; - actor->vel.y = RAND_FLOAT(5.0f); - if (actor->vel.z < 0.0f) { - actor->vel.z = actor->vel.z; + this->vel.x *= 0.5f; + this->vel.y = RAND_FLOAT(5.0f); + if (this->vel.z < 0.0f) { + this->vel.z = this->vel.z; } else { - actor->vel.z = actor->vel.z * 0.3f; + this->vel.z = this->vel.z * 0.3f; } - if (((actor->obj.pos.z + D_ctx_80177D20) > -3000.0f) && (actor->vel.z > 0.0f)) { - actor->vel.z = RAND_FLOAT(-10.0f); + if (((this->obj.pos.z + D_ctx_80177D20) > -3000.0f) && (this->vel.z > 0.0f)) { + this->vel.z = RAND_FLOAT(-10.0f); } } - if (actor->unk_0B4 == 90) { - actor->timer_04C = 999; + if (this->unk_0B4 == EINFO_90) { + this->timer_04C = 999; } } else { - switch (actor->unk_0B4) { - case 13: - func_enmy_800654E4(&actor->obj); + switch (this->unk_0B4) { + case EINFO_13: + func_enmy_800654E4(&this->obj); break; - case 61: - Meteo_8018CCF8(actor); + case EINFO_61: + Meteo_8018CCF8(this); break; - case 27: - actor->obj.pos.y -= actor->vel.y; - actor->obj.status = OBJ_ACTIVE; - func_effect_8007D0E0(actor->obj.pos.x - actor->vel.x, actor->obj.pos.y + 30.0f, - actor->obj.pos.z - actor->vel.z, actor->scale * 5.0f); - actor->unk_0D0 = 0; - actor->timer_0C2 = 10000; - actor->info.unk_1C = 0.0f; - gHitCount += actor->info.bonus; - D_ctx_80177850 = 0xF; + case EINFO_27: + this->obj.pos.y -= this->vel.y; + this->obj.status = OBJ_ACTIVE; + func_effect_8007D0E0(this->obj.pos.x - this->vel.x, this->obj.pos.y + 30.0f, + this->obj.pos.z - this->vel.z, this->scale * 5.0f); + this->unk_0D0 = 0; + this->timer_0C2 = 10000; + this->info.unk_1C = 0.0f; + gHitCount += this->info.bonus; + D_ctx_80177850 = 15; break; default: - actor->timer_0BC = 35; - actor->timer_04C = 2; - actor->vel.y = RAND_FLOAT_CENTERED(20.0f); - actor->vel.x = RAND_FLOAT_CENTERED(20.0f); - actor->vel.z = 0.0f; + this->timer_0BC = 35; + this->timer_04C = 2; + this->vel.y = RAND_FLOAT_CENTERED(20.0f); + this->vel.x = RAND_FLOAT_CENTERED(20.0f); + this->vel.z = 0.0f; break; } } } - if (actor->unk_0B4 == 0x52) { - AUDIO_PLAY_SFX(0x11000055, actor->sfxSource, 0); - actor->unk_0D0 = 1; - func_effect_8007C688(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 3.0f, 0x3C); + if (this->unk_0B4 == EINFO_82) { + AUDIO_PLAY_SFX(0x11000055, this->sfxSource, 0); + this->unk_0D0 = 1; + func_effect_8007C688(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 3.0f, 60); } } else { - actor->timer_0C6 = 20; - if ((actor->unk_0B4 == 6) && (gCurrentLevel == LEVEL_SOLAR)) { - AUDIO_PLAY_SFX(0x29033037, actor->sfxSource, 4); - } else if (actor->health < 20) { - AUDIO_PLAY_SFX(0x2943500F, actor->sfxSource, 4); + this->timer_0C6 = 20; + if ((this->unk_0B4 == EINFO_6) && (gCurrentLevel == LEVEL_SOLAR)) { + AUDIO_PLAY_SFX(0x29033037, this->sfxSource, 4); + } else if (this->health < 20) { + AUDIO_PLAY_SFX(0x2943500F, this->sfxSource, 4); } else { - AUDIO_PLAY_SFX(0x2903300E, actor->sfxSource, 4); + AUDIO_PLAY_SFX(0x2903300E, this->sfxSource, 4); } - if ((actor->unk_0B4 != 0xD) && (actor->unk_0B4 != 0x3D) && (actor->unk_0B4 != 0x53)) { - func_effect_8007D10C(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, actor->scale * 1.5f); + if ((this->unk_0B4 != EINFO_13) && (this->unk_0B4 != EINFO_61) && (this->unk_0B4 != EINFO_83)) { + func_effect_8007D10C(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, this->scale * 1.5f); } - if (((gLevelMode == LEVELMODE_ALL_RANGE) || (gLevelMode == LEVELMODE_UNK_2)) && (actor->unk_0B4 != 0x15) && - (actor->unk_0B4 != 0x17)) { - actor->fwork[13] = 20.0f; - if (actor->obj.pos.x < actor->unk_0D8.x) { - actor->fwork[13] *= -1.0f; + if (((gLevelMode == LEVELMODE_ALL_RANGE) || (gLevelMode == LEVELMODE_UNK_2)) && + (this->unk_0B4 != EINFO_21) && (this->unk_0B4 != EINFO_23)) { + this->fwork[13] = 20.0f; + if (this->obj.pos.x < this->unk_0D8.x) { + this->fwork[13] *= -1.0f; } } - if (actor->unk_0D4 == 1) { - switch (actor->iwork[12]) { + if (this->unk_0D4 == 1) { + switch (this->iwork[12]) { case 1: - if (actor->unk_0D0 == 3) { - func_enmy2_8006A7B0(gMsg_ID_20210, RCID_FALCO); + if (this->unk_0D0 == 3) { + ActorEvent_SetMessage(gMsg_ID_20210, RCID_FALCO); } else { - func_enmy2_8006A7B0(gMsg_ID_20060, RCID_FALCO); + ActorEvent_SetMessage(gMsg_ID_20060, RCID_FALCO); } break; case 3: - if (actor->unk_0D0 == 3) { - func_enmy2_8006A7B0(gMsg_ID_20200, RCID_PEPPY); + if (this->unk_0D0 == 3) { + ActorEvent_SetMessage(gMsg_ID_20200, RCID_PEPPY); } else { - func_enmy2_8006A7B0(gMsg_ID_20070, RCID_PEPPY); + ActorEvent_SetMessage(gMsg_ID_20070, RCID_PEPPY); } break; case 2: - if (actor->unk_0D0 == 3) { - func_enmy2_8006A7B0(gMsg_ID_20190, RCID_SLIPPY); + if (this->unk_0D0 == 3) { + ActorEvent_SetMessage(gMsg_ID_20190, RCID_SLIPPY); } else { - func_enmy2_8006A7B0(gMsg_ID_20080, RCID_SLIPPY); + ActorEvent_SetMessage(gMsg_ID_20080, RCID_SLIPPY); } break; case 4: - func_enmy2_8006A7B0(gMsg_ID_20084, RCID_KATT); + ActorEvent_SetMessage(gMsg_ID_20084, RCID_KATT); break; case 5: - func_enmy2_8006A7B0(gMsg_ID_20085, RCID_BILL); + ActorEvent_SetMessage(gMsg_ID_20085, RCID_BILL); break; } } - actor->unk_0D0 = 0; + this->unk_0D0 = 0; } } - if ((actor->iwork[12] == 0) && (actor->iwork[13] == 0) && (actor->info.unk_16 != 2) && + if ((this->iwork[12] == 0) && (this->iwork[13] == 0) && (this->info.unk_16 != 2) && (gLevelType == LEVELTYPE_SPACE)) { - sp3C.x = actor->vel.x; - sp3C.y = actor->vel.y; - sp3C.z = actor->vel.z; + sp3C.x = this->vel.x; + sp3C.y = this->vel.y; + sp3C.z = this->vel.z; - if ((func_enmy_8006351C(actor->index, &actor->obj.pos, &sp3C, 0) != 0) || - (actor->obj.pos.y < (gGroundLevel + 20.0f))) { - actor->obj.status = OBJ_DYING; - actor->obj.pos.z -= actor->vel.z; - actor->unk_0D0 = 1; - if (actor->unk_0B4 == 13) { - actor->obj.id = OBJ_ACTOR_182; - func_enmy_800654E4(&actor->obj); + if ((func_enmy_8006351C(this->index, &this->obj.pos, &sp3C, 0) != 0) || + (this->obj.pos.y < (gGroundLevel + 20.0f))) { + this->obj.status = OBJ_DYING; + this->obj.pos.z -= this->vel.z; + this->unk_0D0 = 1; + if (this->unk_0B4 == EINFO_13) { + this->obj.id = OBJ_ACTOR_182; + func_enmy_800654E4(&this->obj); } - if (actor->unk_0B4 == 61) { - Meteo_8018CCF8(actor); + if (this->unk_0B4 == EINFO_61) { + Meteo_8018CCF8(this); } } } } -void func_enmy2_80070BA8(Actor* actor) { - if (actor->unk_0D0 != 0) { - actor->unk_0D0 = 0; - if ((actor->unk_0B4 != 17) || ((actor->unk_0B4 == 17) && (actor->unk_0D2 == 0))) { - actor->timer_0C6 = 10; - func_effect_8007C120(actor->unk_0D8.x, actor->unk_0D8.y, actor->unk_0D8.z, actor->vel.x, actor->vel.y, - actor->vel.z, 0.2f, 10); - actor->health -= actor->damage; - AUDIO_PLAY_SFX(0x29033064, actor->sfxSource, 4); - if (actor->health <= 0) { - BonusText_Display(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, actor->info.bonus); - gHitCount += actor->info.bonus + 1; +void ActorEvent_80070BA8(Actor* this) { + if (this->unk_0D0 != 0) { + this->unk_0D0 = 0; + if ((this->unk_0B4 != EINFO_17) || ((this->unk_0B4 == EINFO_17) && (this->unk_0D2 == 0))) { + this->timer_0C6 = 10; + func_effect_8007C120(this->unk_0D8.x, this->unk_0D8.y, this->unk_0D8.z, this->vel.x, this->vel.y, + this->vel.z, 0.2f, 10); + this->health -= this->damage; + AUDIO_PLAY_SFX(0x29033064, this->sfxSource, 4); + if (this->health <= 0) { + BonusText_Display(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, this->info.bonus); + gHitCount += this->info.bonus + 1; D_ctx_80177850 = 15; } } else { - AUDIO_PLAY_SFX(0x29121007, actor->sfxSource, 4); + AUDIO_PLAY_SFX(0x29121007, this->sfxSource, 4); } } } -void func_enmy2_80070CEC(Actor* actor) { - if (actor->iwork[3] < 200) { - actor->aiIndex = actor->iwork[3] * 2; - actor->iwork[0] = 0; - actor->iwork[2] = 0; - func_enmy2_8006D36C(actor); +void ActorEvent_80070CEC(Actor* this) { + if (this->iwork[3] < 200) { + this->aiIndex = this->iwork[3] * 2; + this->iwork[0] = 0; + this->iwork[2] = 0; + ActorEvent_ProcessScript(this); } else { - actor->aiType = actor->iwork[3] - 200; - actor->aiIndex = 0; - actor->iwork[0] = 0; - actor->iwork[2] = 0; - func_enmy2_8006D36C(actor); + this->aiType = this->iwork[3] - 200; + this->aiIndex = 0; + this->iwork[0] = 0; + this->iwork[2] = 0; + ActorEvent_ProcessScript(this); } } -void func_enmy2_80070D44(Actor* actor) { +void ActorEvent_ProcessTriggers(Actor* this) { s32 i; s32 var_v1 = 0; s32 var_v1_4; @@ -2291,253 +2280,253 @@ void func_enmy2_80070D44(Actor* actor) { } } - if (actor->iwork[2] >= 100) { - if (fabsf(actor->obj.pos.z - gPlayer[0].unk_138) <= ((actor->iwork[2] - 100) * 100.0f)) { - func_enmy2_80070CEC(actor); + if (this->iwork[2] >= 100) { + if (fabsf(this->obj.pos.z - gPlayer[0].unk_138) <= ((this->iwork[2] - 100) * 100.0f)) { + ActorEvent_80070CEC(this); } return; } - switch (actor->iwork[2]) { - case EVC_0: + switch (this->iwork[2]) { + case EVC_NONE: break; case EVC_1: - if ((gActors[actor->iwork[1]].obj.status != OBJ_ACTIVE) || (gActors[actor->iwork[1]].health <= 0) || - (actor->iwork[10] != gActors[actor->iwork[1]].aiType)) { - func_enmy2_80070CEC(actor); + if ((gActors[this->iwork[1]].obj.status != OBJ_ACTIVE) || (gActors[this->iwork[1]].health <= 0) || + (this->iwork[10] != gActors[this->iwork[1]].aiType)) { + ActorEvent_80070CEC(this); } break; - case EVC_2: + case EVC_TEAM_COUNT_3: if (var_v1 == 3) { - func_enmy2_80070CEC(actor); + ActorEvent_80070CEC(this); } break; - case EVC_3: + case EVC_TEAM_COUNT_2: if (var_v1 == 2) { - func_enmy2_80070CEC(actor); + ActorEvent_80070CEC(this); } break; - case EVC_4: + case EVC_TEAM_COUNT_1: if (var_v1 == 1) { - func_enmy2_80070CEC(actor); + ActorEvent_80070CEC(this); } break; - case EVC_5: + case EVC_TEAM_COUNT_0: if (var_v1 == 0) { - func_enmy2_80070CEC(actor); + ActorEvent_80070CEC(this); } break; - case EVC_6: + case EVC_FALCO_ACTIVE: if (gTeamShields[1] > 0) { - func_enmy2_80070CEC(actor); + ActorEvent_80070CEC(this); } break; - case EVC_7: + case EVC_PEPPY_ACTIVE: if (gTeamShields[3] > 0) { - func_enmy2_80070CEC(actor); + ActorEvent_80070CEC(this); } break; - case EVC_8: + case EVC_SLIPPY_ACTIVE: if (gTeamShields[2] > 0) { - func_enmy2_80070CEC(actor); + ActorEvent_80070CEC(this); } break; case EVC_9: - if (((actor->obj.pos.x - gPlayer[0].pos.x) <= 100.0f) && ((actor->obj.pos.x - gPlayer[0].pos.x) >= 0.0f)) { - func_enmy2_80070CEC(actor); + if (((this->obj.pos.x - gPlayer[0].pos.x) <= 100.0f) && ((this->obj.pos.x - gPlayer[0].pos.x) >= 0.0f)) { + ActorEvent_80070CEC(this); } break; case EVC_10: - if (((actor->obj.pos.x - gPlayer[0].pos.x) <= 400.0f) && ((actor->obj.pos.x - gPlayer[0].pos.x) >= 0.0f)) { - func_enmy2_80070CEC(actor); + if (((this->obj.pos.x - gPlayer[0].pos.x) <= 400.0f) && ((this->obj.pos.x - gPlayer[0].pos.x) >= 0.0f)) { + ActorEvent_80070CEC(this); } break; case EVC_11: - if (((actor->obj.pos.x - gPlayer[0].pos.x) <= 700.0f) && ((actor->obj.pos.x - gPlayer[0].pos.x) >= 0.0f)) { - func_enmy2_80070CEC(actor); + if (((this->obj.pos.x - gPlayer[0].pos.x) <= 700.0f) && ((this->obj.pos.x - gPlayer[0].pos.x) >= 0.0f)) { + ActorEvent_80070CEC(this); } break; case EVC_12: - if (((actor->obj.pos.x - gPlayer[0].pos.x) <= 200.0f) && ((actor->obj.pos.x - gPlayer[0].pos.x) >= 0.0f)) { - func_enmy2_80070CEC(actor); + if (((this->obj.pos.x - gPlayer[0].pos.x) <= 200.0f) && ((this->obj.pos.x - gPlayer[0].pos.x) >= 0.0f)) { + ActorEvent_80070CEC(this); } break; case EVC_13: - if (((actor->obj.pos.x - gPlayer[0].pos.x) >= -100.0f) && ((actor->obj.pos.x - gPlayer[0].pos.x) <= 0.0f)) { - func_enmy2_80070CEC(actor); + if (((this->obj.pos.x - gPlayer[0].pos.x) >= -100.0f) && ((this->obj.pos.x - gPlayer[0].pos.x) <= 0.0f)) { + ActorEvent_80070CEC(this); } break; case EVC_14: - if (((actor->obj.pos.x - gPlayer[0].pos.x) >= -400.0f) && ((actor->obj.pos.x - gPlayer[0].pos.x) <= 0.0f)) { - func_enmy2_80070CEC(actor); + if (((this->obj.pos.x - gPlayer[0].pos.x) >= -400.0f) && ((this->obj.pos.x - gPlayer[0].pos.x) <= 0.0f)) { + ActorEvent_80070CEC(this); } break; case EVC_15: - if (((actor->obj.pos.x - gPlayer[0].pos.x) >= -700.0f) && ((actor->obj.pos.x - gPlayer[0].pos.x) <= 0.0f)) { - func_enmy2_80070CEC(actor); + if (((this->obj.pos.x - gPlayer[0].pos.x) >= -700.0f) && ((this->obj.pos.x - gPlayer[0].pos.x) <= 0.0f)) { + ActorEvent_80070CEC(this); } break; case EVC_16: - if (((actor->obj.pos.x - gPlayer[0].pos.x) >= -200.0f) && ((actor->obj.pos.x - gPlayer[0].pos.x) <= 0.0f)) { - func_enmy2_80070CEC(actor); + if (((this->obj.pos.x - gPlayer[0].pos.x) >= -200.0f) && ((this->obj.pos.x - gPlayer[0].pos.x) <= 0.0f)) { + ActorEvent_80070CEC(this); } break; case EVC_17: - if (((actor->obj.pos.y - gPlayer[0].pos.y) <= 100.0f) && ((actor->obj.pos.y - gPlayer[0].pos.y) >= 0.0f)) { - func_enmy2_80070CEC(actor); + if (((this->obj.pos.y - gPlayer[0].pos.y) <= 100.0f) && ((this->obj.pos.y - gPlayer[0].pos.y) >= 0.0f)) { + ActorEvent_80070CEC(this); } break; case EVC_18: - if (((actor->obj.pos.y - gPlayer[0].pos.y) <= 400.0f) && ((actor->obj.pos.y - gPlayer[0].pos.y) >= 0.0f)) { - func_enmy2_80070CEC(actor); + if (((this->obj.pos.y - gPlayer[0].pos.y) <= 400.0f) && ((this->obj.pos.y - gPlayer[0].pos.y) >= 0.0f)) { + ActorEvent_80070CEC(this); } break; case EVC_19: - if (((actor->obj.pos.y - gPlayer[0].pos.y) <= 700.0f) && ((actor->obj.pos.y - gPlayer[0].pos.y) >= 0.0f)) { - func_enmy2_80070CEC(actor); + if (((this->obj.pos.y - gPlayer[0].pos.y) <= 700.0f) && ((this->obj.pos.y - gPlayer[0].pos.y) >= 0.0f)) { + ActorEvent_80070CEC(this); } break; case EVC_20: - if (((actor->obj.pos.y - gPlayer[0].pos.y) <= 200.0f) && ((actor->obj.pos.y - gPlayer[0].pos.y) >= 0.0f)) { - func_enmy2_80070CEC(actor); + if (((this->obj.pos.y - gPlayer[0].pos.y) <= 200.0f) && ((this->obj.pos.y - gPlayer[0].pos.y) >= 0.0f)) { + ActorEvent_80070CEC(this); } break; case EVC_21: - if (((actor->obj.pos.y - gPlayer[0].pos.y) >= -100.0f) && ((actor->obj.pos.y - gPlayer[0].pos.y) <= 0.0f)) { - func_enmy2_80070CEC(actor); + if (((this->obj.pos.y - gPlayer[0].pos.y) >= -100.0f) && ((this->obj.pos.y - gPlayer[0].pos.y) <= 0.0f)) { + ActorEvent_80070CEC(this); } break; case EVC_22: - if (((actor->obj.pos.y - gPlayer[0].pos.y) >= -400.0f) && ((actor->obj.pos.y - gPlayer[0].pos.y) <= 0.0f)) { - func_enmy2_80070CEC(actor); + if (((this->obj.pos.y - gPlayer[0].pos.y) >= -400.0f) && ((this->obj.pos.y - gPlayer[0].pos.y) <= 0.0f)) { + ActorEvent_80070CEC(this); } break; case EVC_23: - if (((actor->obj.pos.y - gPlayer[0].pos.y) >= -700.0f) && ((actor->obj.pos.y - gPlayer[0].pos.y) <= 0.0f)) { - func_enmy2_80070CEC(actor); + if (((this->obj.pos.y - gPlayer[0].pos.y) >= -700.0f) && ((this->obj.pos.y - gPlayer[0].pos.y) <= 0.0f)) { + ActorEvent_80070CEC(this); } break; case EVC_24: - if (((actor->obj.pos.y - gPlayer[0].pos.y) >= -200.0f) && ((actor->obj.pos.y - gPlayer[0].pos.y) <= 0.0f)) { - func_enmy2_80070CEC(actor); + if (((this->obj.pos.y - gPlayer[0].pos.y) >= -200.0f) && ((this->obj.pos.y - gPlayer[0].pos.y) <= 0.0f)) { + ActorEvent_80070CEC(this); } break; - case EVC_25: + case EVC_HEALTH_100p: if (gPlayer[0].shields >= Play_GetMaxShields()) { - func_enmy2_80070CEC(actor); + ActorEvent_80070CEC(this); } break; - case EVC_26: + case EVC_HEALTH_75p: if (gPlayer[0].shields >= (Play_GetMaxShields() * 3 / 4)) { - func_enmy2_80070CEC(actor); + ActorEvent_80070CEC(this); } break; - case EVC_27: + case EVC_HEALTH_50p: if (gPlayer[0].shields >= (Play_GetMaxShields() / 2)) { - func_enmy2_80070CEC(actor); + ActorEvent_80070CEC(this); } break; - case EVC_28: + case EVC_HEALTH_25p: if (gPlayer[0].shields >= (Play_GetMaxShields() / 4)) { - func_enmy2_80070CEC(actor); + ActorEvent_80070CEC(this); } break; - case EVC_29: + case EVC_HEALTH_0p: if (gPlayer[0].shields == 0) { - func_enmy2_80070CEC(actor); + ActorEvent_80070CEC(this); } break; case EVC_30: if (gPlayer[0].unk_270 >= 5) { - func_enmy2_80070CEC(actor); + ActorEvent_80070CEC(this); } break; case EVC_31: if (gPlayer[0].unk_270 != 0) { - func_enmy2_80070CEC(actor); + ActorEvent_80070CEC(this); } break; case EVC_32: if (gPlayer[0].unk_270 == 0) { - func_enmy2_80070CEC(actor); + ActorEvent_80070CEC(this); } break; case EVC_33: if (gPlayer[0].unk_250 >= 16.8f) { - func_enmy2_80070CEC(actor); + ActorEvent_80070CEC(this); } break; case EVC_34: if (gPlayer[0].unk_250 <= 8.4f) { - func_enmy2_80070CEC(actor); + ActorEvent_80070CEC(this); } break; - case EVC_35: + case EVC_SINGLE_LASER: if (gPlayer[0].wings.unk_14 > -8.0f) { - func_enmy2_80070CEC(actor); + ActorEvent_80070CEC(this); } break; - case EVC_36: + case EVC_TWIN_LASER: if ((gPlayer[0].wings.unk_14 < -8.0f) && (gLaserStrength[0] == LASERS_TWIN)) { - func_enmy2_80070CEC(actor); + ActorEvent_80070CEC(this); } break; - case EVC_37: + case EVC_HYPER_LASER: if ((gPlayer[0].wings.unk_14 < -8.0f) && (gLaserStrength[0] == LASERS_HYPER)) { - func_enmy2_80070CEC(actor); + ActorEvent_80070CEC(this); } break; - case EVC_38: + case EVC_UNK3_LASER: if ((gPlayer[0].wings.unk_14 < -8.0f) && (gLaserStrength[0] == LASERS_UNK_3)) { - func_enmy2_80070CEC(actor); + ActorEvent_80070CEC(this); } break; case EVC_39: for (i = 0; i < ARRAY_COUNT(gPlayerShots); i++) { if ((gPlayerShots[i].obj.status == 1) && - (fabsf(actor->obj.pos.x - gPlayerShots[i].obj.pos.x) < 150.0f) && - (fabsf(actor->obj.pos.y - gPlayerShots[i].obj.pos.y) < 150.0f) && - (fabsf(actor->obj.pos.z - gPlayerShots[i].obj.pos.z) < 150.0f)) { - func_enmy2_80070CEC(actor); + (fabsf(this->obj.pos.x - gPlayerShots[i].obj.pos.x) < 150.0f) && + (fabsf(this->obj.pos.y - gPlayerShots[i].obj.pos.y) < 150.0f) && + (fabsf(this->obj.pos.z - gPlayerShots[i].obj.pos.z) < 150.0f)) { + ActorEvent_80070CEC(this); break; } } @@ -2546,45 +2535,45 @@ void func_enmy2_80070D44(Actor* actor) { case EVC_40: for (i = 0; i < ARRAY_COUNT(gPlayerShots); i++) { if ((gPlayerShots[i].obj.status == 1) && - (fabsf(actor->obj.pos.x - gPlayerShots[i].obj.pos.x) < 300.0f) && - (fabsf(actor->obj.pos.y - gPlayerShots[i].obj.pos.y) < 300.0f) && - (fabsf(actor->obj.pos.z - gPlayerShots[i].obj.pos.z) < 300.0f)) { - func_enmy2_80070CEC(actor); + (fabsf(this->obj.pos.x - gPlayerShots[i].obj.pos.x) < 300.0f) && + (fabsf(this->obj.pos.y - gPlayerShots[i].obj.pos.y) < 300.0f) && + (fabsf(this->obj.pos.z - gPlayerShots[i].obj.pos.z) < 300.0f)) { + ActorEvent_80070CEC(this); break; } } break; case EVC_41: - if ((gActors[actor->iwork[9]].obj.status != OBJ_ACTIVE) || - ((gActors[actor->iwork[9]].scale < 0.0f) && (actor->health <= 0))) { - func_enmy2_80070CEC(actor); + if ((gActors[this->iwork[9]].obj.status != OBJ_ACTIVE) || + ((gActors[this->iwork[9]].scale < 0.0f) && (this->health <= 0))) { + ActorEvent_80070CEC(this); } break; case EVC_42: for (i = 0; i < ARRAY_COUNT(gActors); i++) { - if ((gActors[i].obj.status == OBJ_ACTIVE) && (gActors[i].obj.id == OBJ_ACTOR_200) && - (gActors[i].iwork[13] != 0) && (i != actor->index) && (actor->index == gActors[i].iwork[9])) { + if ((gActors[i].obj.status == OBJ_ACTIVE) && (gActors[i].obj.id == OBJ_ACTOR_EVENT) && + (gActors[i].iwork[13] != 0) && (i != this->index) && (this->index == gActors[i].iwork[9])) { return; } } - func_enmy2_80070CEC(actor); + ActorEvent_80070CEC(this); break; case EVC_43: for (i = 0; i < ARRAY_COUNT(gActors); i++) { - if ((gActors[i].obj.status == OBJ_ACTIVE) && (gActors[i].obj.id == OBJ_ACTOR_200) && - (gActors[i].iwork[13] != 0) && (i != actor->index) && (actor->index == gActors[i].iwork[9])) { - func_enmy2_80070CEC(actor); + if ((gActors[i].obj.status == OBJ_ACTIVE) && (gActors[i].obj.id == OBJ_ACTOR_EVENT) && + (gActors[i].iwork[13] != 0) && (i != this->index) && (this->index == gActors[i].iwork[9])) { + ActorEvent_80070CEC(this); break; } } break; case EVC_44: - if (actor->unk_0D0 != 0) { - func_enmy2_80070CEC(actor); + if (this->unk_0D0 != 0) { + ActorEvent_80070CEC(this); } break; @@ -2601,146 +2590,146 @@ void func_enmy2_80070D44(Actor* actor) { break; } - if (((gCurrentLevel != LEVEL_CORNERIA) || (gTeamShields[1] > 0)) && (D_ctx_80177E80 >= var_v1_4)) { - func_enmy2_80070CEC(actor); + if (!((gCurrentLevel == LEVEL_CORNERIA) && (gTeamShields[1] <= 0)) && (D_ctx_80177E80 >= var_v1_4)) { + ActorEvent_80070CEC(this); } break; case EVC_46: for (i = 0, otherActor = gActors; i < ARRAY_COUNT(gActors); i++, otherActor++) { if (((otherActor->obj.status == OBJ_DYING) || (otherActor->obj.status == OBJ_FREE)) && - (otherActor->iwork[15] == actor->iwork[15]) && (otherActor->iwork[16] != 0)) { - func_enmy2_80070CEC(actor); + (otherActor->iwork[15] == this->iwork[15]) && (otherActor->iwork[16] != 0)) { + ActorEvent_80070CEC(this); } } break; - case EVC_47: + case EVC_PRESS_CRIGHT: if (gControllerPress[gMainController].button & R_CBUTTONS) { func_8001AF40(0); D_enmy2_800CFF90 = 0; D_enmy2_80161690 = 0; - func_enmy2_80070CEC(actor); + ActorEvent_80070CEC(this); } break; - case EVC_48: + case EVC_WING_BROKEN: if ((gPlayer[0].wings.rightState <= WINGSTATE_BROKEN) || (gPlayer[0].wings.leftState <= WINGSTATE_BROKEN)) { - func_enmy2_80070CEC(actor); + ActorEvent_80070CEC(this); } break; - case EVC_49: + case EVC_ME_CLEAR: if (D_play_800D3180[LEVEL_METEO] != 0) { - func_enmy2_80070CEC(actor); + ActorEvent_80070CEC(this); } break; - case EVC_50: + case EVC_FO_CLEAR: if (D_play_800D3180[LEVEL_FORTUNA] != 0) { - func_enmy2_80070CEC(actor); + ActorEvent_80070CEC(this); } break; - case EVC_51: + case EVC_SX_CLEAR: if (D_play_800D3180[LEVEL_SECTOR_X] != 0) { - func_enmy2_80070CEC(actor); + ActorEvent_80070CEC(this); } break; - case EVC_52: + case EVC_TI_CLEAR: if (D_play_800D3180[LEVEL_TITANIA] != 0) { - func_enmy2_80070CEC(actor); + ActorEvent_80070CEC(this); } break; - case EVC_53: + case EVC_BO_CLEAR: if (D_play_800D3180[LEVEL_BOLSE] != 0) { - func_enmy2_80070CEC(actor); + ActorEvent_80070CEC(this); } break; - case EVC_54: + case EVC_SY_CLEAR: if (D_play_800D3180[LEVEL_SECTOR_Y] != 0) { - func_enmy2_80070CEC(actor); + ActorEvent_80070CEC(this); } break; - case EVC_55: + case EVC_KA_CLEAR: if (D_play_800D3180[LEVEL_KATINA] != 0) { - func_enmy2_80070CEC(actor); + ActorEvent_80070CEC(this); } break; - case EVC_56: + case EVC_SO_CLEAR: if (D_play_800D3180[LEVEL_SOLAR] != 0) { - func_enmy2_80070CEC(actor); + ActorEvent_80070CEC(this); } break; - case EVC_57: + case EVC_MA_CLEAR: if (D_play_800D3180[LEVEL_MACBETH] != 0) { - func_enmy2_80070CEC(actor); + ActorEvent_80070CEC(this); } break; - case EVC_58: + case EVC_AQ_CLEAR: if (D_play_800D3180[LEVEL_AQUAS] != 0) { - func_enmy2_80070CEC(actor); + ActorEvent_80070CEC(this); } break; - case EVC_59: + case EVC_ZO_CLEAR: if (D_play_800D3180[LEVEL_ZONESS] != 0) { - func_enmy2_80070CEC(actor); + ActorEvent_80070CEC(this); } break; - case EVC_60: + case EVC_SZ_CLEAR: if (D_play_800D3180[LEVEL_SECTOR_Z] != 0) { - func_enmy2_80070CEC(actor); + ActorEvent_80070CEC(this); } break; - case EVC_61: + case EVC_A6_CLEAR: if (D_play_800D3180[LEVEL_AREA_6] != 0) { - func_enmy2_80070CEC(actor); + ActorEvent_80070CEC(this); } break; case EVC_62: - if (D_enmy_Timer_80161670[actor->iwork[12]] == 0) { - func_enmy2_80070CEC(actor); + if (D_enmy_Timer_80161670[this->iwork[12]] == 0) { + ActorEvent_80070CEC(this); } break; case EVC_63: - if (D_enmy_Timer_80161670[actor->iwork[12]] != 0) { - func_enmy2_80070CEC(actor); + if (D_enmy_Timer_80161670[this->iwork[12]] != 0) { + ActorEvent_80070CEC(this); } break; case EVC_64: if (D_enmy_80161684 != 0) { - func_enmy2_80070CEC(actor); + ActorEvent_80070CEC(this); } break; - case EVC_65: + case EVC_30_HITS: if (gHitCount >= 30) { - func_enmy2_80070CEC(actor); + ActorEvent_80070CEC(this); } break; - case EVC_66: + case EVC_80_HITS: if (gHitCount >= 80) { - func_enmy2_80070CEC(actor); + ActorEvent_80070CEC(this); } break; - case EVC_67: + case EVC_EXPERT_MODE: if (gExpertMode) { - func_enmy2_80070CEC(actor); + ActorEvent_80070CEC(this); } break; } @@ -2787,95 +2776,95 @@ static Vec3f D_800D1194[21] = { { 453.0f, 420.0f, 67.0f }, }; -void func_enmy2_80071DC0(Actor* actor) { +void ActorEvent_80071DC0(Actor* this) { s32 rInd; Vec3f sp38; - Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, actor->obj.rot.x * M_DTOR, 1); - Matrix_RotateZ(gCalcMatrix, actor->obj.rot.z * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, this->obj.rot.y * M_DTOR, 0); + Matrix_RotateX(gCalcMatrix, this->obj.rot.x * M_DTOR, 1); + Matrix_RotateZ(gCalcMatrix, this->obj.rot.z * M_DTOR, 1); - if (actor->unk_0B4 == 30) { + if (this->unk_0B4 == EINFO_30) { rInd = RAND_FLOAT(ARRAY_COUNT(D_800D1074) - 1.1f); // off by 1 error? Matrix_MultVec3fNoTranslate(gCalcMatrix, &D_800D1074[rInd], &sp38); } - if (actor->unk_0B4 == 17) { + if (this->unk_0B4 == EINFO_17) { rInd = RAND_FLOAT(ARRAY_COUNT(D_800D0DD4) - 0.1f); Matrix_MultVec3fNoTranslate(gCalcMatrix, &D_800D0DD4[rInd], &sp38); } - if (actor->unk_0B4 == 31) { + if (this->unk_0B4 == EINFO_31) { rInd = RAND_FLOAT(ARRAY_COUNT(D_800D1194) - 0.1f); Matrix_MultVec3fNoTranslate(gCalcMatrix, &D_800D1194[rInd], &sp38); } if (!(gGameFrameCount & 1)) { - func_effect_8007C120(actor->obj.pos.x + sp38.x, actor->obj.pos.y + sp38.y, actor->obj.pos.z + sp38.z, - actor->vel.x, actor->vel.y, actor->vel.z, 0.3f, 0x14); + func_effect_8007C120(this->obj.pos.x + sp38.x, this->obj.pos.y + sp38.y, this->obj.pos.z + sp38.z, this->vel.x, + this->vel.y, this->vel.z, 0.3f, 20); } if (!(gGameFrameCount & 7)) { - func_effect_8007BFFC(actor->obj.pos.x + sp38.x, actor->obj.pos.y + sp38.y, actor->obj.pos.z + sp38.z, - actor->vel.x, actor->vel.y, actor->vel.z, 10.0f, 9); + func_effect_8007BFFC(this->obj.pos.x + sp38.x, this->obj.pos.y + sp38.y, this->obj.pos.z + sp38.z, this->vel.x, + this->vel.y, this->vel.z, 10.0f, 9); } if (!(gGameFrameCount & 0xF)) { - AUDIO_PLAY_SFX(0x2903B009, actor->sfxSource, 4); + AUDIO_PLAY_SFX(0x2903B009, this->sfxSource, 4); } - actor->vel.y -= 0.1f; - actor->vel.z = 0.0f; - actor->obj.rot.x += 0.2f; - actor->obj.rot.z += 0.3f; + this->vel.y -= 0.1f; + this->vel.z = 0.0f; + this->obj.rot.x += 0.2f; + this->obj.rot.z += 0.3f; if (!(gGameFrameCount & 7) && (Rand_ZeroOne() < 0.5f)) { - actor->timer_0C6 = 4; + this->timer_0C6 = 4; } } -void func_enmy2_800720E8(Actor* actor) { - switch (actor->unk_046) { +void ActorEvent_800720E8(Actor* this) { + switch (this->unk_046) { case 0: - if (actor->unk_0D0 != 0) { - if (actor->unk_0D0 == 2) { - actor->damage = 3; + if (this->unk_0D0 != 0) { + if (this->unk_0D0 == 2) { + this->damage = 3; } - if ((actor->unk_0D4 > 100) && (gActors[actor->unk_0D4 - 101].unk_0B4 == 85)) { - actor->damage = 20; + if ((this->unk_0D4 >= 101) && (gActors[this->unk_0D4 - 101].unk_0B4 == 85)) { + this->damage = 20; } - actor->health -= actor->damage; - actor->fwork[16] += 0.2f; - actor->timer_0BC = 5; + this->health -= this->damage; + this->fwork[16] += 0.2f; + this->timer_0BC = 5; - if (actor->timer_0BE < 20) { - actor->timer_0BE += 5; + if (this->timer_0BE < 20) { + this->timer_0BE += 5; } - if (actor->health <= 0) { - actor->unk_046 = 1; - actor->info.hitbox = SEGMENTED_TO_VIRTUAL(D_SX_6032408); - AUDIO_PLAY_SFX(0x1900000D, actor->sfxSource, 0); + if (this->health <= 0) { + this->unk_046 = 1; + this->info.hitbox = SEGMENTED_TO_VIRTUAL(D_SX_6032408); + AUDIO_PLAY_SFX(0x1900000D, this->sfxSource, 0); } else { - AUDIO_PLAY_SFX(0x2903300E, actor->sfxSource, 0); + AUDIO_PLAY_SFX(0x2903300E, this->sfxSource, 0); } - actor->unk_0D0 = 0; + this->unk_0D0 = 0; } break; case 1: case 2: - Math_SmoothStepToF(&actor->fwork[16], 130.0f, 0.2f, 8.0f, 0.001f); - if (actor->fwork[16] > 45.0f) { - Math_SmoothStepToF(&actor->fwork[15], 90.0f, 0.2f, 10.0f, 0.001f); + Math_SmoothStepToF(&this->fwork[16], 130.0f, 0.2f, 8.0f, 0.001f); + if (this->fwork[16] > 45.0f) { + Math_SmoothStepToF(&this->fwork[15], 90.0f, 0.2f, 10.0f, 0.001f); } break; } } -void func_enmy2_800722EC(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 yRot) { +void ActorEvent_800722EC(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 yRot) { Vec3f sp2C; Vec3f sp20; @@ -2899,51 +2888,51 @@ void func_enmy2_800722EC(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 yRot) Object_SetInfo(&effect->info, effect->obj.id); } -void func_enmy2_8007240C(f32 xPos, f32 yPos, f32 zPos, f32 yRot) { +void ActorEvent_8007240C(f32 xPos, f32 yPos, f32 zPos, f32 yRot) { s32 i; for (i = 0; i < ARRAY_COUNT(gEffects); i++) { if (gEffects[i].obj.status == OBJ_FREE) { - func_enmy2_800722EC(&gEffects[i], xPos, yPos, zPos, yRot); + ActorEvent_800722EC(&gEffects[i], xPos, yPos, zPos, yRot); break; } } } -void func_enmy2_80072474(Actor* actor) { +void ActorEvent_80072474(Actor* this) { f32 var_fv1; - if (actor->unk_048 != 0) { - switch (actor->unk_048) { - case 1: - actor->fwork[16] = 45.0f; + + if (this->unk_048 != EVACT_0) { + switch (this->unk_048) { + case EVACT_1: + this->fwork[16] = 45.0f; break; - case 2: - actor->fwork[16] = 0.0f; + case EVACT_2: + this->fwork[16] = 0.0f; break; - case 3: - actor->iwork[15] = 1; + case EVACT_3: + this->iwork[15] = 1; break; - case 4: - actor->iwork[15] = 0; + case EVACT_4: + this->iwork[15] = 0; break; } - actor->unk_048 = 0; + this->unk_048 = EVACT_0; } - if (actor->iwork[15] != 0) { - var_fv1 = - Math_RadToDeg(Math_Atan2F(gPlayer[0].pos.x - actor->obj.pos.x, gPlayer[0].unk_138 - actor->obj.pos.z)); - } else if (actor->iwork[6] != 0) { - var_fv1 = actor->unk_0F4.y; + if (this->iwork[15] != 0) { + var_fv1 = Math_RadToDeg(Math_Atan2F(gPlayer[0].pos.x - this->obj.pos.x, gPlayer[0].unk_138 - this->obj.pos.z)); + } else if (this->iwork[6] != 0) { + var_fv1 = this->unk_0F4.y; } else { var_fv1 = 0.0f; } - Math_SmoothStepToAngle(&actor->obj.rot.y, var_fv1, 0.2f, 3.0f, 0.0f); - Math_SmoothStepToAngle(&actor->fwork[15], actor->fwork[16], 0.5f, 8.0f, 0.0f); + Math_SmoothStepToAngle(&this->obj.rot.y, var_fv1, 0.2f, 3.0f, 0.0f); + Math_SmoothStepToAngle(&this->fwork[15], this->fwork[16], 0.5f, 8.0f, 0.0f); } static Vec3f D_800D1290 = { 0.0f, 837.00006f, 0.0f }; // could be in-function -void func_enmy2_80072594(Actor* actor) { +void ActorEvent_Update(Actor* this) { s32 spFC; f32 var_fv0; s32 var_s0; @@ -2964,87 +2953,87 @@ void func_enmy2_80072594(Actor* actor) { Vec3f spA0; if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_7) || (D_ctx_8017828C != 0)) { - Object_Kill(&actor->obj, actor->sfxSource); + Object_Kill(&this->obj, this->sfxSource); return; } - if (actor->state == 0x3E8) { - actor->obj.rot.y += actor->fwork[15]; - actor->obj.rot.x += actor->fwork[16]; + if (this->state == EVSTATE_1000) { + this->obj.rot.y += this->fwork[15]; + this->obj.rot.x += this->fwork[16]; if (!(gGameFrameCount & 0xF)) { - func_effect_8007C120(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, actor->vel.x, actor->vel.y, - actor->vel.z, 0.3f, 0xA); + func_effect_8007C120(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, this->vel.x, this->vel.y, + this->vel.z, 0.3f, 10); } } else { - if (((actor->unk_0B4 == 0x11) || (actor->unk_0B4 == 0x1E) || (actor->unk_0B4 == 0x1F)) && - (actor->health <= 0)) { - func_enmy2_80071DC0(actor); + if (((this->unk_0B4 == EINFO_17) || (this->unk_0B4 == EINFO_30) || (this->unk_0B4 == EINFO_31)) && + (this->health <= 0)) { + ActorEvent_80071DC0(this); return; } - if (actor->unk_0B4 == 300) { - gPlayer[0].unk_1A4 = actor->index; - actor->timer_0C2 = 100; - } else if (actor->unk_0B4 >= 200) { - actor->unk_04E++; + if (this->unk_0B4 == EINFO_300) { + gPlayer[0].unk_1A4 = this->index; + this->timer_0C2 = 100; + } else if (this->unk_0B4 >= EINFO_200) { + this->unk_04E++; - if (actor->unk_04E >= 100) { - actor->unk_04E = 0; + if (this->unk_04E >= 100) { + this->unk_04E = 0; } - D_ctx_80176558[actor->unk_046][actor->unk_04E] = actor->obj.pos.x; - D_ctx_80176878[actor->unk_046][actor->unk_04E] = actor->obj.pos.y; - D_ctx_80176B98[actor->unk_046][actor->unk_04E] = actor->obj.pos.z; - D_ctx_80176EB8[actor->unk_046][actor->unk_04E] = actor->obj.rot.x; - D_ctx_801771D8[actor->unk_046][actor->unk_04E] = actor->obj.rot.y; - D_ctx_80177500[actor->unk_046][actor->unk_04E] = actor->obj.rot.z; + D_ctx_80176558[this->unk_046][this->unk_04E] = this->obj.pos.x; + D_ctx_80176878[this->unk_046][this->unk_04E] = this->obj.pos.y; + D_ctx_80176B98[this->unk_046][this->unk_04E] = this->obj.pos.z; + D_ctx_80176EB8[this->unk_046][this->unk_04E] = this->obj.rot.x; + D_ctx_801771D8[this->unk_046][this->unk_04E] = this->obj.rot.y; + D_ctx_80177500[this->unk_046][this->unk_04E] = this->obj.rot.z; - if (actor->unk_0D0 != 0) { - actor->unk_0D0 = 0; - actor->timer_0C6 = 20; - actor->health -= actor->damage; + if (this->unk_0D0 != 0) { + this->unk_0D0 = 0; + this->timer_0C6 = 20; + this->health -= this->damage; - AUDIO_PLAY_SFX(0x29034041, actor->sfxSource, 4); + AUDIO_PLAY_SFX(0x29034041, this->sfxSource, 4); - if (actor->health <= 0) { - actor->timer_0C6 = 200; - actor->obj.status = OBJ_DYING; - func_effect_8007D2C8(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 8.0f); - actor->obj.status = OBJ_DYING; - actor->timer_0BC = 20; - actor->obj.id = OBJ_ACTOR_194; + if (this->health <= 0) { + this->timer_0C6 = 200; + this->obj.status = OBJ_DYING; + func_effect_8007D2C8(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 8.0f); + this->obj.status = OBJ_DYING; + this->timer_0BC = 20; + this->obj.id = OBJ_ACTOR_194; } } } - if ((actor->unk_0B4 == 27) && (actor->timer_0C2 != 0)) { - actor->state = 0; + if ((this->unk_0B4 == EINFO_27) && (this->timer_0C2 != 0)) { + this->state = EVSTATE_0; } - switch (actor->state) { - case 0: - func_enmy2_8006D36C(actor); + switch (this->state) { + case EVSTATE_0: + ActorEvent_ProcessScript(this); break; - case 1: - if (actor->timer_0BC == 0) { - func_enmy2_8006D36C(actor); + case EVSTATE_1: + if (this->timer_0BC == 0) { + ActorEvent_ProcessScript(this); } break; - case 6: - case 7: - case 14: - case 15: - spF0 = actor->obj.pos.x; - spEC = actor->obj.pos.y; - spE8 = actor->obj.pos.z; + case EVSTATE_6: + case EVSTATE_7: + case EVSTATE_14: + case EVSTATE_15: + spF0 = this->obj.pos.x; + spEC = this->obj.pos.y; + spE8 = this->obj.pos.z; - if ((actor->unk_0B4 == 0x21) || (actor->unk_0B4 == 0x44)) { - Matrix_RotateZ(gCalcMatrix, -(actor->vwork[29].z + actor->unk_0F4.z) * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, -actor->vwork[29].x * M_DTOR, 1); - Matrix_RotateY(gCalcMatrix, -actor->vwork[29].y * M_DTOR, 1); + if ((this->unk_0B4 == EINFO_33) || (this->unk_0B4 == EINFO_68)) { + Matrix_RotateZ(gCalcMatrix, -(this->vwork[29].z + this->unk_0F4.z) * M_DTOR, 0); + Matrix_RotateX(gCalcMatrix, -this->vwork[29].x * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, -this->vwork[29].y * M_DTOR, 1); - if ((actor->state == 0xE) || (actor->state == 0xF)) { + if ((this->state == EVSTATE_14) || (this->state == EVSTATE_15)) { spB8.x = gPlayer[0].camEye.x - spF0; spB8.y = gPlayer[0].camEye.y - (spEC + 25.0f); spB8.z = (gPlayer[0].camEye.z * 15.0f) - spE8; @@ -3070,23 +3059,23 @@ void func_enmy2_80072594(Actor* actor) { spFC++; } - actor->obj.rot.x = 0.0f; + this->obj.rot.x = 0.0f; - Math_SmoothStepToAngle(&actor->obj.rot.y, spE0, 0.2f, actor->fwork[24], 0.001f); - Math_SmoothStepToAngle(&actor->fwork[15], spE4, 0.2f, actor->fwork[24], 0.001f); + Math_SmoothStepToAngle(&this->obj.rot.y, spE0, 0.2f, this->fwork[24], 0.001f); + Math_SmoothStepToAngle(&this->fwork[15], spE4, 0.2f, this->fwork[24], 0.001f); - if (!(actor->timer_0BC & 0x1F) && (spFC == 0)) { - Matrix_RotateY(gCalcMatrix, actor->vwork[29].y * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, actor->vwork[29].x * M_DTOR, 1); - Matrix_RotateZ(gCalcMatrix, (actor->vwork[29].z + actor->unk_0F4.z) * M_DTOR, 1); + if (!(this->timer_0BC & 0x1F) && (spFC == 0)) { + Matrix_RotateY(gCalcMatrix, this->vwork[29].y * M_DTOR, 0); + Matrix_RotateX(gCalcMatrix, this->vwork[29].x * M_DTOR, 1); + Matrix_RotateZ(gCalcMatrix, (this->vwork[29].z + this->unk_0F4.z) * M_DTOR, 1); spB8.x = 0.0f; spB8.y = 25.0f; spB8.z = 0.0f; Matrix_MultVec3fNoTranslate(gCalcMatrix, &spB8, &spA0); - Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, 1); - Matrix_RotateX(gCalcMatrix, actor->fwork[15] * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, this->obj.rot.y * M_DTOR, 1); + Matrix_RotateX(gCalcMatrix, this->fwork[15] * M_DTOR, 1); spB8.x = 0.0f; spB8.y = 0.0f; @@ -3094,21 +3083,21 @@ void func_enmy2_80072594(Actor* actor) { Matrix_MultVec3fNoTranslate(gCalcMatrix, &spB8, &spAC); - if (actor->unk_0B4 == 0x44) { + if (this->unk_0B4 == EINFO_68) { var_fv0 = 80.0f; } else { var_fv0 = 0.0f; } - func_effect_8007F04C(OBJ_EFFECT_353, actor->obj.pos.x + spAC.x + spA0.x, - actor->obj.pos.y + spAC.y + spA0.y + var_fv0, - actor->obj.pos.z + spAC.z + spA0.z, actor->fwork[15], actor->obj.rot.y, - actor->obj.rot.z, actor->vwork[29].x, actor->vwork[29].y, - actor->vwork[29].z + actor->unk_0F4.z, spAC.x, spAC.y, spAC.z, 1.0f); - actor->fwork[16] = -15.0f; + func_effect_8007F04C(OBJ_EFFECT_353, this->obj.pos.x + spAC.x + spA0.x, + this->obj.pos.y + spAC.y + spA0.y + var_fv0, + this->obj.pos.z + spAC.z + spA0.z, this->fwork[15], this->obj.rot.y, + this->obj.rot.z, this->vwork[29].x, this->vwork[29].y, + this->vwork[29].z + this->unk_0F4.z, spAC.x, spAC.y, spAC.z, 1.0f); + this->fwork[16] = -15.0f; } } else { - if ((actor->state == 0xE) || (actor->state == 0xF)) { + if ((this->state == EVSTATE_14) || (this->state == EVSTATE_15)) { spCC = gPlayer[0].camEye.x; spC8 = gPlayer[0].camEye.y; spC4 = gPlayer[0].camEye.z; @@ -3118,12 +3107,12 @@ void func_enmy2_80072594(Actor* actor) { spC4 = gPlayer[0].pos.z; } - Math_SmoothStepToAngle(&actor->vwork[29].z, 0.0f, 0.1f, 5.0f, 0.0001f); - Math_SmoothStepToAngle(&actor->unk_0F4.z, 0.0f, 0.1f, 5.0f, 0.0001f); + Math_SmoothStepToAngle(&this->vwork[29].z, 0.0f, 0.1f, 5.0f, 0.0001f); + Math_SmoothStepToAngle(&this->unk_0F4.z, 0.0f, 0.1f, 5.0f, 0.0001f); spE0 = Math_RadToDeg(Math_Atan2F(spCC - spF0, spC4 - spE8)); - if ((actor->state == 7) || (actor->state == 0xF)) { + if ((this->state == EVSTATE_7) || (this->state == EVSTATE_15)) { spE0 += 180.0f; if (spE0 > 360.0f) { spE0 -= 360.0f; @@ -3131,418 +3120,418 @@ void func_enmy2_80072594(Actor* actor) { } spE4 = Math_RadToDeg(-Math_Atan2F(spC8 - spEC, sqrtf(SQ(spCC - spF0) + SQ(spC4 - spE8)))); - spEC = Math_SmoothStepToAngle(&actor->unk_0F4.y, spE0, 0.2f, actor->fwork[24], 0.0001f); + spEC = Math_SmoothStepToAngle(&this->unk_0F4.y, spE0, 0.2f, this->fwork[24], 0.0001f); - Math_SmoothStepToAngle(&actor->unk_0F4.x, spE4, 0.2f, actor->fwork[24], 0.0001f); + Math_SmoothStepToAngle(&this->unk_0F4.x, spE4, 0.2f, this->fwork[24], 0.0001f); - if (actor->iwork[6] != 0) { + if (this->iwork[6] != 0) { var_fv0 = 330.0f; if (spEC < 0.0f) { var_fv0 = 30.0f; } - Math_SmoothStepToAngle(&actor->fwork[23], var_fv0, 0.1f, 5.0f, 0.01f); + Math_SmoothStepToAngle(&this->fwork[23], var_fv0, 0.1f, 5.0f, 0.01f); } } - if (actor->timer_0BC == 0) { - func_enmy2_8006D36C(actor); + if (this->timer_0BC == 0) { + ActorEvent_ProcessScript(this); } break; - case 13: - spDC = SIN_DEG((actor->index * 45) + gGameFrameCount) * actor->fwork[17]; - spD8 = COS_DEG((actor->index * 45) + (gGameFrameCount * 2)) * actor->fwork[17]; - pad = actor->iwork[1]; + case EVSTATE_13: + spDC = SIN_DEG((this->index * 45) + gGameFrameCount) * this->fwork[17]; + spD8 = COS_DEG((this->index * 45) + (gGameFrameCount * 2)) * this->fwork[17]; + pad = this->iwork[1]; pad = gActors[pad].iwork[12]; D_enmy_Timer_80161670[pad] = 5; + /* fallthrough */ + case EVSTATE_8: + case EVSTATE_9: + spF0 = this->obj.pos.x; + spEC = this->obj.pos.y; + spE8 = this->obj.pos.z; - case 8: - case 9: - spF0 = actor->obj.pos.x; - spEC = actor->obj.pos.y; - spE8 = actor->obj.pos.z; - - spE0 = Math_RadToDeg(Math_Atan2F(gActors[actor->iwork[1]].obj.pos.x + spDC - spF0, - gActors[actor->iwork[1]].obj.pos.z + spD4 - spE8)); - if (actor->state == 7) { + spE0 = Math_RadToDeg(Math_Atan2F(gActors[this->iwork[1]].obj.pos.x + spDC - spF0, + gActors[this->iwork[1]].obj.pos.z + spD4 - spE8)); + if (this->state == EVSTATE_7) { spE0 += 180.0f; if (spE0 > 360.0f) { spE0 -= 360.0f; } } - spE4 = Math_RadToDeg(-Math_Atan2F(gActors[actor->iwork[1]].obj.pos.y + spD8 - spEC, - sqrtf(SQ(gActors[actor->iwork[1]].obj.pos.x + spDC - spF0) + - SQ(gActors[actor->iwork[1]].obj.pos.z + spD4 - spE8)))); - spEC = Math_SmoothStepToAngle(&actor->unk_0F4.y, spE0, 0.2f, actor->fwork[24], 0.0001f); + spE4 = Math_RadToDeg(-Math_Atan2F(gActors[this->iwork[1]].obj.pos.y + spD8 - spEC, + sqrtf(SQ(gActors[this->iwork[1]].obj.pos.x + spDC - spF0) + + SQ(gActors[this->iwork[1]].obj.pos.z + spD4 - spE8)))); + spEC = Math_SmoothStepToAngle(&this->unk_0F4.y, spE0, 0.2f, this->fwork[24], 0.0001f); - Math_SmoothStepToAngle(&actor->unk_0F4.x, spE4, 0.2f, actor->fwork[24], 0.0001f); + Math_SmoothStepToAngle(&this->unk_0F4.x, spE4, 0.2f, this->fwork[24], 0.0001f); - if (actor->iwork[6] != 0) { + if (this->iwork[6] != 0) { var_fv0 = 310.0f; if (spEC < 0.0f) { var_fv0 = 50.0f; } - Math_SmoothStepToAngle(&actor->fwork[23], var_fv0, 0.1f, 5.0f, 0.01f); + Math_SmoothStepToAngle(&this->fwork[23], var_fv0, 0.1f, 5.0f, 0.01f); } - if (actor->timer_0BC == 0) { - func_enmy2_8006D36C(actor); + if (this->timer_0BC == 0) { + ActorEvent_ProcessScript(this); } break; - case 2: - actor->unk_0F4.x += actor->fwork[3]; - actor->fwork[2] -= actor->fwork[3]; - if (actor->fwork[2] <= 0.0f) { - func_enmy2_8006D36C(actor); + case EVSTATE_F4_PLUS_X: + this->unk_0F4.x += this->fwork[3]; + this->fwork[2] -= this->fwork[3]; + if (this->fwork[2] <= 0.0f) { + ActorEvent_ProcessScript(this); } break; - case 3: - actor->unk_0F4.x -= actor->fwork[3]; - actor->fwork[2] -= actor->fwork[3]; - if (actor->fwork[2] <= 0.0f) { - func_enmy2_8006D36C(actor); + case EVSTATE_F4_MINUS_X: + this->unk_0F4.x -= this->fwork[3]; + this->fwork[2] -= this->fwork[3]; + if (this->fwork[2] <= 0.0f) { + ActorEvent_ProcessScript(this); } break; - case 4: - actor->unk_0F4.y += actor->fwork[3]; - actor->fwork[2] -= actor->fwork[3]; - if (actor->fwork[2] <= 0.0f) { - func_enmy2_8006D36C(actor); + case EVSTATE_F4_PLUS_Y: + this->unk_0F4.y += this->fwork[3]; + this->fwork[2] -= this->fwork[3]; + if (this->fwork[2] <= 0.0f) { + ActorEvent_ProcessScript(this); } break; - case 5: - actor->unk_0F4.y -= actor->fwork[3]; - actor->fwork[2] -= actor->fwork[3]; - if (actor->fwork[2] <= 0.0f) { - func_enmy2_8006D36C(actor); + case EVSTATE_F4_MINUS_Y: + this->unk_0F4.y -= this->fwork[3]; + this->fwork[2] -= this->fwork[3]; + if (this->fwork[2] <= 0.0f) { + ActorEvent_ProcessScript(this); } break; - case 10: + case EVSTATE_10: var_s0 = 0; - if (Math_SmoothStepToAngle(&actor->obj.rot.x, 0.0f, 0.3f, 10.0f, 1.0f) == 0.0f) { + if (Math_SmoothStepToAngle(&this->obj.rot.x, 0.0f, 0.3f, 10.0f, 1.0f) == 0.0f) { var_s0++; } - if (Math_SmoothStepToAngle(&actor->obj.rot.y, 0.0f, 0.3f, 10.0f, 1.0f) == 0.0f) { + if (Math_SmoothStepToAngle(&this->obj.rot.y, 0.0f, 0.3f, 10.0f, 1.0f) == 0.0f) { var_s0++; } - if (Math_SmoothStepToF(&actor->fwork[15], 40.0f, 0.3f, 10.0f, 1.0f) == 0.0f) { + if (Math_SmoothStepToF(&this->fwork[15], 40.0f, 0.3f, 10.0f, 1.0f) == 0.0f) { var_s0++; } if (var_s0 == 3) { - actor->info.hitbox = SEGMENTED_TO_VIRTUAL(D_ME_602F638); - func_enmy2_8006D36C(actor); + this->info.hitbox = SEGMENTED_TO_VIRTUAL(D_ME_602F638); + ActorEvent_ProcessScript(this); } break; - case 11: - if (Math_SmoothStepToF(&actor->fwork[15], 0.0f, 0.3f, 10.0f, 1.0f) == 0.0f) { - func_enmy2_8006D36C(actor); + case EVSTATE_11: + if (Math_SmoothStepToF(&this->fwork[15], 0.0f, 0.3f, 10.0f, 1.0f) == 0.0f) { + ActorEvent_ProcessScript(this); } break; - case 12: - Math_SmoothStepToAngle(&actor->unk_0F4.x, 270.0f, 0.1f, 2.0f, 0.0f); - gTeamShields[actor->iwork[12]] = -1; - gTeamDamage[actor->iwork[12]] = 0; + case EVSTATE_TEAM_RETREAT: + Math_SmoothStepToAngle(&this->unk_0F4.x, 270.0f, 0.1f, 2.0f, 0.0f); + gTeamShields[this->iwork[12]] = -1; + gTeamDamage[this->iwork[12]] = 0; break; - case 200: + case EVSTATE_SCRIPT_END: break; } - if (actor->iwork[13] != 0) { - if (gActors[actor->iwork[9]].obj.status != OBJ_ACTIVE) { - actor->iwork[13] = 0; + if (this->iwork[13] != 0) { + if (gActors[this->iwork[9]].obj.status != OBJ_ACTIVE) { + this->iwork[13] = 0; } else { - Matrix_RotateY(gCalcMatrix, gActors[actor->iwork[9]].obj.rot.y * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, gActors[actor->iwork[9]].obj.rot.x * M_DTOR, 1); - Matrix_RotateZ(gCalcMatrix, gActors[actor->iwork[9]].obj.rot.z * M_DTOR, 1); - Matrix_MultVec3fNoTranslate(gCalcMatrix, &actor->vwork[28], &spAC); - actor->obj.pos.x = gActors[actor->iwork[9]].obj.pos.x + spAC.x; - actor->obj.pos.y = gActors[actor->iwork[9]].obj.pos.y + spAC.y; - actor->obj.pos.z = gActors[actor->iwork[9]].obj.pos.z + spAC.z; - actor->vwork[29].x = gActors[actor->iwork[9]].obj.rot.x; - actor->vwork[29].y = gActors[actor->iwork[9]].obj.rot.y; - actor->vwork[29].z = gActors[actor->iwork[9]].obj.rot.z; - if (actor->timer_0C0 == 0) { - actor->iwork[13] = 0; + Matrix_RotateY(gCalcMatrix, gActors[this->iwork[9]].obj.rot.y * M_DTOR, 0); + Matrix_RotateX(gCalcMatrix, gActors[this->iwork[9]].obj.rot.x * M_DTOR, 1); + Matrix_RotateZ(gCalcMatrix, gActors[this->iwork[9]].obj.rot.z * M_DTOR, 1); + Matrix_MultVec3fNoTranslate(gCalcMatrix, &this->vwork[28], &spAC); + this->obj.pos.x = gActors[this->iwork[9]].obj.pos.x + spAC.x; + this->obj.pos.y = gActors[this->iwork[9]].obj.pos.y + spAC.y; + this->obj.pos.z = gActors[this->iwork[9]].obj.pos.z + spAC.z; + this->vwork[29].x = gActors[this->iwork[9]].obj.rot.x; + this->vwork[29].y = gActors[this->iwork[9]].obj.rot.y; + this->vwork[29].z = gActors[this->iwork[9]].obj.rot.z; + if (this->timer_0C0 == 0) { + this->iwork[13] = 0; } } } - Math_SmoothStepToF(&actor->fwork[0], actor->fwork[1], 0.1f, 5.0f, 0.0001f); + Math_SmoothStepToF(&this->fwork[0], this->fwork[1], 0.1f, 5.0f, 0.0001f); - if (actor->unk_0F4.x >= 360.0f) { - actor->unk_0F4.x -= 360.0f; + if (this->unk_0F4.x >= 360.0f) { + this->unk_0F4.x -= 360.0f; } - if (actor->unk_0F4.x < 0.0f) { - actor->unk_0F4.x += 360.0f; + if (this->unk_0F4.x < 0.0f) { + this->unk_0F4.x += 360.0f; } - if (actor->unk_0F4.y >= 360.0f) { - actor->unk_0F4.y -= 360.0f; + if (this->unk_0F4.y >= 360.0f) { + this->unk_0F4.y -= 360.0f; } - if (actor->unk_0F4.y < 0.0f) { - actor->unk_0F4.y += 360.0f; + if (this->unk_0F4.y < 0.0f) { + this->unk_0F4.y += 360.0f; } - if (actor->iwork[6] != 0) { - if ((gLevelMode == LEVELMODE_UNK_2) && (actor->unk_0B4 == 200)) { - Math_SmoothStepToAngle(&actor->obj.rot.x, actor->unk_0F4.x, 0.1f, 10.0f, 0.00001f); - Math_SmoothStepToAngle(&actor->obj.rot.y, actor->unk_0F4.y, 0.1f, 10.0f, 0.00001f); + if (this->iwork[6] != 0) { + if ((gLevelMode == LEVELMODE_UNK_2) && (this->unk_0B4 == EINFO_200)) { + Math_SmoothStepToAngle(&this->obj.rot.x, this->unk_0F4.x, 0.1f, 10.0f, 0.00001f); + Math_SmoothStepToAngle(&this->obj.rot.y, this->unk_0F4.y, 0.1f, 10.0f, 0.00001f); } else { - Math_SmoothStepToAngle(&actor->obj.rot.x, actor->unk_0F4.x, 0.2f, 100.0f, 0.00001f); - Math_SmoothStepToAngle(&actor->obj.rot.y, actor->unk_0F4.y, 0.2f, 100.0f, 0.00001f); + Math_SmoothStepToAngle(&this->obj.rot.x, this->unk_0F4.x, 0.2f, 100.0f, 0.00001f); + Math_SmoothStepToAngle(&this->obj.rot.y, this->unk_0F4.y, 0.2f, 100.0f, 0.00001f); } } - if (actor->fwork[4] > 0.0f) { - actor->fwork[4] -= actor->fwork[5]; - actor->obj.rot.x += actor->fwork[5] * actor->fwork[6]; - if (actor->obj.rot.x >= 360.0f) { - actor->obj.rot.x -= 360.0f; + if (this->fwork[4] > 0.0f) { + this->fwork[4] -= this->fwork[5]; + this->obj.rot.x += this->fwork[5] * this->fwork[6]; + if (this->obj.rot.x >= 360.0f) { + this->obj.rot.x -= 360.0f; } - if (actor->obj.rot.x < 0.0f) { - actor->obj.rot.x += 360.0f; + if (this->obj.rot.x < 0.0f) { + this->obj.rot.x += 360.0f; } } - if (actor->fwork[7] > 0.0f) { - actor->fwork[7] -= actor->fwork[8]; - actor->obj.rot.y += actor->fwork[8] * actor->fwork[9]; - if (actor->obj.rot.y >= 360.0f) { - actor->obj.rot.y = actor->obj.rot.y - 360.0f; + if (this->fwork[7] > 0.0f) { + this->fwork[7] -= this->fwork[8]; + this->obj.rot.y += this->fwork[8] * this->fwork[9]; + if (this->obj.rot.y >= 360.0f) { + this->obj.rot.y = this->obj.rot.y - 360.0f; } - if (actor->obj.rot.y < 0.0f) { - actor->obj.rot.y += 360.0f; + if (this->obj.rot.y < 0.0f) { + this->obj.rot.y += 360.0f; } } - if (actor->fwork[10] > 0.0f) { - if ((actor->unk_0B4 == 0xD) || (actor->unk_0B4 == 0xE) || (actor->unk_0B4 == 0x3D) || - (actor->unk_0B4 == 0x3E) || (actor->unk_0B4 == 0x3F) || (actor->unk_0B4 == 0x40) || - (actor->unk_0B4 == 0x41) || (actor->unk_0B4 == 0x42) || (actor->unk_0B4 == 0x5E) || - (actor->unk_0B4 == 0x5F) || (actor->unk_0B4 == 0x61)) { - actor->obj.rot.y -= actor->fwork[11] * actor->fwork[12]; - actor->obj.rot.x += actor->fwork[11] * actor->fwork[12]; + if (this->fwork[10] > 0.0f) { + if ((this->unk_0B4 == EINFO_13) || (this->unk_0B4 == EINFO_14) || (this->unk_0B4 == EINFO_61) || + (this->unk_0B4 == EINFO_62) || (this->unk_0B4 == EINFO_63) || (this->unk_0B4 == EINFO_64) || + (this->unk_0B4 == EINFO_65) || (this->unk_0B4 == EINFO_66) || (this->unk_0B4 == EINFO_94) || + (this->unk_0B4 == EINFO_95) || (this->unk_0B4 == EINFO_97)) { + this->obj.rot.y -= this->fwork[11] * this->fwork[12]; + this->obj.rot.x += this->fwork[11] * this->fwork[12]; } else { - actor->fwork[10] -= actor->fwork[11]; - actor->fwork[23] += actor->fwork[11] * actor->fwork[12]; + this->fwork[10] -= this->fwork[11]; + this->fwork[23] += this->fwork[11] * this->fwork[12]; } } - if (actor->fwork[23] >= 360.0f) { - actor->fwork[23] -= 360.0f; + if (this->fwork[23] >= 360.0f) { + this->fwork[23] -= 360.0f; } - if (actor->fwork[23] < 0.0f) { - actor->fwork[23] += 360.0f; + if (this->fwork[23] < 0.0f) { + this->fwork[23] += 360.0f; } - Math_SmoothStepToAngle(&actor->obj.rot.z, actor->fwork[23], 0.2f, 100.0f, 0.0001f); - Matrix_RotateZ(gCalcMatrix, (actor->vwork[29].z + actor->unk_0F4.z) * M_DTOR, 0); - Matrix_RotateY(gCalcMatrix, actor->unk_0F4.y * M_DTOR, 1); - Matrix_RotateX(gCalcMatrix, actor->unk_0F4.x * M_DTOR, 1); + Math_SmoothStepToAngle(&this->obj.rot.z, this->fwork[23], 0.2f, 100.0f, 0.0001f); + Matrix_RotateZ(gCalcMatrix, (this->vwork[29].z + this->unk_0F4.z) * M_DTOR, 0); + Matrix_RotateY(gCalcMatrix, this->unk_0F4.y * M_DTOR, 1); + Matrix_RotateX(gCalcMatrix, this->unk_0F4.x * M_DTOR, 1); spB8.x = 0.0f; spB8.y = 0.0f; - spB8.z = actor->fwork[0]; + spB8.z = this->fwork[0]; Matrix_MultVec3fNoTranslate(gCalcMatrix, &spB8, &spAC); - actor->vel.x = actor->fwork[13] + spAC.x; - actor->vel.y = actor->fwork[14] + spAC.y; - actor->vel.z = spAC.z; + this->vel.x = this->fwork[13] + spAC.x; + this->vel.y = this->fwork[14] + spAC.y; + this->vel.z = spAC.z; - actor->fwork[13] -= actor->fwork[13] * 0.1f; - actor->fwork[14] -= actor->fwork[14] * 0.1f; + this->fwork[13] -= this->fwork[13] * 0.1f; + this->fwork[14] -= this->fwork[14] * 0.1f; - if (actor->iwork[5] == 0x80) { - actor->vel.z -= actor->fwork[22]; + if (this->iwork[5] == EV_ZMODE(EMZ_RELATIVE)) { + this->vel.z -= this->fwork[22]; if ((gCurrentLevel == LEVEL_SECTOR_Y) && (D_ctx_80177D08 < 0.0f)) { - actor->vel.z -= D_ctx_80177D08; + this->vel.z -= D_ctx_80177D08; } } - if (actor->iwork[5] == 0x100) { - actor->vel.z -= D_ctx_80177D08; + if (this->iwork[5] == EV_ZMODE(EMZ_PLAYER)) { + this->vel.z -= D_ctx_80177D08; } if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_8) { - actor->vel.z = 100.0f; + this->vel.z = 100.0f; } - func_enmy2_80070D44(actor); - func_enmy2_8006F40C(actor); - func_enmy2_8006EA50(actor); + ActorEvent_ProcessTriggers(this); + ActorEvent_ProcessActions(this); + ActorEvent_UpdateTexLines(this); - if (actor->unk_0B4 == 0x26) { - func_enmy2_800720E8(actor); + if (this->unk_0B4 == EINFO_38) { + ActorEvent_800720E8(this); } else { - if (actor->scale <= -1.999f) { - func_enmy2_80070BA8(actor); + if (this->scale <= -1.999f) { + ActorEvent_80070BA8(this); } else { - if ((actor->unk_0D0 == 1) && (actor->scale < 0.5f) && (actor->unk_0B4 != 0x30) && - (actor->unk_0B4 != 0x31) && (actor->unk_0B4 != 0x32)) { - actor->unk_0D0 = 0; + if ((this->unk_0D0 == 1) && (this->scale < 0.5f) && (this->unk_0B4 != EINFO_48) && + (this->unk_0B4 != EINFO_49) && (this->unk_0B4 != EINFO_50)) { + this->unk_0D0 = 0; if (gCurrentLevel == LEVEL_METEO) { - AUDIO_PLAY_SFX(0x2902107D, actor->sfxSource, 4); + AUDIO_PLAY_SFX(0x2902107D, this->sfxSource, 4); } else { - AUDIO_PLAY_SFX(0x29121007, actor->sfxSource, 4); + AUDIO_PLAY_SFX(0x29121007, this->sfxSource, 4); } } - if ((actor->unk_0B4 < 200) && (actor->unk_0B4 != 78) && (actor->scale >= 0.5f)) { - switch (actor->unk_0B4) { - case 71: - func_enmy2_8006FE28(actor); + if ((this->unk_0B4 < EINFO_200) && (this->unk_0B4 != EINFO_78) && (this->scale >= 0.5f)) { + switch (this->unk_0B4) { + case EINFO_71: + ActorEvent_8006FE28(this); break; - case 79: - func_enmy2_8006FEEC(actor); + case EINFO_79: + ActorEvent_8006FEEC(this); break; default: - func_enmy2_800701E0(actor); + ActorEvent_800701E0(this); break; } } } } - switch (actor->unk_0B4) { - case 92: - case 93: - case 94: - case 95: - case 96: + switch (this->unk_0B4) { + case EINFO_92: + case EINFO_93: + case EINFO_94: + case EINFO_95: + case EINFO_96: if (!(gGameFrameCount & 7)) { - actor->fwork[18] = RAND_FLOAT(255.0f); - actor->fwork[19] = RAND_FLOAT(255.0f); - actor->fwork[20] = RAND_FLOAT(255.0f); + this->fwork[18] = RAND_FLOAT(255.0f); + this->fwork[19] = RAND_FLOAT(255.0f); + this->fwork[20] = RAND_FLOAT(255.0f); } - Math_SmoothStepToF(&actor->fwork[15], actor->fwork[18], 1.0f, 10.0f, 0.0f); - Math_SmoothStepToF(&actor->fwork[16], actor->fwork[19], 1.0f, 10.0f, 0.0f); - Math_SmoothStepToF(&actor->fwork[17], actor->fwork[20], 1.0f, 10.0f, 0.0f); + Math_SmoothStepToF(&this->fwork[15], this->fwork[18], 1.0f, 10.0f, 0.0f); + Math_SmoothStepToF(&this->fwork[16], this->fwork[19], 1.0f, 10.0f, 0.0f); + Math_SmoothStepToF(&this->fwork[17], this->fwork[20], 1.0f, 10.0f, 0.0f); break; - case 46: - if (func_play_800A73E4(&spEC, &spFC, actor->obj.pos.x, -100.0f, actor->obj.pos.z)) { + case EINFO_46: + if (func_play_800A73E4(&spEC, &spFC, this->obj.pos.x, -100.0f, this->obj.pos.z)) { spF0 = 10.0f; - if (Math_SmoothStepToF(&actor->obj.pos.y, spEC, 0.5f, 7.0f, 0.0f) >= 0.0f) { + if (Math_SmoothStepToF(&this->obj.pos.y, spEC, 0.5f, 7.0f, 0.0f) >= 0.0f) { spF0 = 350.0f; if (!(gGameFrameCount & 3)) { - func_enmy2_8007240C(actor->obj.pos.x, spEC, actor->obj.pos.z, actor->obj.rot.y); - AUDIO_PLAY_SFX(0x19800017, actor->sfxSource, 4); + ActorEvent_8007240C(this->obj.pos.x, spEC, this->obj.pos.z, this->obj.rot.y); + AUDIO_PLAY_SFX(0x19800017, this->sfxSource, 4); } } - Math_SmoothStepToAngle(&actor->obj.rot.x, spF0, 0.1f, 1.0f, 0.0f); + Math_SmoothStepToAngle(&this->obj.rot.x, spF0, 0.1f, 1.0f, 0.0f); - if ((actor->state == 4) || (actor->state == 5)) { - var_fv0 = actor->fwork[3] * 20.0f; - if (actor->state == 4) { + if ((this->state == EVSTATE_F4_PLUS_Y) || (this->state == EVSTATE_F4_MINUS_Y)) { + var_fv0 = this->fwork[3] * 20.0f; + if (this->state == EVSTATE_F4_PLUS_Y) { var_fv0 *= -1.0f; } - Math_SmoothStepToAngle(&actor->obj.rot.z, var_fv0, 0.1f, 3.0f, 0.0f); + Math_SmoothStepToAngle(&this->obj.rot.z, var_fv0, 0.1f, 3.0f, 0.0f); } } - actor->obj.rot.y = actor->unk_0F4.y; + this->obj.rot.y = this->unk_0F4.y; break; - case 31: - actor->obj.rot.z = gGameFrameCount; + case EINFO_31: + this->obj.rot.z = gGameFrameCount; break; - case 21: - case 22: - actor->obj.rot.z = gGameFrameCount * 3.0f; + case EINFO_21: + case EINFO_22: + this->obj.rot.z = gGameFrameCount * 3.0f; break; - case 3: - actor->unk_0C9 = 1; - actor->obj.rot.y -= 10.0f; + case EINFO_3: + this->unk_0C9 = 1; + this->obj.rot.y -= 10.0f; break; - case 6: - actor->unk_0B6++; + case EINFO_6: + this->unk_0B6++; if (gCurrentLevel == LEVEL_SOLAR) { - if (actor->unk_0B6 >= Animation_GetFrameCount(&D_SO_600636C)) { - actor->unk_0B6 = 0; + if (this->unk_0B6 >= Animation_GetFrameCount(&D_SO_600636C)) { + this->unk_0B6 = 0; } if (((s32) gGameFrameCount % 3) == 0) { - Solar_8019E9F4(actor->obj.pos.x, actor->obj.pos.y - 20, actor->obj.pos.z - 180.0f, 0.0f, + Solar_8019E9F4(this->obj.pos.x, this->obj.pos.y - 20, this->obj.pos.z - 180.0f, 0.0f, RAND_FLOAT(20.0f) * -1.0f, 0.0f, 4.0f, 2); } - } else if (actor->unk_0B6 >= Animation_GetFrameCount(&D_ENMY_PLANET_40057AC)) { - actor->unk_0B6 = 0; + } else if (this->unk_0B6 >= Animation_GetFrameCount(&D_ENMY_PLANET_40057AC)) { + this->unk_0B6 = 0; } break; - case 9: - actor->unk_0B6++; - if (actor->unk_0B6 >= Animation_GetFrameCount(&D_ENMY_PLANET_40001A4)) { - actor->unk_0B6 = 0; + case EINFO_9: + this->unk_0B6++; + if (this->unk_0B6 >= Animation_GetFrameCount(&D_ENMY_PLANET_40001A4)) { + this->unk_0B6 = 0; } - if (actor->iwork[6] == 0) { - actor->obj.rot.y = 0.0f; + if (this->iwork[6] == 0) { + this->obj.rot.y = 0.0f; } break; - case 48: - case 49: - case 50: - SectorY_801A3BD4(actor); + case EINFO_48: + case EINFO_49: + case EINFO_50: + SectorY_Actor204_Update(this); break; - case 52: - func_enmy2_80072474(actor); + case EINFO_52: + ActorEvent_80072474(this); break; - case 78: - func_enmy_8006753C(actor); + case EINFO_78: + ActorSupplies_Update(this); break; - case 79: - if (actor->timer_0C4 == 0) { - actor->unk_0B6 += 1; - if (Animation_GetFrameCount(&D_ZO_600E5EC) < actor->unk_0B6) { - actor->unk_0B6 = 0; + case EINFO_79: + if (this->timer_0C4 == 0) { + this->unk_0B6 += 1; + if (Animation_GetFrameCount(&D_ZO_600E5EC) < this->unk_0B6) { + this->unk_0B6 = 0; } } break; - case 80: { + case EINFO_80: { Effect* effect; Vec3f sp90; Vec3f sp84; Vec3f sp78; s32 sp74; - switch (actor->unk_046) { + switch (this->unk_046) { case 1: break; case 0: - Matrix_RotateZ(gCalcMatrix, actor->unk_0F4.z * M_DTOR, 0); + Matrix_RotateZ(gCalcMatrix, this->unk_0F4.z * M_DTOR, 0); Matrix_MultVec3fNoTranslate(gCalcMatrix, &D_800D1290, &sp90); - if ((actor->obj.pos.y + sp90.y) > -30.0f) { + if ((this->obj.pos.y + sp90.y) > -30.0f) { for (sp74 = 0; sp74 < 7; sp74++) { effect = func_effect_8007783C(OBJ_EFFECT_394); if (effect != NULL) { effect->unk_78 = effect->unk_7A = 12; effect->obj.status = OBJ_ACTIVE; - effect->obj.pos.x = actor->obj.pos.x + sp90.x; - effect->obj.pos.y = actor->obj.pos.y + sp90.y; - effect->obj.pos.z = actor->obj.pos.z; + effect->obj.pos.x = this->obj.pos.x + sp90.x; + effect->obj.pos.y = this->obj.pos.y + sp90.y; + effect->obj.pos.z = this->obj.pos.z; effect->obj.rot.x = RAND_FLOAT(360.0f); effect->obj.rot.y = RAND_FLOAT(360.0f); effect->obj.rot.z = RAND_FLOAT(360.0f); @@ -3561,24 +3550,24 @@ void func_enmy2_80072594(Actor* actor) { effect->unk_60.z = RAND_FLOAT_CENTERED(1.0f) + 5.0f; } } - actor->unk_046++; + this->unk_046++; } break; } - if ((fabsf(actor->fwork[0]) > 10.0f) && !(gGameFrameCount & 1)) { + if ((fabsf(this->fwork[0]) > 10.0f) && !(gGameFrameCount & 1)) { effect = func_effect_8007783C(OBJ_EFFECT_394); if (effect != NULL) { - Matrix_RotateZ(gCalcMatrix, actor->unk_0F4.z * M_DTOR, 0); + Matrix_RotateZ(gCalcMatrix, this->unk_0F4.z * M_DTOR, 0); Matrix_MultVec3fNoTranslate(gCalcMatrix, &D_800D1290, &sp90); effect->unk_78 = effect->unk_7A = 11; effect->obj.status = OBJ_ACTIVE; - effect->obj.pos.x = actor->obj.pos.x + RAND_FLOAT_CENTERED(3.0f) + sp90.x; - effect->obj.pos.y = actor->obj.pos.y + RAND_FLOAT_CENTERED(3.0f) + sp90.y; - effect->obj.pos.z = actor->obj.pos.z + RAND_FLOAT_CENTERED(3.0f) + 180.0f; + effect->obj.pos.x = this->obj.pos.x + RAND_FLOAT_CENTERED(3.0f) + sp90.x; + effect->obj.pos.y = this->obj.pos.y + RAND_FLOAT_CENTERED(3.0f) + sp90.y; + effect->obj.pos.z = this->obj.pos.z + RAND_FLOAT_CENTERED(3.0f) + 180.0f; effect->scale2 = 9.0f; effect->obj.rot.z = RAND_FLOAT(360.0f); @@ -3602,9 +3591,9 @@ void func_enmy2_80072594(Actor* actor) { if (effect != NULL) { effect->unk_78 = effect->unk_7A = 11; effect->obj.status = OBJ_ACTIVE; - effect->obj.pos.x = RAND_FLOAT_CENTERED(3.0f) + actor->obj.pos.x; - effect->obj.pos.y = RAND_FLOAT_CENTERED(5.0f) + actor->obj.pos.y + 50.0f; - effect->obj.pos.z = RAND_FLOAT_CENTERED(3.0f) + actor->obj.pos.z + 200.0f; + effect->obj.pos.x = RAND_FLOAT_CENTERED(3.0f) + this->obj.pos.x; + effect->obj.pos.y = RAND_FLOAT_CENTERED(5.0f) + this->obj.pos.y + 50.0f; + effect->obj.pos.z = RAND_FLOAT_CENTERED(3.0f) + this->obj.pos.z + 200.0f; effect->scale2 = 9.0f; effect->obj.rot.z = RAND_FLOAT(360.0f); effect->vel.x = RAND_FLOAT_CENTERED(5.0f); @@ -3625,119 +3614,118 @@ void func_enmy2_80072594(Actor* actor) { } } break; - case 81: - Math_SmoothStepToF(&actor->fwork[15], 1.0f, 0.1f, 0.1f, 0.001f); + case EINFO_81: + Math_SmoothStepToF(&this->fwork[15], 1.0f, 0.1f, 0.1f, 0.001f); - if (actor->fwork[15] > 0.5f) { - actor->info.hitbox = SEGMENTED_TO_VIRTUAL(D_VE1_601B4C4); + if (this->fwork[15] > 0.5f) { + this->info.hitbox = SEGMENTED_TO_VIRTUAL(D_VE1_601B4C4); } - if (actor->unk_046 == 0) { - actor->fwork[16] += 4.0f; - if (actor->fwork[16] >= 100.0f) { - actor->unk_046 = 1; - actor->fwork[16] = 100.0f; + if (this->unk_046 == 0) { + this->fwork[16] += 4.0f; + if (this->fwork[16] >= 100.0f) { + this->unk_046 = 1; + this->fwork[16] = 100.0f; } } else { - actor->fwork[16] -= 4.0f; - if (actor->fwork[16] <= 0.0f) { - actor->unk_046 = 0; - actor->fwork[16] = 0.0f; + this->fwork[16] -= 4.0f; + if (this->fwork[16] <= 0.0f) { + this->unk_046 = 0; + this->fwork[16] = 0.0f; } } break; - case 83: - if (actor->health <= 0) { - if (actor->unk_0B6 == 0x14) { - spD4 = actor->obj.pos.z; - spD8 = actor->obj.pos.y; + case EINFO_83: + if (this->health <= 0) { + if (this->unk_0B6 == 20) { + spD4 = this->obj.pos.z; + spD8 = this->obj.pos.y; - actor->obj.pos.y += 80.0f; - actor->obj.pos.z += 40.0f; - func_enmy_80066254(actor); - actor->obj.pos.y = spD8; - actor->obj.pos.z = spD4; + this->obj.pos.y += 80.0f; + this->obj.pos.z += 40.0f; + func_enmy_80066254(this); + this->obj.pos.y = spD8; + this->obj.pos.z = spD4; } - if ((actor->unk_0B6 >= 0x12) && (actor->unk_0B6 < 0x18)) { - func_effect_8007BC7C(actor->obj.pos.x, actor->obj.pos.y + 80.0f, actor->obj.pos.z + 60.0f, - 20.0f); + if ((this->unk_0B6 >= 18) && (this->unk_0B6 < 24)) { + func_effect_8007BC7C(this->obj.pos.x, this->obj.pos.y + 80.0f, this->obj.pos.z + 60.0f, 20.0f); } - if (actor->unk_0B6 < 49) { - actor->unk_0B6++; - if (actor->unk_0B6 >= 49) { - actor->unk_0B6 = 49; + if (this->unk_0B6 < 49) { + this->unk_0B6++; + if (this->unk_0B6 >= 49) { + this->unk_0B6 = 49; } if (gGameFrameCount & 1) { - Aquas_801AC8A8(RAND_FLOAT_CENTERED(100.0f) + actor->obj.pos.x, - RAND_FLOAT(50.0f) + actor->obj.pos.y, - RAND_FLOAT_CENTERED(100.0f) + actor->obj.pos.z, 1.0f, 0); + Aquas_801AC8A8(RAND_FLOAT_CENTERED(100.0f) + this->obj.pos.x, + RAND_FLOAT(50.0f) + this->obj.pos.y, + RAND_FLOAT_CENTERED(100.0f) + this->obj.pos.z, 1.0f, 0); } } - actor->timer_0C2 = 10000; + this->timer_0C2 = 10000; } break; - case 88: - if (actor->unk_04A == 0) { - actor->unk_046 += 4; - if (actor->unk_046 >= 255) { - actor->unk_046 = 255; - actor->unk_04A = 1; + case EINFO_88: + if (this->unk_04A == 0) { + this->unk_046 += 4; + if (this->unk_046 >= 255) { + this->unk_046 = 255; + this->unk_04A = 1; } } else { - actor->unk_046 -= 4; - if (actor->unk_046 <= 0) { - actor->unk_046 = 0; - actor->unk_04A = 0; + this->unk_046 -= 4; + if (this->unk_046 <= 0) { + this->unk_046 = 0; + this->unk_04A = 0; } } break; - case 103: - case 104: - Andross_80187530(actor); // might be i5 or i2 + case EINFO_103: + case EINFO_104: + Andross_80187530(this); break; - case 106: - actor->unk_0B6 += 1; - if (actor->unk_0B6 >= 6) { - actor->unk_0B6 = 0; + case EINFO_106: + this->unk_0B6++; + if (this->unk_0B6 >= 6) { + this->unk_0B6 = 0; } break; } if (gLevelMode == LEVELMODE_ALL_RANGE) { - D_ctx_80177F20[actor->index + 1] = actor->obj.pos.x; - D_ctx_80178028[actor->index + 1] = actor->obj.pos.z; - D_ctx_80178130[actor->index + 1] = Math_ModF(actor->unk_0F4.y, 360.0f) + 180.0f; - D_ctx_80178238[actor->index + 1] = 1; + D_ctx_80177F20[this->index + 1] = this->obj.pos.x; + D_ctx_80178028[this->index + 1] = this->obj.pos.z; + D_ctx_80178130[this->index + 1] = Math_ModF(this->unk_0F4.y, 360.0f) + 180.0f; + D_ctx_80178238[this->index + 1] = 1; } } } -static UNK_TYPE D_800D129C[0x8C] = { 0 }; // unused +static UNK_TYPE D_800D129C[140] = { 0 }; // unused -bool func_enmy2_80074BFC(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* data) { - Actor* actor = data; +bool ActorEvent_OverrideLimbDraw1(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* thisx) { + Actor* this = thisx; if (limbIndex == 1) { - pos->x += actor->fwork[16]; + pos->x += this->fwork[16]; } if (limbIndex == 2) { - rot->z -= actor->fwork[15]; + rot->z -= this->fwork[15]; } return false; } -bool func_enmy2_80074C44(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* data) { - Actor* actor = data; +bool ActorEvent_OverrideLimbDraw2(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* thisx) { + Actor* this = thisx; s32 var_s1; if (limbIndex == 5) { - var_s1 = (s32) (actor->health * 0.6375f); + var_s1 = (s32) (this->health * 0.6375f); if (var_s1 > 255) { var_s1 = 255; } @@ -3763,17 +3751,17 @@ bool func_enmy2_80074C44(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, voi return false; } -void func_enmy2_80074E3C(Actor* actor) { +void ActorEvent_80074E3C(Actor* this) { Vec3f sp30[10]; Animation_GetFrameData(&D_SX_6013820, 0, sp30); - sp30[6].y += actor->fwork[15]; - sp30[5].z += actor->fwork[16] + ((actor->timer_0BE >> 2) & 1); - sp30[4].z -= actor->fwork[16] + ((actor->timer_0BE >> 2) & 1); - Animation_DrawSkeleton(1, D_SX_601390C, sp30, func_enmy2_80074C44, NULL, actor, &gIdentityMatrix); + sp30[6].y += this->fwork[15]; + sp30[5].z += this->fwork[16] + ((this->timer_0BE >> 2) & 1); + sp30[4].z -= this->fwork[16] + ((this->timer_0BE >> 2) & 1); + Animation_DrawSkeleton(1, D_SX_601390C, sp30, ActorEvent_OverrideLimbDraw2, NULL, this, &gIdentityMatrix); } -bool func_enmy2_80074F04(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* thisx) { +bool ActorEvent_OverrideLimbDraw3(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* thisx) { gSPClearGeometryMode(gMasterDisp++, G_TEXTURE_GEN); if ((limbIndex == 3) || (limbIndex == 5)) { gSPTexture(gMasterDisp++, 5000, 5000, 0, G_TX_RENDERTILE, G_ON); @@ -3782,31 +3770,32 @@ bool func_enmy2_80074F04(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, voi return false; } -s32 func_enmy2_80074F90(Object_80* obj80) { +s32 Obj111_Draw(Object_80* this) { RCP_SetupDL(&gMasterDisp, 0x3C); gSPDisplayList(gMasterDisp++, D_SY_601AD70); RCP_SetupDL(&gMasterDisp, 0x40); return 0; } -void func_enmy2_80074FF0(Actor* actor) { +void ActorEvent_Draw(Actor* this) { Vec3f sp114[31]; f32 sp40; s16 temp_s0; s32 pad; - if (actor->timer_0C6 && (actor->unk_0B4 != 0x5A) && (actor->unk_0B4 != 0x44) && (actor->unk_0B4 != 0x48)) { - if ((actor->unk_0B4 != 0xD) && (actor->unk_0B4 != 0xE) && (actor->unk_0B4 != 0x3D) && - (actor->unk_0B4 != 0x3E) && (actor->unk_0B4 != 0x53) && (actor->unk_0B4 != 0x62) && (actor->scale > 0.5f) && - (actor->timer_0C6 >= 9) && !(actor->timer_0C6 & 3) && (D_ctx_80177854 != 0x64)) { - func_effect_8007C120(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, actor->vel.x, actor->vel.y, - actor->vel.z, actor->scale * 0.07f, 3); + if (this->timer_0C6 && (this->unk_0B4 != EINFO_90) && (this->unk_0B4 != EINFO_68) && (this->unk_0B4 != EINFO_72)) { + if ((this->unk_0B4 != EINFO_13) && (this->unk_0B4 != EINFO_14) && (this->unk_0B4 != EINFO_61) && + (this->unk_0B4 != EINFO_62) && (this->unk_0B4 != EINFO_83) && (this->unk_0B4 != EINFO_98) && + (this->scale > 0.5f) && (this->timer_0C6 >= 9) && !(this->timer_0C6 & 3) && (D_ctx_80177854 != 100)) { + func_effect_8007C120(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, this->vel.x, this->vel.y, + this->vel.z, this->scale * 0.07f, 3); } - if ((actor->unk_0B4 != 0x15) && (actor->unk_0B4 != 0x17) && (actor->unk_0B4 != 0x4F) && - (actor->unk_0B4 != 0x53) && (actor->unk_0B4 != 0x1B) && (actor->unk_0B4 != 0x33) && - (actor->unk_0B4 != 0xD) && (actor->unk_0B4 != 0x48) && (actor->unk_0B4 != 0x1C) && (actor->scale > 0.5f)) { - sp40 = SIN_DEG(actor->timer_0C6 * 400.0f) * actor->timer_0C6; + if ((this->unk_0B4 != EINFO_21) && (this->unk_0B4 != EINFO_23) && (this->unk_0B4 != EINFO_79) && + (this->unk_0B4 != EINFO_83) && (this->unk_0B4 != EINFO_27) && (this->unk_0B4 != EINFO_51) && + (this->unk_0B4 != EINFO_13) && (this->unk_0B4 != EINFO_72) && (this->unk_0B4 != EINFO_28) && + (this->scale > 0.5f)) { + sp40 = SIN_DEG(this->timer_0C6 * 400.0f) * this->timer_0C6; Matrix_RotateY(gGfxMatrix, M_DTOR * sp40, 1); Matrix_RotateX(gGfxMatrix, M_DTOR * sp40, 1); Matrix_RotateZ(gGfxMatrix, M_DTOR * sp40, 1); @@ -3814,152 +3803,152 @@ void func_enmy2_80074FF0(Actor* actor) { } } - if ((actor->obj.status == OBJ_DYING) && (actor->timer_0BE != 0)) { + if ((this->obj.status == OBJ_DYING) && (this->timer_0BE != 0)) { RCP_SetupDL_27(); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 0, 0, 255); } - if ((actor->unk_0B4 == 0x1D) || (actor->unk_0B4 == 0x3B) || (actor->unk_0B4 == 0x3C)) { + if ((this->unk_0B4 == EINFO_29) || (this->unk_0B4 == EINFO_59) || (this->unk_0B4 == EINFO_60)) { RCP_SetupDL_60(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); - } else if ((actor->unk_0B4 == 0x52) || (actor->unk_0B4 == 0x5A) || - ((actor->unk_0B4 == 6) && (gCurrentLevel == LEVEL_SOLAR))) { - if (!(actor->timer_0C6 & 1)) { + } else if ((this->unk_0B4 == EINFO_82) || (this->unk_0B4 == EINFO_90) || + ((this->unk_0B4 == EINFO_6) && (gCurrentLevel == LEVEL_SOLAR))) { + if (!(this->timer_0C6 & 1)) { RCP_SetupDL(&gMasterDisp, 0x39); } else { RCP_SetupDL(&gMasterDisp, 0x3D); } } - switch (actor->unk_0B4) { - case 92: - case 93: - case 94: - case 95: - case 96: + switch (this->unk_0B4) { + case EINFO_92: + case EINFO_93: + case EINFO_94: + case EINFO_95: + case EINFO_96: RCP_SetupDL(&gMasterDisp, 0x22); gDPSetTextureFilter(gMasterDisp++, G_TF_POINT); - gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, (s32) actor->fwork[15], (s32) actor->fwork[16], - (s32) actor->fwork[17], 255); - gSPDisplayList(gMasterDisp++, D_800D003C[actor->unk_0B4].dList); + gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, (s32) this->fwork[15], (s32) this->fwork[16], + (s32) this->fwork[17], 255); + gSPDisplayList(gMasterDisp++, D_800D003C[this->unk_0B4].dList); gDPSetTextureFilter(gMasterDisp++, G_TF_BILERP); break; default: - if ((actor->unk_0B4 < 200) && (D_800D003C[actor->unk_0B4].dList != NULL)) { - gSPDisplayList(gMasterDisp++, D_800D003C[actor->unk_0B4].dList); + if ((this->unk_0B4 < EINFO_200) && (D_800D003C[this->unk_0B4].dList != NULL)) { + gSPDisplayList(gMasterDisp++, D_800D003C[this->unk_0B4].dList); } - switch (actor->unk_0B4) { - case 56: + switch (this->unk_0B4) { + case EINFO_56: func_demo_800515C4(); break; - case 0: - actor->iwork[11] = 1; - func_edisplay_8005ADAC(actor); + case EINFO_0: + this->iwork[11] = 1; + func_edisplay_8005ADAC(this); break; - case 2: - actor->fwork[15] -= actor->fwork[15] * 0.1f; - actor->fwork[26] -= actor->fwork[26] * 0.1f; - actor->fwork[16] -= actor->fwork[16] * 0.1f; - actor->fwork[27] -= actor->fwork[27] * 0.1f; + case EINFO_2: + this->fwork[15] -= this->fwork[15] * 0.1f; + this->fwork[26] -= this->fwork[26] * 0.1f; + this->fwork[16] -= this->fwork[16] * 0.1f; + this->fwork[27] -= this->fwork[27] * 0.1f; - if (actor->obj.rot.z > 0.0f) { - actor->fwork[15] += (actor->obj.rot.z * 0.7f - actor->fwork[15]) * 0.2f; - actor->fwork[26] += (-actor->obj.rot.z * 0.7f - actor->fwork[26]) * 0.2f; + if (this->obj.rot.z > 0.0f) { + this->fwork[15] += (this->obj.rot.z * 0.7f - this->fwork[15]) * 0.2f; + this->fwork[26] += (-this->obj.rot.z * 0.7f - this->fwork[26]) * 0.2f; } - if (actor->obj.rot.z < 0.0f) { - actor->fwork[16] += (-actor->obj.rot.z * 0.7f - actor->fwork[16]) * 0.2f; - actor->fwork[27] += (actor->obj.rot.z * 0.7f - actor->fwork[27]) * 0.2f; + if (this->obj.rot.z < 0.0f) { + this->fwork[16] += (-this->obj.rot.z * 0.7f - this->fwork[16]) * 0.2f; + this->fwork[27] += (this->obj.rot.z * 0.7f - this->fwork[27]) * 0.2f; } - func_edisplay_8005B388(actor); + func_edisplay_8005B388(this); break; - case 43: + case EINFO_43: if (gLevelType == LEVELTYPE_PLANET) { gSPDisplayList(gMasterDisp++, D_ENMY_PLANET_40018A0); } else { gSPDisplayList(gMasterDisp++, D_ENMY_SPACE_4007870); } - func_edisplay_8005ADAC(actor); + func_edisplay_8005ADAC(this); break; - case 5: - actor->iwork[11] = 1; - func_edisplay_8005ADAC(actor); + case EINFO_5: + this->iwork[11] = 1; + func_edisplay_8005ADAC(this); break; - case 6: + case EINFO_6: if (gCurrentLevel == LEVEL_SOLAR) { gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK); - Animation_GetFrameData(&D_SO_600636C, actor->unk_0B6, sp114); - Animation_DrawSkeleton(1, D_SO_6006558, sp114, NULL, NULL, actor, &gIdentityMatrix); + Animation_GetFrameData(&D_SO_600636C, this->unk_0B6, sp114); + Animation_DrawSkeleton(1, D_SO_6006558, sp114, NULL, NULL, this, &gIdentityMatrix); gSPSetGeometryMode(gMasterDisp++, G_CULL_BACK); } else { - Animation_GetFrameData(&D_ENMY_PLANET_40057AC, actor->unk_0B6, sp114); - Animation_DrawSkeleton(1, D_ENMY_PLANET_40058B8, sp114, NULL, NULL, actor, &gIdentityMatrix); + Animation_GetFrameData(&D_ENMY_PLANET_40057AC, this->unk_0B6, sp114); + Animation_DrawSkeleton(1, D_ENMY_PLANET_40058B8, sp114, NULL, NULL, this, &gIdentityMatrix); } break; - case 7: - actor->iwork[11] = 1; - func_edisplay_8005ADAC(actor); + case EINFO_7: + this->iwork[11] = 1; + func_edisplay_8005ADAC(this); break; - case 9: + case EINFO_9: Matrix_Translate(gGfxMatrix, 0.0f, -30.0f, 0.0f, 1); - Animation_GetFrameData(&D_ENMY_PLANET_40001A4, actor->unk_0B6, sp114); - Animation_DrawSkeleton(1, D_ENMY_PLANET_4000270, sp114, NULL, NULL, actor, &gIdentityMatrix); + Animation_GetFrameData(&D_ENMY_PLANET_40001A4, this->unk_0B6, sp114); + Animation_DrawSkeleton(1, D_ENMY_PLANET_4000270, sp114, NULL, NULL, this, &gIdentityMatrix); break; - case 18: - if (actor->fwork[0] > 0.1f) { - actor->iwork[11] = 1; + case EINFO_18: + if (this->fwork[0] > 0.1f) { + this->iwork[11] = 1; Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -30.0f, 1); Matrix_Scale(gGfxMatrix, 2.5f, 2.5f, 2.5f, 1); - func_edisplay_8005B1E8(actor, 2); + func_edisplay_8005B1E8(this, 2); } break; - case 19: - if (actor->fwork[0] > 0.1f) { - actor->iwork[11] = 1; + case EINFO_19: + if (this->fwork[0] > 0.1f) { + this->iwork[11] = 1; Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -30.0f, 1); Matrix_Scale(gGfxMatrix, 2.5f, 2.5f, 2.5f, 1); - func_edisplay_8005B1E8(actor, 2); + func_edisplay_8005B1E8(this, 2); } break; - case 20: + case EINFO_20: RCP_SetupDL_60(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); gSPDisplayList(gMasterDisp++, D_A6_601A120); break; - case 21: + case EINFO_21: gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK); gSPDisplayList(gMasterDisp++, D_A6_6018BF0); gSPSetGeometryMode(gMasterDisp++, G_CULL_BACK); Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -30.0f, 1); - actor->iwork[11] = 1; - func_edisplay_8005B1E8(actor, 2); + this->iwork[11] = 1; + func_edisplay_8005B1E8(this, 2); break; - case 22: + case EINFO_22: gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK); gSPDisplayList(gMasterDisp++, D_A6_6019730); gSPSetGeometryMode(gMasterDisp++, G_CULL_BACK); Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -30.0f, 1); - actor->iwork[11] = 1; - func_edisplay_8005B1E8(actor, 2); + this->iwork[11] = 1; + func_edisplay_8005B1E8(this, 2); break; - case 27: - if (actor->timer_0C2 != 0) { - if (!(actor->timer_0C2 & 3) && (D_ctx_80177854 != 0x64)) { - func_effect_8007D0E0(RAND_FLOAT_CENTERED(200.0f) + actor->obj.pos.x, - RAND_FLOAT_CENTERED(200.0f) + actor->obj.pos.y, - RAND_FLOAT_CENTERED(200.0f) + actor->obj.pos.z, + case EINFO_27: + if (this->timer_0C2 != 0) { + if (!(this->timer_0C2 & 3) && (D_ctx_80177854 != 100)) { + func_effect_8007D0E0(RAND_FLOAT_CENTERED(200.0f) + this->obj.pos.x, + RAND_FLOAT_CENTERED(200.0f) + this->obj.pos.y, + RAND_FLOAT_CENTERED(200.0f) + this->obj.pos.z, RAND_FLOAT(1.5f) + 2.5f); } RCP_SetupDL(&gMasterDisp, 0x39); @@ -3970,157 +3959,157 @@ void func_enmy2_80074FF0(Actor* actor) { } break; - case 31: + case EINFO_31: Matrix_RotateX(gGfxMatrix, M_PI / 2, 1); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_A6_600E0C0); break; - case 33: - Animation_GetFrameData(&D_ENMY_SPACE_400A30C, actor->unk_0B6, sp114); + case EINFO_33: + Animation_GetFrameData(&D_ENMY_SPACE_400A30C, this->unk_0B6, sp114); Matrix_RotateY(gGfxMatrix, M_PI, 1); Matrix_Scale(gGfxMatrix, 1.5f, 1.5f, 1.5f, 1); - Animation_DrawSkeleton(1, D_ENMY_SPACE_400A398, sp114, func_enmy2_80074BFC, NULL, actor, + Animation_DrawSkeleton(1, D_ENMY_SPACE_400A398, sp114, ActorEvent_OverrideLimbDraw1, NULL, this, &gIdentityMatrix); - Math_SmoothStepToF(&actor->fwork[16], 0.0f, 0.3f, 2.0f, 0.0001f); + Math_SmoothStepToF(&this->fwork[16], 0.0f, 0.3f, 2.0f, 0.0001f); break; - case 36: - Animation_GetFrameData(&D_TI1_700CAF4, actor->unk_0B6, sp114); - sp114[2].z += actor->fwork[15]; - Animation_DrawSkeleton(1, D_TI1_700CB60, sp114, NULL, NULL, actor, &gIdentityMatrix); + case EINFO_36: + Animation_GetFrameData(&D_TI1_700CAF4, this->unk_0B6, sp114); + sp114[2].z += this->fwork[15]; + Animation_DrawSkeleton(1, D_TI1_700CB60, sp114, NULL, NULL, this, &gIdentityMatrix); break; - case 38: - func_enmy2_80074E3C(actor); + case EINFO_38: + ActorEvent_80074E3C(this); break; - case 48: - case 49: - case 50: - SectorY_801A4CB0(actor); + case EINFO_48: + case EINFO_49: + case EINFO_50: + SectorY_Actor204_Draw(this); break; - case 52: - Animation_GetFrameData(&D_ZO_601F874, actor->unk_0B6, sp114); - sp114[2].z -= actor->fwork[15]; + case EINFO_52: + Animation_GetFrameData(&D_ZO_601F874, this->unk_0B6, sp114); + sp114[2].z -= this->fwork[15]; gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK); Matrix_Scale(gGfxMatrix, 2.6f, 2.6f, 2.6f, 1); - Animation_DrawSkeleton(1, D_ZO_601F920, sp114, NULL, NULL, actor, &gIdentityMatrix); + Animation_DrawSkeleton(1, D_ZO_601F920, sp114, NULL, NULL, this, &gIdentityMatrix); gSPSetGeometryMode(gMasterDisp++, G_CULL_BACK); break; - case 64: + case EINFO_64: Matrix_Push(&gGfxMatrix); - Matrix_RotateX(gGfxMatrix, actor->unk_0F4.x * M_DTOR, 1); - Matrix_RotateY(gGfxMatrix, actor->unk_0F4.y * M_DTOR, 1); + Matrix_RotateX(gGfxMatrix, this->unk_0F4.x * M_DTOR, 1); + Matrix_RotateY(gGfxMatrix, this->unk_0F4.y * M_DTOR, 1); Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, 0.0f, actor->fwork[15], 0.0f, 1); + Matrix_Translate(gGfxMatrix, 0.0f, this->fwork[15], 0.0f, 1); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_ME_600CAA0); Matrix_Pop(&gGfxMatrix); gSPDisplayList(gMasterDisp++, D_ME_600C130); - Matrix_Translate(gGfxMatrix, 0.0f, -actor->fwork[15], 0.0f, 1); + Matrix_Translate(gGfxMatrix, 0.0f, -this->fwork[15], 0.0f, 1); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_ME_600C740); Matrix_Pop(&gGfxMatrix); break; - case 67: + case EINFO_67: gSPDisplayList(gMasterDisp++, D_ME_6008AA0); RCP_SetupDL(&gMasterDisp, 0x35); gSPDisplayList(gMasterDisp++, D_ME_6009E30); break; - case 78: - func_enmy_80067874(actor); + case EINFO_78: + ActorSupplies_Draw(this); break; - case 79: - temp_s0 = actor->state; - actor->state = 2; - Zoness_80190430(actor); - actor->state = temp_s0; + case EINFO_79: + temp_s0 = this->state; + this->state = 2; // actor 235 state + Zoness_80190430(this); + this->state = temp_s0; break; - case 80: + case EINFO_80: Matrix_Scale(gGfxMatrix, 0.6f, 0.6f, 0.6f, 1); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_VE1_9011200); break; - case 81: - if (actor->fwork[15] > 0.001f) { - Matrix_Scale(gGfxMatrix, actor->fwork[15], actor->fwork[15], actor->fwork[15], 1); + case EINFO_81: + if (this->fwork[15] > 0.001f) { + Matrix_Scale(gGfxMatrix, this->fwork[15], this->fwork[15], this->fwork[15], 1); Matrix_SetGfxMtx(&gMasterDisp); - Texture_BlendRGBA16(actor->fwork[16], 16 * 11, D_VE1_9003890, D_VE1_9003DF0, D_VE1_9003330); + Texture_BlendRGBA16(this->fwork[16], 16 * 11, D_VE1_9003890, D_VE1_9003DF0, D_VE1_9003330); gSPDisplayList(gMasterDisp++, D_VE1_9002CF0); } break; - case 82: + case EINFO_82: gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK); gSPDisplayList(gMasterDisp++, D_MA_600DA10); gSPSetGeometryMode(gMasterDisp++, G_CULL_BACK); break; - case 83: + case EINFO_83: Matrix_Scale(gGfxMatrix, 3.0f, 3.0f, 3.0f, 1); - Animation_GetFrameData(&D_AQ_602201C, actor->unk_0B6, sp114); - Animation_DrawSkeleton(1, D_AQ_60220E8, sp114, NULL, NULL, actor, &gIdentityMatrix); + Animation_GetFrameData(&D_AQ_602201C, this->unk_0B6, sp114); + Animation_DrawSkeleton(1, D_AQ_60220E8, sp114, NULL, NULL, this, &gIdentityMatrix); break; - case 85: + case EINFO_85: gSPDisplayList(gMasterDisp++, D_D00B880); - func_edisplay_8005ADAC(actor); + func_edisplay_8005ADAC(this); break; - case 86: + case EINFO_86: gSPDisplayList(gMasterDisp++, D_D009A40); - func_edisplay_8005ADAC(actor); + func_edisplay_8005ADAC(this); break; - case 88: + case EINFO_88: RCP_SetupDL(&gMasterDisp, 0x16); - gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, actor->unk_046, actor->unk_046, actor->unk_046, 255); + gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, this->unk_046, this->unk_046, this->unk_046, 255); gSPDisplayList(gMasterDisp++, D_AQ_6008970); break; - case 89: + case EINFO_89: RCP_SetupDL(&gMasterDisp, 0x15); gSPDisplayList(gMasterDisp++, D_AQ_6000E10); break; - case 103: - case 104: - Andross_8018769C(actor); + case EINFO_103: + case EINFO_104: + Andross_8018769C(this); break; - case 105: + case EINFO_105: RCP_SetupDL(&gMasterDisp, 0x23); - gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 0, 0, 0, 0x8F); + gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 0, 0, 0, 143); gDPSetEnvColor(gMasterDisp++, 0, 0, 0, 0); gSPDisplayList(gMasterDisp++, D_WZ_7000000); break; - case 106: - Animation_GetFrameData(&D_ENMY_SPACE_4000080, actor->unk_0B6, sp114); - Animation_DrawSkeleton(1, D_ENMY_SPACE_400014C, sp114, NULL, NULL, actor, &gIdentityMatrix); + case EINFO_106: + Animation_GetFrameData(&D_ENMY_SPACE_4000080, this->unk_0B6, sp114); + Animation_DrawSkeleton(1, D_ENMY_SPACE_400014C, sp114, NULL, NULL, this, &gIdentityMatrix); break; case 0xFFF: - actor->timer_0C2 = 10; + this->timer_0C2 = 10; break; } - if ((D_display_80161410 > 0) && ((actor->iwork[12] > 0) && (actor->iwork[12] < 6))) { + if ((D_display_80161410 > 0) && ((this->iwork[12] > 0) && (this->iwork[12] < 6))) { Vec3f sp58 = { 0.0f, 0.0f, 0.0f }; - if ((actor->iwork[12] == 4) || (actor->iwork[12] == 5)) { - Matrix_MultVec3f(gGfxMatrix, &sp58, &D_ctx_80177E98[actor->iwork[12] + 4]); + if ((this->iwork[12] == 4) || (this->iwork[12] == 5)) { + Matrix_MultVec3f(gGfxMatrix, &sp58, &D_ctx_80177E98[this->iwork[12] + 4]); return; } else { - Matrix_MultVec3f(gGfxMatrix, &sp58, &D_ctx_80177E98[actor->iwork[12]]); + Matrix_MultVec3f(gGfxMatrix, &sp58, &D_ctx_80177E98[this->iwork[12]]); } } break; @@ -4135,7 +4124,7 @@ void func_enmy2_800763A4(Actor* actor) { Vec3f sp4C; s32 pad; - if (actor->unk_0B4 == 27) { + if (actor->unk_0B4 == EINFO_27) { actor->obj.pos.y -= actor->vel.y; actor->obj.status = OBJ_ACTIVE; func_effect_8007D0E0(actor->obj.pos.x - actor->vel.x, actor->obj.pos.y + 30.0f, actor->obj.pos.z - actor->vel.z, @@ -4190,7 +4179,7 @@ void func_enmy2_800763A4(Actor* actor) { break; } - if (((actor->timer_0BC & 3) == 1) && (actor->unk_0B4 != 13) && (actor->unk_0B4 != 61)) { + if (((actor->timer_0BC & 3) == 1) && (actor->unk_0B4 != EINFO_13) && (actor->unk_0B4 != EINFO_61)) { func_effect_8007D24C(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 2.2f); } @@ -4223,7 +4212,7 @@ void func_enmy2_800763A4(Actor* actor) { if ((sp60 != 0) || (actor->obj.pos.y < (gGroundLevel + 30.0f))) { if ((Rand_ZeroOne() < 0.5f) && (actor->timer_04C < 3) && (gLevelType == LEVELTYPE_PLANET) && - (sp60 != 999) && (D_80161A88 != 2) && ((actor->vel.z < -20.0f) || (actor->vel.z > 0.0f))) { + (sp60 != 999) && (D_ctx_80161A88 != 2) && ((actor->vel.z < -20.0f) || (actor->vel.z > 0.0f))) { if (gCurrentLevel == LEVEL_FORTUNA) { func_enmy2_8006BF7C(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z - actor->vel.z); func_enmy_80062C38(actor->obj.pos.x, actor->obj.pos.z); @@ -4241,13 +4230,13 @@ void func_enmy2_800763A4(Actor* actor) { func_effect_8007D2C8(actor->obj.pos.x - actor->vel.x, actor->obj.pos.y, actor->obj.pos.z - actor->vel.z, actor->scale * 3.0f); - if ((actor->obj.id == OBJ_ACTOR_197) && (actor->aiType < 8)) { + if ((actor->obj.id == OBJ_ACTOR_ALLRANGE) && (actor->aiType < AI360_KATT)) { func_effect_8007A6F0(&actor->obj.pos, 0x2903B009); } else { func_effect_8007A6F0(&actor->obj.pos, 0x2903A008); } - if ((actor->obj.id == OBJ_ACTOR_200) && (actor->unk_0B4 == 2)) { + if ((actor->obj.id == OBJ_ACTOR_EVENT) && (actor->unk_0B4 == EINFO_2)) { if (actor->fwork[17] < 360.0f) { func_play_800A69F8(1, actor->obj.pos.x + 20.0f, actor->obj.pos.y, actor->obj.pos.z); actor->fwork[17] = 777.0f; @@ -4260,7 +4249,7 @@ void func_enmy2_800763A4(Actor* actor) { } else { if ((actor->obj.pos.y < (gGroundLevel + 30.0f)) && (gLevelType == LEVELTYPE_PLANET)) { actor->vel.z = 0.0f; - if (D_80161A88 == 2) { + if (D_ctx_80161A88 == 2) { func_effect_8007D9DC(actor->obj.pos.x, gGroundLevel + 2.0f, actor->obj.pos.z, 3.0f, 20.0f, 0); func_effect_8007D9DC(actor->obj.pos.x, gGroundLevel + 2.0f, actor->obj.pos.z, 3.0f, 20.0f, @@ -4273,7 +4262,7 @@ void func_enmy2_800763A4(Actor* actor) { actor->obj.pos.z, 0.0f, 0.0f, 90.0f, 6.5f, 0, 0); } func_effect_8007C120(actor->obj.pos.x, 20.0f, actor->obj.pos.z, 0.0f, 0.0f, 0.0f, - actor->scale * 0.05f, 0x1E); + actor->scale * 0.05f, 30); if ((gCurrentLevel == LEVEL_FORTUNA) || (gCurrentLevel == LEVEL_VENOM_2)) { func_effect_8007C688(actor->obj.pos.x, gGroundLevel + 30.0f, actor->obj.pos.z, 3.0f, 60); if (gCurrentLevel == LEVEL_FORTUNA) { @@ -4309,7 +4298,7 @@ void func_enmy2_800763A4(Actor* actor) { actor->timer_0BE = 2; - if ((actor->obj.id == OBJ_ACTOR_197) && (actor->aiType < 8)) { + if ((actor->obj.id == OBJ_ACTOR_ALLRANGE) && (actor->aiType < AI360_KATT)) { func_effect_8007A6F0(&actor->obj.pos, 0x2903B009); } else { func_effect_8007A6F0(&actor->obj.pos, 0x2903A008); @@ -4318,7 +4307,7 @@ void func_enmy2_800763A4(Actor* actor) { } } if ((actor->unk_0D0 != 0) || (actor->timer_0BC == 0) || - ((actor->unk_044 != 0) && (actor->obj.id != OBJ_ACTOR_197))) { + ((actor->itemDrop != DROP_NONE) && (actor->obj.id != OBJ_ACTOR_ALLRANGE))) { if (gLevelMode == LEVELMODE_ALL_RANGE) { for (var_s0 = 0; var_s0 < 4; var_s0++) { if (Rand_ZeroOne() < 0.7f) { @@ -4334,20 +4323,20 @@ void func_enmy2_800763A4(Actor* actor) { actor->vel.z, 5.0f, 15); func_effect_8007D0E0(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z - actor->vel.z, 8.0f); } else { - if ((actor->unk_0B4 != 0xD) && (actor->unk_0B4 != 61)) { + if ((actor->unk_0B4 != EINFO_13) && (actor->unk_0B4 != EINFO_61)) { func_effect_8007D0E0(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z - actor->vel.z, actor->scale * 5.0f); } - if (actor->unk_0B4 == 0x24) { + if (actor->unk_0B4 == EINFO_36) { func_effect_8007BFFC(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, actor->vel.x, - actor->vel.y, actor->vel.z, 5.0f, 0xF); + actor->vel.y, actor->vel.z, 5.0f, 15); } } actor->timer_0BE = 2; - if ((actor->obj.id == OBJ_ACTOR_197) && (actor->aiType < 8)) { + if ((actor->obj.id == OBJ_ACTOR_ALLRANGE) && (actor->aiType < AI360_KATT)) { func_effect_8007A6F0(&actor->obj.pos, 0x2903B009); } else { func_effect_8007A6F0(&actor->obj.pos, 0x2903A008); @@ -4361,28 +4350,28 @@ void func_enmy2_800763A4(Actor* actor) { D_ctx_80178130[actor->index + 1] = actor->unk_0F4.y + 180.0f; } - if (actor->obj.id == OBJ_ACTOR_197) { + if (actor->obj.id == OBJ_ACTOR_ALLRANGE) { func_360_8002EE64(actor); } } -void func_enmy2_8007717C(Actor* actor) { - if ((actor->unk_0B4 == 0x30) || (actor->unk_0B4 == 0x31) || (actor->unk_0B4 == 0x32)) { - SectorY_801A3BD4(actor); +void ActorEvent_Dying(Actor* actor) { + if ((actor->unk_0B4 == EINFO_48) || (actor->unk_0B4 == EINFO_49) || (actor->unk_0B4 == EINFO_50)) { + SectorY_Actor204_Update(actor); } else { func_enmy2_800763A4(actor); } } -void func_enmy2_800771CC(Actor* actor) { +void Actor234_Update(Actor* this) { Vec3f sp24; - Math_Vec3fFromAngles(&sp24, actor->obj.rot.x, actor->obj.rot.y, 50.0f); - actor->vel.x = sp24.x; - actor->vel.y = sp24.y; - actor->vel.z = sp24.z; + Math_Vec3fFromAngles(&sp24, this->obj.rot.x, this->obj.rot.y, 50.0f); + this->vel.x = sp24.x; + this->vel.y = sp24.y; + this->vel.z = sp24.z; } -void func_enmy2_80077218(Actor* actor) { +void Actor234_Draw(Actor* this) { func_demo_800515C4(); } diff --git a/src/engine/fox_game.c b/src/engine/fox_game.c index de2f1120..a02b7da9 100644 --- a/src/engine/fox_game.c +++ b/src/engine/fox_game.c @@ -21,10 +21,10 @@ f32 D_game_80161A44; s32 D_game_800D2860[4] = { true, true, true, true }; s32 D_game_800D2870 = 0; -static s32 D_game_800D2874[] = { 0, 160, 0, 160 }; -static s32 D_game_800D2884[] = { 159, 319, 159, 319 }; -static s32 D_game_800D2894[] = { 0, 0, 120, 120 }; -static s32 D_game_800D28A4[] = { 119, 119, 239, 239 }; +static s32 sVsCameraULx[] = { 0, SCREEN_WIDTH / 2, 0, SCREEN_WIDTH / 2 }; +static s32 sVsCameraLRx[] = { SCREEN_WIDTH / 2 - 1, SCREEN_WIDTH - 1, SCREEN_WIDTH / 2 - 1, SCREEN_WIDTH - 1 }; +static s32 sVsCameraULy[] = { 0, 0, SCREEN_HEIGHT / 2, SCREEN_HEIGHT / 2 }; +static s32 sVsCameraLRy[] = { SCREEN_HEIGHT / 2 - 1, SCREEN_HEIGHT / 2 - 1, SCREEN_HEIGHT - 1, SCREEN_HEIGHT - 1 }; static s32 sOverlaySetups[] = { /* LEVEL_CORNERIA */ OVL_SETUP_CORNERIA, /* LEVEL_METEO */ OVL_SETUP_METEO, @@ -56,7 +56,7 @@ void Game_Initialize(void) { gGameState = GSTATE_BOOT; D_Timer_8017783C = 0; gBgColor = 0; - gBlurAlpha = 0xFF; + gBlurAlpha = 255; D_game_80161A3C = 45.0f; D_game_80161A40 = 10.0f; D_game_80161A44 = 12800.0f; @@ -150,7 +150,7 @@ void func_game_800A1C14(Gfx** arg0) { gDPFillRectangle((*arg0)++, 8, 8, SCREEN_WIDTH - 8 - 1, SCREEN_HEIGHT - 8 - 1); gDPSetColorImage((*arg0)++, G_IM_FMT_RGBA, G_IM_SIZ_16b, SCREEN_WIDTH, gFrameBuffer); - if (gBlurAlpha < 0xFF) { + if (gBlurAlpha < 255) { gDPPipeSync((*arg0)++); gDPSetCycleType((*arg0)++, G_CYC_1CYCLE); gDPSetCombineMode((*arg0)++, G_CC_PRIMITIVE, G_CC_PRIMITIVE); @@ -518,13 +518,13 @@ void Game_Update(void) { for (i = 0; i < gCamCount; i++) { if (gPlayer[i].timer_224 != 0) { - Graphics_FillRectangle(&gMasterDisp, D_game_800D2874[i], D_game_800D2894[i], D_game_800D2884[i], - D_game_800D28A4[i], D_ctx_80178348, D_ctx_80178350, D_ctx_80178354, + Graphics_FillRectangle(&gMasterDisp, sVsCameraULx[i], sVsCameraULy[i], sVsCameraLRx[i], + sVsCameraLRy[i], D_ctx_80178348, D_ctx_80178350, D_ctx_80178354, D_ctx_80178340); spBB = 1; } else { - Graphics_FillRectangle(&gMasterDisp, D_game_800D2874[i], D_game_800D2894[i], D_game_800D2884[i], - D_game_800D28A4[i], D_ctx_80178390[i], D_ctx_801783A0[i], D_ctx_801783B0[i], + Graphics_FillRectangle(&gMasterDisp, sVsCameraULx[i], sVsCameraULy[i], sVsCameraLRx[i], + sVsCameraLRy[i], D_ctx_80178390[i], D_ctx_801783A0[i], D_ctx_801783B0[i], D_ctx_80178380[i]); } } diff --git a/src/engine/fox_hud.c b/src/engine/fox_hud.c index c6381dc3..2db59f19 100644 --- a/src/engine/fox_hud.c +++ b/src/engine/fox_hud.c @@ -24,7 +24,7 @@ s32 gTotalHits; s32 D_80161718; s32 D_8016171C; f32 D_hud_80161720[3]; -s32 D_hud_8016172C; +s32 gDisplayedHitCount; s32 D_hud_80161730; s32 gShowBossHealth; s32 D_80161738[4]; @@ -229,12 +229,12 @@ void func_hud_80084B94(s32 arg0) { void func_hud_80084E78(Gfx** gfxP, void* arg1, void* arg2, u32 arg3, u32 arg4, f32 arg5, f32 arg6, f32 arg7, f32 arg8, f32 arg9, f32 argA) { gDPPipeSync((*gfxP)++); - gDPLoadTLUT((*gfxP)++, 0x100, 0x100, arg2); + gDPLoadTLUT((*gfxP)++, 256, 256, arg2); gDPLoadTextureBlock((*gfxP)++, arg1, G_IM_FMT_CI, G_IM_SIZ_8b, arg3, arg4, 0, G_TX_NOMIRROR, G_TX_NOMIRROR, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); gSPTextureRectangle((*gfxP)++, (arg5 * 4.0f), (arg6 * 4.0f), ((arg5 + (arg9 * arg7)) * 4.0f), - ((arg6 + (argA * arg8)) * 4.0f), G_TX_RENDERTILE, 0 * 0x20, 0 * 0x20, (s32) (1 / arg7 * 0x400), - (s32) (1 / arg8 * 0x400)); + ((arg6 + (argA * arg8)) * 4.0f), G_TX_RENDERTILE, 0 * 32, 0 * 32, (s32) (1 / arg7 * (32 * 32)), + (s32) (1 / arg8 * (32 * 32))); } void func_hud_800853A4(f32 xPos, f32 yPos, f32 xScale, f32 yScale) { @@ -723,7 +723,7 @@ void func_hud_80086CC8(void) { f32 sp18; f32 temp; - if ((D_ctx_80177854 != 0x64) && (D_ctx_80177838 != 0)) { + if ((D_ctx_80177854 != 100) && (D_ctx_80177838 != 0)) { D_ctx_80177838 -= 1; } @@ -1564,7 +1564,7 @@ void func_hud_80088970(void) { func_8001CA24(0); gPlayer[0].state_1C8 = PLAYERSTATE_1C8_6; - D_play_Timer_80161A60 = 0; + gScreenFlashTimer = 0; gPlayer[0].timer_1F8 = 0; D_ctx_80178340 = D_ctx_80178358 = 255; D_ctx_8017837C = 7; @@ -1962,7 +1962,7 @@ void func_hud_8008A240(void) { continue; } - if (gPlayer[i].state_1C8 != 3) { + if (gPlayer[i].state_1C8 != PLAYERSTATE_1C8_3) { continue; } @@ -2378,7 +2378,7 @@ void func_hud_8008B5B0(f32 x, f32 y) { gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, 255); func_hud_800856C0(x + 8.0f, y + 2.0f, D_801617A8, 1.0f, D_801617AC); RCP_SetupDL(&gMasterDisp, 0x4C); - gDPSetPrimColor(gMasterDisp++, 0, 0, D_800D1EB4, D_800D1EB8, D_800D1EBC, 0xFF); + gDPSetPrimColor(gMasterDisp++, 0, 0, D_800D1EB4, D_800D1EB8, D_800D1EBC, 255); func_hud_80085618(x, y, 1.0f, 1.0f); func_hud_800855C4(x + 7.0f + (D_801617A8 * 6.0f * 8.0f), y, 1.0f, 1.0f); func_hud_8008566C(x + 7.0f, y, D_801617A8 * 6.0f, 1.0f); @@ -2458,8 +2458,9 @@ s32 func_hud_8008B774(void) { for (i = 0; i < 60; i++) { if ((gActors[i].obj.status == OBJ_ACTIVE) && (gActors[i].iwork[12] == temp)) { if ((gActors[i].unk_0B4 == 2) || (gActors[i].unk_0B4 == 43) || - ((gActors[i].obj.id == 198) && - ((gActors[i].aiType == 1) || (gActors[i].aiType == 2) || (gActors[i].aiType == 3)))) { + ((gActors[i].obj.id == OBJ_ACTOR_TEAM_BOSS) && + ((gActors[i].aiType == AI360_FALCO) || (gActors[i].aiType == AI360_SLIPPY) || + (gActors[i].aiType == AI360_PEPPY)))) { if (gActors[i].timer_0C6) { ret = 1; } else { @@ -2770,8 +2771,8 @@ void func_hud_8008CA44(void) { s32 i; s32 j; - if ((gPlayer[gPlayerNum].unk_228 != 0) && (gPlayer[gPlayerNum].timer_210 == 0) && (D_ctx_80177854 != 100)) { - j = gPlayer[gPlayerNum].unk_228; + if ((gPlayer[gPlayerNum].flags_228 != 0) && (gPlayer[gPlayerNum].timer_210 == 0) && (D_ctx_80177854 != 100)) { + j = gPlayer[gPlayerNum].flags_228; for (i = 0; i < 12; i++) { if ((j & D_800D2048[i]) != D_800D2048[i]) { @@ -3148,7 +3149,7 @@ void func_hud_8008E2C8(f32 arg0, f32 arg1, s32* arg2, f32 arg3) { if (i & 1) { RCP_SetupDL_78(); gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, 255); - TextureRect_4bCI(&gMasterDisp, D_1011E80, D_1011EC0, 0x10, 8, (var_fs0 * arg3) + arg0, arg1, arg3, arg3); + TextureRect_4bCI(&gMasterDisp, D_1011E80, D_1011EC0, 16, 8, (var_fs0 * arg3) + arg0, arg1, arg3, arg3); } else { RCP_SetupDL_76(); gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 0, 255); @@ -3998,7 +3999,7 @@ s32 func_hud_80090E8C(Actor* actor) { } } - if (actor->aiType == 1) { + if (actor->aiType == AI360_FALCO) { var_fv1_2 = 3000.0f; } else { var_fv1_2 = 5000.0f; @@ -4030,7 +4031,7 @@ bool func_hud_800910C0(Actor* actor) { actor->fwork[5] = actor->vwork[28].y; actor->fwork[6] = gBosses[0].obj.pos.z + actor->vwork[28].z; - if (actor->aiType == 1) { + if (actor->aiType == AI360_FALCO) { var_fv1 = 1500.0f; } else { var_fv1 = 3000.0f; @@ -4079,15 +4080,15 @@ bool func_hud_80091368(Actor* actor) { gTeamShields[actor->aiType] = 1; switch (actor->aiType) { - case 1: + case AI360_FALCO: Radio_PlayMessage(gMsg_ID_20220, RCID_FALCO); break; - case 3: + case AI360_PEPPY: Radio_PlayMessage(gMsg_ID_20221, RCID_PEPPY); break; - case 2: + case AI360_SLIPPY: Radio_PlayMessage(gMsg_ID_20222, RCID_SLIPPY); break; } @@ -4178,7 +4179,7 @@ bool func_hud_800915FC(Actor* actor) { } if (actor->obj.pos.y + vec.y < 650.0f) { - ret = 1; + ret = true; } } break; @@ -4191,11 +4192,11 @@ bool func_hud_800915FC(Actor* actor) { boss = &gBosses[0]; y = 650.0f; - if (actor->aiType < 8) { + if (actor->aiType < AI360_KATT) { y = 720.0f; } - if (boss->obj.id == 293) { + if (boss->obj.id == OBJ_BOSS_293) { y = 280.0f; } @@ -4382,13 +4383,13 @@ bool func_hud_80091F00(Actor* actor) { if ((actor->unk_0D0 == 3) && (actor->unk_0D4 == 1)) { switch (actor->aiType) { - case 1: + case AI360_FALCO: Radio_PlayMessage(gMsg_ID_20210, RCID_FALCO); break; - case 3: + case AI360_PEPPY: Radio_PlayMessage(gMsg_ID_20200, RCID_PEPPY); break; - case 2: + case AI360_SLIPPY: Radio_PlayMessage(gMsg_ID_20190, RCID_SLIPPY); break; } @@ -4396,13 +4397,13 @@ bool func_hud_80091F00(Actor* actor) { if ((actor->unk_0D0 != 3) && (actor->unk_0D4 == 1)) { switch (actor->aiType) { - case 1: + case AI360_FALCO: Radio_PlayMessage(gMsg_ID_20060, RCID_FALCO); break; - case 3: + case AI360_PEPPY: Radio_PlayMessage(gMsg_ID_20070, RCID_PEPPY); break; - case 2: + case AI360_SLIPPY: Radio_PlayMessage(gMsg_ID_20080, RCID_SLIPPY); break; } @@ -4410,13 +4411,13 @@ bool func_hud_80091F00(Actor* actor) { if ((actor->unk_0D4 == 2) || (actor->unk_0D4 == 100)) { switch (actor->aiType) { - case 1: + case AI360_FALCO: Radio_PlayMessage(gMsg_ID_20030, RCID_FALCO); break; - case 3: + case AI360_PEPPY: Radio_PlayMessage(gMsg_ID_20040, RCID_PEPPY); break; - case 2: + case AI360_SLIPPY: Radio_PlayMessage(gMsg_ID_20050, RCID_SLIPPY); break; } @@ -4663,7 +4664,7 @@ bool func_hud_800927A0(Actor* actor) { return ret; } -void func_hud_80092D48(Actor* actor) { +void ActorTeamBoss_Init(Actor* actor) { s32 D_800D22A8[] = { 1, 2, 3 }; if (gCurrentLevel != LEVEL_TITANIA) { @@ -4673,7 +4674,7 @@ void func_hud_80092D48(Actor* actor) { D_hud_800D1970++; } else { actor->state = 7; - actor->aiType = 2; + actor->aiType = AI360_SLIPPY; actor->iwork[5] = 0; gTeamShields[2] = 255; } @@ -4687,7 +4688,7 @@ void func_hud_80092D48(Actor* actor) { AUDIO_PLAY_SFX(0x3100000CU, actor->sfxSource, 4U); - if (((D_hud_800D1970 & 3) == 2) && (gCurrentLevel == LEVEL_SECTOR_X)) { + if (((D_hud_800D1970 & 3) == AI360_SLIPPY) && (gCurrentLevel == LEVEL_SECTOR_X)) { Object_Kill(&actor->obj, actor->sfxSource); } @@ -4696,7 +4697,7 @@ void func_hud_80092D48(Actor* actor) { } } -void func_hud_80092EC0(Actor* actor) { +void ActorTeamBoss_Update(Actor* actor) { f32 var_fv1; actor->health = gTeamShields[actor->aiType]; @@ -4866,10 +4867,10 @@ void func_hud_800933D8(f32 x, f32 y, f32 z, f32 arg3) { } if (player->unk_1D0 >= 5) { - effect->unk_4A = 0x60; + effect->unk_4A = 96; effect->unk_46 = 4; } else { - effect->unk_4A = 0x80; + effect->unk_4A = 128; effect->unk_46 = 2; } } @@ -5101,7 +5102,7 @@ void func_hud_800935E8(Player* player) { Aquas_801BDF14(); - AUDIO_PLAY_BGM(SEQ_ID_45); + AUDIO_PLAY_BGM(SEQ_ID_INTRO_45); case 3: D_ctx_8017835C = 16; @@ -5274,7 +5275,7 @@ void func_hud_800935E8(Player* player) { D_ctx_80178488 = 1; SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM, 50); SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_FANFARE, 50); - AUDIO_PLAY_BGM(SEQ_ID_14); + AUDIO_PLAY_BGM(SEQ_ID_AQUAS); } Aquas_801AC8A8(player->pos.x + RAND_FLOAT_CENTERED(10.0f), player->pos.y + RAND_FLOAT_CENTERED(10.0f), @@ -5410,12 +5411,12 @@ void func_hud_80094D20(f32 x, f32 y) { f32 y1; f32 xScale; - if (gHitCount > D_hud_8016172C) { - temp3 = D_hud_8016172C + 1; - temp4 = D_hud_8016172C; + if (gHitCount > gDisplayedHitCount) { + temp3 = gDisplayedHitCount + 1; + temp4 = gDisplayedHitCount; } else { temp3 = gHitCount; - temp4 = D_hud_8016172C; + temp4 = gDisplayedHitCount; } boolTemp = 0; @@ -5519,13 +5520,13 @@ void func_hud_80094D20(f32 x, f32 y) { TextureRect_8bIA(&gMasterDisp, D_800D24DC[temp3], 16, 15, x1, y1, xScale, 1.0f); } - if ((gHitCount != D_hud_8016172C) && (D_hud_80161720[0] == 0.0f) && (D_hud_80161720[1] == 0.0f) && + if ((gHitCount != gDisplayedHitCount) && (D_hud_80161720[0] == 0.0f) && (D_hud_80161720[1] == 0.0f) && (D_hud_80161720[2] == 0.0f)) { - D_hud_8016172C++; + gDisplayedHitCount++; - if ((D_hud_8016172C == 4) || (D_hud_8016172C == 9) || (D_hud_8016172C == 14) || (D_hud_8016172C == 19) || - (D_hud_8016172C == 24) || (D_hud_8016172C == 29)) { - D_play_80161A62 = D_hud_8016172C; + if ((gDisplayedHitCount == 4) || (gDisplayedHitCount == 9) || (gDisplayedHitCount == 14) || + (gDisplayedHitCount == 19) || (gDisplayedHitCount == 24) || (gDisplayedHitCount == 29)) { + gDropHitCountItem = gDisplayedHitCount; } } } @@ -5889,7 +5890,7 @@ void func_hud_80095604(Player* player) { break; case 400: - AUDIO_PLAY_BGM(SEQ_ID_38); + AUDIO_PLAY_BGM(SEQ_ID_GOOD_END); break; case 440: diff --git a/src/engine/fox_message.c b/src/engine/fox_message.c index 0277cc17..3bb859c3 100644 --- a/src/engine/fox_message.c +++ b/src/engine/fox_message.c @@ -54,8 +54,8 @@ void Message_DisplayChar(Gfx** gfxPtr, u16 msgChar, s32 xpos, s32 ypos) { gDPLoadTextureBlock_4b((*gfxPtr)++, gTextCharTextures[msgChar >> 2], G_IM_FMT_CI, 16, 13, msgChar & 3, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); - gSPTextureRectangle((*gfxPtr)++, xpos << 2, ypos << 2, (xpos + 13) << 2, (ypos + 13) << 2, G_TX_RENDERTILE, 0x40, 0, - 0x400, 0x400); + gSPTextureRectangle((*gfxPtr)++, xpos << 2, ypos << 2, (xpos + 13) << 2, (ypos + 13) << 2, G_TX_RENDERTILE, 64, 0, + 1024, 1024); } bool Message_DisplayText(Gfx** gfxPtr, u16* msgPtr, s32 xPos, s32 yPos, s32 len) { @@ -66,7 +66,7 @@ bool Message_DisplayText(Gfx** gfxPtr, u16* msgPtr, s32 xPos, s32 yPos, s32 len) gDPSetPrimColor((*gfxPtr)++, 0x00, 0x00, 255, 255, 255, 255); gDPSetTextureLUT((*gfxPtr)++, G_TT_RGBA16); - gDPLoadTLUT((*gfxPtr)++, 64, 0x100, gTextCharPalettes); + gDPLoadTLUT((*gfxPtr)++, 64, 256, gTextCharPalettes); // bug: if the for loop is skipped, print is never initialized for (i = 0; msgPtr[i] != MSGCHAR_END && i < len; i++) { @@ -117,7 +117,7 @@ void Message_DisplayScrollingText(Gfx** gfxPtr, u16* msgPtr, s32 xPos, s32 yPos, s32 i; gDPSetTextureLUT((*gfxPtr)++, G_TT_RGBA16); - gDPLoadTLUT((*gfxPtr)++, 64, 0x100, gTextCharPalettes); + gDPLoadTLUT((*gfxPtr)++, 64, 256, gTextCharPalettes); for (i = 0; msgPtr[i] != 0 && i < len; i++) { switch (msgPtr[i]) { diff --git a/src/engine/fox_play.c b/src/engine/fox_play.c index ec20f51f..eb9ba85b 100644 --- a/src/engine/fox_play.c +++ b/src/engine/fox_play.c @@ -39,8 +39,8 @@ u8 D_play_80161A50; f32 D_play_80161A54; s32 D_play_80161A58; s32 D_play_80161A5C; -u16 D_play_Timer_80161A60; -u16 D_play_80161A62; +u16 gScreenFlashTimer; +u16 gDropHitCountItem; s32 D_play_80161A64; EnvSettings* sEnvSettings; @@ -191,14 +191,14 @@ void func_play_800A46A0(Player* player) { } } var_v1 = 7; - if (player->shields < 0x40) { - if (player->shields > 0x10) { + if (player->shields < 64) { + if (player->shields > 16) { var_v1 = 0xF; } - if (player->shields > 0x20) { + if (player->shields > 32) { var_v1 = 0x1F; } - if (player->shields > 0x30) { + if (player->shields > 48) { var_v1 = 0x3F; } if ((player->unk_238 == 0) || (gLevelMode == LEVELMODE_ALL_RANGE)) { @@ -232,7 +232,7 @@ void func_play_800A4C40(Player* player) { Vec3f sp3C; Vec3f sp30; - if (D_80161A88 == 2) { + if (D_ctx_80161A88 == 2) { Matrix_Translate(gCalcMatrix, player->pos.x, player->pos.y, player->unk_138, 0); Matrix_RotateY(gCalcMatrix, (player->unk_114 + player->unk_0E8 + 180.0f) * M_DTOR, 1); Matrix_RotateX(gCalcMatrix, -((player->unk_0E4 + player->unk_4D8) * M_DTOR), 1); @@ -502,7 +502,7 @@ void func_play_800A594C(void) { } else if (gCurrentLevel == LEVEL_AQUAS) { sEnvSettings = SEGMENTED_TO_VIRTUAL(&D_AQ_602E584); } - D_ctx_80177C90 = sEnvSettings->seqId; + gBgmSeqId = sEnvSettings->seqId; gLevelType = sEnvSettings->type; D_ctx_801784AC = sEnvSettings->unk_04; gBgColor = sEnvSettings->bgColor; @@ -511,9 +511,9 @@ void func_play_800A594C(void) { gFogBlue = sEnvSettings->fogB; gFogNear = sEnvSettings->fogN; gFogFar = sEnvSettings->fogF; - gLight1R = gLight2R = D_80161A70 = sEnvSettings->lightR; - gLight1G = gLight2G = D_80161A74 = sEnvSettings->lightG; - gLight1B = gLight2B = D_80161A78 = sEnvSettings->lightB; + gLight1R = gLight2R = D_ctx_80161A70 = sEnvSettings->lightR; + gLight1G = gLight2G = D_ctx_80161A74 = sEnvSettings->lightG; + gLight1B = gLight2B = D_ctx_80161A78 = sEnvSettings->lightB; gAmbientR = sEnvSettings->ambR; gAmbientG = sEnvSettings->ambG; gAmbientB = sEnvSettings->ambB; @@ -683,9 +683,9 @@ void func_play_800A6590(void) { } D_ctx_8017835C = 16; Math_SmoothStepToF(&D_ctx_8017836C, 0.0f, 1.0f, 0.04f, 0.001f); - if (D_play_Timer_80161A60 != 0) { - D_play_Timer_80161A60--; - if (D_play_Timer_80161A60 & 2) { + if (gScreenFlashTimer != 0) { + gScreenFlashTimer--; + if (gScreenFlashTimer & 2) { D_ctx_80178348 = 255; D_ctx_80178350 = 255; D_ctx_80178354 = 255; @@ -770,7 +770,7 @@ void func_play_800A69F8(s32 state, f32 xPos, f32 yPos, f32 zPos) { } // has to be int. s32 and u32 don't match -int func_play_800A6A74(void) { +bool func_play_800A6A74(void) { return gGoldRingCount[0] && gGoldRingCount[1] && gGoldRingCount[2] && gGoldRingCount[3]; } @@ -1228,7 +1228,7 @@ bool func_play_800A8054(ObjectId objId, f32 arg1, f32 arg2, f32 arg3, f32 arg4, case OBJ_BOSS_309: colId = COL1_7; break; - case OBJ_UNK_1000: + case ACTOR_EVENT_ID: colId = COL1_3; break; case OBJ_BOSS_313: @@ -1595,7 +1595,7 @@ void func_play_800A8BA4(Player* player) { } } else if (player->form == FORM_ARWING) { if ((player->hit1.y < (gGroundLevel + 13.0f)) && (player->state_1C8 != PLAYERSTATE_1C8_4)) { - if (D_80161A88 == 2) { + if (D_ctx_80161A88 == 2) { player->unk_1F4 = 7; player->unk_0E4 = (player->unk_0D0 + player->unk_110) * 0.5f; } else { @@ -1608,7 +1608,7 @@ void func_play_800A8BA4(Player* player) { } } if ((player->hit2.y < (gGroundLevel + 13.0f)) && (player->state_1C8 != PLAYERSTATE_1C8_4)) { - if (D_80161A88 == 2) { + if (D_ctx_80161A88 == 2) { player->unk_1F4 = 7; player->unk_0E4 = (player->unk_0D0 + player->unk_110) * 0.5f; } else { @@ -1903,15 +1903,15 @@ void func_play_800A8BA4(Player* player) { if (temp_v0 != 0) { Player_ApplyDamage(player, temp_v0, actor->info.damage); } - } else if (actor->obj.id == OBJ_ACTOR_200) { + } else if (actor->obj.id == OBJ_ACTOR_EVENT) { if (actor->unk_0B4 == 42) { temp_v0 = - func_play_800A8304(player, OBJ_UNK_1000, actor->obj.pos.x, actor->obj.pos.y, + func_play_800A8304(player, ACTOR_EVENT_ID, actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, actor->obj.rot.x, actor->obj.rot.y, actor->obj.rot.z); if (temp_v0 != 0) { Player_ApplyDamage(player, temp_v0, actor->info.damage); } - } else if (actor->unk_0B4 == 63) { + } else if (actor->unk_0B4 == EINFO_63) { spfD4.x = fabsf(actor->obj.pos.x - player->pos.x); spfD4.y = fabsf(actor->obj.pos.y - player->pos.y); spfD4.z = fabsf(actor->obj.pos.z - player->unk_138); @@ -2573,8 +2573,8 @@ void func_play_800ABAB4(void) { } D_ctx_80177E7C = 0; func_play_800A594C(); - D_play_80161A62 = D_ctx_8017796C = D_Timer_80177B44 = D_ctx_80177B4C = D_360_8015F928 = D_360_8015F940 = - gBossActive = gGameFrameCount = D_ctx_80178480 = D_ctx_801782FC = gBossFrameCount = D_enmy2_80161690 = + gDropHitCountItem = D_ctx_8017796C = D_Timer_80177B44 = D_ctx_80177B4C = D_360_8015F928 = D_360_8015F940 = + gBossActive = gGameFrameCount = gCameraShake = D_ctx_801782FC = gBossFrameCount = D_enmy2_80161690 = D_360_8015F900 = D_ctx_80177930 = 0; if (gCurrentLevel == LEVEL_SECTOR_X) { @@ -2587,7 +2587,7 @@ void func_play_800ABAB4(void) { } else { D_ctx_80178348 = D_ctx_80178350 = D_ctx_80178354 = 0; } - D_play_Timer_80161A60 = D_ctx_80178360 = D_ctx_80178364 = D_ctx_80178368 = D_hud_80161704 = D_hud_80161708 = + gScreenFlashTimer = D_ctx_80178360 = D_ctx_80178364 = D_ctx_80178368 = D_hud_80161704 = D_hud_80161708 = D_ctx_80178340 = D_ctx_80177C50 = D_360_8015F93C = D_ctx_80177B6C = 0; gCsFrameCount = 0; @@ -3434,10 +3434,10 @@ void func_play_800AE4A4(Player* player) { } player->pos.z += player->vel.z; if (player->unk_0A0 - 100.0f < player->pos.y) { - player->unk_228 = 8; + player->flags_228 = 8; } if (player->pos.y < -(player->unk_0A0 - 100.0f)) { - player->unk_228 = 4; + player->flags_228 = 4; } func_play_800AE278(player); player->unk_138 = player->pos.z; @@ -3669,16 +3669,16 @@ void func_play_800AF07C(Player* player) { } if (player->pos.x > (player->unk_0AC + (player->unk_09C - 100.0f))) { - player->unk_228 = 1; + player->flags_228 = 1; } if (player->pos.x < (player->unk_0AC - (player->unk_09C - 100.0f))) { - player->unk_228 = 2; + player->flags_228 = 2; } if (player->pos.y > (player->unk_0B0 + (player->unk_0A0 - 100.0f))) { - player->unk_228 = 8; + player->flags_228 = 8; } if (player->pos.y < (player->unk_0B0 - (player->unk_0A0 - 100.0f))) { - player->unk_228 = 4; + player->flags_228 = 4; } player->pos.x += player->vel.x; @@ -3996,7 +3996,7 @@ void func_play_800B0194(Player* player) { sp48 = SEGMENTED_TO_VIRTUAL(D_versus_302E65C); break; } - Math_SmoothStepToVec3fArray(sp48, player->jointTable, 1, 0x18, 0.2f, 10.0f, 0.01f); + Math_SmoothStepToVec3fArray(sp48, player->jointTable, 1, 24, 0.2f, 10.0f, 0.01f); Math_SmoothStepToF(&player->unk_080, -3.0f, 0.1f, 2.0f, 0.1f); Math_SmoothStepToF(&player->unk_164, 0.0f, 0.03f, 1.0f, 0.0001f); Math_SmoothStepToF(&player->unk_168, 0.0f, 0.03f, 1.0f, 0.0001f); @@ -4019,7 +4019,7 @@ void func_play_800B0194(Player* player) { sp48 = SEGMENTED_TO_VIRTUAL(D_versus_302EA4C); break; } - Math_SmoothStepToVec3fArray(sp48, player->jointTable, 1, 0x18, 0.2f, 10.0f, 0.01f); + Math_SmoothStepToVec3fArray(sp48, player->jointTable, 1, 24, 0.2f, 10.0f, 0.01f); } player->unk_0D4 = 2.0f; if ((gInputPress->button & Z_TRIG) && (player->unk_1D4 != 0)) { @@ -4065,14 +4065,14 @@ void func_play_800B0F50(Player* playerx) { Player* player = playerx; // fake? D_ctx_80177BAC = 0; - player->shields = 0xFF; + player->shields = 255; if (gVersusMode) { switch (gHandicap[gPlayerNum]) { case 1: - player->shields = 0xBF; + player->shields = 191; break; case 2: - player->shields = 0x7F; + player->shields = 127; break; } } @@ -4153,9 +4153,9 @@ void func_play_800B0F50(Player* playerx) { break; } if (gCurrentLevel != LEVEL_CORNERIA) { - D_80161A8C = 0; + D_ctx_80161A8C = 0; } - gGoldRingCount[0] = D_80161A94[0]; + gGoldRingCount[0] = D_ctx_80161A94[0]; do { if (gGoldRingCount[0] > 3) { gGoldRingCount[0] -= 3; @@ -4183,11 +4183,11 @@ void func_play_800B0F50(Player* playerx) { D_hud_80161720[0] = 0.0f; D_hud_80161720[1] = 0.0f; D_hud_80161720[2] = 0.0f; - D_hud_8016172C = gHitCount; + gDisplayedHitCount = gHitCount; D_hud_80161730 = 0; D_enmy_80161684 = D_play_80161A50; D_ctx_80177DC8 = D_ctx_80177CA0; - D_80161A88 = D_80161A8C; + D_ctx_80161A88 = D_ctx_80161A8C; D_ctx_80177D20 = player->unk_144 = D_ctx_80177CB0; player->pos.z = player->unk_138 = -player->unk_144; if ((D_ctx_80177CA0 > 0) && (gLevelMode == LEVELMODE_ON_RAILS)) { @@ -4205,8 +4205,7 @@ void func_play_800B0F50(Player* playerx) { player->camEye.y = (player->pos.y * player->unk_148) + 10.0f; player->camEye.x = player->pos.x * player->unk_148; - D_ctx_801779E8.x = D_ctx_801779E8.y = D_ctx_801779E8.z = D_ctx_801779D8.x = D_ctx_801779D8.y = D_ctx_801779D8.z = - 0.0f; + gPlayerCamAt.x = gPlayerCamAt.y = gPlayerCamAt.z = gPlayerCamEye.x = gPlayerCamEye.y = gPlayerCamEye.z = 0.0f; if (gVersusMode) { gLaserStrength[gPlayerNum] = LASERS_SINGLE; @@ -4280,7 +4279,7 @@ void func_play_800B0F50(Player* playerx) { case LEVEL_CORNERIA: player->state_1C8 = PLAYERSTATE_1C8_2; player->unk_204 = 1; - D_80161A88 = D_80161A8C = 2; + D_ctx_80161A88 = D_ctx_80161A8C = 2; func_play_800A3FB0(); break; case LEVEL_BOLSE: @@ -4331,24 +4330,24 @@ void func_play_800B0F50(Player* playerx) { player->unk_234 = 1; switch (gCurrentLevel) { case LEVEL_CORNERIA: - AUDIO_PLAY_BGM(SEQ_ID_37); + AUDIO_PLAY_BGM(SEQ_ID_CO_INTRO); break; case LEVEL_METEO: - AUDIO_PLAY_BGM(SEQ_ID_50); + AUDIO_PLAY_BGM(SEQ_ID_ME_INTRO); break; case LEVEL_FORTUNA: case LEVEL_BOLSE: case LEVEL_VENOM_2: - AUDIO_PLAY_BGM(SEQ_ID_51); + AUDIO_PLAY_BGM(SEQ_ID_INTRO_51); break; case LEVEL_VENOM_1: - AUDIO_PLAY_BGM(SEQ_ID_8 | 0x8000); + AUDIO_PLAY_BGM(SEQ_ID_VENOM_1 | SEQ_FLAG); break; case LEVEL_KATINA: - AUDIO_PLAY_BGM(SEQ_ID_51); + AUDIO_PLAY_BGM(SEQ_ID_INTRO_51); break; case LEVEL_TITANIA: - AUDIO_PLAY_BGM(SEQ_ID_45); + AUDIO_PLAY_BGM(SEQ_ID_INTRO_45); break; case LEVEL_ZONESS: case LEVEL_SECTOR_X: @@ -4356,7 +4355,7 @@ void func_play_800B0F50(Player* playerx) { case LEVEL_TRAINING: case LEVEL_MACBETH: default: - AUDIO_PLAY_BGM(SEQ_ID_44); + AUDIO_PLAY_BGM(SEQ_ID_INTRO_44); break; case LEVEL_AREA_6: case LEVEL_SECTOR_Y: @@ -4365,9 +4364,9 @@ void func_play_800B0F50(Player* playerx) { case LEVEL_SOLAR: break; } - } else if (!gVersusMode && (D_ctx_80177C90 != 0xFFFF) && + } else if (!gVersusMode && (gBgmSeqId != SEQ_ID_NONE) && ((gLevelMode != LEVELMODE_ALL_RANGE) || (D_360_8015F924 == 0))) { - AUDIO_PLAY_BGM(D_ctx_80177C90); + AUDIO_PLAY_BGM(gBgmSeqId); } D_ctx_80177840 = gBossHealthBar = D_ctx_80177850 = 0; @@ -4376,13 +4375,13 @@ void func_play_800B0F50(Player* playerx) { } if (D_ctx_80177824 && !gVersusMode) { for (j = 1; j < 6; j++) { - gTeamShields[j] = gSavedTeamShields[j] = D_ctx_80177C38[j] = D_ctx_801778F0[j] = 0xFF; + gTeamShields[j] = gSavedTeamShields[j] = D_ctx_80177C38[j] = D_ctx_801778F0[j] = 255; } for (j = 0; j < 6; j++) { D_ctx_80177CD0[j] = D_ctx_80177CF0[j] = 1; } gLaserStrength[gPlayerNum] = LASERS_SINGLE; - gGoldRingCount[0] = D_80161A94[0] = gTotalHits = 0; + gGoldRingCount[0] = D_ctx_80161A94[0] = gTotalHits = 0; gLifeCount[gPlayerNum] = 2; gBombCount[gPlayerNum] = 3; gGreatFoxIntact = true; @@ -4390,7 +4389,7 @@ void func_play_800B0F50(Player* playerx) { D_hud_80161720[0] = 0.0f; D_hud_80161720[1] = 0.0f; D_hud_80161720[2] = 0.0f; - D_hud_8016172C = 0; + gDisplayedHitCount = 0; gHitCount = 0; D_ctx_80177824 = 0; } @@ -5066,10 +5065,10 @@ void func_play_800B415C(Player* player) { func_play_800B40AC(player); - if (player->shields < 0x80) { - if (player->shields > 0x50) { + if (player->shields < 128) { + if (player->shields > 80) { var_v0 = 0x3F; - } else if (player->shields > 0x28) { + } else if (player->shields > 40) { var_v0 = 0x1F; } else { var_v0 = 0xF; @@ -5088,7 +5087,7 @@ void func_play_800B41EC(Player* player) { if (!gVersusMode) { SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM, 1); SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_FANFARE, 1); - AUDIO_PLAY_BGM(SEQ_ID_39); + AUDIO_PLAY_BGM(SEQ_ID_DEATH); } if (gCurrentLevel == LEVEL_SOLAR) { Audio_KillSfxById(0x4100C023); @@ -5238,7 +5237,7 @@ void func_play_800B46F8(Player* player) { if (D_ctx_8017796C > 960) { D_ctx_8017796C = 0; if (1) {} - if ((player->shields < 0x40) && ((gTeamShields[1] > 0) || (gTeamShields[3] > 0) || (gTeamShields[2] > 0))) { + if ((player->shields < 64) && ((gTeamShields[1] > 0) || (gTeamShields[3] > 0) || (gTeamShields[2] > 0))) { do { do { teamId = RAND_INT(2.9f) + 1; @@ -5306,7 +5305,7 @@ void func_play_800B48BC(Player* player) { if (player->state_1C8 >= PLAYERSTATE_1C8_2) { func_play_800B39E0(player); } - player->unk_228 = 0; + player->flags_228 = 0; if ((player->state_1C8 >= PLAYERSTATE_1C8_2) && (player->form == FORM_ARWING) && !gVersusMode) { switch (player->unk_204) { case 0: @@ -5347,7 +5346,7 @@ void func_play_800B48BC(Player* player) { D_game_80161A2C = 1; func_play_800B46F8(player); player->wings.unk_2C = 0; - D_hud_80161704 = 0xFF; + D_hud_80161704 = 255; if ((!gVersusMode || (D_ctx_80177E7C != 0)) && (player->unk_4DC == 0) && (gInputPress->button & U_CBUTTONS) && ((player->form == FORM_ARWING) || (gVersusMode && (player->form == FORM_LANDMASTER)))) { @@ -5499,16 +5498,16 @@ void func_play_800B48BC(Player* player) { player->timer_1F8 = 200; } else { D_ctx_80178348 = D_ctx_80178350 = D_ctx_80178354 = 0; - D_ctx_80178358 = 0xFF; + D_ctx_80178358 = 255; } - if (D_ctx_80178340 == 0xFF) { + if (D_ctx_80178340 == 255) { func_play_800A6148(); D_ctx_80177D20 = gPlayer[0].unk_144 = 0.0f; D_ctx_80178380[0] = 0; D_360_8015F93C = gRadioState = 0; Audio_ClearVoice(); Audio_SetBaseSfxReverb(0); - D_80161A94[0] = gGoldRingCount[0]; + D_ctx_80161A94[0] = gGoldRingCount[0]; if (gCurrentLevel == LEVEL_VENOM_ANDROSS) { if (1) {} if (1) {} @@ -5533,7 +5532,7 @@ void func_play_800B48BC(Player* player) { } if (gLifeCount[gPlayerNum] < 0) { gNextGameState = GSTATE_GAME_OVER; - D_80161A94[0] = 0; + D_ctx_80161A94[0] = 0; } else { D_ctx_80177854 = 1; } @@ -6250,7 +6249,7 @@ void func_play_800B79B0(void) { } } } - var_a0 = MIN(gPlayer[0].shields, 0xFF); + var_a0 = MIN(gPlayer[0].shields, 255); func_8001D1C8(var_a0, sp3A); if (!(gGameFrameCount & 7) && (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_7)) { Solar_8019E8B8(RAND_FLOAT_CENTERED(6000.0f), -80.0f, @@ -6319,16 +6318,16 @@ void func_play_800B832C(void) { gPlayer[i].num = gPlayerNum = i; func_play_800B71E4(&gPlayer[i]); } - D_ctx_8017847C = 0.0f; - if (D_ctx_80178480 != 0) { + gCameraShakeY = 0.0f; + if (gCameraShake != 0) { f32 var_fv1; - D_ctx_80178480--; - var_fv1 = D_ctx_80178480; + gCameraShake--; + var_fv1 = gCameraShake; if (var_fv1 > 20.0f) { var_fv1 = 20.0f; } - D_ctx_8017847C = var_fv1 * SIN_DEG(gGameFrameCount * 70.0f); + gCameraShakeY = var_fv1 * SIN_DEG(gGameFrameCount * 70.0f); } func_play_800B79B0(); } diff --git a/src/engine/fox_shapes.c b/src/engine/fox_shapes.c index 9b13a370..f3be1210 100644 --- a/src/engine/fox_shapes.c +++ b/src/engine/fox_shapes.c @@ -120,7 +120,7 @@ Vtx D_Vtx_800D9950[] = { Gfx D_Gfx_800D9990[] = { // unused - gsDPSetPrimColor(0, 0, 0xFF, 0xFF, 0xFF, 0xFF), + gsDPSetPrimColor(0, 0, 255, 255, 255, 255), gsDPSetupTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 8, 0, 0, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, 3, 3, G_TX_NOLOD, G_TX_NOLOD), gsDPLoadTileTexture(D_Tex_800D99F8, G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 8), diff --git a/src/engine/fox_std_lib.c b/src/engine/fox_std_lib.c index ed556dd7..15d5ff62 100644 --- a/src/engine/fox_std_lib.c +++ b/src/engine/fox_std_lib.c @@ -85,7 +85,7 @@ void Texture_Mottle(u16* dst, u16* src, u8 mode) { for (var_s3 = 0; var_s3 < 32 * 32; var_s3 += 32) { temp_ft3 = 3.0f * __sinf((s32) (((var_s3 / 32) + (gGameFrameCount / 4)) % 32U) * (2 * M_PI / 32)); for (var_v1 = 0; var_v1 < 32; var_v1++) { - dst[var_s3 + (temp_ft3 + var_v1) % 0x20U] = src[var_s3 + var_v1]; + dst[var_s3 + (temp_ft3 + var_v1) % 32U] = src[var_s3 + var_v1]; } } break; @@ -376,7 +376,7 @@ void Animation_GetSkeletonBoundingBox(Limb** skeletonSegment, Animation* animati Matrix_RotateX(gGfxMatrix, (((s32) var_t6 * 360.0f) / 65536.0f) * M_DTOR, 1); vtxFound = false; if (limb->dList != NULL) { - Animation_FindBoundingBox(limb->dList, 0x2000, min, max, &vtxFound, &vtxCount, &vtxList); + Animation_FindBoundingBox(limb->dList, 8192, min, max, &vtxFound, &vtxCount, &vtxList); if (vtxFound) { boundBox[0].x = boundBox[3].x = boundBox[4].x = boundBox[7].x = min->x; boundBox[0].y = boundBox[1].y = boundBox[4].y = boundBox[5].y = max->y; diff --git a/src/engine/fox_tank.c b/src/engine/fox_tank.c index 90acd396..4eb0b069 100644 --- a/src/engine/fox_tank.c +++ b/src/engine/fox_tank.c @@ -97,7 +97,7 @@ void func_tank_80043468(Player* player) { if (0 || (gCurrentLevel == LEVEL_MACBETH) && (D_MA_801BA1E8 == 102)) { sp4C = player->pos.y + 150.0f; } - if (D_MA_801BA1E8 == 0x63) { + if (D_MA_801BA1E8 == 99) { sp4C = player->pos.y + 150.0f; } } @@ -184,7 +184,7 @@ void func_tank_80043B18(Player* player) { } if (!(gGameFrameCount & 3)) { func_effect_8007A900(player->pos.x + sp3C.x, player->pos.y + sp3C.y + 20.0f, player->unk_138 + sp3C.z, - 2.0f, 0xFF, 0xF, 0); + 2.0f, 255, 15, 0); } } } else { @@ -203,7 +203,7 @@ void func_tank_80043B18(Player* player) { } if (!(gGameFrameCount & 3) && (player->unk_0D0 >= 5.0f)) { func_effect_8007A900(player->pos.x + sp3C.x, player->pos.y + sp3C.y + 20.0f, - player->unk_138 + sp3C.z, 2.0f, 0xFF, 0xF, 0); + player->unk_138 + sp3C.z, 2.0f, 255, 15, 0); } } } @@ -221,7 +221,7 @@ void func_tank_80043B18(Player* player) { } if (!(gGameFrameCount & 3) && (player->unk_0D0 >= 5.0f)) { func_effect_8007A900(player->pos.x + sp3C.x, player->pos.y + sp3C.y + 20.0f, - player->unk_138 + sp3C.z, 2.0f, 0xFF, 0xF, 0); + player->unk_138 + sp3C.z, 2.0f, 255, 15, 0); } } } @@ -330,7 +330,7 @@ void func_tank_800444BC(Player* player) { } if (D_ctx_80177BAC != 0) { D_ctx_80177BAC = 0; - AUDIO_PLAY_BGM(SEQ_ID_4 | 0x8000); + AUDIO_PLAY_BGM(SEQ_ID_TITANIA | SEQ_FLAG); func_8001C8B8(0); } @@ -449,10 +449,10 @@ void func_tank_80044868(Player* player) { } player->pos.x += player->vel.x; if ((player->unk_0AC + (player->unk_09C - 100.0f)) < player->pos.x) { - player->unk_228 = 1; + player->flags_228 = 1; } if (player->pos.x < (player->unk_0AC - (player->unk_09C - 100.0f))) { - player->unk_228 = 2; + player->flags_228 = 2; } if (player->unk_09C + player->unk_0AC < player->pos.x) { player->pos.x = player->unk_09C + player->unk_0AC; @@ -486,7 +486,7 @@ void func_tank_80044868(Player* player) { } } if (player->unk_0D0 > 0.0f) { - Texture_Scroll(D_landmaster_3002E80, 0x20, 0x20, 0); + Texture_Scroll(D_landmaster_3002E80, 32, 32, 0); if ((gCurrentLevel == LEVEL_TITANIA) && (gBossActive == 0)) { func_tank_80043280(D_landmaster_3005EA8, D_TI_6009BB8, gGameFrameCount * -55.0f); } @@ -495,7 +495,7 @@ void func_tank_80044868(Player* player) { } } if (player->unk_0D0 > 10.0f) { - Texture_Scroll(D_landmaster_3002E80, 0x20, 0x20, 0); + Texture_Scroll(D_landmaster_3002E80, 32, 32, 0); if ((gCurrentLevel == LEVEL_TITANIA) && (gBossActive == 0)) { func_tank_80043280(D_landmaster_3005EA8, D_TI_6009BB8, gGameFrameCount * -55.0f); } @@ -674,18 +674,18 @@ void func_tank_80045678(Player* player) { } if ((gCamCount == 1) && !(gGameFrameCount & 1)) { func_effect_8007A900(RAND_FLOAT_CENTERED(20.0f) + player->pos.x, player->unk_068 + 10.0f, - player->unk_138 - 10.0f, RAND_FLOAT(2.0f) + 3.5f, 0xFF, 0x10, 1); + player->unk_138 - 10.0f, RAND_FLOAT(2.0f) + 3.5f, 255, 16, 1); } } else { D_800C9F3C = 0; if ((gCamCount == 1) && !(gGameFrameCount & 3) && (player->unk_1DC == 0)) { if ((player->unk_16C > 0.2f) && (player->timer_220 == 0)) { func_effect_8007A900(RAND_FLOAT_CENTERED(10.0f) + (player->pos.x - 57.0f), player->unk_068 + 10.0f, - player->unk_138 - 10.0f, RAND_FLOAT(1.0f) + 1.5f, 0xFF, 0xF, 0); + player->unk_138 - 10.0f, RAND_FLOAT(1.0f) + 1.5f, 255, 15, 0); } if ((player->unk_170 > 0.2f) && (player->timer_220 == 0)) { func_effect_8007A900(RAND_FLOAT_CENTERED(10.0f) + (player->pos.x + 57.0f), player->unk_068 + 10.0f, - player->unk_138 - 10.0f, RAND_FLOAT(1.0f) + 1.5f, 0xFF, 0xF, 0); + player->unk_138 - 10.0f, RAND_FLOAT(1.0f) + 1.5f, 255, 15, 0); } } } @@ -1389,7 +1389,7 @@ void func_tank_800481F4(Player* player) { for (i = 0, actor = gActors; i < ARRAY_COUNT(gActors); i++, actor++) { if ((actor->obj.status == OBJ_ACTIVE) && (actor->timer_0C2 == 0)) { - if (actor->obj.id == OBJ_ACTOR_200) { + if (actor->obj.id == OBJ_ACTOR_EVENT) { temp_v0 = func_play_800A7974(player, actor->info.hitbox, &sp98, actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, actor->obj.rot.x, actor->obj.rot.y, actor->obj.rot.z, actor->vwork[29].x, actor->vwork[29].y, diff --git a/src/engine/fox_versus.c b/src/engine/fox_versus.c index a4af5ffe..94e5daee 100644 --- a/src/engine/fox_versus.c +++ b/src/engine/fox_versus.c @@ -75,7 +75,7 @@ void func_versus_800BC760(void) { gRadioState = 0; gVersusMode = 0; D_ctx_80178358 = 0; - D_ctx_80178340 = 0xFF; + D_ctx_80178340 = 255; D_ctx_80177824 = GSTATE_INIT; } @@ -320,7 +320,7 @@ void func_versus_800BDE44(void) { gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 0, 255); for (i = 0; i < 4; i++) { - if ((gPlayer[i].state_1C8 == 3) || (gPlayer[i].state_1C8 == 5)) { + if ((gPlayer[i].state_1C8 == PLAYERSTATE_1C8_3) || (gPlayer[i].state_1C8 == PLAYERSTATE_1C8_5)) { if ((D_ctx_80177C30[i] != D_80178808[i]) || (D_80178810[i])) { D_80178810[i] += 4; if (D_80178810[i] > 15) { @@ -642,7 +642,7 @@ s32 func_versus_800BF17C(void) { for (i = 0, ret = 0; i < 4; i++) { D_80178850[i] = 1; - if (gPlayer[i].state_1C8 != 13) { + if (gPlayer[i].state_1C8 != PLAYERSTATE_1C8_13) { D_80178850[i] = 0; D_801787F8[i] = 150; continue; @@ -766,7 +766,7 @@ void func_versus_800BF750(void) { RCP_SetupDL(&gMasterDisp, 0x4C); for (i = 0; i < 4; i++) { - if (gPlayer[i].state_1C8 != 3) { + if (gPlayer[i].state_1C8 != PLAYERSTATE_1C8_3) { continue; } for (j = 0, temp = 0; j < 4; j++) { @@ -993,7 +993,7 @@ s32 func_versus_800BF9AC(void) { gPlayer[j].unk_288 = i + 1; } - gPlayer[j].state_1C8 = 13; + gPlayer[j].state_1C8 = PLAYERSTATE_1C8_13; } D_ctx_80177E74 = 1; break; @@ -1372,7 +1372,7 @@ void func_versus_800C1368(void) { D_800D4A90 = 0; D_800D4A98 = 0; D_800D4A9C = D_800D4AA0 = 0; - D_ctx_80178340 = 0xFF; + D_ctx_80178340 = 255; D_ctx_8017835C = 0; D_ctx_80178358 = 0; @@ -1495,7 +1495,7 @@ bool func_versus_800C176C(void) { break; } if (func_versus_800C16A0(30)) { - AUDIO_PLAY_BGM(D_ctx_80177C90); + AUDIO_PLAY_BGM(gBgmSeqId); D_versus_80178754 = 2; func_versus_800C1690(); } @@ -1530,7 +1530,7 @@ bool func_versus_800C176C(void) { case 4: if ((D_800D4A9C == 1) && (D_800D4AA0 == 0)) { - AUDIO_PLAY_BGM(SEQ_ID_47 | 0x8000); + AUDIO_PLAY_BGM(SEQ_ID_VS_HURRY | SEQ_FLAG); D_800D4AA0 = 1; } @@ -1567,11 +1567,11 @@ bool func_versus_800C176C(void) { case 2: case 3: - AUDIO_PLAY_BGM(SEQ_ID_38); + AUDIO_PLAY_BGM(SEQ_ID_GOOD_END); break; case 99: - AUDIO_PLAY_BGM(SEQ_ID_49); + AUDIO_PLAY_BGM(SEQ_ID_BAD_END); break; default: @@ -1996,7 +1996,7 @@ void func_versus_800C26C8(void) { actor->obj.pos.x = dest.x; actor->obj.pos.y = dest.y; actor->obj.pos.z = dest.z; - actor->aiType = i + 10; + actor->aiType = i + AI360_10; actor->health = 24; actor->timer_0C2 = 30; diff --git a/src/mods/sfxjukebox.c b/src/mods/sfxjukebox.c index 4f56f631..05d34dd6 100644 --- a/src/mods/sfxjukebox.c +++ b/src/mods/sfxjukebox.c @@ -94,7 +94,7 @@ void Option_ExpertSoundUpdate(void) { if (gControllerPress[gMainController].button & B_BUTTON) { if (!D_menu_801B9320) { - AUDIO_PLAY_BGM(SEQ_ID_36); + AUDIO_PLAY_BGM(SEQ_ID_MENU); gDrawMode = DRAWMODE_0; D_menu_801B9124 = 1000; D_menu_801B912C = 0; diff --git a/src/overlays/ovl_ending/fox_end1.c b/src/overlays/ovl_ending/fox_end1.c index 6aeb606c..29175edb 100644 --- a/src/overlays/ovl_ending/fox_end1.c +++ b/src/overlays/ovl_ending/fox_end1.c @@ -742,7 +742,7 @@ void Ending_80189108(void) { } } -s32 Ending_80189C64(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* data) { +bool Ending_80189C64(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* data) { s32 temp_v0 = *(s32*) data; if (temp_v0 == 3) { diff --git a/src/overlays/ovl_ending/fox_end2.c b/src/overlays/ovl_ending/fox_end2.c index d5fff94e..44f6f4c2 100644 --- a/src/overlays/ovl_ending/fox_end2.c +++ b/src/overlays/ovl_ending/fox_end2.c @@ -1041,7 +1041,7 @@ void Ending_801926D4(void) { } else { D_ending_80198590.rightState = D_ending_80198590.leftState = 2; } - AUDIO_PLAY_BGM(SEQ_ID_42); + AUDIO_PLAY_BGM(SEQ_ID_ENDING); } if ((2790 <= D_ending_80192E70) && (D_ending_80192E70 < 3000)) { diff --git a/src/overlays/ovl_i1/fox_co.c b/src/overlays/ovl_i1/fox_co.c index c67c101f..f4630394 100644 --- a/src/overlays/ovl_i1/fox_co.c +++ b/src/overlays/ovl_i1/fox_co.c @@ -95,13 +95,13 @@ void Corneria_80187838(s32 arg0, f32 arg1, f32 arg2, f32 arg3, s32 arg4) { } } -void Corneria_801878D8(Boss* boss) { +void Corneria_Boss292_Init(Boss* boss) { s32 i; gBossFrameCount = 0; if (gLevelMode == LEVELMODE_ON_RAILS) { - if (gPlayer[0].state_1C8 == 3) { - gPlayer[0].state_1C8 = 9; + if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_3) { + gPlayer[0].state_1C8 = PLAYERSTATE_1C8_9; gPlayer[0].unk_1D0 = 0; SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM, 50); SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_FANFARE, 50); @@ -161,7 +161,7 @@ void Corneria_80187AC8(Boss* boss) { boss->info.hitbox[1 + 0] = 100000.0f; Corneria_8018798C(boss, D_i1_8019B6D8[62], D_i1_8019B6D8[63], D_i1_8019B6D8[64], 10.0f); AUDIO_PLAY_SFX(0x2940D09A, boss->sfxSource, 4); - D_play_Timer_80161A60 = 8; + gScreenFlashTimer = 8; if (fabsf(boss->obj.rot.x) < 20.0f) { boss->swork[32] = 1; } @@ -171,8 +171,8 @@ void Corneria_80187AC8(Boss* boss) { SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_FANFARE, 80); gCsFrameCount = 0; - if ((gPlayer[0].state_1C8 == 3) || (gPlayer[0].state_1C8 == 5)) { - gPlayer[0].state_1C8 = 7; + if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_3) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_5)) { + gPlayer[0].state_1C8 = PLAYERSTATE_1C8_7; gPlayer[0].unk_1D0 = gPlayer[0].timer_1F8 = 0; gPlayer[0].unk_0E8 += gPlayer[0].unk_114; if (gPlayer[0].unk_0E8 > 360.0f) { @@ -241,7 +241,7 @@ void Corneria_80187AC8(Boss* boss) { func_boss_800430DC(D_i1_8019B6D8[18 + var_s1 + 2], D_i1_8019B6D8[24 + var_s1 + 2], D_i1_8019B6D8[30 + var_s1 + 2], D_i1_8019B6D8[36 + var_s1 + 2], D_i1_8019B6D8[42 + var_s1 + 2], D_i1_8019B6D8[48 + var_s1 + 2], 0.0f, - RAND_FLOAT(20.0f), 0.0f, 5.5f, var_s1 + 0x1C, RAND_INT(30.0f) + 60.0f); + RAND_FLOAT(20.0f), 0.0f, 5.5f, var_s1 + 28, RAND_INT(30.0f) + 60.0f); } if (boss->state < 5) { boss->state = 5; @@ -260,7 +260,7 @@ void Corneria_80187AC8(Boss* boss) { func_boss_800430DC(D_i1_8019B6D8[18 + var_s1 + 2], D_i1_8019B6D8[24 + var_s1 + 2], D_i1_8019B6D8[30 + var_s1 + 2], D_i1_8019B6D8[36 + var_s1 + 2], D_i1_8019B6D8[42 + var_s1 + 2], D_i1_8019B6D8[48 + var_s1 + 2], 0.0f, - RAND_FLOAT(20.0f), 0.0f, 5.5f, var_s1 + 0x1C, RAND_INT(30.0f) + 60.0f); + RAND_FLOAT(20.0f), 0.0f, 5.5f, var_s1 + 28, RAND_INT(30.0f) + 60.0f); } if (boss->state < 5) { boss->state = 6; @@ -276,9 +276,9 @@ void Corneria_80187AC8(Boss* boss) { if ((boss->state != 0) && (boss->state < 5)) { boss->fwork[14] = 0.0f; if (Rand_ZeroOne() < 0.5f) { - var_v0 = 0x144; + var_v0 = OBJ_ITEM_SILVER_RING; } else { - var_v0 = 0x147; + var_v0 = OBJ_ITEM_BOMB; } Corneria_80187838(boss, boss->obj.pos.x, boss->obj.pos.y + 100.0f, boss->obj.pos.z, var_v0); } @@ -462,7 +462,7 @@ void Corneria_80188C7C(Boss* boss) { boss->swork[21] = 10; boss->swork[22] = 12; boss->swork[20] = 17; - D_ctx_80178480 = 20; + gCameraShake = 20; } else { boss->fwork[12] = 0.0f; } @@ -547,7 +547,7 @@ void Corneria_80189058(Boss* boss) { Vec3f sp6C = { 0.0f, 0.0f, -30.0f }; f32 sp5C; - if (gPlayer[0].state_1C8 != 9) { + if (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_9) { if (boss->swork[33] == 0) { boss->swork[33]++; gBossActive = 2; @@ -576,7 +576,7 @@ void Corneria_80189058(Boss* boss) { } gBossFrameCount++; gRadarMarks[59].unk_00 = 1; - gRadarMarks[59].unk_02 = 0x66; + gRadarMarks[59].unk_02 = 102; gRadarMarks[59].pos.x = boss->obj.pos.x; gRadarMarks[59].pos.y = boss->obj.pos.y; gRadarMarks[59].pos.z = boss->obj.pos.z; @@ -585,9 +585,9 @@ void Corneria_80189058(Boss* boss) { Corneria_80188D50(boss); if (D_edisplay_801615D0.z > 0.0f) { if (D_edisplay_801615D0.x > 0.0f) { - gPlayer[0].unk_228 = 0x10; + gPlayer[0].flags_228 = 0x10; } else { - gPlayer[0].unk_228 = 0x20; + gPlayer[0].flags_228 = 0x20; } } @@ -875,7 +875,7 @@ void Corneria_80189058(Boss* boss) { func_effect_8007A568(D_i1_8019B6D8[62], D_i1_8019B6D8[63] - 100.0f, D_i1_8019B6D8[64], 40.0f); func_effect_8007D0E0(D_i1_8019B6D8[62], D_i1_8019B6D8[63] - 100.0f, D_i1_8019B6D8[64], 30.0f); func_enmy_80062B60(D_i1_8019B6D8[62], D_i1_8019B6D8[64], 0, 120.0f); - D_ctx_80178480 = 25; + gCameraShake = 25; gShowBossHealth = 0; for (sp218 = 0; sp218 < 100; sp218++) { @@ -949,7 +949,7 @@ void Corneria_80189058(Boss* boss) { } } -s32 Corneria_8018A434(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* data) { +bool Corneria_8018A434(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* data) { Boss* boss = (Boss*) data; if (boss->swork[limbIndex] == 1000) { @@ -1089,7 +1089,7 @@ void Corneria_8018AA74(Boss* boss) { Matrix_Push(&gGfxMatrix); } -s32 Corneria_8018AB08(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* data) { +bool Corneria_8018AB08(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* data) { Actor* actor = (Actor*) data; if (limbIndex == 1) { @@ -1418,7 +1418,7 @@ void Corneria_8018BBF8(Actor* actor) { Animation_DrawSkeleton(3, D_CO_6029A48, actor->vwork, Corneria_8018AB08, Corneria_8018BAFC, actor, gCalcMatrix); } -s32 Corneria_8018BC50(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* data) { +bool Corneria_8018BC50(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* data) { Actor* actor = (Actor*) data; if ((actor->state == 101) && (limbIndex != 8)) { @@ -1472,7 +1472,7 @@ void Corneria_8018BDD4(Boss* boss, f32 arg1, f32 arg2, f32 arg3, f32 arg4, s32 a boss->obj.rot.y, arg5, arg6, objId); } -void Corneria_8018BE7C(Boss* boss) { +void Corneria_Boss293_Init(Boss* boss) { s32 i; s16 temp_s1; @@ -1729,7 +1729,7 @@ void Corneria_8018C19C(Boss* boss) { boss->fwork[6] = 800.0f; boss->fwork[3] = gPlayer[0].camEye.z - D_ctx_80177D20 - 2500.0f; boss->fwork[18] = -D_play_80161A54; - AUDIO_PLAY_BGM(SEQ_ID_48 | 0x8000); + AUDIO_PLAY_BGM(SEQ_ID_CO_BOSS_2 | SEQ_FLAG); boss->timer_050 = 40; } break; @@ -1898,7 +1898,7 @@ void Corneria_8018C19C(Boss* boss) { SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM, 40); SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_FANFARE, 40); AUDIO_PLAY_SFX(0x2940D09A, boss->sfxSource, 4); - D_play_Timer_80161A60 = 8; + gScreenFlashTimer = 8; gShowBossHealth = false; Radio_PlayMessage(gMsg_ID_2294, RCID_BOSS_CORNERIA2); boss->health = 1; @@ -1951,7 +1951,8 @@ void Corneria_8018C19C(Boss* boss) { boss->fwork[17] = 10.0f; boss->vel.y *= 1.5f; D_ctx_80177930 = 1; - if ((gPlayer[0].state_1C8 == 3) || (gPlayer[0].state_1C8 == 5)) { + if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_3) || + (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_5)) { func_boss_8004319C(gPlayer, boss->obj.pos.x, boss->obj.pos.y, boss->obj.pos.z); } boss->health--; @@ -1987,7 +1988,7 @@ void Corneria_8018C19C(Boss* boss) { boss->obj.rot.z -= 2.0f; boss->gravity = 1.0f; if (boss->obj.pos.y < (gGroundLevel + 150.0f)) { - D_ctx_80178480 = 100; + gCameraShake = 100; func_effect_80081A8C(boss->obj.pos.x, boss->obj.pos.y, boss->obj.pos.z, 40.0f, 12); boss->timer_050 = 20; boss->vel.y = -10.0f; @@ -2325,7 +2326,7 @@ void Corneria_8018E76C(Boss* boss) { } } -s32 Corneria_8018EC54(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* data) { +bool Corneria_8018EC54(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* data) { if ((limbIndex == 10) && (gBosses[2].state != 0) && (gBosses[3].state != 0)) { *dList = NULL; } @@ -2341,7 +2342,7 @@ void Corneria_8018ECAC(Boss* boss) { Animation_DrawSkeleton(1, D_CO_602D5AC, boss->vwork, Corneria_8018EC54, NULL, &boss->index, &gIdentityMatrix); } -s32 Corneria_8018ED1C(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* data) { +bool Corneria_8018ED1C(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* data) { if (limbIndex == 5) { rot->y -= gBosses[*(s32*) data].fwork[2]; } @@ -2359,7 +2360,7 @@ void Corneria_8018ED78(Boss* boss) { Animation_DrawSkeleton(1, D_CO_602D5AC, boss->vwork, Corneria_8018ED1C, NULL, &boss->index, &gIdentityMatrix); } -s32 Corneria_8018EE2C(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* data) { +bool Corneria_8018EE2C(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* data) { if (limbIndex == 1) { rot->z -= gBosses[*(s32*) data].fwork[0]; } @@ -2377,7 +2378,7 @@ void Corneria_8018EE84(Boss* boss) { Animation_DrawSkeleton(1, D_CO_602D5AC, boss->vwork, Corneria_8018EE2C, NULL, &boss->index, &gIdentityMatrix); } -s32 Corneria_8018EF38(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* data) { +bool Corneria_8018EF38(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* data) { if (limbIndex == 3) { rot->z -= gBosses[*(s32*) data].fwork[1]; } @@ -2423,7 +2424,7 @@ void Corneria_8018F044(Object_80* obj80) { } } -s32 Corneria_8018F1C8(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* data) { +bool Corneria_8018F1C8(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* data) { Object_80* obj80 = (Object_80*) data; RCP_SetupDL_29(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); @@ -2496,7 +2497,7 @@ void Corneria_8018F55C(Effect* effect) { effect->obj.pos.y = gPlayer[0].camEye.y + RAND_RANGE(-280.0f, 70.0f); effect->obj.id = OBJ_EFFECT_352; effect->timer_50 = 80; - effect->unk_46 = 0x90; + effect->unk_46 = 144; effect->obj.pos.z = -4000.0f; effect->vel.z = 60.0f; effect->scale2 = 10.0f + RAND_FLOAT(15.0f); @@ -2562,16 +2563,16 @@ void Corneria_8018F880(Player* player) { f32 sp30; f32 sp2C; - if (gCsFrameCount < 0x32F) { + if (gCsFrameCount < 815) { sp3C = player->pos.x; sp38 = player->pos.y + 15.0f; sp34 = player->unk_138 - 20.0f; } else { - if (gCsFrameCount < 0x3F1) { + if (gCsFrameCount < 1009) { sp3C = actor0->obj.pos.x; sp38 = actor0->obj.pos.y + 15.0f; sp34 = actor0->obj.pos.z - 20.0f; - } else if (gCsFrameCount < 0x4AE) { + } else if (gCsFrameCount < 1198) { sp3C = actor2->obj.pos.x; sp38 = actor2->obj.pos.y + 15.0f; sp34 = actor2->obj.pos.z - 20.0f; @@ -2628,7 +2629,7 @@ void Corneria_8018F880(Player* player) { D_ctx_80177A48[4] = Math_RadToDeg(sp2C); D_ctx_80177A48[5] = Math_RadToDeg(sp30); - player->unk_228 = 0; + player->flags_228 = 0; D_ctx_80177950 = -1.0f; if ((Math_RadToDeg(gPlayer[0].unk_058) < 90.0f) || (Math_RadToDeg(gPlayer[0].unk_058) > 270.0f)) { D_ctx_80177950 = 1.0f; @@ -2664,12 +2665,12 @@ void Corneria_8018F880(Player* player) { player->camAt.z = gCsCamAtZ = player->unk_138 + 300.0f; D_ctx_80177A48[0] = 0; D_ctx_80177A48[1] = D_ctx_80177A48[2] = 0; - D_ctx_80178358 = 0xFF; - D_ctx_80178340 = 0xFF; - D_ctx_80178348 = D_ctx_80178350 = D_ctx_80178354 = 0xFF; + D_ctx_80178358 = 255; + D_ctx_80178340 = 255; + D_ctx_80178348 = D_ctx_80178350 = D_ctx_80178354 = 255; break; case 1: - if (player->timer_1F8 < 0x226) { + if (player->timer_1F8 < 550) { D_ctx_80178358 = 0; D_ctx_8017835C = 3; Math_SmoothStepToF(&D_ctx_80177A48[0], 0.01f, 1.0f, 0.0005f, 0.0f); @@ -2913,12 +2914,12 @@ void Corneria_8018F880(Player* player) { D_ctx_80177A48[0] = 0.03f; player->unk_190 = 2.0f; if (player->timer_1F8 == 0) { - D_ctx_80178358 = 0xFF; - D_ctx_8017835C = 0x30; - D_ctx_80178348 = D_ctx_80178350 = D_ctx_80178354 = 0xFF; + D_ctx_80178358 = 255; + D_ctx_8017835C = 48; + D_ctx_80178348 = D_ctx_80178350 = D_ctx_80178354 = 255; } - if (D_ctx_80178340 == 0xFF) { - AUDIO_PLAY_BGM(D_ctx_80177C90); + if (D_ctx_80178340 == 255) { + AUDIO_PLAY_BGM(gBgmSeqId); Object_Kill(&actor0->obj, actor0->sfxSource); Object_Kill(&actor1->obj, actor1->sfxSource); Object_Kill(&actor2->obj, actor2->sfxSource); @@ -2928,7 +2929,7 @@ void Corneria_8018F880(Player* player) { player->camEye.x = player->pos.x; player->camEye.y = (player->pos.y * player->unk_148) + 50.0f; player->camEye.z = 30.0f; - player->state_1C8 = 3; + player->state_1C8 = PLAYERSTATE_1C8_3; player->unk_1D0 = 0; player->camAt.x = player->pos.x; player->camAt.y = (player->pos.y * player->unk_148) + 20.0f; @@ -3158,12 +3159,12 @@ void Corneria_80191160(Player* player) { if (gCsFrameCount == 1290) { Audio_FadeOutAll(50); } - if (gCsFrameCount >= 1301) { - D_ctx_80178358 = 0xFF; + if (gCsFrameCount > 1300) { + D_ctx_80178358 = 255; D_ctx_80178348 = D_ctx_80178350 = D_ctx_80178354 = 0; D_ctx_8017835C = 8; - if (D_ctx_80178340 == 0xFF) { - player->state_1C8 = 6; + if (D_ctx_80178340 == 255) { + player->state_1C8 = PLAYERSTATE_1C8_6; player->timer_1F8 = 0; D_ctx_8017837C = 4; D_play_800D3180[gCurrentLevel] = Play_CheckMedalStatus(150) + 1; @@ -3180,7 +3181,7 @@ void Corneria_80191160(Player* player) { D_ctx_80177830 = 0; break; case 240: - AUDIO_PLAY_BGM(SEQ_ID_38); + AUDIO_PLAY_BGM(SEQ_ID_GOOD_END); break; case 330: D_ctx_80177840 = 100; diff --git a/src/overlays/ovl_i1/fox_tr.c b/src/overlays/ovl_i1/fox_tr.c index 7eb30682..4f9c4ae8 100644 --- a/src/overlays/ovl_i1/fox_tr.c +++ b/src/overlays/ovl_i1/fox_tr.c @@ -15,7 +15,7 @@ void Training_801988E0(void) { } } -void Training_80198968(Item* item) { +void Training_ItemRing_Update(Item* item) { f32 var_fv0; switch (item->state) { diff --git a/src/overlays/ovl_i1/fox_tr360.c b/src/overlays/ovl_i1/fox_tr360.c index a288b86e..3c1d7b0d 100644 --- a/src/overlays/ovl_i1/fox_tr360.c +++ b/src/overlays/ovl_i1/fox_tr360.c @@ -184,37 +184,35 @@ void Training_8019949C(void) { var_v1 = 0; } - if (!(gGameFrameCount & 3)) { - if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_3) { - sp44.x = 0.0f; - sp44.y = 0.0f; - sp44.z = -15000.0f; - for (i = var_v1, actor = &gActors[i + 10]; i < 16; i++, actor++) { - if (actor->obj.status == OBJ_FREE) { - Actor_Initialize(actor); - actor->obj.status = OBJ_ACTIVE; - actor->obj.id = OBJ_ACTOR_197; - Matrix_RotateY(gCalcMatrix, gGameFrameCount * 6.0f * M_DTOR, 0); - Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp44, &sp38); - actor->obj.pos.x = sp38.x; - actor->obj.pos.y = 2000.0f; - actor->obj.pos.z = sp38.z; - actor->unk_0F4.y = gGameFrameCount * 6.0f; - actor->aiType = i + 10; - actor->health = 24; - actor->unk_0C9 = actor->iwork[11] = 1; - actor->timer_0C2 = 30; - Object_SetInfo(&actor->info, actor->obj.id); - AUDIO_PLAY_SFX(0x3100000C, actor->sfxSource, 4); - if ((i + 10) == 10) { - actor->aiIndex = 0; - actor->health = 50; - } else { - actor->aiIndex = -1; - actor->info.action = (ObjectFunc) Training_80199024; - } - break; + if (!(gGameFrameCount & 3) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_3)) { + sp44.x = 0.0f; + sp44.y = 0.0f; + sp44.z = -15000.0f; + for (i = var_v1, actor = &gActors[i + 10]; i < 16; i++, actor++) { + if (actor->obj.status == OBJ_FREE) { + Actor_Initialize(actor); + actor->obj.status = OBJ_ACTIVE; + actor->obj.id = OBJ_ACTOR_ALLRANGE; + Matrix_RotateY(gCalcMatrix, gGameFrameCount * 6.0f * M_DTOR, 0); + Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp44, &sp38); + actor->obj.pos.x = sp38.x; + actor->obj.pos.y = 2000.0f; + actor->obj.pos.z = sp38.z; + actor->unk_0F4.y = gGameFrameCount * 6.0f; + actor->aiType = i + AI360_10; + actor->health = 24; + actor->unk_0C9 = actor->iwork[11] = 1; + actor->timer_0C2 = 30; + Object_SetInfo(&actor->info, actor->obj.id); + AUDIO_PLAY_SFX(0x3100000C, actor->sfxSource, 4); + if ((i + 10) == 10) { + actor->aiIndex = AI360_FOX; + actor->health = 50; + } else { + actor->aiIndex = -1; + actor->info.action = (ObjectFunc) Training_80199024; } + break; } } } diff --git a/src/overlays/ovl_i1/fox_ve1.c b/src/overlays/ovl_i1/fox_ve1.c index 0a587d0d..99db8795 100644 --- a/src/overlays/ovl_i1/fox_ve1.c +++ b/src/overlays/ovl_i1/fox_ve1.c @@ -646,7 +646,7 @@ void Venom1_80192CD4(Actor* actor) { actor->obj.rot.x += actor->fwork[0]; if (actor->obj.rot.x >= 90.0f) { - D_ctx_80178480 = 12; + gCameraShake = 12; Venom1_80192AA4(actor); actor->iwork[1] = 5; actor->obj.rot.x = 90.0f; @@ -807,7 +807,7 @@ void Venom1_80193540(Object_80* obj80) { } } -void Venom1_801935CC(Boss* boss) { +void Venom1_Boss319_Init(Boss* boss) { s32 i; s32 var_v0; s32 j; @@ -855,7 +855,7 @@ void Venom1_801935CC(Boss* boss) { } boss->swork[29] = boss->swork[30] = var_v0 + 100; Animation_GetFrameData(D_i1_8019ACD4[boss->swork[5]], 0, boss->vwork); - AUDIO_PLAY_BGM(SEQ_ID_24 | 0x8000); + AUDIO_PLAY_BGM(SEQ_ID_VE_BOSS | SEQ_FLAG); } bool Venom1_801937F4(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* thisx) { @@ -1577,7 +1577,7 @@ void Venom1_80194398(Boss* boss) { boss->timer_05A = 18; if (boss->health <= 0) { - D_play_Timer_80161A60 = 8; + gScreenFlashTimer = 8; D_ctx_8017796C = -1; D_ctx_8017828C = 1; AUDIO_PLAY_SFX(0x2940D09A, boss->sfxSource, 4); @@ -1625,7 +1625,7 @@ void Venom1_80194398(Boss* boss) { boss->health -= 10; boss->timer_05A = 35; if (boss->health <= 0) { - D_play_Timer_80161A60 = 8; + gScreenFlashTimer = 8; D_ctx_8017796C = -1; D_ctx_8017828C = 1; AUDIO_PLAY_SFX(0x2940D09A, boss->sfxSource, 4); @@ -1717,7 +1717,7 @@ void Venom1_80194398(Boss* boss) { boss->gravity = 0.f; boss->swork[6] = 2; boss->swork[10] = 16; - D_ctx_80178480 = 40; + gCameraShake = 40; boss->swork[23] = RAND_FLOAT(5.0f); AUDIO_PLAY_SFX(0x29034082, boss->sfxSource, 4); spB8 = 3; @@ -1828,7 +1828,7 @@ void Venom1_80194398(Boss* boss) { D_i1_8019B838[6].unk_7C |= 0x20; break; case 122: - D_ctx_80178480 = 20; + gCameraShake = 20; boss->swork[28] = 7; AUDIO_PLAY_SFX(0x29405084, boss->sfxSource, 4); D_i1_8019B838[2].unk_60 = 5.0f; @@ -1844,7 +1844,7 @@ void Venom1_80194398(Boss* boss) { D_i1_8019B838[8].unk_7C |= 0x20; break; case 118: - D_ctx_80178480 = 30; + gCameraShake = 30; boss->swork[28] = 7; AUDIO_PLAY_SFX(0x29405084, boss->sfxSource, 4); D_i1_8019B838[8].unk_7C |= 0x800; @@ -1860,7 +1860,7 @@ void Venom1_80194398(Boss* boss) { case 78: boss->swork[28] = 7; AUDIO_PLAY_SFX(0x29405084, boss->sfxSource, 4); - D_ctx_80178480 = 20; + gCameraShake = 20; D_i1_8019B838[10].unk_7C |= 0x800; D_i1_8019B838[10].unk_60 = 10.0f; break; @@ -1916,7 +1916,7 @@ void Venom1_80194398(Boss* boss) { boss->info.hitbox = D_edata_800CBF34; boss->unk_05E = 0; func_effect_8007A568(boss->obj.pos.x, boss->obj.pos.y + 10.0f, boss->obj.pos.z, 40.0f); - D_ctx_80178480 = 40; + gCameraShake = 40; break; case 12: D_ctx_80178348 = D_ctx_80178350 = D_ctx_80178354 = 255; @@ -1937,7 +1937,7 @@ void Venom1_80194398(Boss* boss) { break; case 1: AUDIO_PLAY_SFX(0x31030083, boss->sfxSource, 4); - D_ctx_80178480 = 40; + gCameraShake = 40; boss->swork[28] = 5; spB8 = spB4 = 1; boss->swork[18]++; @@ -1955,7 +1955,7 @@ void Venom1_80194398(Boss* boss) { case 1: spB4 = 1; AUDIO_PLAY_SFX(0x31030083, boss->sfxSource, 4); - D_ctx_80178480 = 40; + gCameraShake = 40; boss->swork[28] = 5; spB8 = 2; boss->swork[19]++; @@ -2322,7 +2322,7 @@ void Venom1_80198310(Boss* boss) { RCP_SetupDL(&gMasterDisp, 0x41); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 0, 0, 0, 255); gDPSetEnvColor(gMasterDisp++, 0, 0, 0, 0); - Matrix_Translate(gGfxMatrix, 0.0f, -5.0f + D_ctx_8017847C, 0.0f, 1); + Matrix_Translate(gGfxMatrix, 0.0f, -5.0f + gCameraShakeY, 0.0f, 1); Matrix_Scale(gGfxMatrix, 10.0f, 0.0f, 8.0f, 1); Matrix_RotateX(gGfxMatrix, -90.0f * M_DTOR, 1); Matrix_SetGfxMtx(&gMasterDisp); diff --git a/src/overlays/ovl_i2/fox_me.c b/src/overlays/ovl_i2/fox_me.c index 14c60930..dfafcf8c 100644 --- a/src/overlays/ovl_i2/fox_me.c +++ b/src/overlays/ovl_i2/fox_me.c @@ -402,7 +402,7 @@ void Meteo_80188344(Boss* boss) { boss->unk_04A = 7; } - if (boss->swork[0] >= 0xFF) { + if (boss->swork[0] >= 255) { boss->unk_04A = 0; Audio_KillSfxBySource(boss->sfxSource); if (boss->swork[1] == 0) { @@ -501,7 +501,7 @@ void Meteo_801887D0(Boss* boss) { } } -void Meteo_80188A40(Boss* boss) { +void Meteo_Boss297_Init(Boss* boss) { s32 i; AUDIO_PLAY_BGM(D_boss_800C9E90[gCurrentLevel]); @@ -524,7 +524,7 @@ void Meteo_80188A40(Boss* boss) { Boss_Initialize(&gBosses[i]); gBosses[i].obj.status = OBJ_INIT; - gBosses[i].obj.id = 0x12A; + gBosses[i].obj.id = OBJ_BOSS_298; gBosses[i].obj.pos.x = boss->obj.pos.x; gBosses[i].obj.pos.y = boss->obj.pos.y; gBosses[i].obj.pos.z = boss->obj.pos.z; @@ -738,7 +738,7 @@ void Meteo_801892F0(Boss* boss, s32 arg1) { if (arg1 == 4) { func_effect_8007D2C8(boss->obj.pos.x, boss->obj.pos.y, boss->obj.pos.z + 300.0f, 20.0f); - func_effect_8007BFFC(boss->obj.pos.x, boss->obj.pos.y, boss->obj.pos.z + 300.0f, 0.0f, 0.0f, 0.0f, 10.0f, 0x19); + func_effect_8007BFFC(boss->obj.pos.x, boss->obj.pos.y, boss->obj.pos.z + 300.0f, 0.0f, 0.0f, 0.0f, 10.0f, 25); } if (arg1 < 4) { @@ -940,7 +940,7 @@ void Meteo_8018978C(Boss* boss) { SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM, 50); SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_FANFARE, 50); AUDIO_PLAY_SFX(0x2940D09AU, boss->sfxSource, 4U); - D_play_Timer_80161A60 = 8; + gScreenFlashTimer = 8; } } } @@ -1053,7 +1053,7 @@ void Meteo_8018978C(Boss* boss) { if (boss->swork[18] == 1) { Meteo_80187D08(boss->obj.pos.x + dest.x, boss->obj.pos.y + dest.y, boss->obj.pos.z + dest.z, 50.0f, 270.0f, - 0.0f, 0x1E, 0, id); + 0.0f, 30, 0, id); } else { Meteo_80187D08(boss->obj.pos.x + dest.x, boss->obj.pos.y + dest.y, boss->obj.pos.z + dest.z, 50.0f, 0.0f, 0.0f, 0, 0, id); @@ -1065,7 +1065,7 @@ void Meteo_8018978C(Boss* boss) { if (boss->swork[18] == 1) { Meteo_80187D08(boss->obj.pos.x + dest.x, boss->obj.pos.y + dest.y, boss->obj.pos.z + dest.z, 50.0f, 90.0f, - 0.0f, 0x1E, 0, id); + 0.0f, 30, 0, id); } else { Meteo_80187D08(boss->obj.pos.x + dest.x, boss->obj.pos.y + dest.y, boss->obj.pos.z + dest.z, 50.0f, 0.0f, 0.0f, 0, 0, id); @@ -1266,7 +1266,7 @@ void Meteo_8018978C(Boss* boss) { if ((boss->timer_050 == 10) || (boss->timer_050 == 30) || (boss->timer_050 == 50) || (boss->timer_050 == 70)) { D_ctx_80178340 = 150; - D_ctx_80178348 = D_ctx_80178350 = D_ctx_80178354 = 0xFF; + D_ctx_80178348 = D_ctx_80178350 = D_ctx_80178354 = 255; Meteo_80187E38(boss->obj.pos.x, boss->obj.pos.y, boss->obj.pos.z + 1300.0f, boss->fwork[12] + boss->obj.rot.z); boss->fwork[12] = RAND_FLOAT(360.0f); @@ -1326,7 +1326,7 @@ void Meteo_8018978C(Boss* boss) { } if (gCsFrameCount == 400) { - AUDIO_PLAY_BGM(SEQ_ID_65 | 0x8000); + AUDIO_PLAY_BGM(SEQ_ID_BOSS_RESUME | SEQ_FLAG); if (gTeamShields[1] > 0) { Radio_PlayMessage(gMsg_ID_3345, RCID_BOSS_METEO); } else { @@ -1446,7 +1446,7 @@ void Meteo_8018978C(Boss* boss) { AUDIO_PLAY_SFX(0x2940F026U, boss->sfxSource, 4U); D_Timer_80177BD0[0] = 60; for (i = 0; i < ARRAY_COUNT(gActors); i++) { - if (gActors[i].obj.id == 0xC6) { + if (gActors[i].obj.id == OBJ_ACTOR_TEAM_BOSS) { Object_Kill(&gActors[i].obj, gActors[i].sfxSource); } } @@ -1463,7 +1463,7 @@ void Meteo_8018978C(Boss* boss) { func_effect_8007B344(boss->obj.pos.x, boss->obj.pos.y, boss->obj.pos.z, 71.0f, 5); case 0: - for (i = 0; i < 0x64; i++) { + for (i = 0; i < ARRAY_COUNT(gEffects); i++) { func_effect_80079618(RAND_FLOAT_CENTERED(1000.0f) + boss->obj.pos.x, RAND_FLOAT_CENTERED(1000.0f) + boss->obj.pos.y, RAND_FLOAT_CENTERED(1000.0f) + boss->obj.pos.z, 3.0f); @@ -1604,7 +1604,7 @@ void Meteo_8018BACC(Boss* boss) { gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, boss->swork[19], 255); if (boss->swork[9 + i] & 1) { - gDPSetPrimColor(gMasterDisp++, 0, 0, 0x50, 0, 0, 255); + gDPSetPrimColor(gMasterDisp++, 0, 0, 80, 0, 0, 255); } Matrix_Push(&gGfxMatrix); @@ -1642,7 +1642,7 @@ void Meteo_8018BACC(Boss* boss) { } } - gDPSetPrimColor(gMasterDisp++, 0, 0, 0xA0, 0xFF, 0xA0, 0x80); + gDPSetPrimColor(gMasterDisp++, 0, 0, 160, 255, 160, 128); for (i = 0; i < 4; i++) { if (boss->fwork[11] != 0) { var_fs1 = boss->fwork[11]; @@ -1700,7 +1700,7 @@ void Meteo_8018BACC(Boss* boss) { if (boss->fwork[11] > 15.0f) { var_fs1 = boss->fwork[11] - 15.0f; - gDPSetPrimColor(gMasterDisp++, 0, 0, 0xA0, 0xFF, 0xA0, 0xFF); + gDPSetPrimColor(gMasterDisp++, 0, 0, 160, 255, 160, 255); Matrix_Push(&gGfxMatrix); Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, 1300.0f, 1); if (gGameFrameCount & 1) { @@ -1713,7 +1713,7 @@ void Meteo_8018BACC(Boss* boss) { Matrix_Pop(&gGfxMatrix); } - if ((boss->state == 9) || (boss->state == 0xA)) { + if ((boss->state == 9) || (boss->state == 10)) { var_fs1 = boss->fwork[15]; for (i = 0; i < 10; i++) { var_fs1 += 0.3f; @@ -1825,7 +1825,7 @@ void Meteo_8018CA10(Actor* actor1, Actor* actor2, f32 x, f32 y, f32 z) { actor1->obj.rot.y = RAND_FLOAT_SEEDED(360.0f); actor1->obj.rot.x = RAND_FLOAT_SEEDED(360.0f); - actor1->timer_0C2 = 0x2710; + actor1->timer_0C2 = 10000; actor1->vel.z = 30.0f; Object_SetInfo(&actor1->info, actor1->obj.id); } @@ -2064,7 +2064,7 @@ void Meteo_8018CD8C(Player* player) { Math_SmoothStepToF(D_ctx_80177A48, 1.0f, 1.0f, 0.01f, 0.0f); if (player->timer_1F8 == 0) { - AUDIO_PLAY_BGM(D_ctx_80177C90); + AUDIO_PLAY_BGM(gBgmSeqId); D_ctx_80177838 = 80; player->state_1C8 = PLAYERSTATE_1C8_3; player->unk_1D0 = 0; @@ -2273,7 +2273,7 @@ void Meteo_8018E084(Player* player) { Math_SmoothStepToF(&D_ctx_80177A48[3], 1.0f, 1.0f, 0.01f, 0.0f); } if (player->timer_1F8 == 50) { - AUDIO_PLAY_BGM(SEQ_ID_38); + AUDIO_PLAY_BGM(SEQ_ID_GOOD_END); } Math_SmoothStepToF(&D_ctx_80177A48[1], 1080.0f, 0.01f, D_ctx_80177A48[3], 0.0f); @@ -2494,7 +2494,7 @@ void Meteo_8018ED9C(Actor* actor) { case 1: actor->state = 2; AUDIO_PLAY_SFX(0x09000002U, actor->sfxSource, 0U); - actor->timer_0BC = 0x96; + actor->timer_0BC = 150; actor->fwork[29] = 5.0f; case 2: diff --git a/src/overlays/ovl_i2/fox_sx.c b/src/overlays/ovl_i2/fox_sx.c index a68fe736..9f2f680c 100644 --- a/src/overlays/ovl_i2/fox_sx.c +++ b/src/overlays/ovl_i2/fox_sx.c @@ -23,14 +23,14 @@ void SectorX_8018F030(void) { if (actor->obj.status == OBJ_FREE) { Actor_Initialize(actor); actor->obj.status = OBJ_INIT; - actor->obj.id = OBJ_ACTOR_203; + actor->obj.id = OBJ_ACTOR_SLIPPY_SX; actor->unk_0B6 = 1; actor->obj.rot.y = 180.0f; actor->obj.pos.x = gPlayer[0].camEye.x - 300.0f; actor->obj.pos.y = gPlayer[0].camEye.y + 200.0f; actor->obj.pos.z = gPlayer[0].camEye.z - D_ctx_80177D20 + 300.0f; actor->iwork[11] = 1; - actor->aiType = 2; + actor->aiType = AI360_SLIPPY; Object_SetInfo(&actor->info, actor->obj.id); Radio_PlayMessage(gMsg_ID_5475, RCID_SLIPPY); break; @@ -43,7 +43,7 @@ void SectorX_8018F124(void) { Actor_Initialize(actor); actor->obj.status = OBJ_INIT; - actor->obj.id = OBJ_ACTOR_203; + actor->obj.id = OBJ_ACTOR_SLIPPY_SX; actor->unk_0B6 = -1; actor->obj.pos.x = gPlayer[0].camEye.x + 3000.0f; actor->obj.pos.y = gPlayer[0].camEye.y - 3000.0f; @@ -191,7 +191,7 @@ void SectorX_8018FA04(f32 x, f32 y, f32 z) { if (actor->obj.status == OBJ_FREE) { Actor_Initialize(actor); actor->obj.status = OBJ_INIT; - actor->obj.id = OBJ_ACTOR_203; + actor->obj.id = OBJ_ACTOR_SLIPPY_SX; actor->obj.pos.x = x; actor->obj.pos.y = y; actor->obj.pos.z = z; @@ -430,7 +430,7 @@ void SectorX_80190078(Boss* boss) { SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM, 1); SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_FANFARE, 1); boss->timer_052 = 40; - D_play_Timer_80161A60 = 5; + gScreenFlashTimer = 5; } } else { func_effect_8007A6F0(&boss->obj.pos, 0x29121007); @@ -469,7 +469,7 @@ void SectorX_80190078(Boss* boss) { AUDIO_PLAY_SFX(0x2940D09A, boss->sfxSource, 4); - D_play_Timer_80161A60 = 8; + gScreenFlashTimer = 8; SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM, 1); SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_FANFARE, 1); func_boss_80042EC0(boss); @@ -838,7 +838,7 @@ void SectorX_80190078(Boss* boss) { boss->fwork[0] = 0.0f; boss->unk_04C = 0; boss->health = 300; - Audio_PlaySequenceDistorted(0, D_boss_800C9E90[gCurrentLevel], 1121, 25, 255); + Audio_PlaySequenceDistorted(0, D_boss_800C9E90[gCurrentLevel], 1121, 25, -1); Radio_PlayMessage(gMsg_ID_19205, RCID_FOX); boss->timer_052 = 100; } @@ -1590,7 +1590,7 @@ void SectorX_80193A30(Player* player) { if (player->timer_1F8 == 0) { player->unk_0D0 = D_play_80161A54; - AUDIO_PLAY_BGM(D_ctx_80177C90); + AUDIO_PLAY_BGM(gBgmSeqId); D_ctx_80177838 = 80; player->state_1C8 = PLAYERSTATE_1C8_3; player->unk_1D0 = player->timer_1F8 = player->timer_1FC = 0; @@ -1786,7 +1786,7 @@ void SectorX_80194728(Player* player) { break; case 30: - AUDIO_PLAY_BGM(SEQ_ID_38); + AUDIO_PLAY_BGM(SEQ_ID_GOOD_END); break; case 60: diff --git a/src/overlays/ovl_i3/fox_a6.c b/src/overlays/ovl_i3/fox_a6.c index 97a77614..d1976d8b 100644 --- a/src/overlays/ovl_i3/fox_a6.c +++ b/src/overlays/ovl_i3/fox_a6.c @@ -496,7 +496,7 @@ void Area6_80187704(void) { } } -void Area6_80187754(Boss* bossA6) { +void Area6_BossA6_Init(Boss* bossA6) { Hitbox* hitbox; s32 i; @@ -604,7 +604,7 @@ void Area6_80187944(Boss* bossA6) { D_i3_801C2250[A6_BSS_2_0] = D_i3_801C2250[A6_BSS_2_1] = D_i3_801C2250[A6_BSS_2_2] = bossA6->swork[A6_SWK_33 + 0] = bossA6->swork[A6_SWK_33 + 1] = bossA6->swork[A6_SWK_33 + 2] = 0; - D_play_Timer_80161A60 = 4; + gScreenFlashTimer = 4; bossA6->state = 11; AUDIO_PLAY_SFX(0x2940C00A, bossA6->sfxSource, 4); AUDIO_PLAY_SFX(0x3143402E, bossA6->sfxSource, 4); @@ -847,7 +847,7 @@ void Area6_80187944(Boss* bossA6) { D_ctx_80178340 = D_ctx_80178358 = 255; D_ctx_80178358 = 0; D_ctx_8017835C = 25; - D_ctx_80178480 = 50; + gCameraShake = 50; } if (bossA6->timer_050 == 0) { if (D_i3_801C2250[A6_BSS_8] == 0) { @@ -986,7 +986,7 @@ void Area6_80187944(Boss* bossA6) { D_i3_801C2250[A6_BSS_7] = bossA6->swork[A6_SWK_37] = 0; bossA6->state = 3; if (D_i3_801C2250[A6_BSS_6] == 0) { - AUDIO_PLAY_BGM(SEQ_ID_23 | 0x8000); + AUDIO_PLAY_BGM(SEQ_ID_A6_BOSS | SEQ_FLAG); } } } else if (bossA6->swork[A6_SWK_38] != 0) { @@ -1836,7 +1836,7 @@ void Area6_8018C54C(Boss* bossA6) { for (i = 0; i < 3; i++) { if ((bossA6->swork[A6_SWK_33 + i] == 0) && (bossA6->state != 3) && (D_i3_801C2250[A6_BSS_2_0 + i] == 0) && !(gGameFrameCount & 3) && - (bossA6->swork[A6_SWK_27 + i] != 0) && (D_ctx_80177854 != 0x64)) { + (bossA6->swork[A6_SWK_27 + i] != 0) && (D_ctx_80177854 != 100)) { Matrix_RotateY(gCalcMatrix, bossA6->obj.rot.y * M_DTOR, 0); Matrix_RotateX(gCalcMatrix, bossA6->obj.rot.x * M_DTOR, 1); Matrix_RotateZ(gCalcMatrix, bossA6->obj.rot.z * M_DTOR, 1); @@ -1940,7 +1940,7 @@ void Area6_8018C54C(Boss* bossA6) { } else { Math_SmoothStepToF(&bossA6->fwork[A6_FWK_29], 0.0f, 1.0f, 10.0f, 0.0001f); if ((bossA6->timer_054 == 0) && (bossA6->swork[A6_SWK_36] == 4) && (D_i3_801C2250[A6_BSS_31] == 0)) { - Radio_PlayMessage(gMsg_ID_7087, 0x1E); + Radio_PlayMessage(gMsg_ID_7087, RCID_PEPPY); bossA6->swork[A6_SWK_36] = 5; D_i3_801C2250[A6_BSS_31]++; D_i3_801C2250[A6_BSS_31] &= 1; @@ -2010,7 +2010,7 @@ void Area6_8018D3CC(s32 arg0, f32 xPos, f32 yPos, f32 zPos, f32 xVel, f32 yVel, void Area6_8018D4E0(Actor* actor) { s32 i; - func_effect_8007BFFC(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 0.0f, 0.0f, 0.0f, 4.0f, 0x14); + func_effect_8007BFFC(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 0.0f, 0.0f, 0.0f, 4.0f, 20); func_effect_8007D2C8(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 7.0f); func_effect_8007B344(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 6.0f, 5); Object_Kill(&actor->obj, actor->sfxSource); @@ -2297,14 +2297,14 @@ void Area6_8018DF74(Player* player) { player->unk_1D0 = 0; player->timer_1F8 = 0; - AUDIO_PLAY_BGM(SEQ_ID_7 | 0x8000); + AUDIO_PLAY_BGM(SEQ_ID_AREA_6 | SEQ_FLAG); player->state_1C8 = PLAYERSTATE_1C8_3; } break; } switch (gCsFrameCount) { case 280: - AUDIO_PLAY_BGM(SEQ_ID_51); + AUDIO_PLAY_BGM(SEQ_ID_INTRO_51); break; case 40: Radio_PlayMessage(gMsg_ID_7005, RCID_CAIMAN_AREA6); @@ -2442,7 +2442,7 @@ void Area6_8018EC38(Actor* actor, s32 arg1) { actor->obj.pos.x = sp2C[arg1].x + player->pos.x; actor->obj.pos.y = sp2C[arg1].y + player->pos.y; actor->obj.pos.z = sp2C[arg1].z + player->pos.z; - actor->state = 0x64; + actor->state = 100; actor->iwork[11] = 1; actor->fwork[0] = 0.0f; if (arg1 + 1 != 3) { @@ -2656,7 +2656,7 @@ void Area6_8018ED78(Player* player) { D_ctx_80177C38[i] = 255; } } - D_80161A94[0] = gGoldRingCount[0]; + D_ctx_80161A94[0] = gGoldRingCount[0]; func_8001CA24(0); Audio_KillSfxBySource(player->sfxSource); func_play_800A6148(); @@ -2673,7 +2673,7 @@ void Area6_8018ED78(Player* player) { } switch (gCsFrameCount) { case 380: - AUDIO_PLAY_BGM(SEQ_ID_38); + AUDIO_PLAY_BGM(SEQ_ID_GOOD_END); break; case 550: D_ctx_80177840 = 100; diff --git a/src/overlays/ovl_i3/fox_aq.c b/src/overlays/ovl_i3/fox_aq.c index 3edc1c2f..a590f5ce 100644 --- a/src/overlays/ovl_i3/fox_aq.c +++ b/src/overlays/ovl_i3/fox_aq.c @@ -933,16 +933,16 @@ void Aquas_801AACF8(Player* player) { player->vel.y = 0.0f; } if (player->pos.x > (player->unk_0AC + (player->unk_09C - 100.0f))) { - player->unk_228 = 1; + player->flags_228 = 1; } if (player->pos.x < (player->unk_0AC - (player->unk_09C - 100.0f))) { - player->unk_228 = 2; + player->flags_228 = 2; } if (player->pos.y > (player->unk_0B0 + (player->unk_0A0 - 100.0f))) { - player->unk_228 = 8; + player->flags_228 = 8; } if (player->pos.y <= (gGroundLevel + 100)) { - player->unk_228 = 4; + player->flags_228 = 4; } if (D_i3_801C4190[6] != 0) { player->unk_0D0 = 20.0f; @@ -1602,7 +1602,7 @@ void Aquas_801AD6C0(Actor* actor) { func_effect_800815DC(); actor->iwork[1]--; if (actor->iwork[1] <= 0) { - actor->unk_044 = 0; + actor->itemDrop = DROP_NONE; actor->unk_0D4 = 2; func_enmy_80066254(actor); Object_Kill(&actor->obj, actor->sfxSource); @@ -2253,7 +2253,7 @@ void Aquas_801B0B60(Actor* actor) { break; case 3: if (Rand_ZeroOne() < 0.1) { - actor->unk_044 = 22; + actor->itemDrop = DROP_SILVER_RING_10p; actor->unk_0D4 = 2; func_enmy_80066254(actor); } @@ -2313,7 +2313,7 @@ void Aquas_801B1008(Boss* bossAQ, s32 timer) { } // OBJ_BOSS_AQ init -void Aquas_801B10F8(Boss* bossAQ) { +void Aquas_BossAq_Init(Boss* bossAQ) { s32 i; Actor* actor; @@ -2411,7 +2411,7 @@ void Aquas_801B134C(Boss* bossAQ) { if (fabsf(bossAQ->obj.pos.z - gPlayer[0].unk_138) <= 3000.0f) { D_i3_801C4190[6] = 1; bossAQ->timer_056 = 20; - Audio_PlaySequence(SEQ_PLAYER_BGM, SEQ_ID_30 | 0x8000, 0, 1); + Audio_PlaySequence(SEQ_PLAYER_BGM, SEQ_ID_AQ_BOSS | SEQ_FLAG, 0, 1); bossAQ->state = 1; } break; @@ -2531,15 +2531,15 @@ void Aquas_801B134C(Boss* bossAQ) { break; case 16: D_ctx_801779A8[0] = 20.0f; - if (D_ctx_80178480 == 0) { + if (gCameraShake == 0) { D_ctx_80178340 = D_ctx_80178348 = D_ctx_80178350 = D_ctx_80178354 = D_ctx_80178358 = 255; D_ctx_80178358 = 0; D_ctx_8017835C = 25; - D_ctx_80178480 = 20 + RAND_FLOAT(20); + gCameraShake = 20 + RAND_FLOAT(20); } - if (D_ctx_80178480 == 29) { + if (gCameraShake == 29) { D_ctx_80178348 = D_ctx_80178350 = D_ctx_80178354 = D_ctx_80178340 = 0; } Math_SmoothStepToF(&D_i3_801C41B8[25], D_bg_8015F970, 1.0f, 100, 0.f); @@ -2659,7 +2659,7 @@ void Aquas_801B134C(Boss* bossAQ) { } bossAQ->timer_058 = 30; bossAQ->swork[AQ_SWK_0] = 4; - D_ctx_80178480 = 50; + gCameraShake = 50; AUDIO_PLAY_SFX(0x1900002D, bossAQ->sfxSource, 0); func_enmy_80062B60(bossAQ->obj.pos.x, bossAQ->obj.pos.z + 800.0f, 0, 100.0f); var_fs3 = 80.0f; @@ -3416,7 +3416,7 @@ f32 D_i3_801C0224[11] = { }; Vec3f D_i3_801C0250 = { 0.0f, 0.0f, 0.0f }; -s32 Aquas_801B4DDC(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* thisx) { +bool Aquas_801B4DDC(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* thisx) { Actor* this = thisx; if (!(this->timer_0C6 & 1)) { @@ -3593,7 +3593,7 @@ void Aquas_801B50E8(Actor* actor) { RAND_FLOAT_CENTERED(10.0f), 49, actor->scale, 200, i); func_effect_8007BC7C(actor->vwork[i].x, actor->vwork[i].y, actor->vwork[i].z + 100.0f, 6.0f); } - actor->unk_044 = 0; + actor->itemDrop = DROP_NONE; func_enmy_80066254(actor); func_effect_800815DC(); Object_Kill(&actor->obj, actor->sfxSource); @@ -3640,7 +3640,7 @@ void Aquas_801B50E8(Actor* actor) { } } -s32 Aquas_801B5C18(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* thisx) { +bool Aquas_801B5C18(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* thisx) { f32 sp6C = 1.0f; f32 sp68 = 1.0f; f32 sp64 = 1.0f; @@ -3810,9 +3810,9 @@ void Aquas_801B638C(Actor* actor) { func_effect_80081A8C(actor->obj.pos.x + RAND_FLOAT(i * 15.0f), actor->obj.pos.y + RAND_FLOAT(i * 3.0f), actor->obj.pos.z + RAND_FLOAT(i * 5.0f), 1.0f + RAND_FLOAT(1.0f), 7); } - actor->unk_044 = 2; + actor->itemDrop = DROP_SILVER_RING_50p; if (actor->iwork[16] != 0) { - actor->unk_044 = 14; + actor->itemDrop = DROP_GOLD_RING_1; } func_enmy_80066254(actor); Object_Kill(&actor->obj, actor->sfxSource); @@ -3977,7 +3977,7 @@ void Aquas_801B6FF8(Actor* actor) { f32 var_fs0; if (actor->health == -100) { - actor->unk_044 = 2; + actor->itemDrop = DROP_SILVER_RING_50p; func_enmy_80066254(actor); for (i = 0; i < 15; i++) { Aquas_801A9448(&actor->vwork[i], &actor->vwork[15 + i], RAND_FLOAT_CENTERED(20.0f), RAND_FLOAT(5.0f), @@ -4079,7 +4079,7 @@ void Aquas_801B6FF8(Actor* actor) { #pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_i3/fox_aq/Aquas_801B6FF8.s") #endif -s32 Aquas_801B76EC(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* thisx) { +bool Aquas_801B76EC(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* thisx) { gSPSetGeometryMode(gMasterDisp++, G_CULL_BACK); if ((limbIndex >= 4) && (limbIndex < 14)) { gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK); @@ -4226,7 +4226,7 @@ void Aquas_801B7C78(Actor* actor) { } func_effect_800815DC(); func_effect_8007D0E0(actor->vwork[7].x, actor->vwork[7].y, actor->vwork[7].z, 5.0f); - actor->unk_044 = 4; + actor->itemDrop = DROP_SILVER_RING_25p; func_enmy_80066254(actor); Object_Kill(&actor->obj, actor->sfxSource); func_effect_8007A6F0(&actor->obj.pos, 0x29038090); @@ -4452,7 +4452,7 @@ void Aquas_801B7C78(Actor* actor) { } } -s32 Aquas_801B8C50(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* thisx) { +bool Aquas_801B8C50(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* thisx) { Actor* this = thisx; RCP_SetupDL(&gMasterDisp, 0x3A); @@ -4578,7 +4578,7 @@ void Aquas_801B91A4(Actor* actor) { Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, 0); Matrix_RotateX(gCalcMatrix, actor->obj.rot.x * M_DTOR, 1); if ((actor->health == 0) && (actor->state > 0)) { - actor->unk_044 = 0; + actor->itemDrop = DROP_NONE; func_enmy_80066254(actor); for (i = 0; i < 5; i++) { func_effect_80081A8C(actor->obj.pos.x + RAND_FLOAT(i * 15.0f), actor->obj.pos.y + RAND_FLOAT(i * 3.0f), @@ -4943,7 +4943,7 @@ void Aquas_801BA6A4(Actor* actor) { actor->unk_0D0 = 0; actor->health -= actor->damage; if (actor->health <= 0) { - actor->health = actor->unk_044 = 0; + actor->health = actor->itemDrop = 0; func_enmy_80066254(actor); if (actor->state == 0) { for (i = 0, var_s2 = 0, var_s0 = gActors; i < 60 && var_s2 < 4; i++, var_s0++) { @@ -5449,7 +5449,7 @@ void Aquas_801BB79C(Actor* actor) { Aquas_801A96DC(actor); } -s32 Aquas_801BC530(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* thisx) { +bool Aquas_801BC530(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* thisx) { Vec3f sp64 = { 0.0f, 0.0f, 0.0f }; Vec3f sp58; f32 sp54 = 0.0f; @@ -5523,7 +5523,8 @@ void Aquas_801BC930(Actor* actor) { } s32 D_i3_801C04C4[9] = { - 1, 5, 9, 14, 15, 16, 17, 0, 13, + DROP_SILVER_RING, DROP_BOMB, DROP_LASERS, DROP_GOLD_RING_1, DROP_GOLD_RING_2, + DROP_GOLD_RING_3, DROP_GOLD_RING_4, DROP_NONE, DROP_1UP, }; // OBJ_ACTOR_269 action @@ -5635,7 +5636,7 @@ void Aquas_801BC9A0(Actor* actor) { actor->obj.pos.x = actor->vwork[4].x; actor->obj.pos.y = actor->vwork[4].y; actor->obj.pos.z = actor->vwork[4].z; - actor->unk_044 = D_i3_801C04C4[actor->iwork[1]]; + actor->itemDrop = D_i3_801C04C4[actor->iwork[1]]; func_enmy_80066254(actor); Object_Kill(&actor->obj, actor->sfxSource); func_effect_8007A6F0(&actor->obj.pos, 0x19021078); @@ -5890,7 +5891,7 @@ void Aquas_801BD54C(Actor* actor) { } } -s32 Aquas_801BDDFC(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* thisx) { +bool Aquas_801BDDFC(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* thisx) { gSPSetGeometryMode(gMasterDisp++, G_CULL_BACK); if ((limbIndex == 1) || (limbIndex == 2) || (limbIndex == 5)) { gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK); @@ -6081,7 +6082,7 @@ void Aquas_801BE3F8(Actor* actor) { if (actor->state == 2) { actor->health -= actor->damage; if (actor->health <= 0) { - actor->health = actor->unk_044 = 0; + actor->health = actor->itemDrop = 0; func_enmy_80066254(actor); for (i = 0; i < 10; i++) { Aquas_801AC8A8(actor->obj.pos.x + RAND_FLOAT_CENTERED(200.0f), diff --git a/src/overlays/ovl_i3/fox_so.c b/src/overlays/ovl_i3/fox_so.c index e8ab0add..f1f1ba0b 100644 --- a/src/overlays/ovl_i3/fox_so.c +++ b/src/overlays/ovl_i3/fox_so.c @@ -446,12 +446,12 @@ void Solar_8019F20C(Actor* actor) { D_i3_801BF8F0[i].y + RAND_FLOAT_CENTERED(3.0f), RAND_FLOAT(-10.0f) - 10.0f); } } else if (actor->obj.id == OBJ_ACTOR_275) { - actor->unk_044 = 1; + actor->itemDrop = DROP_SILVER_RING; } else if (actor->obj.id == OBJ_ACTOR_276) { if (gGoldRingCount[0] != 4) { - actor->unk_044 = 14; + actor->itemDrop = DROP_GOLD_RING_1; } else { - actor->unk_044 = 25; + actor->itemDrop = DROP_SILVER_STAR; } } func_enmy_80066254(actor); @@ -1049,7 +1049,7 @@ void Solar_801A10F4(Player* player) { gCsCamAtZ = -3000.0f; gCsCamEyeZ = -3400.0f; Audio_KillSfxBySourceAndId(player->sfxSource, 0x3140807E); - AUDIO_PLAY_BGM(SEQ_ID_51); + AUDIO_PLAY_BGM(SEQ_ID_INTRO_51); func_display_80057814(player); func_8001C8B8(gPlayerNum); D_ctx_80177A48[0] = 0.01f; @@ -1110,7 +1110,7 @@ void Solar_801A10F4(Player* player) { D_ctx_80178348 = D_ctx_80178350 = D_ctx_80178354 = 255; } if (D_ctx_80178340 == 255) { - AUDIO_PLAY_BGM(SEQ_ID_11 | 0x8000); + AUDIO_PLAY_BGM(SEQ_ID_SOLAR | SEQ_FLAG); player->pos.z = 0.0f; player->unk_0D0 = D_play_80161A54; func_play_800A6148(); @@ -1225,7 +1225,7 @@ void Solar_801A1F80(Boss* bossSO) { Solar_801A0CEC(&gActors[10], bossSO->obj.pos.x, bossSO->obj.pos.z + 2000.0f, 20.0f, 1); D_ctx_801779A8[gMainController] = 10.0f; - D_ctx_80178480 = 120; + gCameraShake = 120; bossSO->fwork[SO_FWK_3] = 2400.0f; bossSO->info.hitbox = SEGMENTED_TO_VIRTUAL(D_SO_60231A4); bossSO->unk_04C = 0; @@ -1256,7 +1256,7 @@ void Solar_801A1F80(Boss* bossSO) { gFogBlue--; } if (gBossFrameCount == 30) { - AUDIO_PLAY_BGM(SEQ_ID_27 | 0x8000); + AUDIO_PLAY_BGM(SEQ_ID_SO_BOSS | SEQ_FLAG); } if (gBossFrameCount <= 60) { Math_SmoothStepToF(&D_ctx_801779A8[gMainController], 120.0f, 1.0f, 3.5f, 0.0f); @@ -2118,7 +2118,7 @@ void Solar_801A4EF8(Boss* bossSO) { if (bossSO->swork[SO_SWK_11] == 300) { D_80137E84[gMainController] = 1; D_Timer_80177BD0[gMainController] = 170; - D_ctx_80178480 = 130; + gCameraShake = 130; } if (bossSO->swork[SO_SWK_11] == 200) { Solar_801A0CEC(&gActors[9], bossSO->obj.pos.x, bossSO->obj.pos.z + 1000.0f, 20.0f, 1); @@ -2142,7 +2142,7 @@ void Solar_801A4EF8(Boss* bossSO) { Solar_801A0CEC(&gActors[10], bossSO->obj.pos.x, bossSO->obj.pos.z + 1000.0f, 80.0f, 2); D_80137E84[gMainController] = 1; D_Timer_80177BD0[gMainController] = 100; - D_ctx_80178480 = 10; + gCameraShake = 10; } if (bossSO->obj.pos.y < -1500.0f) { bossSO->state++; @@ -2490,7 +2490,7 @@ void Solar_801A5B3C(Boss* bossSO) { } } -s32 Solar_801A68A8(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* thisx) { +bool Solar_801A68A8(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* thisx) { Boss* this = thisx; Vec3f sp58 = { 0.0f, 0.0f, 0.0f }; Vec3f sp4C = { 10.0f, 0.0f, 0.0f }; @@ -2895,7 +2895,7 @@ void Solar_801A7930(Player* player) { player->unk_1D0++; player->wings.unk_2C = 1; func_8001C8B8(0); - AUDIO_PLAY_BGM(SEQ_ID_38); + AUDIO_PLAY_BGM(SEQ_ID_GOOD_END); D_ctx_80177A98 = 1; func_play_800A6148(); D_ctx_80177A48[1] = 0.0f; diff --git a/src/overlays/ovl_i3/fox_zo.c b/src/overlays/ovl_i3/fox_zo.c index f51b4aed..ae468da8 100644 --- a/src/overlays/ovl_i3/fox_zo.c +++ b/src/overlays/ovl_i3/fox_zo.c @@ -575,7 +575,7 @@ void Zoness_801900FC(Vec3f* pos, Vec3f* rot, f32 xVel, f32 yVel, f32 zVel, s32 a } } -s32 Zoness_8019019C(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* thisx) { +bool Zoness_8019019C(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* thisx) { gSPSetGeometryMode(gMasterDisp++, G_CULL_BACK); if ((limbIndex >= 4) && (limbIndex < 10)) { gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK); @@ -669,7 +669,7 @@ void Zoness_801904CC(Actor* actor) { Zoness_801900FC(&actor->vwork[i], &actor->vwork[i + 11], RAND_FLOAT_CENTERED(20.0f), RAND_FLOAT(-10.0f), RAND_FLOAT(10.0f), 41, actor->scale, 200, i); } - actor->unk_044 = 0; + actor->itemDrop = DROP_NONE; func_enmy_80066254(actor); Object_Kill(&actor->obj, actor->sfxSource); func_effect_8007D0E0(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 4.0f); @@ -910,7 +910,7 @@ void Zoness_80191010(Actor* actor) { Zoness_801900FC(&actor->vwork[i], &actor->vwork[3 + i], RAND_FLOAT_CENTERED(20.0f), RAND_FLOAT(-10.0f), RAND_FLOAT(10.0f), 42, actor->scale, 200, i); } - actor->unk_044 = 4; + actor->itemDrop = DROP_SILVER_RING_25p; func_enmy_80066254(actor); func_effect_8007D0E0(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 3.0f); AUDIO_PLAY_SFX(0x2903A008, actor->sfxSource, 4); @@ -983,7 +983,7 @@ void Zoness_80191680(Actor* actor) { actor->health -= actor->damage; AUDIO_PLAY_SFX(0x29033037, actor->sfxSource, 4); if (actor->health <= 0) { - actor->health = actor->unk_044 = 0; + actor->health = actor->itemDrop = 0; func_enmy_80066254(actor); actor->state = 1; AUDIO_PLAY_SFX(0x29018036, actor->sfxSource, 4); @@ -1238,7 +1238,7 @@ void Zoness_80192094(Actor* actor) { Zoness_801900FC(&actor->vwork[i], &actor->vwork[i + 6], RAND_FLOAT_CENTERED(40.0f), RAND_FLOAT(-10.0f), RAND_FLOAT(20.0f), 44, actor->scale, 200, i); } - actor->unk_044 = 5; + actor->itemDrop = DROP_BOMB; func_enmy_80066254(actor); Object_Kill(&actor->obj, actor->sfxSource); func_effect_8007D0E0(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 10.0f); @@ -1339,7 +1339,7 @@ void Zoness_80192834(Actor* actor) { Zoness_801900FC(&actor->vwork[i], &actor->vwork[5 + i], RAND_FLOAT_CENTERED(20.0f), RAND_FLOAT(-10.0f), RAND_FLOAT(10.0f), 43, actor->scale, 200, i); } - actor->unk_044 = 0; + actor->itemDrop = DROP_NONE; func_enmy_80066254(actor); Object_Kill(&actor->obj, actor->sfxSource); func_effect_8007D0E0(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 3.0f); @@ -1456,7 +1456,7 @@ void Zoness_80192E64(Actor* actor) { Zoness_801900FC(&actor->vwork[i], &actor->vwork[9 + i], RAND_FLOAT_CENTERED(40.0f), RAND_FLOAT(-10.0f), RAND_FLOAT(20.0f), 59, actor->scale, 200, i); } - actor->unk_044 = 7; + actor->itemDrop = DROP_BOMB_33p; func_enmy_80066254(actor); Object_Kill(&actor->obj, actor->sfxSource); func_effect_8007D0E0(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 10.0f); @@ -1494,7 +1494,7 @@ f32 D_i3_801BF608[6] = { -45.0f, 0.0f, -45.0f, 0.0f, -45.0f, 0.0f, }; -void Zoness_801932AC(Boss* bossZO) { +void Zoness_BossZo_Init(Boss* bossZO) { s32 i; gBossActive = 1; @@ -1707,7 +1707,7 @@ f32 Zoness_80193CC8(s32 arg0) { return var_fv1; } -s32 Zoness_80193D08(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* thisx) { +bool Zoness_80193D08(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* thisx) { Boss* this = thisx; f32 temp; @@ -2121,7 +2121,7 @@ void Zoness_80194A84(Boss* bossZO) { sp100 = 5.0f; spFC = 3.0f; if (sZoSwork[ZO_BSS_55] == 0) { - AUDIO_PLAY_BGM(SEQ_ID_22 | 0x8000); + AUDIO_PLAY_BGM(SEQ_ID_ZO_BOSS | SEQ_FLAG); sZoSwork[ZO_BSS_55] = 1; } func_effect_8008377C(sZoFwork[ZO_BSF_43_X], sp134, sZoFwork[ZO_BSF_43_Z] + 100.0f, 5.0f, 3.0f); @@ -2451,14 +2451,14 @@ void Zoness_80194A84(Boss* bossZO) { break; case 6: D_ctx_801779A8[0] = 20.0f; - if (D_ctx_80178480 == 0) { + if (gCameraShake == 0) { D_ctx_80178348 = D_ctx_80178350 = D_ctx_80178354 = 255; D_ctx_80178340 = D_ctx_80178358 = 255; D_ctx_80178358 = 0; D_ctx_8017835C = 25; - D_ctx_80178480 = (s32) (RAND_FLOAT(20.0f) + 20.0f); + gCameraShake = (s32) (RAND_FLOAT(20.0f) + 20.0f); } - if (D_ctx_80178480 == 29) { + if (gCameraShake == 29) { D_ctx_80178348 = D_ctx_80178350 = D_ctx_80178354 = D_ctx_80178340 = 0; } if (!(gGameFrameCount & 3)) { @@ -2874,7 +2874,7 @@ void Zoness_80194A84(Boss* bossZO) { sZoSwork[ZO_BSS_11] -= bossZO->damage; if (sZoSwork[ZO_BSS_11] <= 0) { sZoSwork[ZO_BSS_11] = 0; - D_ctx_80178480 = 30; + gCameraShake = 30; D_ctx_80178348 = D_ctx_80178350 = D_ctx_80178354 = 255; D_ctx_80178340 = D_ctx_80178358 = 255; D_ctx_80178358 = 0; @@ -2900,7 +2900,7 @@ void Zoness_80194A84(Boss* bossZO) { sZoSwork[ZO_BSS_12] -= bossZO->damage; if (sZoSwork[ZO_BSS_12] <= 0) { sZoSwork[ZO_BSS_12] = 0; - D_ctx_80178480 = 30; + gCameraShake = 30; D_ctx_80178348 = D_ctx_80178350 = D_ctx_80178354 = 255; D_ctx_80178340 = D_ctx_80178358 = 255; D_ctx_80178358 = 0; @@ -3357,7 +3357,7 @@ void Zoness_8019969C(Actor* actor) { RAND_FLOAT_CENTERED(50.0f) + actor->obj.pos.z, 1.0f); } func_effect_8007D0E0(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z + 200.0f, 5.0f); - actor->unk_044 = 5; + actor->itemDrop = DROP_BOMB; actor->unk_0D4 = 2; actor->obj.pos.z -= 100.0f; func_enmy_80066254(actor); @@ -3457,7 +3457,7 @@ void Zoness_80199A28(Actor* actor) { } if ((actor->unk_0D0 != 0) && (actor->health != 0)) { actor->unk_0D0 = 0; - actor->unk_044 = 2; + actor->itemDrop = DROP_SILVER_RING_50p; func_effect_8007D0E0(actor->obj.pos.x, actor->obj.pos.y + 100.0f, actor->obj.pos.z, 7.0f); actor->unk_0D4 = 2; actor->obj.pos.y += 200.0f; @@ -3475,7 +3475,7 @@ void Zoness_80199A28(Actor* actor) { } if ((actor->timer_0BC == 0) && (actor->iwork[0] == 0)) { func_effect_8007D0E0(actor->obj.pos.x, actor->obj.pos.y + 100.0f, actor->obj.pos.z, 7.0f); - actor->unk_044 = 2; + actor->itemDrop = DROP_SILVER_RING_50p; actor->unk_0D4 = 2; actor->obj.pos.y += 200.0f; func_enmy_80066254(actor); @@ -3941,7 +3941,8 @@ void Zoness_8019B810(Actor* actor) { actor->health = 30; } -s32 D_i3_801BF824[10] = { 1, 5, 9, 14, 15, 16, 17, 0, 13, 1000 }; +s32 D_i3_801BF824[10] = { DROP_SILVER_RING, DROP_BOMB, DROP_LASERS, DROP_GOLD_RING_1, DROP_GOLD_RING_2, + DROP_GOLD_RING_3, DROP_GOLD_RING_4, DROP_NONE, DROP_1UP, 1000 }; Vec3f D_i3_801BF84C[6] = { { 5.0f, -10.0f, 0.0f }, { 10.0f, 0.0f, 0.0f }, { 5.0f, 10.0f, 0.0f }, { -5.0f, -10.0f, 0.0f }, { -10.0f, 0.0f, 0.0f }, { -5.0f, 10.0f, 0.0f }, @@ -3985,7 +3986,7 @@ void Zoness_8019B854(Actor* actor) { } actor->obj.pos.y += 100.0f; if (D_i3_801BF824[actor->iwork[0]] < 1000) { - actor->unk_044 = D_i3_801BF824[actor->iwork[0]]; + actor->itemDrop = D_i3_801BF824[actor->iwork[0]]; func_enmy_80066254(actor); } else { if (D_i3_801BF824[actor->iwork[0]] == 1000) { @@ -4002,7 +4003,7 @@ void Zoness_8019B854(Actor* actor) { func_effect_8007EE68(353, &spB4, &spA8, &spA8, &sp9C, 1.0f); } } - actor->unk_044 = 0; + actor->itemDrop = DROP_NONE; func_enmy_80066254(actor); } Object_Kill(&actor->obj, actor->sfxSource); @@ -4096,7 +4097,7 @@ void Zoness_8019BE48(Actor* actor) { BonusText_Display(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z + 200.0f, 2); gHitCount += 2; } - actor->health = actor->unk_044 = 0; + actor->health = actor->itemDrop = 0; func_enmy_80066254(actor); actor->state++; } @@ -4390,7 +4391,7 @@ void Zoness_8019CE58(Actor* actor) { gSPDisplayList(gMasterDisp++, D_ZO_60181E0); } -void Zoness_8019D060(Actor* actor) { +void Zoness_Actor247_Init(Actor* actor) { s32 i; for (i = 0; i < 60; i++) { @@ -4446,7 +4447,7 @@ void Zoness_8019D15C(Actor* actor) { } } -s32 Zoness_8019D340(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* thisx) { +bool Zoness_8019D340(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* thisx) { Actor* this = thisx; switch (this->state) { @@ -4512,7 +4513,7 @@ void Zoness_8019D428(Player* player) { } gControllerHold[gMainController].button = sp2C; if (gCsFrameCount >= 270) { - AUDIO_PLAY_BGM(SEQ_ID_6 | 0x8000); + AUDIO_PLAY_BGM(SEQ_ID_ZONESS | SEQ_FLAG); D_ctx_80177838 = 80; player->state_1C8 = PLAYERSTATE_1C8_3; player->unk_1D0 = 0; @@ -4610,7 +4611,7 @@ void Zoness_8019D76C(Player* player) { player->pos.z = -(D_ctx_80177D20 + 1500.0f); player->unk_1D0++; func_8001C8B8(0); - AUDIO_PLAY_BGM(SEQ_ID_38); + AUDIO_PLAY_BGM(SEQ_ID_GOOD_END); D_ctx_80177A98 = 1; func_play_800A6148(); Solar_801A7750(); diff --git a/src/overlays/ovl_i4/fox_bo.c b/src/overlays/ovl_i4/fox_bo.c index a7296202..73ea0119 100644 --- a/src/overlays/ovl_i4/fox_bo.c +++ b/src/overlays/ovl_i4/fox_bo.c @@ -103,7 +103,7 @@ void Bolse_8018BD60(Actor* actor) { if (actorPtr->obj.status == OBJ_FREE) { Actor_Initialize(actorPtr); actorPtr->obj.status = OBJ_ACTIVE; - actorPtr->obj.id = OBJ_ACTOR_197; + actorPtr->obj.id = OBJ_ACTOR_ALLRANGE; actorPtr->obj.pos.x = D_i4_8019EEC4[actor->unk_04E]; actorPtr->obj.pos.y = 1000.0f; actorPtr->obj.pos.z = D_i4_8019EED4[actor->unk_04E]; @@ -111,7 +111,7 @@ void Bolse_8018BD60(Actor* actor) { actorPtr->aiIndex = -1; actorPtr->health = 24; actorPtr->iwork[11] = 1; - actorPtr->unk_044 = 2; + actorPtr->itemDrop = DROP_SILVER_RING_50p; actorPtr->aiType = i; Object_SetInfo(&actorPtr->info, actorPtr->obj.id); AUDIO_PLAY_SFX(0x3100000CU, actorPtr->sfxSource, 4U); @@ -133,7 +133,7 @@ void Bolse_8018BEF8(Actor* actor, s32 arg1) { if (actorPtr->obj.status == OBJ_FREE) { Actor_Initialize(actorPtr); actorPtr->obj.status = OBJ_ACTIVE; - actorPtr->obj.id = OBJ_ACTOR_197; + actorPtr->obj.id = OBJ_ACTOR_ALLRANGE; actorPtr->obj.pos.z = 0.0f; if (D_i4_801A0530 > 1000) { @@ -154,33 +154,33 @@ void Bolse_8018BEF8(Actor* actor, s32 arg1) { actorPtr->aiIndex = -1; if (i < 13) { - actorPtr->aiIndex = 2; - gActors[2].aiIndex = -1; + actorPtr->aiIndex = AI360_SLIPPY; + gActors[AI360_SLIPPY].aiIndex = -1; } if ((i == 17) || (i == 18)) { - actorPtr->aiIndex = 0; + actorPtr->aiIndex = AI360_FOX; } if ((i == 20) || (i == 21)) { - actorPtr->aiIndex = 3; - gActors[3].aiIndex = -1; + actorPtr->aiIndex = AI360_PEPPY; + gActors[AI360_PEPPY].aiIndex = -1; } if (i == 22) { - actorPtr->aiIndex = 1; - gActors[1].aiIndex = -1; + actorPtr->aiIndex = AI360_FALCO; + gActors[AI360_FALCO].aiIndex = -1; } if ((D_i4_801A0530 > 16000) && ((i == 23) || (i == 24))) { - actorPtr->aiIndex = 0; + actorPtr->aiIndex = AI360_FOX; } actorPtr->health = 24; actorPtr->iwork[11] = 1; if (D_i4_801A0530 < 16000) { - actorPtr->unk_044 = 2; + actorPtr->itemDrop = DROP_SILVER_RING_50p; } Object_SetInfo(&actorPtr->info, actorPtr->obj.id); @@ -270,7 +270,7 @@ void Bolse_8018C158(Actor* actor) { actor->state = 6; AUDIO_PLAY_SFX(0x31009063U, actor->sfxSource, 0U); AUDIO_PLAY_SFX(0x2940D09AU, actor->sfxSource, 4U); - D_play_Timer_80161A60 = 8; + gScreenFlashTimer = 8; for (actorPtr = &gActors[10], i = 0; i < 20; i++, actorPtr++) { if (actorPtr->obj.status == OBJ_ACTIVE) { @@ -285,7 +285,7 @@ void Bolse_8018C158(Actor* actor) { actor->state = 10; actor->timer_0BC = 150; gPlayer[0].state_1C8 = PLAYERSTATE_1C8_0; - AUDIO_PLAY_BGM(SEQ_ID_28 | 0x8000); + AUDIO_PLAY_BGM(SEQ_ID_BO_BOSS | SEQ_FLAG); func_360_8002EE34(); gPlayer[0].camEye.x = 400.0f; gPlayer[0].camEye.y = 50.0f; @@ -296,7 +296,7 @@ void Bolse_8018C158(Actor* actor) { for (i = 10; i < 30; i++) { Object_Kill(&gActors[i].obj, gActors[i].sfxSource); } - } else if ((D_360_8015F924 == 1) && (((gHitCount - actor->iwork[1]) >= 5) || (D_i4_801A0530 == 0xFA0))) { + } else if ((D_360_8015F924 == 1) && (((gHitCount - actor->iwork[1]) >= 5) || (D_i4_801A0530 == 4000))) { D_360_8015F924 = 2; actor->iwork[1] = gHitCount; if ((D_ctx_80177CD0[0] != 0) || (D_ctx_80177CD0[1] != 0) || (D_ctx_80177CD0[2] != 0) || @@ -391,13 +391,14 @@ void Bolse_8018C158(Actor* actor) { break; case 6: - gActors[1].aiIndex = 0; - gActors[1].state = 2; - gActors[2].aiIndex = 0; - gActors[2].state = 2; - gActors[3].aiIndex = 0; - gActors[3].state = 2; - gActors[4].aiIndex = gActors[5].aiIndex = gActors[6].aiIndex = gActors[7].aiIndex = -1; + gActors[AI360_FALCO].aiIndex = 0; + gActors[AI360_FALCO].state = 2; + gActors[AI360_SLIPPY].aiIndex = 0; + gActors[AI360_SLIPPY].state = 2; + gActors[AI360_PEPPY].aiIndex = 0; + gActors[AI360_PEPPY].state = 2; + gActors[AI360_WOLF].aiIndex = gActors[AI360_LEON].aiIndex = gActors[AI360_PIGMA].aiIndex = + gActors[AI360_ANDREW].aiIndex = -1; break; } @@ -623,7 +624,7 @@ bool Bolse_8018D278(Actor* actor) { func_effect_8007A6F0(&actor->obj.pos, 0x2903A008); - actor->unk_044 = 1; + actor->itemDrop = DROP_SILVER_RING; func_enmy_80066254(actor); Object_Kill(&actor->obj, actor->sfxSource); @@ -648,7 +649,7 @@ void Bolse_8018D394(Actor* actor) { actor->iwork[0] = 0; } -s32 Bolse_8018D414(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* this) { +bool Bolse_8018D414(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* this) { Actor* actor = (Actor*) this; if (limbIndex == 2) { @@ -751,7 +752,7 @@ void Bolse_8018D7F0(Actor* actor) { actor->scale = -1.0f; } -s32 Bolse_8018D874(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* this) { +bool Bolse_8018D874(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* this) { Actor* actor = (Actor*) this; RCP_SetupDL(&gMasterDisp, 0x1D); @@ -1307,7 +1308,7 @@ void Bolse_8018EF6C(Player* player) { actor->state = 3; actor->timer_0BC = 80; } - AUDIO_PLAY_BGM(D_ctx_80177C90); + AUDIO_PLAY_BGM(gBgmSeqId); D_ctx_80177838 = 80; } break; @@ -1492,11 +1493,11 @@ void Bolse_8018F94C(Player* player) { switch (gCsFrameCount) { case 160: - AUDIO_PLAY_BGM(SEQ_ID_38); + AUDIO_PLAY_BGM(SEQ_ID_GOOD_END); break; case 92: - D_play_Timer_80161A60 = 8; + gScreenFlashTimer = 8; break; case 95: @@ -1602,7 +1603,7 @@ void Bolse_8018F94C(Player* player) { case 800: player->unk_1D0 += 1; - player->timer_1F8 = 0x32; + player->timer_1F8 = 50; player->unk_194 = 5.0f; player->unk_190 = 5.0f; AUDIO_PLAY_SFX(0x09000002U, player->sfxSource, 0U); @@ -1626,7 +1627,7 @@ void Bolse_8018F94C(Player* player) { D_ctx_80178348 = D_ctx_80178350 = D_ctx_80178354 = 0; D_ctx_80178358 = 255; if (D_ctx_80178340 == 255) { - D_80161A94[0] = gGoldRingCount[0]; + D_ctx_80161A94[0] = gGoldRingCount[0]; gNextGameState = GSTATE_PLAY; gNextLevel = LEVEL_VENOM_1; func_8001CA24(0); @@ -1731,9 +1732,9 @@ void Bolse_8018F94C(Player* player) { Math_SmoothStepToF(&player->camAt.z, gCsCamAtZ, D_ctx_80177A48[0], 50000, 0); } player->unk_088 += 10.0f; - player->unk_080 = -__sinf(player->unk_088 * M_DTOR) * 0.3f; + player->unk_080 = -SIN_DEG(player->unk_088) * 0.3f; player->unk_0F4 += 8.0f; - player->unk_0F0 = __sinf(player->unk_0F4 * M_DTOR); + player->unk_0F0 = SIN_DEG(player->unk_0F4); } void Bolse_80190D98(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 xRot, f32 yRot) { @@ -1966,7 +1967,7 @@ void Bolse_801912FC(Boss* boss) { } } -s32 Bolse_801918E4(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* this) { +bool Bolse_801918E4(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* this) { Boss* boss = (Boss*) this; RCP_SetupDL(&gMasterDisp, 0x1D); @@ -2130,7 +2131,7 @@ void Bolse_80191ED8(void) { if (D_ctx_80178310[i].id < 0) { break; } - if ((D_ctx_80178310[i].id >= OBJ_ACTOR_176) && (D_ctx_80178310[i].id <= OBJ_ACTOR_291)) { + if ((D_ctx_80178310[i].id >= OBJ_ACTOR_176) && (D_ctx_80178310[i].id <= OBJ_ACTOR_SUPPLIES)) { Actor_Initialize(actor); actor->obj.status = OBJ_INIT; actor->obj.id = D_ctx_80178310[i].id; @@ -2197,7 +2198,7 @@ void Bolse_80192264(void) { Matrix_Push(&gGfxMatrix); Rand_SetSeed(1, 29100, 9786); - Matrix_Translate(gGfxMatrix, 0.0f, D_ctx_8017847C, 0.0f, 1); + Matrix_Translate(gGfxMatrix, 0.0f, gCameraShakeY, 0.0f, 1); Matrix_RotateY(gGfxMatrix, gBosses[0].obj.rot.y * M_DTOR, 1); Matrix_Scale(gGfxMatrix, 5.0f, 1.0f, 5.0f, 1); diff --git a/src/overlays/ovl_i4/fox_fo.c b/src/overlays/ovl_i4/fox_fo.c index 3ed00f42..69ed460f 100644 --- a/src/overlays/ovl_i4/fox_fo.c +++ b/src/overlays/ovl_i4/fox_fo.c @@ -14,7 +14,7 @@ void Fortuna_801875F0(Actor* actor) { f32 D_i4_8019EDE0[] = { 180.0f, 60.0f, 300.0f }; for (counter = 0, i = 0; i < 10; i++, actorPtr++) { - if (actorPtr->obj.status != 0) { + if (actorPtr->obj.status != OBJ_FREE) { counter++; } } @@ -32,30 +32,30 @@ void Fortuna_801875F0(Actor* actor) { if (actorPtr->obj.status == OBJ_FREE) { Actor_Initialize(actorPtr); actorPtr->obj.status = OBJ_ACTIVE; - actorPtr->obj.id = 197; + actorPtr->obj.id = OBJ_ACTOR_ALLRANGE; actorPtr->obj.pos.x = gBosses[0].obj.pos.x; actorPtr->obj.pos.y = gBosses[0].obj.pos.y + 20.0f; actorPtr->obj.pos.z = gBosses[0].obj.pos.z; actorPtr->state = 1; actorPtr->timer_0BC = 100; - actorPtr->aiType = i + 10; + actorPtr->aiType = i + AI360_10; actorPtr->aiIndex = -1; if ((i == 3) && (Rand_ZeroOne() < 0.3f)) { - actorPtr->aiIndex = 2; + actorPtr->aiIndex = AI360_SLIPPY; } if ((i == 4) && (Rand_ZeroOne() < 0.3f)) { - actorPtr->aiIndex = 3; + actorPtr->aiIndex = AI360_PEPPY; } if ((i == 5) && (Rand_ZeroOne() < 0.3f)) { - actorPtr->aiIndex = 1; + actorPtr->aiIndex = AI360_FALCO; } actorPtr->unk_0F4.x = 3.0f; actorPtr->unk_0F4.y = D_i4_8019EDE0[actor->unk_04E]; actorPtr->health = 24; actorPtr->unk_0C9 = actorPtr->iwork[11] = 1; - actorPtr->unk_044 = 2; + actorPtr->itemDrop = DROP_SILVER_RING_50p; Object_SetInfo(&actorPtr->info, actorPtr->obj.id); AUDIO_PLAY_SFX(0x31000011U, actorPtr->sfxSource, 4); break; @@ -79,8 +79,8 @@ void Fortuna_80187884(Actor* actor, f32 xPos, f32 yPos, f32 zPos, f32 arg4) { actor->obj.pos.x = xPos; actor->obj.pos.y = yPos; actor->obj.pos.z = zPos; - actor->obj.id = OBJ_ACTOR_197; - actor->aiType = 4; + actor->obj.id = OBJ_ACTOR_ALLRANGE; + actor->aiType = AI360_WOLF; actor->unk_0C9 = 1; actor->state = 0; actor->timer_0BC = 10000; @@ -150,7 +150,7 @@ void Fortuna_80187960(Actor* actor) { if (D_360_8015F928 == 8540) { Radio_PlayMessage(gMsg_ID_9400, RCID_ROB64); - Audio_PlaySequence(SEQ_PLAYER_BGM, SEQ_ID_10 | 0x8000, 0, 0); + Audio_PlaySequence(SEQ_PLAYER_BGM, SEQ_ID_FORTUNA | SEQ_FLAG, 0, 0); gActors[1].aiIndex = gActors[2].aiIndex = gActors[3].aiIndex = gActors[4].aiIndex = gActors[5].aiIndex = gActors[6].aiIndex = gActors[7].aiIndex = -1; } @@ -261,9 +261,9 @@ void Fortuna_80187960(Actor* actor) { if (gCsFrameCount == 264) { actorPtr->state = 2; actor->state = 2; - player->state_1C8 = 3; + player->state_1C8 = PLAYERSTATE_1C8_3; player->unk_014 = 0.0001f; - AUDIO_PLAY_BGM(D_ctx_80177C90); + AUDIO_PLAY_BGM(gBgmSeqId); D_ctx_80177838 = 80; } }; @@ -292,7 +292,7 @@ void Fortuna_80187960(Actor* actor) { }; } - if ((gControllerPress->button & 0x1000) || (D_360_8015F928 == (D_360_800C9B4C + 0x1B8))) { + if ((gControllerPress->button & START_BUTTON) || (D_360_8015F928 == (D_360_800C9B4C + 440))) { actor->state = 2; player->state_1C8 = PLAYERSTATE_1C8_3; func_play_800B7184(player, 1); @@ -364,11 +364,11 @@ void Fortuna_80187960(Actor* actor) { case 6: actor->iwork[0] += 1; if (D_ctx_80177930 == 0) { - actor1->aiIndex = 0; + actor1->aiIndex = AI360_FOX; actor1->state = 2; - actor2->aiIndex = 0; + actor2->aiIndex = AI360_FOX; actor2->state = 2; - actor3->aiIndex = 0; + actor3->aiIndex = AI360_FOX; actor3->state = 2; if (actor->iwork[0] == 130) { Vec3f sp50 = { 0.0f, 0.0f, -10000 }; @@ -380,11 +380,11 @@ void Fortuna_80187960(Actor* actor) { Matrix_MultVec3f(gCalcMatrix, &sp50, &actor19->obj.pos); actor19->obj.status = OBJ_ACTIVE; - actor19->obj.id = OBJ_ACTOR_197; + actor19->obj.id = OBJ_ACTOR_ALLRANGE; actor19->state = 4; actor19->unk_0F4.y = player->unk_0E8 + player->unk_114 + 180.0f; actor19->unk_0F4.x = 15.0f; - actor19->aiType = 100; + actor19->aiType = AI360_GREAT_FOX; actor19->fwork[1] = 90.0f; actor19->fwork[0] = 90.0f; Object_SetInfo(&actor19->info, actor19->obj.id); @@ -483,7 +483,7 @@ void Fortuna_80188AD0(Actor* actor) { Fortuna_80188A48(&actor->vwork[3], &actor->vwork[9], RAND_FLOAT_CENTERED(50.0f), RAND_FLOAT(10.0f) + 10.0f, RAND_FLOAT_CENTERED(50.0f), 35); func_effect_8007BFFC(actor->obj.pos.x, actor->obj.pos.y + 180.0f, actor->obj.pos.z, 0.0f, 0.0f, 0.0f, 5.0f, 10); - actor->unk_044 = 1; + actor->itemDrop = DROP_SILVER_RING; actor->obj.pos.y += 230.0f; func_enmy_80066254(actor); actor->obj.pos.y -= 230.0f; @@ -539,7 +539,7 @@ void Fortuna_80188DA0(s32 limbIndex, Vec3f* rot, void* ptr) { } } -s32 Fortuna_80188F08(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* ptr) { +bool Fortuna_80188F08(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* ptr) { Actor* actor = (Actor*) ptr; gSPSetGeometryMode(gMasterDisp++, G_CULL_BACK); @@ -793,9 +793,9 @@ void Fortuna_8018927C(Player* player) { func_play_800A5EBC(); gLevelType = 1; D_ctx_801784AC = gBgColor = gFogRed = gFogGreen = gFogBlue = 0; - gLight1R = gLight2R = D_80161A70 = 86; - gLight1G = gLight2G = D_80161A74 = 58; - gLight1B = gLight2B = D_80161A78 = 25; + gLight1R = gLight2R = D_ctx_80161A70 = 86; + gLight1G = gLight2G = D_ctx_80161A74 = 58; + gLight1B = gLight2B = D_ctx_80161A78 = 25; gAmbientR = 11; gAmbientG = 8; gAmbientB = 24; @@ -872,14 +872,14 @@ void Fortuna_8018927C(Player* player) { if (gCsFrameCount == 200) { if (D_ctx_80177930 == 0) { - AUDIO_PLAY_BGM(SEQ_ID_49); + AUDIO_PLAY_BGM(SEQ_ID_BAD_END); } else { - AUDIO_PLAY_BGM(SEQ_ID_38); + AUDIO_PLAY_BGM(SEQ_ID_GOOD_END); } } if (gCsFrameCount == 420) { - D_ctx_80177840 = 0x64; + D_ctx_80177840 = 100; } break; @@ -1015,7 +1015,7 @@ void Fortuna_8018927C(Player* player) { D_ctx_80178430 += 0.3f; D_ctx_8017842C += 0.3f; Math_SmoothStepToF(&D_ctx_80177A48[3], 0.0f, 1.0f, 0.02f, 0); - if (gCsFrameCount == 0x4C0) { + if (gCsFrameCount == 1216) { player->unk_1D0 = 12; player->timer_1F8 = 1000; D_ctx_80177A48[4] = 1.0f; @@ -1192,7 +1192,7 @@ void Fortuna_8018927C(Player* player) { switch (gCsFrameCount) { case 140: - AUDIO_PLAY_BGM(SEQ_ID_38); + AUDIO_PLAY_BGM(SEQ_ID_GOOD_END); break; case 450: D_ctx_80177840 = 100; diff --git a/src/overlays/ovl_i4/fox_i4.c b/src/overlays/ovl_i4/fox_i4.c index ced9fdab..ea2a4991 100644 --- a/src/overlays/ovl_i4/fox_i4.c +++ b/src/overlays/ovl_i4/fox_i4.c @@ -15,31 +15,31 @@ s32 D_i4_8019EDD0 = 0; void OvlI4_CallFunction(u32 arg0, void* arg1) { switch (arg0) { - case 0x5A: + case 90: Fortuna_8018927C(arg1); break; - case 0x5B: + case 91: Bolse_8018E710(arg1); break; - case 0x5C: + case 92: Bolse_8018E870(arg1); break; - case 0x5D: + case 93: Bolse_80191BAC(arg1); break; - case 0x5E: + case 94: Bolse_80191DB0(arg1); break; - case 0x5F: + case 95: Bolse_8018D7F0(arg1); break; - case 0x60: + case 96: Bolse_8018D960(arg1); break; - case 0x61: + case 97: Bolse_8018D394(arg1); break; - case 0x62: + case 98: Bolse_8018D454(arg1); default: PRINTF("i4 指定外!\n"); // Not specified! diff --git a/src/overlays/ovl_i4/fox_ka.c b/src/overlays/ovl_i4/fox_ka.c index 3a574f4d..4e34208b 100644 --- a/src/overlays/ovl_i4/fox_ka.c +++ b/src/overlays/ovl_i4/fox_ka.c @@ -273,7 +273,7 @@ void Katina_80192E20(Player* player) { Object_Kill(&gActors[6].obj, gActors[6].sfxSource); player->state_1C8 = PLAYERSTATE_1C8_3; player->unk_014 = 0.0001f; - AUDIO_PLAY_BGM(D_ctx_80177C90); + AUDIO_PLAY_BGM(gBgmSeqId); D_ctx_80177838 = 80; for (actor = &gActors[1], i = 1; i < 4; i += 1, actor++) { actor->timer_0BC = 0; @@ -365,7 +365,7 @@ void Katina_80193718(Boss* boss) { boss->timer_050 = 4; boss->state++; func_effect_8007B344(boss->obj.pos.x, boss->obj.pos.y + 250.0f, boss->obj.pos.z + 600.0f, 71.0f, 5); - D_ctx_80178480 = 25; + gCameraShake = 25; gLight1R = 255; gLight1G = 0; gLight1B = 0; @@ -419,7 +419,7 @@ void Katina_80193B1C(Boss* boss) { } } -void Katina_80193CA4(Boss* boss) { +void Katina_Boss316_Init(Boss* boss) { boss->swork[10] = 100; boss->swork[11] = 100; boss->swork[12] = 100; @@ -518,7 +518,7 @@ void Katina_80193EF0(Boss* boss) { boss->obj.pos.z + dest.z, 1.6f); } AUDIO_PLAY_SFX(0x2940D09AU, boss->sfxSource, 4U); - D_play_Timer_80161A60 = 8; + gScreenFlashTimer = 8; boss->state = 20; boss->timer_050 = 50; SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM, 50); @@ -569,7 +569,7 @@ void Katina_80194458(Boss* boss, Vec3f* pos, f32 arg2) { if (actor->obj.status == OBJ_FREE) { Actor_Initialize(actor); actor->obj.status = OBJ_ACTIVE; - actor->obj.id = OBJ_ACTOR_197; + actor->obj.id = OBJ_ACTOR_ALLRANGE; actor->obj.pos.x = boss->obj.pos.x + pos->x; actor->obj.pos.y = boss->obj.pos.y + pos->y; actor->obj.pos.z = boss->obj.pos.z + pos->z; @@ -577,7 +577,7 @@ void Katina_80194458(Boss* boss, Vec3f* pos, f32 arg2) { actor->timer_0BC = 20; actor->unk_0F4.y = arg2; actor->unk_0F4.x = -30.0f; - actor->aiType = i + 10; + actor->aiType = i + AI360_10; actor->unk_0B6 = D_i4_8019F198[i - 10]; actor->aiIndex = D_i4_8019F1C0[i - 10]; actor->health = 24; @@ -586,7 +586,7 @@ void Katina_80194458(Boss* boss, Vec3f* pos, f32 arg2) { } actor->unk_0C9 = 1; if (D_i4_801A0540 < 9600) { - actor->unk_044 = 22; + actor->itemDrop = DROP_SILVER_RING_10p; } actor->timer_0C2 = 30; actor->timer_0C4 = 400; @@ -765,7 +765,7 @@ void Katina_801946C4(Boss* boss) { case 5: if (boss->timer_050 == 1) { - AUDIO_PLAY_BGM(SEQ_ID_29 | 0x8000); + AUDIO_PLAY_BGM(SEQ_ID_KA_BOSS | SEQ_FLAG); } if ((boss->timer_050 == 0) && !(boss->timer_052 & 15)) { @@ -1157,8 +1157,8 @@ void Katina_801946C4(Boss* boss) { &boss->unk_078.y, Math_RadToDeg(Math_Atan2F(boss->vwork[0].x - boss->obj.pos.x, boss->vwork[0].z - boss->obj.pos.z)), 0.5f, 1.5f, 0.0001f); - boss->vel.x = __sinf(boss->unk_078.y * M_DTOR) * boss->fwork[10]; - boss->vel.z = __cosf(boss->unk_078.y * M_DTOR) * boss->fwork[10]; + boss->vel.x = SIN_DEG(boss->unk_078.y) * boss->fwork[10]; + boss->vel.z = COS_DEG(boss->unk_078.y) * boss->fwork[10]; } for (i = 0; i < 10; i++) { if (boss->swork[i] != 0) { @@ -1192,7 +1192,7 @@ void Katina_801946C4(Boss* boss) { } } -s32 Katina_801965A8(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* data) { +bool Katina_801965A8(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* data) { Boss* boss = (Boss*) data; RCP_SetupDL(&gMasterDisp, 29); @@ -1499,9 +1499,9 @@ void Katina_80197290(Player* player) { player->unk_1D0 = 3; func_8001C8B8(0); if (D_ctx_80177930 != 0) { - AUDIO_PLAY_BGM(SEQ_ID_38); + AUDIO_PLAY_BGM(SEQ_ID_GOOD_END); } else { - AUDIO_PLAY_BGM(SEQ_ID_49); + AUDIO_PLAY_BGM(SEQ_ID_BAD_END); } D_ctx_80177A98 = 0; D_ctx_80177A48[1] = 0.0f; @@ -1661,9 +1661,9 @@ void Katina_80197290(Player* player) { Math_SmoothStepToF(&player->camAt.z, gCsCamAtZ, D_ctx_80177A48[0], 50000.0f, 0); } player->unk_088 += 10.0f; - player->unk_080 = -__sinf(player->unk_088 * M_DTOR) * 0.3f; + player->unk_080 = -SIN_DEG(player->unk_088) * 0.3f; player->unk_0F4 += 8.0f; - player->unk_0F0 = __sinf(player->unk_0F4 * M_DTOR); + player->unk_0F0 = SIN_DEG(player->unk_0F4); } void Katina_80197F10(Actor* actor) { @@ -1740,7 +1740,7 @@ void Katina_801981F8(Actor* actor) { actor_it->unk_0B6 = D_i4_8019F430[i]; if ((actor_it->unk_0B6 != 0) || (gBosses[1].state == 0)) { actor_it->obj.status = OBJ_ACTIVE; - actor_it->obj.id = OBJ_ACTOR_197; + actor_it->obj.id = OBJ_ACTOR_ALLRANGE; Matrix_RotateY(gCalcMatrix, actor->unk_04E * 18.0f * M_DTOR, 0); Matrix_MultVec3fNoTranslate(gCalcMatrix, &src, &dest); actor_it->obj.pos.x = dest.x; @@ -1748,7 +1748,7 @@ void Katina_801981F8(Actor* actor) { actor_it->obj.pos.z = dest.z; actor_it->unk_0F4.y = actor->unk_04E * 18.0f; actor_it->state = 1; - actor_it->aiType = i + 10; + actor_it->aiType = i + AI360_10; actor_it->aiIndex = D_i4_8019F444[i]; actor_it->unk_0F4.x = 3.0f; actor_it->health = 24; @@ -1758,7 +1758,7 @@ void Katina_801981F8(Actor* actor) { actor_it->iwork[11] = 1; actor_it->unk_0C9 = 1; if (D_i4_801A0540 < 9600) { - actor_it->unk_044 = 22; + actor_it->itemDrop = DROP_SILVER_RING_10p; } actor_it->timer_0C2 = 30; Object_SetInfo(&actor_it->info, actor_it->obj.id); @@ -1785,14 +1785,14 @@ void Katina_8019848C(void) { actor->obj.pos.x = 0; actor->obj.pos.y = 1000.0f; actor->state = 1; - actor->aiType = 9; - actor->aiIndex = 27; + actor->aiType = AI360_BILL; + actor->aiIndex = AI360_10 + 17; actor->unk_0B6 = 2; actor->health = 1000; actor->iwork[11] = 1; actor->unk_0C9 = 1; actor->timer_0C2 = 30; - actor->obj.id = OBJ_ACTOR_197; + actor->obj.id = OBJ_ACTOR_ALLRANGE; Object_SetInfo(&actor->info, actor->obj.id); actor->info.unk_1C = 0.0f; actor->info.bonus = 0; @@ -1819,7 +1819,7 @@ void Katina_80198594(Actor* actor) { D_360_8015F928 = 20000; gBosses[1].swork[16] = 5760; D_360_8015F920 = 1; - AUDIO_PLAY_BGM(SEQ_ID_29 | 0x8000); + AUDIO_PLAY_BGM(SEQ_ID_KA_BOSS | SEQ_FLAG); } Katina_8019848C(); @@ -1831,11 +1831,11 @@ void Katina_80198594(Actor* actor) { break; case 6: - gActors[1].aiIndex = 0; + gActors[1].aiIndex = AI360_FOX; gActors[1].state = 2; - gActors[2].aiIndex = 0; + gActors[2].aiIndex = AI360_FOX; gActors[2].state = 2; - gActors[3].aiIndex = 0; + gActors[3].aiIndex = AI360_FOX; gActors[3].state = 2; break; } @@ -1961,13 +1961,13 @@ void Katina_80198AA0(Actor* actor) { state = 1; xDist = fabsf(actor->fwork[4] - actor->obj.pos.x); yDist = fabsf(actor->fwork[6] - actor->obj.pos.z); - if (actor->aiIndex < 0) { + if (actor->aiIndex <= -1) { actor->state = 3; } else { - if (actor->aiType >= 10) { - xPos = __sinf(((actor->index * 45) + gGameFrameCount) * M_DTOR) * 200.0f; - yPos = __cosf(((actor->index * 45) + (gGameFrameCount * 2)) * M_DTOR) * 200.0f; - zPos = __sinf(((actor->index * 45) + gGameFrameCount) * M_DTOR) * 200.0f; + if (actor->aiType >= AI360_10) { + xPos = SIN_DEG((actor->index * 45) + gGameFrameCount) * 200.0f; + yPos = COS_DEG((actor->index * 45) + (gGameFrameCount * 2)) * 200.0f; + zPos = SIN_DEG((actor->index * 45) + gGameFrameCount) * 200.0f; } actor->fwork[4] = gActors[actor->aiIndex].obj.pos.x + xPos; actor->fwork[5] = gActors[actor->aiIndex].obj.pos.y + yPos; @@ -1977,7 +1977,7 @@ void Katina_80198AA0(Actor* actor) { actor->fwork[1] = 30.0f; } actor->fwork[3] = 1.4f; - if (actor->aiIndex >= 0) { + if (actor->aiIndex > -1) { if (yDist < 800.0f) { if (xDist < 800.0f) { actor->fwork[1] = gActors[actor->aiIndex].fwork[0] - 5.0f; @@ -1998,7 +1998,7 @@ void Katina_80198AA0(Actor* actor) { actor->iwork[4] = 0; } - if ((actor->aiIndex > 0) && + if ((actor->aiIndex >= AI360_FALCO) && ((gActors[actor->aiIndex].obj.status == 3) || (gActors[actor->aiIndex].state == 6) || gActors[actor->aiIndex].obj.status == OBJ_FREE)) { actor->state = 3; @@ -2031,17 +2031,17 @@ void Katina_80198AA0(Actor* actor) { actor->fwork[10] = 30.0f; } - if ((actor->aiIndex > 0) && (gActors[actor->aiIndex].obj.status == OBJ_ACTIVE)) { + if ((actor->aiIndex >= AI360_FALCO) && (gActors[actor->aiIndex].obj.status == OBJ_ACTIVE)) { actor->state = 2; - actor->iwork[2] = 0; + actor->iwork[2] = AI360_FOX; } break; } - xSin = __sinf(actor->obj.rot.x * M_DTOR); - xCos = __cosf(actor->obj.rot.x * M_DTOR); - ySin = __sinf(actor->obj.rot.y * M_DTOR); - yCos = __cosf(actor->obj.rot.y * M_DTOR); + xSin = SIN_DEG(actor->obj.rot.x); + xCos = COS_DEG(actor->obj.rot.x); + ySin = SIN_DEG(actor->obj.rot.y); + yCos = COS_DEG(actor->obj.rot.y); if (state != 0) { xRand = actor->fwork[4] - actor->obj.pos.x; @@ -2136,8 +2136,8 @@ void Katina_801995B4(Actor* actor) { } } - if ((actor->iwork[8] != 0) && (actor->aiType < 100)) { - angle = __sinf(actor->iwork[8] * 400.0f * M_DTOR) * actor->iwork[8]; + if ((actor->iwork[8] != 0) && (actor->aiType < AI360_GREAT_FOX)) { + angle = SIN_DEG(actor->iwork[8] * 400.0f) * actor->iwork[8]; Matrix_RotateY(gGfxMatrix, M_DTOR * angle, 1); Matrix_RotateX(gGfxMatrix, M_DTOR * angle, 1); Matrix_RotateZ(gGfxMatrix, M_DTOR * angle, 1); diff --git a/src/overlays/ovl_i4/fox_sz.c b/src/overlays/ovl_i4/fox_sz.c index 3e8cf8da..c588e9b3 100644 --- a/src/overlays/ovl_i4/fox_sz.c +++ b/src/overlays/ovl_i4/fox_sz.c @@ -30,7 +30,7 @@ void SectorZ_80199900(Actor* actor, s32 arg1) { PRINTF("time0 %d\n"); PRINTF("Demo_Time=%d\n"); - D_play_Timer_80161A60 = 8; + gScreenFlashTimer = 8; Object_Kill(&actor->obj, actor->sfxSource); func_effect_8007A6F0(&actor->obj.pos, 0x2903A060); @@ -138,7 +138,7 @@ void SectorZ_80199C60(Actor* missile) { if (xDist) {} if (zDist) {} - if (missile->aiType < 100) { + if (missile->aiType < AI360_GREAT_FOX) { xDist = SIN_DEG((missile->index * 45) + gGameFrameCount) * 5000.0f; zDist = COS_DEG((missile->index * 45) + (gGameFrameCount * 2)) * 5000.0f; } else { @@ -155,7 +155,7 @@ void SectorZ_80199C60(Actor* missile) { (fabsf(missile->fwork[MISSILE_TARGET_Y] - missile->obj.pos.y) < 800.0f)) && (fabsf(missile->fwork[MISSILE_TARGET_Z] - missile->obj.pos.z) < 800.0f)) { SectorZ_80199900(missile, 0); - D_ctx_80178480 = 25; + gCameraShake = 25; gBosses[0].dmgType = DMG_UNK_100; if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_3) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_5)) { gPlayer[0].state_1C8 = PLAYERSTATE_1C8_7; @@ -181,8 +181,8 @@ void SectorZ_80199C60(Actor* missile) { void SectorZ_80199FCC(Actor* actor, s32 arg1) { Actor_Initialize(actor); actor->obj.status = OBJ_INIT; - actor->obj.id = OBJ_ACTOR_197; - actor->aiType = 200; + actor->obj.id = OBJ_ACTOR_ALLRANGE; + actor->aiType = AI360_MISSILE; actor->obj.pos.x = D_i4_8019F4C0[arg1].x; actor->obj.pos.y = D_i4_8019F4C0[arg1].y; @@ -205,8 +205,8 @@ void SectorZ_80199FCC(Actor* actor, s32 arg1) { void SectorZ_8019A0F8(Actor* actor, s32 arg1) { Actor_Initialize(actor); actor->obj.status = OBJ_INIT; - actor->obj.id = OBJ_ACTOR_197; - actor->aiType = arg1 + 13; + actor->obj.id = OBJ_ACTOR_ALLRANGE; + actor->aiType = arg1 + AI360_10 + 3; actor->obj.pos.x = gActors[10].obj.pos.x + D_i4_8019F4E4[arg1].x; actor->obj.pos.y = gActors[10].obj.pos.y + D_i4_8019F4E4[arg1].y; @@ -226,14 +226,14 @@ void SectorZ_8019A1D0(void) { Actor_Initialize(actor); actor->obj.status = OBJ_ACTIVE; - actor->obj.id = OBJ_ACTOR_197; + actor->obj.id = OBJ_ACTOR_ALLRANGE; actor->obj.pos.x = 0.0f; actor->obj.pos.y = 4500.0f; actor->obj.pos.z = 30000.0f; - actor->aiType = 8; - actor->aiIndex = 12; + actor->aiType = AI360_KATT; + actor->aiIndex = AI360_10 + 2; actor->health = 10000; actor->unk_0F4.y = 180.0f; actor->state = 0; @@ -257,7 +257,7 @@ void SectorZ_8019A2F4(Actor* actor) { actor->state = 3; gPlayer[0].state_1C8 = PLAYERSTATE_1C8_0; - Audio_PlayFanfare(SEQ_ID_54, 20, 10, 10); + Audio_PlayFanfare(SEQ_ID_KATT, 20, 10, 10); func_360_8002EE34(); gPlayer[0].camEye.x = 250.0f; @@ -278,57 +278,57 @@ void SectorZ_8019A3E8(Actor* actor) { Actor* actorPtr; if (D_360_8015F928 >= 0) { - if (gTeamShields[1] > 0) { - if (gActors[1].iwork[2] == 0) { - if (gActors[10].obj.status == 2) { - if (gActors[1].aiIndex != 10) { + if (gTeamShields[AI360_FALCO] > 0) { + if (gActors[AI360_FALCO].iwork[2] == AI360_FOX) { + if (gActors[AI360_10].obj.status == 2) { + if (gActors[1].aiIndex != AI360_10) { Radio_PlayMessage(gMsg_ID_16040, RCID_FALCO); } - gActors[1].aiIndex = 10; + gActors[AI360_FALCO].aiIndex = AI360_10; } else { - gActors[1].aiIndex = 13; + gActors[AI360_FALCO].aiIndex = AI360_10 + 3; } } else { - gActors[1].aiIndex = -1; + gActors[AI360_FALCO].aiIndex = -1; } } - if (gTeamShields[3] > 0) { - if (gActors[3].iwork[2] == 0) { - if (gActors[12].obj.status == 2) { - if (gActors[3].aiIndex != 12) { + if (gTeamShields[AI360_PEPPY] > 0) { + if (gActors[AI360_PEPPY].iwork[2] == AI360_FOX) { + if (gActors[AI360_10 + 2].obj.status == 2) { + if (gActors[AI360_PEPPY].aiIndex != AI360_10 + 2) { Radio_PlayMessage(gMsg_ID_16046, RCID_PEPPY); } - gActors[3].aiIndex = 12; + gActors[AI360_PEPPY].aiIndex = AI360_10 + 2; } else { - gActors[3].aiIndex = 15; + gActors[AI360_PEPPY].aiIndex = AI360_10 + 5; } } else { - gActors[3].aiIndex = -1; + gActors[AI360_PEPPY].aiIndex = -1; } } if (D_i4_801A0564 != 0) { if (gActors[11].obj.status == 2) { - if (gActors[8].aiIndex != 11) { + if (gActors[8].aiIndex != AI360_10 + 1) { Radio_PlayMessage(gMsg_ID_16135, RCID_KATT); } - gActors[8].aiIndex = 11; + gActors[AI360_KATT].aiIndex = AI360_10 + 1; } else { - gActors[8].aiIndex = -1; + gActors[AI360_KATT].aiIndex = -1; } - } else if (gTeamShields[2] > 0) { - if (gActors[2].iwork[2] == 0) { + } else if (gTeamShields[AI360_SLIPPY] > 0) { + if (gActors[AI360_SLIPPY].iwork[2] == AI360_FOX) { if (gActors[11].obj.status == 2) { - if (gActors[2].aiIndex != 11) { + if (gActors[AI360_SLIPPY].aiIndex != AI360_10 + 1) { Radio_PlayMessage(gMsg_ID_16047, RCID_SLIPPY); } - gActors[2].aiIndex = 11; + gActors[AI360_SLIPPY].aiIndex = AI360_10 + 1; } else { - gActors[2].aiIndex = 14; + gActors[AI360_SLIPPY].aiIndex = AI360_10 + 4; } } else { - gActors[2].aiIndex = -1; + gActors[AI360_SLIPPY].aiIndex = -1; } } } @@ -349,7 +349,7 @@ void SectorZ_8019A3E8(Actor* actor) { if (actorPtr->obj.status == 0) { Actor_Initialize(actorPtr); actorPtr->obj.status = OBJ_ACTIVE; - actorPtr->obj.id = OBJ_ACTOR_197; + actorPtr->obj.id = OBJ_ACTOR_ALLRANGE; Matrix_RotateY(gCalcMatrix, (actor->unk_04E * 18.0f) * M_DTOR, 0); Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp40, &sp34); @@ -359,30 +359,30 @@ void SectorZ_8019A3E8(Actor* actor) { actorPtr->unk_0F4.y = actor->unk_04E * 18.0f; actorPtr->state = 3; - actorPtr->aiType = i + 13; + actorPtr->aiType = i + AI360_10 + 3; actorPtr->aiIndex = -1; if (D_360_8015F928 >= 0) { if (((i + 13) == 23) || ((i + 13) == 24)) { - actorPtr->aiIndex = 2; + actorPtr->aiIndex = AI360_SLIPPY; actorPtr->state = 2; } if ((i + 13) == 25) { - actorPtr->aiIndex = 0; + actorPtr->aiIndex = AI360_FOX; actorPtr->state = 2; } if (((i + 13) == 26) || ((i + 13) == 27)) { - actorPtr->aiIndex = 3; + actorPtr->aiIndex = AI360_PEPPY; actorPtr->state = 2; } if ((i + 13) == 28) { - actorPtr->aiIndex = 1; + actorPtr->aiIndex = AI360_FALCO; actorPtr->state = 2; } } actorPtr->health = 24; actorPtr->iwork[11] = 1; - actorPtr->unk_044 = 2; + actorPtr->itemDrop = DROP_SILVER_RING_50p; actorPtr->timer_0C2 = 30; Object_SetInfo(&actorPtr->info, actorPtr->obj.id); AUDIO_PLAY_SFX(0x31000011U, actorPtr->sfxSource, 4U); @@ -442,7 +442,7 @@ void SectorZ_8019A3E8(Actor* actor) { actor->timer_0BC = 10000; D_ctx_80178340 = D_ctx_80178358 = 255; D_ctx_80178348 = D_ctx_80178350 = D_ctx_80178354 = 0; - AUDIO_PLAY_BGM(SEQ_ID_31 | 0x8000); + AUDIO_PLAY_BGM(SEQ_ID_SZ_BOSS | SEQ_FLAG); break; } @@ -562,11 +562,11 @@ void SectorZ_8019AB8C(Actor* actor) { break; case 6: - gActors[1].aiIndex = 0; + gActors[1].aiIndex = AI360_FOX; gActors[1].state = 2; - gActors[2].aiIndex = 0; + gActors[2].aiIndex = AI360_FOX; gActors[2].state = 2; - gActors[3].aiIndex = 0; + gActors[3].aiIndex = AI360_FOX; gActors[3].state = 2; for (i = 10; i < ARRAY_COUNT(gActors); i++) { @@ -754,10 +754,10 @@ void SectorZ_8019B888(void) { if ((i <= 0) || (gTeamShields[i] > 0)) { Actor_Initialize(actor); actor->obj.status = OBJ_ACTIVE; - actor->obj.id = OBJ_ACTOR_197; + actor->obj.id = OBJ_ACTOR_ALLRANGE; Object_SetInfo(&actor->info, actor->obj.id); if (i == 0) { - actor->aiType = 1000; + actor->aiType = AI360_EVENT_HANDLER; } else { actor->obj.pos.x = gPlayer[0].pos.x + D_i4_8019F5EC[i].x; actor->obj.pos.y = gPlayer[0].pos.y + D_i4_8019F5EC[i].y; @@ -874,7 +874,7 @@ void SectorZ_8019BA64(Player* player) { player->pos.y = actor->obj.pos.y - 480.0f; player->pos.z = actor->obj.pos.z; - AUDIO_PLAY_BGM(SEQ_ID_51); + AUDIO_PLAY_BGM(SEQ_ID_INTRO_51); } break; @@ -927,12 +927,12 @@ void SectorZ_8019BA64(Player* player) { SectorZ_8019B888(); } - if (gCsFrameCount == 0x334) { + if (gCsFrameCount == 820) { Audio_KillSfxById(0x49000014U); player->state_1C8 = PLAYERSTATE_1C8_3; player->unk_01C = player->unk_018 = player->unk_014 = 0.f; - AUDIO_PLAY_BGM(D_ctx_80177C90); - D_ctx_80177838 = 0x32; + AUDIO_PLAY_BGM(gBgmSeqId); + D_ctx_80177838 = 50; } break; } @@ -1203,7 +1203,7 @@ void SectorZ_8019C85C(Player* player) { Math_SmoothStepToF(&boss0->fwork[3], 0.7f, 1.0f, 0.7f, 0.0f); if ((gCsFrameCount == 100) && gGreatFoxIntact) { - AUDIO_PLAY_BGM(SEQ_ID_38); + AUDIO_PLAY_BGM(SEQ_ID_GOOD_END); } if ((gCsFrameCount == 210) && gGreatFoxIntact) { @@ -1216,7 +1216,7 @@ void SectorZ_8019C85C(Player* player) { } gCsCamAtX = boss0->obj.pos.x; - gCsCamAtY = boss0->obj.pos.y + (2.0f * D_ctx_8017847C); + gCsCamAtY = boss0->obj.pos.y + (2.0f * gCameraShakeY); gCsCamAtZ = boss0->obj.pos.z; if (player->timer_1F8 == 0) { @@ -1486,7 +1486,7 @@ void SectorZ_8019C85C(Player* player) { if (gGreatFoxIntact) { D_ctx_80177930 = 1; } else { - AUDIO_PLAY_BGM(SEQ_ID_49); + AUDIO_PLAY_BGM(SEQ_ID_BAD_END); D_ctx_80177930 = 0; } break; @@ -1796,7 +1796,7 @@ void SectorZ_8019EA68(void) { D_ctx_80178310 = SEGMENTED_TO_VIRTUAL(D_enmy_800CFDA0[gCurrentLevel]); - Rand_SetSeed(1, 0x7148, 0x2694); + Rand_SetSeed(1, 29000, 9876); for (obj58 = gObjects58, i = 0; i < 1000; i++) { if (D_ctx_80178310[i].id < 0) { @@ -1832,7 +1832,7 @@ void SectorZ_8019EA68(void) { actor->unk_0F4.x = RAND_FLOAT_CENTERED(4.0f); actor->unk_0F4.y = RAND_FLOAT_CENTERED(4.0f); Object_SetInfo(&actor->info, actor->obj.id); - actor->unk_044 = 1; + actor->itemDrop = DROP_SILVER_RING; if (j++ >= 60) { break; diff --git a/src/overlays/ovl_i5/fox_ground.c b/src/overlays/ovl_i5/fox_ground.c index 21a01a23..cc5b9007 100644 --- a/src/overlays/ovl_i5/fox_ground.c +++ b/src/overlays/ovl_i5/fox_ground.c @@ -1,5 +1,6 @@ #include "global.h" #include "assets/ast_titania.h" +#include "prevent_bss_reordering.h" void Ground_801B5244(s32 arg0, s32 arg1); void Ground_801B5FE0(s32 arg0, s32 arg1, s32 arg2); diff --git a/src/overlays/ovl_i5/fox_ma.c b/src/overlays/ovl_i5/fox_ma.c index 615b3339..825d5091 100644 --- a/src/overlays/ovl_i5/fox_ma.c +++ b/src/overlays/ovl_i5/fox_ma.c @@ -500,10 +500,10 @@ void Macbeth_8019A2F4(Actor* actor) { } } if (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_7) { - if (var_fa1 < (gPlayer[0].unk_138 - actor->obj.pos.z - (D_i5_801BA1E4 * 0x588 - 0x588))) { + if (var_fa1 < (gPlayer[0].unk_138 - actor->obj.pos.z - (D_i5_801BA1E4 * 1416 - 1416))) { Math_SmoothStepToF(&D_i5_801BA1DC, -6.0f, 0.1f, 0.2f, 0.01f); } - if ((gPlayer[0].unk_138 - actor->obj.pos.z - (D_i5_801BA1E4 * 0x588 - 0x588)) < var_ft4) { + if ((gPlayer[0].unk_138 - actor->obj.pos.z - (D_i5_801BA1E4 * 1416 - 1416)) < var_ft4) { Math_SmoothStepToF(&D_i5_801BA1DC, -30.0f, 0.1f, 0.2f, 0.01f); } if ((D_i5_801BA1E4 < 5) && (gPlayer[0].unk_138 - actor->obj.pos.z > 4000.0f)) { @@ -849,7 +849,7 @@ void Macbeth_8019C778(Actor* actor) { Macbeth_8019AF34(actor); actor->health = 0; actor->timer_0BC = 200; - D_ctx_80178480 = 30; + gCameraShake = 30; actor->state++; break; case 5: @@ -867,7 +867,7 @@ void Macbeth_8019C778(Actor* actor) { func_effect_8007A568(actor->obj.pos.x + actor->fwork[25], actor->obj.pos.y, actor->obj.pos.z, 40.0f); Macbeth_8019C6C4(actor); actor->vel.z = 0.0f; - D_ctx_80178480 = 25; + gCameraShake = 25; } if (actor->timer_0BC == 100) { Object_Kill(&actor->obj, actor->sfxSource); @@ -1149,7 +1149,7 @@ void Macbeth_8019D910(Actor* actor, s32* arg1, s32* arg2, s32 arg3, f32 arg4, f3 AUDIO_PLAY_SFX(0x29034003, actor->sfxSource, 4); actor->unk_0D0 = 0; func_effect_8007C120(actor->obj.pos.x + arg4, actor->obj.pos.y + 200.0f, actor->obj.pos.z + arg5, - actor->vel.x, actor->vel.y, actor->vel.z, 0.15f, 0x14); + actor->vel.x, actor->vel.y, actor->vel.z, 0.15f, 20); actor->iwork[arg3 + 6] = 20; *arg2 -= actor->damage; if ((*arg2 <= 0) || @@ -1423,7 +1423,7 @@ void Macbeth_8019EE68(Actor* actor) { D_MA_801BE2F0[3] = actor->iwork[5]; } D_ctx_80178348 = D_ctx_80178350 = D_ctx_80178354 = D_ctx_80178340 = 255; - D_ctx_80178480 = 35; + gCameraShake = 35; if ((gPlayer[0].unk_138 - actor->obj.pos.z > -200.0f) && (gPlayer[0].unk_138 - actor->obj.pos.z < 200.0f) && (gPlayer[0].pos.y - actor->obj.pos.y > -300.0f) && (gPlayer[0].pos.y - actor->obj.pos.y < 300.0f) && (gPlayer[0].pos.x - actor->obj.pos.x > -800.0f) && (gPlayer[0].pos.x - actor->obj.pos.x < 800.0f)) { @@ -1437,7 +1437,7 @@ void Macbeth_8019EE68(Actor* actor) { actor->state = 2; break; case 2: - if (D_ctx_80178480 == 20) { + if (gCameraShake == 20) { D_MA_801BE2F0[1] = actor->iwork[5]; } Macbeth_8019BBEC(actor); @@ -1447,7 +1447,7 @@ void Macbeth_8019EE68(Actor* actor) { Math_SmoothStepToF(&actor->vel.z, 0.0f, 0.02f, 10.0f, 0.01f); Macbeth_801A015C(actor); Macbeth_8019A87C(actor); - if (D_ctx_80178480 == 20) { + if (gCameraShake == 20) { actor->unk_0D0 = 0; actor->timer_0BC = 20; Macbeth_8019BE50(actor); @@ -3118,7 +3118,7 @@ s32 Macbeth_801A55D4(s32 arg0, Vec3f* arg1, Vec3f* arg2, s32 arg3) { s32 i; obj80 = &gObjects80[0]; - for (i = 0; i < 50; i++, obj80++) { + for (i = 0; i < ARRAY_COUNT(gObjects80); i++, obj80++) { if ((obj80->obj.status == OBJ_ACTIVE) && (obj80->obj.id != OBJ_80_68) && (fabsf(arg1->x - obj80->obj.pos.x) < 2000.0f) && (fabsf(arg1->z - obj80->obj.pos.z) < 2000.0f) && (func_enmy_80062DBC(arg1, obj80->info.hitbox, &obj80->obj, 0.0f, 0.0f, 0.0f) != 0)) { @@ -3127,7 +3127,7 @@ s32 Macbeth_801A55D4(s32 arg0, Vec3f* arg1, Vec3f* arg2, s32 arg3) { } actor = &gActors[0]; - for (i = 0; i < 60; i++, actor++) { + for (i = 0; i < ARRAY_COUNT(gActors); i++, actor++) { if ((actor->obj.status >= OBJ_ACTIVE) && (fabsf(arg1->x - actor->obj.pos.x) < 1000.0f) && (fabsf(arg1->z - actor->obj.pos.z) < 1500.0f) && (arg0 != i) && (actor->info.unk_16 != 2) && (actor->timer_0C2 == 0) && (func_enmy_800631A8(arg1, actor->info.hitbox, &actor->obj.pos) != 0)) { @@ -3185,7 +3185,7 @@ void Macbeth_801A57D0(Effect* effect) { if (effect->obj.pos.y < gGroundLevel) { Macbeth_801ADCEC(effect->obj.pos.x, effect->obj.pos.y, effect->obj.pos.z, 999.9f, -10.0f, 5.0f); Object_Kill(&effect->obj, effect->sfxSource); - if (D_80161A88 != 2) { + if (D_ctx_80161A88 != 2) { effect->obj.pos.y = gGroundLevel; } } @@ -3791,7 +3791,7 @@ void Macbeth_801A7E7C(Actor* actor) { Macbeth_8019A830(actor); Macbeth_8019A728(actor); if (actor->iwork[1] != 0) { - AUDIO_PLAY_BGM(SEQ_ID_32 | 0x8000); + AUDIO_PLAY_BGM(SEQ_ID_MA_BOSS | SEQ_FLAG); actor->state = 1; } Macbeth_801A6984(actor); @@ -4988,7 +4988,7 @@ void Macbeth_801AC754(Player* player) { } break; case 3: - AUDIO_PLAY_BGM(SEQ_ID_16 | 0x8000); + AUDIO_PLAY_BGM(SEQ_ID_MACBETH | SEQ_FLAG); D_ctx_80177838 = 50; player->state_1C8 = PLAYERSTATE_1C8_3; player->unk_1D0 = player->timer_1F8 = player->timer_1FC = player->unk_240 = 0; @@ -5416,7 +5416,7 @@ void Macbeth_801AE4CC(Actor* actor, f32 xPos, f32 yPos, f32 zPos, f32 arg4, f32 actor->obj.pos.y = yPos; actor->obj.pos.z = zPos; actor->vel.y = yVel; - actor->iwork[0] = 0xFF; + actor->iwork[0] = 255; actor->fwork[1] = arg6; actor->fwork[2] = 0.2f; actor->timer_0BC = 0; @@ -5732,7 +5732,7 @@ void Macbeth_801AF628(Actor* actor, s32 arg1) { actor->unk_0B6 = 37; actor->obj.rot.y = D_i5_801BA84C[arg1]; actor->iwork[4] = actor->iwork[5] = 192; - actor->iwork[0] = actor->iwork[1] = actor->iwork[2] = actor->iwork[7] = actor->iwork[3] = 0xFF; + actor->iwork[0] = actor->iwork[1] = actor->iwork[2] = actor->iwork[7] = actor->iwork[3] = 255; actor->iwork[6] = 128; Object_SetInfo(&actor->info, actor->obj.id); } @@ -5806,7 +5806,7 @@ void Macbeth_801AF8F4(Player* player) { D_ctx_80177A48[4] = -60.0f; D_ctx_80177A48[5] = 240.0f; player->unk_0D4 = 3.0f; - D_ctx_8017847C = player->vel.x = player->vel.y = player->vel.z = player->unk_0D0 = 0.0f; + gCameraShakeY = player->vel.x = player->vel.y = player->vel.z = player->unk_0D0 = 0.0f; if (player->shields <= 0) { player->shields = 1; } @@ -5860,7 +5860,7 @@ void Macbeth_801AF8F4(Player* player) { player->pos.y = -3.0f; player->pos.z = player->unk_138 = -111130.0f; player->unk_144 = D_ctx_80177D20 = 115930.0f; - player->unk_228 = 16; + player->flags_228 = 0x10; D_enmy_80161680 = 330; D_i5_801BA1DC = 0.0f; gActors[D_i5_801BE314].obj.pos.x = -431.0f; @@ -6042,7 +6042,7 @@ void Macbeth_801AF8F4(Player* player) { D_i5_801BA1DC = 0.0f; D_80137E84[0] = 1; D_Timer_80177BD0[0] = 10; - D_ctx_80178480 = 10; + gCameraShake = 10; D_ctx_80177A48[4] = -70.0f; D_ctx_80177A48[5] = 280.0f; } @@ -6158,7 +6158,7 @@ void Macbeth_801AF8F4(Player* player) { Macbeth_801AF70C(RAND_FLOAT_CENTERED(650.0f) + 11250.0f, 300.0f, RAND_FLOAT(650.0f) + -139000.0f, 0.7f); } - D_ctx_80178480 = 30; + gCameraShake = 30; } if (gCsFrameCount == 860) { func_effect_8007D9DC(gActors[D_i5_801BE314].obj.pos.x + 1000.0f, @@ -6292,12 +6292,12 @@ void Macbeth_801AF8F4(Player* player) { case 835: case 845: case 860: - D_ctx_80178480 = 20; + gCameraShake = 20; D_ctx_80177A48[4] = -90.0f; D_ctx_80177A48[5] = 360.0f; break; case 910: - AUDIO_PLAY_BGM(SEQ_ID_38); + AUDIO_PLAY_BGM(SEQ_ID_GOOD_END); break; case 1040: Radio_PlayMessage(gMsg_ID_20010, RCID_FOX); @@ -6430,7 +6430,7 @@ void Macbeth_801AF8F4(Player* player) { Math_SmoothStepToF(&player->camAt.z, gCsCamAtZ, D_ctx_80177A48[0], 20000.0f, 0); player->camAt.y += zeroVar; if (player->unk_1D0 >= 6) { - player->camEye.y += D_ctx_8017847C * 10.0f; + player->camEye.y += gCameraShakeY * 10.0f; } if (gCsFrameCount > 2500) { D_ctx_80178348 = D_ctx_80178350 = D_ctx_80178354 = 0; @@ -6887,7 +6887,7 @@ void Macbeth_801B3D04(Player* player) { D_ctx_80177830 = 0; break; case 50: - AUDIO_PLAY_BGM(SEQ_ID_38); + AUDIO_PLAY_BGM(SEQ_ID_GOOD_END); break; case 100: D_ctx_80177840 = 100; diff --git a/src/overlays/ovl_i5/fox_ti.c b/src/overlays/ovl_i5/fox_ti.c index ff5d3d20..350a3ce5 100644 --- a/src/overlays/ovl_i5/fox_ti.c +++ b/src/overlays/ovl_i5/fox_ti.c @@ -310,9 +310,9 @@ void Titania_801895B8(Actor* actor) { if (actor->unk_0D0 > 0) { if (Rand_ZeroOne() <= 0.25f) { - actor->unk_044 = 2; + actor->itemDrop = DROP_SILVER_RING_50p; } else { - actor->unk_044 = 0; + actor->itemDrop = DROP_NONE; } func_enmy_80066254(actor); actor->info.bonus = 0; @@ -364,7 +364,7 @@ void Titania_80189CC8(Actor* actor) { if (actor->health <= 0) { actor->health = 0; AUDIO_PLAY_SFX(0x2903A008, actor->sfxSource, 4); - actor->timer_0CA[0] = actor->unk_044 = 0; + actor->timer_0CA[0] = actor->itemDrop = 0; actor->info.unk_1C = 0.0f; func_enmy_80066254(actor); actor->info.bonus = 0; @@ -510,19 +510,19 @@ void Titania_8018A544(Actor* actor) { if ((Actor*) actor->iwork[0] != NULL) { ((Actor*) actor->iwork[0])->iwork[actor->iwork[1]] = 0; } - func_effect_8007A900(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 8.0f, 0xFF, 8, 1); + func_effect_8007A900(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 8.0f, 255, 8, 1); if (Rand_ZeroOne() < 0.3f) { - actor->unk_044 = 1; + actor->itemDrop = DROP_SILVER_RING; } else { Titania_8018A474(actor); - actor->unk_044 = 0; + actor->itemDrop = DROP_NONE; } func_enmy_80066254(actor); actor->info.bonus = 0; } Object_Kill(&actor->obj, actor->sfxSource); } else { - func_effect_8007A900(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 8.0f, 0xFF, 8, 1); + func_effect_8007A900(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 8.0f, 255, 8, 1); Object_Kill(&actor->obj, actor->sfxSource); if ((Actor*) actor->iwork[0] != NULL) { @@ -633,7 +633,7 @@ void Titania_8018AB44(Actor* actor) { break; case 2: - actor->unk_044 = 0; + actor->itemDrop = DROP_NONE; func_enmy_80066254(actor); actor->info.bonus = 0; func_effect_8007D2C8(actor->obj.pos.x, actor->obj.pos.y + 10.0f, actor->obj.pos.z, 6.0f); @@ -782,7 +782,7 @@ void Titania_8018B268(Actor* actor) { if (actor->health > 0) { actor->health -= actor->damage; if (actor->health <= 0) { - actor->health = actor->unk_044 = 0; + actor->health = actor->itemDrop = 0; func_enmy_80066254(actor); actor->info.bonus = 0; } @@ -928,7 +928,7 @@ void Titania_8018B720(Actor* actor) { Object_Kill(&actor->obj, actor->sfxSource); } -void Titania_8018B96C(Actor* actor) { +void Titania_Actor231_Init(Actor* actor) { f32 sp24; Ground_801B6E20(actor->obj.pos.x, actor->obj.pos.z + D_ctx_80177D20, &sp24, &actor->obj.pos.y, &sp24); @@ -996,7 +996,7 @@ void Titania_8018B9D0(Actor* actor) { actor->fwork[1] = sp4C; actor->fwork[2] = sp48; if (actor->vel.y <= 0.0f) { - actor->unk_044 = 0; + actor->itemDrop = DROP_NONE; func_enmy_80066254(actor); func_effect_8007A6F0(&actor->obj.pos, 0x2903B009); func_effect_8007D2C8(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 10.0f); @@ -1315,7 +1315,7 @@ void Titania_8018C8A8(Actor* actor) { if (actor->health <= 0) { BonusText_Display(actor->obj.pos.x, actor->obj.pos.y, actor->fwork[27] + actor->obj.pos.z, 3); gHitCount += 3; - actor->health = actor->unk_044 = 0; + actor->health = actor->itemDrop = 0; func_enmy_80066254(actor); actor->info.bonus = 0; actor->timer_0BC = 20; @@ -1369,11 +1369,11 @@ void Titania_8018C8A8(Actor* actor) { x = actor->obj.pos.x + actor->fwork[6]; y = actor->obj.pos.y + actor->fwork[7] + actor->fwork[26]; z = actor->obj.pos.z + actor->fwork[8]; - func_effect_8007A900(x, y, z, 20.0f, 0xFF, 8, 0); + func_effect_8007A900(x, y, z, 20.0f, 255, 8, 0); x = actor->obj.pos.x + actor->fwork[3]; y = actor->obj.pos.y + actor->fwork[4] + actor->fwork[26]; z = actor->obj.pos.z + actor->fwork[5]; - func_effect_8007A900(x, y, z, 20.0f, 0xFF, 8, 0); + func_effect_8007A900(x, y, z, 20.0f, 255, 8, 0); sp88 = fabsf(sp88); if (sp88 < 5000.0f) { actor->iwork[4] = (s32) (sp88 / 200.0f); @@ -1457,7 +1457,7 @@ void Titania_8018C8A8(Actor* actor) { Math_SmoothStepToAngle(&actor->obj.rot.z, sp98 * M_RTOD, 0.1f, 1.0f, 0.01f); if (actor->timer_0BC == 0) { - if (((actor->unk_0B6 == 0x28) || (actor->unk_0B6 == 0x50)) && (actor->timer_0BC == 0)) { + if (((actor->unk_0B6 == 40) || (actor->unk_0B6 == 80)) && (actor->timer_0BC == 0)) { AUDIO_PLAY_SFX(0x2902201F, actor->sfxSource, 4); } Math_SmoothStepToF(&actor->fwork[15], 1.0f, 0.7f, 0.1f, 0.01f); @@ -1537,23 +1537,23 @@ void Titania_8018C8A8(Actor* actor) { Animation_DrawSkeleton(0, D_TI1_7006990, actor->vwork, Titania_8018C118, Titania_8018C3D8, actor, &gIdentityMatrix); actor->vwork[0].y = temp_fs0; - if (actor->unk_0B6 == 0x15) { + if (actor->unk_0B6 == 21) { Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, 0); Matrix_RotateX(gCalcMatrix, actor->obj.rot.x * M_DTOR, 1); Matrix_RotateZ(gCalcMatrix, actor->obj.rot.z * M_DTOR, 1); Matrix_MultVec3f(gCalcMatrix, (Vec3f*) &actor->fwork[12], &sp158); func_effect_8007A900(actor->obj.pos.x + sp158.x, actor->obj.pos.y + sp158.y, actor->obj.pos.z + sp158.z, - 20.0f, 0xFF, 8, 0); + 20.0f, 255, 8, 0); Matrix_MultVec3f(gCalcMatrix, (Vec3f*) &actor->fwork[9], &sp158); func_effect_8007A900(actor->obj.pos.x + sp158.x, actor->obj.pos.y + sp158.y, actor->obj.pos.z + sp158.z, - 20.0f, 0xFF, 8, 0); + 20.0f, 255, 8, 0); Matrix_MultVec3f(gCalcMatrix, (Vec3f*) &actor->fwork[3], &sp158); func_effect_8007A900(actor->obj.pos.x + sp158.x, actor->obj.pos.y + sp158.y, actor->obj.pos.z + sp158.z, - 20.0f, 0xFF, 8, 0); + 20.0f, 255, 8, 0); Matrix_MultVec3f(gCalcMatrix, (Vec3f*) &actor->fwork[6], &sp158); func_effect_8007A900(actor->obj.pos.x + sp158.x, actor->obj.pos.y + sp158.y, actor->obj.pos.z + sp158.z, - 20.0f, 0xFF, 8, 0); + 20.0f, 255, 8, 0); AUDIO_PLAY_SFX(0x19030003, actor->sfxSource, 4); } @@ -1594,7 +1594,7 @@ void Titania_8018C8A8(Actor* actor) { D_i5_801BD738[actor->iwork[0]][i].unk_18 |= 1; } AUDIO_PLAY_SFX(0x2940C00A, actor->sfxSource, 4); - D_ctx_80178480 = 20; + gCameraShake = 20; D_Timer_80177BD0[0] = 16; Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, 0); Matrix_RotateX(gCalcMatrix, actor->obj.rot.x * M_DTOR, 1); @@ -1603,9 +1603,9 @@ void Titania_8018C8A8(Actor* actor) { 15.0f); var_s1 = D_i5_801BD738[actor->iwork[0]]; for (i = 0; i < 9U; i++, var_s1++) { - actorPtr = func_game_800A3608(0xBD); + actorPtr = func_game_800A3608(OBJ_ACTOR_189); if ((actorPtr != NULL) && ((s16(*)[2]) D_i5_801B7630)[i][1] == 1) { - actorPtr->state = 0x2F; + actorPtr->state = 47; actorPtr->unk_048 = i; Matrix_MultVec3f(gCalcMatrix, &var_s1->unk_00.pos, &sp158); actorPtr->obj.pos.x = actor->obj.pos.x + sp158.x; @@ -1639,9 +1639,9 @@ void Titania_8018C8A8(Actor* actor) { } if (i == 8) { - actorPtr = func_game_800A3608(0xBD); + actorPtr = func_game_800A3608(OBJ_ACTOR_189); if (actorPtr != NULL) { - actorPtr->state = 0x2F; + actorPtr->state = 47; actorPtr->unk_048 = 9; Matrix_MultVec3f(gCalcMatrix, &var_s1->unk_00.pos, &sp158); actorPtr->obj.pos.x = actor->obj.pos.x + sp158.x; @@ -1668,7 +1668,7 @@ void Titania_8018C8A8(Actor* actor) { case 4: D_ctx_80178348 = D_ctx_80178350 = D_ctx_80178354 = D_ctx_80178340 = 255; D_ctx_80178358 = 0; - D_ctx_8017835C = 0x40; + D_ctx_8017835C = 64; break; case 5: @@ -1835,7 +1835,7 @@ void Titania_8018E5F8(Actor* actor) { } if (actor->timer_0BE == 0) { func_effect_8007D0E0(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 10.0f); - actor->timer_0BE = 0xA; + actor->timer_0BE = 10; } Ground_801B6E20(actor->obj.pos.x, actor->obj.pos.z + D_ctx_80177D20, &sp80, &sp7C, &sp80); if (actor->obj.pos.y < (94.0f + sp7C)) { @@ -1879,13 +1879,13 @@ void Titania_8018E5F8(Actor* actor) { actor->fwork[5] = sp84.z; if (actor->unk_0D0 > 0) { actor->unk_0D0 = 0; - actor->timer_0C6 = 0xA; + actor->timer_0C6 = 10; if (actor->health > 0) { actor->health -= actor->damage; if (actor->health <= 0) { BonusText_Display(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z + actor->fwork[27], 2); gHitCount += 2; - actor->timer_0CA[0] = actor->health = actor->unk_044 = 0; + actor->timer_0CA[0] = actor->health = actor->itemDrop = 0; actor->info.unk_1C = 0.0f; func_enmy_80066254(actor); actor->info.bonus = 0; @@ -1924,28 +1924,28 @@ void Titania_8018E5F8(Actor* actor) { if (actor->iwork[2] == 0) { index = actor->iwork[3] - 1; - gTexturedLines[index].mode = 0x65; + gTexturedLines[index].mode = 101; gTexturedLines[index].unk_04.x = actor->obj.pos.x + actor->fwork[0]; gTexturedLines[index].unk_04.y = actor->obj.pos.y + actor->fwork[1]; gTexturedLines[index].unk_04.z = actor->obj.pos.z + actor->fwork[2]; - gTexturedLines[index].unk_2C = 0xFF; - gTexturedLines[index].unk_2D = 0xFF; + gTexturedLines[index].unk_2C = 255; + gTexturedLines[index].unk_2D = 255; gTexturedLines[index].unk_2E = 0; - gTexturedLines[index].unk_2F = 0xFF; + gTexturedLines[index].unk_2F = 255; gTexturedLines[index].unk_10.x = sp5C; gTexturedLines[index].unk_10.y = sp70; gTexturedLines[index].unk_10.z = sp54; gTexturedLines[index].unk_28 = 3.0f; if (actor->timer_0C0 == 0) { - gTexturedLines[index].unk_2C = 0xFF; - gTexturedLines[index].unk_2D = 0xFF; - gTexturedLines[index].unk_2E = 0x40; + gTexturedLines[index].unk_2C = 255; + gTexturedLines[index].unk_2D = 255; + gTexturedLines[index].unk_2E = 64; } else { - gTexturedLines[index].unk_2C = 0xFF; - gTexturedLines[index].unk_2D = 0x64; + gTexturedLines[index].unk_2C = 255; + gTexturedLines[index].unk_2D = 100; gTexturedLines[index].unk_2E = 0; } - if (i < 0xBB9) { + if (i <= 3000) { if (actor->timer_0C0 == 0) { func_effect_8007D1E0(sp5C, sp70 + 5.0f, sp54, 2.0f); } @@ -2045,7 +2045,7 @@ void Titania_8018F134(Object_80* obj80) { for (*j = -80.0f; *j <= 80.0f; *j += 40.0f) { Matrix_MultVec3fNoTranslate(gCalcMatrix, &D_i5_801B7690, &sp70); func_effect_8007A900(obj80->obj.pos.x + sp70.x, obj80->obj.pos.y + sp70.y, - obj80->obj.pos.z + sp70.z, 10.0f, 0xFF, 15, 0); + obj80->obj.pos.z + sp70.z, 10.0f, 255, 15, 0); } } else { sp7C.z = 0.0f; @@ -2060,7 +2060,7 @@ void Titania_8018F134(Object_80* obj80) { sp7C.y = i; Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp7C, &sp70); func_effect_8007A900(obj80->obj.pos.x + sp70.x, obj80->obj.pos.y + sp70.y, - obj80->obj.pos.z + sp70.z, 10.0f, 0xFF, 15, 0); + obj80->obj.pos.z + sp70.z, 10.0f, 255, 15, 0); } } break; @@ -2072,7 +2072,7 @@ void Titania_8018F134(Object_80* obj80) { sp7C.y = i; Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp7C, &sp70); func_effect_8007A900(obj80->obj.pos.x + sp70.x, obj80->obj.pos.y + sp70.y, obj80->obj.pos.z + sp70.z, - 10.0f, 0xFF, 15, 0); + 10.0f, 255, 15, 0); } break; } @@ -2103,7 +2103,7 @@ void Titania_8018F4D8(Object_80* obj80) { obj80->obj.rot.x = 90.0f; obj80->state++; D_Timer_80177BD0[0] = 7; - D_ctx_80178480 = 12; + gCameraShake = 12; Titania_8018F134(obj80); AUDIO_PLAY_SFX(0x19130003, obj80->sfxSource, 4); } @@ -2113,7 +2113,7 @@ void Titania_8018F4D8(Object_80* obj80) { if (obj80->obj.rot.z >= 90.0f) { obj80->obj.rot.z = 90.0f; D_Timer_80177BD0[0] = 7; - D_ctx_80178480 = 12; + gCameraShake = 12; Titania_8018F134(obj80); AUDIO_PLAY_SFX(0x19130003, obj80->sfxSource, 4); obj80->state++; @@ -2124,7 +2124,7 @@ void Titania_8018F4D8(Object_80* obj80) { if (obj80->obj.rot.z <= -90.0f) { obj80->obj.rot.z = -90.0f; D_Timer_80177BD0[0] = 7; - D_ctx_80178480 = 12; + gCameraShake = 12; Titania_8018F134(obj80); AUDIO_PLAY_SFX(0x19130003, obj80->sfxSource, 4); obj80->state++; @@ -2179,7 +2179,7 @@ void Titania_8018F8B8(Object_80* obj80) { } } -void Titania_8018FA48(Boss* boss) { +void Titania_Boss306_Init(Boss* boss) { s32 pad[2]; f32* sp1C; s32 i; @@ -2663,24 +2663,24 @@ bool Titania_80190A08(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* rot->y += boss->fwork[0x31]; } - for (i = 0; i < 0x43; i++) { + for (i = 0; i < ARRAY_COUNT(D_i5_801B7770); i++) { if (limbIndex == D_i5_801B7770[i][0]) { if (D_i5_801BBF00[i].unk_26 & 4) { *dList = NULL; } else { switch (limbIndex) { - case 0x7: - case 0x8: - case 0x9: + case 7: + case 8: + case 9: rot->z += D_i5_801BBEF4[8]; break; - case 0x16: - case 0x17: - case 0x18: + case 22: + case 23: + case 24: rot->z += D_i5_801BBEF4[6]; break; - case 0x19: - case 0x1A: + case 25: + case 26: if (D_i5_801BBEF4[2] != 0.0f) { rot->z += D_i5_801BBEF4[2]; if (D_i5_801BBEF4[3] != 0.0f) { @@ -2689,23 +2689,23 @@ bool Titania_80190A08(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* } } break; - case 0x59: + case 89: rot->x += D_i5_801BBEF4[13]; break; } sp88 = 0; switch (limbIndex) { - case 0x37: + case 55: if (boss->fwork[0x28] != 0.0f) { sp88 = 1; } break; - case 0x3D: + case 61: if (boss->fwork[39] != 0.0f) { sp88 = 2; } break; - case 0x47: + case 71: if (boss->fwork[38] != 0.0f) { sp88 = 3; } @@ -2762,7 +2762,7 @@ bool Titania_80190A08(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* Matrix_GetYRPAngles(gCalcMatrix, &sp8C); Matrix_MultVec3f(gCalcMatrix, &D_tank_800C9F2C, &sp7C); - if ((limbIndex == 0x47) && (boss->fwork[0x2E] != 0.0f)) { + if ((limbIndex == 71) && (boss->fwork[0x2E] != 0.0f)) { sp70.x = (gPlayer[0].pos.x - (boss->obj.pos.x + sp7C.x)) * boss->fwork[0x2E]; sp70.y = (gPlayer[0].pos.y + 50.0f) - (boss->obj.pos.y + sp7C.y); sp70.z = (gPlayer[0].unk_138 - (boss->obj.pos.z + sp7C.z)) * boss->fwork[0x2E]; @@ -2784,7 +2784,7 @@ bool Titania_80190A08(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* Matrix_RotateX(gCalcMatrix, -(spCC.x * M_DTOR), 1); Matrix_RotateY(gCalcMatrix, -(spCC.y * M_DTOR), 1); switch (limbIndex) { - case 0x37: + case 55: if (D_i5_801BBEF0[15] == 1) { D_i5_801BBEF4[20] = 0.0f; D_i5_801BBEF4[21] = sp5C.y - 90.0f; @@ -2800,7 +2800,7 @@ bool Titania_80190A08(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* Math_SmoothStepToAngle(&sp8C.y, D_i5_801BBEF4[21], boss->fwork[0x28], 360.0f, 0.01f); Math_SmoothStepToAngle(&sp8C.z, D_i5_801BBEF4[22], boss->fwork[0x28], 360.0f, 0.01f); break; - case 0x3D: + case 61: if (D_i5_801BBEF0[14] == 1) { D_i5_801BBEF4[17] = 0.0f; D_i5_801BBEF4[18] = sp5C.y - 90.0f; @@ -2814,7 +2814,7 @@ bool Titania_80190A08(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* Math_SmoothStepToAngle(&sp8C.y, D_i5_801BBEF4[18], boss->fwork[39], 360.0f, 0.01f); Math_SmoothStepToAngle(&sp8C.z, D_i5_801BBEF4[19], boss->fwork[39], 360.0f, 0.01f); break; - case 0x47: + case 71: if (D_i5_801BBEF0[13] == 1) { D_i5_801BBEF4[14] = 0.0f; D_i5_801BBEF4[15] = sp5C.y + 90.0f; @@ -2851,7 +2851,7 @@ bool Titania_80190A08(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* Matrix_RotateX(gCalcMatrix, rot->x * M_DTOR, 1); } sp6C = 0; - if ((limbIndex == 0x33) || (limbIndex == 0x42)) { + if ((limbIndex == 51) || (limbIndex == 66)) { if (D_i5_801BBEF0[1] != 0) { sp68 = 1.1f - (fabsf(__sinf(((f32) D_i5_801BBEF0[0] / D_i5_801BBEF0[1]) * 360.0f * M_DTOR))) * D_i5_801BBEF4[0]; @@ -2965,7 +2965,7 @@ void Titania_80191AE8(s32 limbIndex, Vec3f* rot, void* data) { cond = !(cond || (i >= 20 && i < 23 && boss->state == 10)); for (j = 0; j < temp_s4; j++) { - if (cond && (D_i5_801BBEF0[8] == 0 || i != 0x17 || j != 2)) { + if (cond && (D_i5_801BBEF0[8] == 0 || i != 23 || j != 2)) { var_s1 = D_i5_801B7A70[temp_s6 + j]; spB4.x = var_s1[0]; spB4.y = var_s1[1]; @@ -2995,23 +2995,23 @@ void Titania_80191AE8(s32 limbIndex, Vec3f* rot, void* data) { var_s0_2 += temp_s4 * 6; } switch (limbIndex) { - case 0x3: + case 3: Matrix_MultVec3f(gCalcMatrix, &D_i5_801B8D30, (Vec3f*) &boss->fwork[17]); break; - case 0xA: + case 10: Matrix_MultVec3f(gCalcMatrix, &D_i5_801B8D00, (Vec3f*) &D_i5_801BBEF4[68]); break; - case 0x10: + case 16: Matrix_MultVec3f(gCalcMatrix, &D_i5_801B8D00, (Vec3f*) &D_i5_801BBEF4[71]); break; - case 0x47: + case 71: Matrix_GetYRPAngles(gCalcMatrix, (Vec3f*) &boss->fwork[20]); break; - case 0x3D: + case 61: Matrix_MultVec3f(gCalcMatrix, &D_i5_801B8D3C, (Vec3f*) &boss->fwork[0x17]); Matrix_GetYRPAngles(gCalcMatrix, (Vec3f*) &boss->fwork[0x1A]); break; - case 0x37: + case 55: if (D_i5_801BBEF0[8] == 0) { Matrix_Push(&gGfxMatrix); Matrix_Translate(gGfxMatrix, 180.0f, 36.0f, 0.0f, 1); @@ -3038,10 +3038,10 @@ void Titania_80191AE8(s32 limbIndex, Vec3f* rot, void* data) { Matrix_MultVec3f(gCalcMatrix, &D_i5_801B8D3C, (Vec3f*) &boss->fwork[29]); Matrix_GetYRPAngles(gCalcMatrix, (Vec3f*) &boss->fwork[32]); break; - case 0x22: + case 34: Matrix_MultVec3f(gCalcMatrix, &D_i5_801B8D24, (Vec3f*) &boss->fwork[5]); break; - case 0x25: + case 37: Matrix_MultVec3f(gCalcMatrix, &D_i5_801B8D24, (Vec3f*) &boss->fwork[8]); break; default: @@ -3189,7 +3189,7 @@ void Titania_80192118(Boss* boss) { D_i5_801BBEF0[38] = 2; gPlayer[0].unk_19C = 0; boss->swork[1] = 3; - AUDIO_PLAY_BGM(SEQ_ID_20 | 0x8000); + AUDIO_PLAY_BGM(SEQ_ID_TI_BOSS | SEQ_FLAG); } break; case 3: @@ -3200,7 +3200,7 @@ void Titania_80192118(Boss* boss) { sp54.z = (boss->obj.pos.z + D_i5_801BBEF4[41]) + D_i5_801BBEF4[70]; func_effect_8007A6F0(&sp54, 0x29403031); boss->swork[39] = 5; - D_ctx_80178480 = 5; + gCameraShake = 5; } if (D_i5_801BBEF0[23] == 37) { sp54.x = (boss->obj.pos.x + D_i5_801BBEF4[42]) + D_i5_801BBEF4[71]; @@ -3208,7 +3208,7 @@ void Titania_80192118(Boss* boss) { sp54.z = (boss->obj.pos.z + D_i5_801BBEF4[44]) + D_i5_801BBEF4[73]; func_effect_8007A6F0(&sp54, 0x29403031); boss->swork[39] = 5; - D_ctx_80178480 = 5; + gCameraShake = 5; } if (boss->dmgType == DMG_BEAM) { switch (D_i5_801B8C0C[boss->dmgPart]) { @@ -3443,7 +3443,7 @@ void Titania_80192118(Boss* boss) { D_i5_801BBEF4[58] = temp_ft4; } if (!(boss->swork[38] & 3)) { - func_effect_8007A900(temp_ft2, boss->obj.pos.y, temp_ft4, 10.0f, 0xC0, 0x10, 0); + func_effect_8007A900(temp_ft2, boss->obj.pos.y, temp_ft4, 10.0f, 192, 16, 0); } } if ((boss->state != 4) || (boss->swork[31] < 90)) { @@ -3474,7 +3474,7 @@ void Titania_80192118(Boss* boss) { D_i5_801BBEF4[60] = temp_ft4; } if (!(boss->swork[38] & 3)) { - func_effect_8007A900(temp_ft2, boss->obj.pos.y, temp_ft4, 10.0f, 0xC0, 0x10, 0); + func_effect_8007A900(temp_ft2, boss->obj.pos.y, temp_ft4, 10.0f, 192, 16, 0); } } if ((boss->state != 4) || (boss->swork[31] < 102)) { @@ -3505,7 +3505,7 @@ void Titania_80192118(Boss* boss) { D_i5_801BBEF4[62] = temp_ft4; } if (!(boss->swork[38] & 3)) { - func_effect_8007A900(temp_ft2, boss->obj.pos.y, temp_ft4, 10.0f, 0xC0, 0x10, 0); + func_effect_8007A900(temp_ft2, boss->obj.pos.y, temp_ft4, 10.0f, 192, 16, 0); } } } @@ -3669,7 +3669,7 @@ void Titania_80193DF0(Boss* boss) { D_i5_801BBEF0[44] = 0; D_i5_801BBEF0[8] = -1; D_i5_801BBEF0[41] = 1; - actor = func_game_800A3608(OBJ_ACTOR_198); + actor = func_game_800A3608(OBJ_ACTOR_TEAM_BOSS); if (actor != NULL) { Matrix_MultVec3f(gCalcMatrix, &D_i5_801BBF00[i].unk_00.pos, &spC8); actor->obj.pos.x = boss->obj.pos.x + spC8.x; @@ -3869,7 +3869,7 @@ void Titania_80193DF0(Boss* boss) { if (boss->swork[21] <= 0) { D_ctx_8017796C = -1; boss->swork[21] = 0; - D_play_Timer_80161A60 = 8; + gScreenFlashTimer = 8; AUDIO_PLAY_SFX(0x2940D09A, boss->sfxSource, 4); } else { AUDIO_PLAY_SFX(0x2940802C, boss->sfxSource, 4); @@ -3936,7 +3936,7 @@ void Titania_80193DF0(Boss* boss) { boss->swork[21] -= boss->damage; if (boss->swork[21] <= 0) { boss->swork[21] = 0; - D_play_Timer_80161A60 = 8; + gScreenFlashTimer = 8; D_ctx_8017796C = -1; AUDIO_PLAY_SFX(0x2940D09A, boss->sfxSource, 4); } else { @@ -4319,7 +4319,7 @@ void Titania_80193DF0(Boss* boss) { if (boss->unk_04C == 38) { func_effect_8007A6F0(&spD4, 0x29403031); boss->swork[39] = 5; - D_ctx_80178480 = 20; + gCameraShake = 20; } } if ((boss->unk_04C >= 97) && (boss->unk_04C < 101) && (boss->swork[12] > 0)) { @@ -4332,7 +4332,7 @@ void Titania_80193DF0(Boss* boss) { if (boss->unk_04C == 98) { func_effect_8007A6F0(&spD4, 0x29403031); boss->swork[39] = 5; - D_ctx_80178480 = 20; + gCameraShake = 20; } } Math_SmoothStepToF(&boss->fwork[0], 0.5f, 1.0f, 0.02f, 0.0f); @@ -4696,7 +4696,7 @@ void Titania_80193DF0(Boss* boss) { if ((boss->state == 6) && ((boss->unk_04C == 134) || (boss->unk_04C == 188))) { AUDIO_PLAY_SFX(0x29406029, boss->sfxSource, 4); boss->swork[39] = 4; - D_ctx_80178480 = 7; + gCameraShake = 7; } if (boss->state >= 7) { if (((boss->fwork[15] > 0.0f) && (boss->fwork[9] <= 0.0f)) || @@ -4704,10 +4704,10 @@ void Titania_80193DF0(Boss* boss) { AUDIO_PLAY_SFX(0x29406029, boss->sfxSource, 4); if (boss->state == 12) { boss->swork[39] = 4; - D_ctx_80178480 = 20; + gCameraShake = 20; } else { boss->swork[39] = 2; - D_ctx_80178480 = 5; + gCameraShake = 5; } } boss->fwork[12] = boss->fwork[6]; @@ -5039,7 +5039,7 @@ void Titania_801982A8(Boss* boss) { gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, (s32) (temp_fv0 * 255.0f), (s32) ((temp_fv0 * 128.0f) + 127.0f), (s32) ((temp_fv0 * 60.0f) + 195.0f), (s32) ((temp_fv0 * 155.0f) + 100.0f)); - for (j = 0; j < 0x168; j += 0x2D) { + for (j = 0; j < 360; j += 45) { Matrix_Push(&gGfxMatrix); Matrix_RotateZ(gGfxMatrix, (j + boss->fwork[43] * 360.0f) * M_DTOR, 1); Matrix_Translate(gGfxMatrix, temp_fs2, 0.0f, 0.0f, 1); diff --git a/src/overlays/ovl_i5/fox_ti_cs.c b/src/overlays/ovl_i5/fox_ti_cs.c index 44de72d7..86803564 100644 --- a/src/overlays/ovl_i5/fox_ti_cs.c +++ b/src/overlays/ovl_i5/fox_ti_cs.c @@ -218,8 +218,8 @@ void Titania_8018769C(Player* player) { Math_SmoothStepToF(&player->unk_0F0, SIN_DEG(gGameFrameCount * 5.0f) * 10.0f, 0.1f, 100.0f, 0.0f); - if (gCsFrameCount == 0x244) { - D_ctx_80177838 = 0x32; + if (gCsFrameCount == 580) { + D_ctx_80177838 = 50; player->state_1C8 = PLAYERSTATE_1C8_3; player->unk_1D0 = player->timer_1F8 = player->timer_1FC = player->unk_240 = 0; player->unk_0D4 = 3.0f; @@ -320,7 +320,7 @@ void Titania_801882CC(Player* player) { Math_SmoothStepToF(&player->unk_0D0, 4.9f, 0.1f, 1.0f, 0.0f); Math_SmoothStepToF(&player->unk_08C, 0.0f, 0.1f, 1.0f, 0.0f); - if (gCsFrameCount < 0x460) { + if (gCsFrameCount < 1120) { Math_SmoothStepToF(&D_ctx_80177A48[1], 0.65f, 0.1f, 0.01f, 0.0f); } else { Math_SmoothStepToF(&D_ctx_80177A48[1], 0.0f, 0.1f, 0.02f, 0.0f); @@ -422,7 +422,7 @@ void Titania_801882CC(Player* player) { break; case 50: - AUDIO_PLAY_BGM(SEQ_ID_38); + AUDIO_PLAY_BGM(SEQ_ID_GOOD_END); break; case 80: diff --git a/src/overlays/ovl_i6/fox_andross.c b/src/overlays/ovl_i6/fox_andross.c index 74548e80..3291131b 100644 --- a/src/overlays/ovl_i6/fox_andross.c +++ b/src/overlays/ovl_i6/fox_andross.c @@ -55,7 +55,7 @@ void Andross_80187530(Actor* actor) { actor->obj.rot.z = D_Andross_801A7F68; } -s32 Andross_8018767C(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* data) { +bool Andross_8018767C(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* data) { if (limbIndex == 13) { *dList = NULL; } @@ -123,7 +123,7 @@ void Andross_801878A8() { break; } - if ((D_ctx_80178310[i].id <= OBJ_ACTOR_291) && (D_ctx_80178310[i].id >= OBJ_ACTOR_176)) { + if ((D_ctx_80178310[i].id <= OBJ_ACTOR_SUPPLIES) && (D_ctx_80178310[i].id >= OBJ_ACTOR_176)) { Actor_Initialize(actor); actor->obj.status = OBJ_ACTIVE; actor->obj.id = D_ctx_80178310[i].id; @@ -189,7 +189,7 @@ void Andross_80187C5C(void) { obj58->obj.pos.y = D_ctx_80178310[i].yPos; obj58->obj.rot.y = D_ctx_80178310[i].rot.y; if (obj58->obj.id == OBJ_80_147) { - obj58->unk40[0] = D_ctx_80178310[i].rot.z; + obj58->unk_40 = D_ctx_80178310[i].rot.z; } Object_SetInfo(&obj58->info, obj58->obj.id); if (obj58->obj.id == OBJ_80_131) { @@ -204,7 +204,7 @@ void Andross_80187C5C(void) { break; } - if ((D_ctx_80178310[i].id <= OBJ_ACTOR_291) && (D_ctx_80178310[i].id >= OBJ_ACTOR_176)) { + if ((D_ctx_80178310[i].id <= OBJ_ACTOR_SUPPLIES) && (D_ctx_80178310[i].id >= OBJ_ACTOR_176)) { Actor_Initialize(actor); actor->obj.status = OBJ_ACTIVE; actor->obj.id = D_ctx_80178310[i].id; @@ -249,7 +249,7 @@ void Andross_801880E4(Actor* actor) { f32 temp_fv1; for (obj58 = gObjects58, i = 0; i < 200; i++, obj58++) { - if ((obj58->obj.id == OBJ_80_147) && ((u8) actor->unk_04E == (u8) obj58->unk40[0])) { + if ((obj58->obj.id == OBJ_80_147) && (obj58->unk_40 == (u8) actor->unk_04E)) { actor->fwork[3] = obj58->obj.pos.x; actor->fwork[4] = obj58->obj.pos.y; actor->fwork[5] = obj58->obj.pos.z; @@ -422,7 +422,7 @@ void Andross_80188A4C(Boss* boss) { AUDIO_PLAY_SFX(0x2943500FU, boss->sfxSource, 4); boss->health -= boss->damage; if ((boss->health != 0) && (boss->health <= 0)) { - D_play_Timer_80161A60 = 8; + gScreenFlashTimer = 8; AUDIO_PLAY_SFX(0x2940D09AU, boss->sfxSource, 4); func_boss_80042EC0(boss); gPlayer[0].state_1C8 = PLAYERSTATE_1C8_0; @@ -514,7 +514,7 @@ void Andross_80188CB8(Boss* boss) { boss->fwork[19] = -26.0f; for (i = 10; i < 12; i++) { - if ((gActors[i].obj.status == OBJ_ACTIVE) && (gActors[i].obj.id == OBJ_ACTOR_197)) { + if ((gActors[i].obj.status == OBJ_ACTIVE) && (gActors[i].obj.id == OBJ_ACTOR_ALLRANGE)) { gTexturedLines[i].mode = 50; gTexturedLines[i].unk_28 = 1.0f; gTexturedLines[i].unk_04.x = boss->obj.pos.x; @@ -534,9 +534,9 @@ void Andross_80189098(Boss* boss) { Actor_Initialize(actor); actor->obj.status = OBJ_INIT; - actor->obj.id = OBJ_ACTOR_197; - actor->aiType = 10; - actor->aiIndex = 0; + actor->obj.id = OBJ_ACTOR_ALLRANGE; + actor->aiType = AI360_10; + actor->aiIndex = AI360_FOX; actor->health = 200; actor->obj.pos.x = 200.0f; actor->obj.pos.y = 0.0f; @@ -548,9 +548,9 @@ void Andross_80189098(Boss* boss) { Actor_Initialize(actor); actor->obj.status = OBJ_INIT; - actor->obj.id = OBJ_ACTOR_197; - actor->aiType = 10; - actor->aiIndex = 0; + actor->obj.id = OBJ_ACTOR_ALLRANGE; + actor->aiType = AI360_10; + actor->aiIndex = AI360_FOX; actor->health = 200; actor->obj.pos.x = -200.0f; actor->obj.pos.y = 0.0f; @@ -966,13 +966,13 @@ void Andross_80189B70(Boss* boss) { case 21: Andross_801876FC(); gCsFrameCount++; - D_ctx_80178480 = 10; + gCameraShake = 10; if (gCsFrameCount < 200) { D_ctx_80178380[0] += 4; - if (D_ctx_80178380[0] >= 0xFF) { - D_ctx_80178380[0] = 0xFF; + if (D_ctx_80178380[0] >= 255) { + D_ctx_80178380[0] = 255; } - D_ctx_80178390[0] = D_ctx_801783A0[0] = D_ctx_801783B0[0] = 0xFF; + D_ctx_80178390[0] = D_ctx_801783A0[0] = D_ctx_801783B0[0] = 255; Math_SmoothStepToF(&D_display_800CA230, 0.15f, 0.2f, 0.004f, 0.0f); Math_SmoothStepToF(&D_ctx_801779A8[gMainController], 70.0f, 1.0f, 4.0f, 0.0f); } @@ -1106,7 +1106,7 @@ void Andross_80189B70(Boss* boss) { boss->vel.z = sp64.z - D_ctx_80177D08; if (boss->state < 20) { gRadarMarks[59].unk_00 = 1; - gRadarMarks[59].unk_02 = 0x66; + gRadarMarks[59].unk_02 = 102; gRadarMarks[59].pos.x = boss->obj.pos.x; gRadarMarks[59].pos.y = boss->obj.pos.y; gRadarMarks[59].pos.z = boss->obj.pos.z; @@ -1139,7 +1139,7 @@ void Andross_80189B70(Boss* boss) { Math_SmoothStepToF(&boss->fwork[23], boss->fwork[24], 0.3f, 0.01f, 0); } -s32 Andross_8018B47C(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* data) { +bool Andross_8018B47C(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* data) { Boss* boss = (Boss*) data; if (boss->fwork[21] >= 254.0f) { @@ -1555,14 +1555,14 @@ void Andross_8018D0D8(Boss* boss) { } } -void Andross_8018D16C(Boss* boss) { +void Andross_Boss320_Init(Boss* boss) { Audio_SetBaseSfxReverb(0x18); D_i6_801A7F5C = D_i6_801A7F64 = D_i6_801A7F6C = D_i6_801A7F74 = D_i6_801A7F7C = D_i6_801A8430 = 0.0f; D_bg_800C9C30 = 0.0f; boss->health = 100; boss->fwork[18] = 1.0f; boss->fwork[17] = 1.0f; - gLight1R = 0xFF; + gLight1R = 255; gLight1G = 80; gLight1B = 20; gAmbientR = 1; @@ -1575,7 +1575,7 @@ void Andross_8018D16C(Boss* boss) { D_ctx_80177AB0 = 1; boss->info.hitbox[16] = 200.0f; boss->info.hitbox[22] = 200.0f; - Audio_PlaySequence(SEQ_PLAYER_BGM, SEQ_ID_33 | 0x8000, 0, 0); + Audio_PlaySequence(SEQ_PLAYER_BGM, SEQ_ID_AND_BOSS | SEQ_FLAG, 0, 0); } void Andross_8018D2B0(Boss* boss) { @@ -1590,7 +1590,7 @@ void Andross_8018D2B0(Boss* boss) { boss->timer_05C = 20; if ((boss->state == 9) || (boss->state == 10)) { if (boss->health <= 0) { - D_play_Timer_80161A60 = 8; + gScreenFlashTimer = 8; AUDIO_PLAY_SFX(0x2940D09A, boss->sfxSource, 4); AUDIO_PLAY_SFX(0x31009063, boss->sfxSource, 4); AUDIO_PLAY_SFX(0x19403070, boss->sfxSource, 4); @@ -2538,7 +2538,7 @@ void Andross_8018DBF0(Boss* boss) { boss->obj.pos.y + RAND_FLOAT_CENTERED(1000.0f), boss->obj.pos.z, 0.0f, 0.0f, boss->vel.z, RAND_FLOAT(0.2f) + 0.2f, 0); } - if (gCsFrameCount >= 0x33) { + if (gCsFrameCount > 50) { func_effect_8007D0E0(boss->obj.pos.x + RAND_FLOAT_CENTERED(1000.0f), boss->obj.pos.y + RAND_FLOAT_CENTERED(1000.0f), boss->obj.pos.z, RAND_FLOAT(3.0f) + 3.0f); @@ -2579,7 +2579,7 @@ void Andross_8018DBF0(Boss* boss) { boss->timer_050 = 50; boss->fwork[9] = 0.0f; AUDIO_PLAY_SFX(0x11030073, boss->sfxSource, 4); - AUDIO_PLAY_BGM(SEQ_ID_33 | 0x8000); + AUDIO_PLAY_BGM(SEQ_ID_AND_BOSS | SEQ_FLAG); break; } break; @@ -2807,7 +2807,7 @@ static f32 D_i6_801A67EC = 0.0f; static f32 D_i6_801A67F0 = 0.0f; static Vec3f D_i6_801A67F4 = { 0.0f, 0.0f, 0.0f }; -s32 Andross_801917F0(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* data) { +bool Andross_801917F0(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* data) { Vec3f sp94; Vec3f sp88; f32 scale; @@ -3297,7 +3297,7 @@ void Andross_80193380(Object_80* obj80) { obj80->obj.rot.z = D_Andross_801A7F68; } -s32 Andross_801934EC(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* data) { +bool Andross_801934EC(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* data) { if (limbIndex == 13) { *dList = NULL; } @@ -3319,7 +3319,7 @@ void Andross_8019356C(Object_80* obj80) { } } -s32 Andross_801935B4(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* data) { +bool Andross_801935B4(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* data) { if (limbIndex != 13) { *dList = NULL; } @@ -3380,7 +3380,7 @@ void Andross_80193710(void) { break; } - if ((D_ctx_80178310[i].id >= OBJ_ACTOR_176) && (D_ctx_80178310[i].id <= OBJ_ACTOR_291)) { + if ((D_ctx_80178310[i].id >= OBJ_ACTOR_176) && (D_ctx_80178310[i].id <= OBJ_ACTOR_SUPPLIES)) { Actor_Initialize(actor); actor->obj.status = OBJ_INIT; actor->obj.id = D_ctx_80178310[i].id; @@ -3418,7 +3418,7 @@ void Andross_801939A0(s32 actorIndex) { } if (actorIndex == 1) { actor->state = 1; - actor->unk_046 = 0xFF; + actor->unk_046 = 255; actor->unk_0B6 = 1000; } Object_SetInfo(&actor->info, actor->obj.id); @@ -3629,7 +3629,7 @@ void Andross_80193C4C(Player* player) { Audio_KillSfxBySourceAndId(player->sfxSource, 0x11403071); Audio_SetBaseSfxReverb(0); D_play_800D2F68 = 0; - gBlurAlpha = 0xFF; + gBlurAlpha = 255; gCurrentLevel = LEVEL_VENOM_2; D_ctx_8017827C = 1; gLevelMode = LEVELMODE_ALL_RANGE; @@ -3676,7 +3676,7 @@ void Andross_80193C4C(Player* player) { if (gCsFrameCount == 40) { Andross_801939A0(10); AUDIO_PLAY_SFX(0x2940F026, boss->sfxSource, 4); - D_ctx_80178480 = 30; + gCameraShake = 30; gOverlayStage = 1; D_Timer_80177BD0[0] = 30; } @@ -3696,7 +3696,7 @@ void Andross_80193C4C(Player* player) { } if (gCsFrameCount == 70) { - AUDIO_PLAY_BGM(SEQ_ID_64 | 0x8000); + AUDIO_PLAY_BGM(SEQ_ID_VE_CLEAR | SEQ_FLAG); } if (gCsFrameCount == 150) { player->unk_1D0++; @@ -3938,7 +3938,7 @@ void Andross_80193C4C(Player* player) { D_ctx_8017835C = 4; D_ctx_80178348 = D_ctx_80178350 = D_ctx_80178354 = 0; D_ctx_80178358 = 255; - if (D_ctx_80178340 == 0xFF) { + if (D_ctx_80178340 == 255) { gNextGameState = GSTATE_CREDITS; D_ending_80196D00 = 0; D_play_800D3180[LEVEL_VENOM_ANDROSS] = Play_CheckMedalStatus(200) + 1; @@ -3948,7 +3948,7 @@ void Andross_80193C4C(Player* player) { break; case 100: D_ctx_80178380[0] -= 4; - if (D_ctx_80178380[0] >= 0x100) { + if (D_ctx_80178380[0] > 255) { D_ctx_80178380[0] = 0; } Matrix_RotateY(gCalcMatrix, (player->unk_114 + player->unk_0E8 + 180.0f) * M_DTOR, 0); diff --git a/src/overlays/ovl_i6/fox_sy.c b/src/overlays/ovl_i6/fox_sy.c index 716f59d7..3f188069 100644 --- a/src/overlays/ovl_i6/fox_sy.c +++ b/src/overlays/ovl_i6/fox_sy.c @@ -51,7 +51,7 @@ void SectorY_80197C64(Effect* effect) { void SectorY_80197CB8(Object_80* obj80) { } -void SectorY_80197CC4(Boss* boss) { +void SectorY_Boss314_Init(Boss* boss) { boss->fwork[9] = 0.0f; boss->swork[33] = 5500; boss->timer_050 = 10; @@ -578,7 +578,7 @@ void SectorY_80199438(Boss* boss) { func_effect_8007A568(boss->obj.pos.x, boss->obj.pos.y, boss->obj.pos.z, 40.0f); func_effect_8007D0E0(boss->obj.pos.x, boss->obj.pos.y, boss->obj.pos.z, 30.0f); func_enmy_80062B60(boss->obj.pos.x, boss->obj.pos.z, 0, 120.0f); - D_ctx_80178480 = 25; + gCameraShake = 25; boss->swork[36]++; for (i = 10; i < 24; i++) { @@ -964,7 +964,7 @@ void SectorY_8019AEEC(Boss* boss) { if ((boss->obj.pos.y != 365.0f) && (boss->swork[21] != 1)) { if (boss->unk_04A != 0) { if (boss->unk_04A == 1) { - Audio_PlaySequence(SEQ_PLAYER_BGM, SEQ_ID_65 | 0x8000, 0, 0); + Audio_PlaySequence(SEQ_PLAYER_BGM, SEQ_ID_BOSS_RESUME | SEQ_FLAG, 0, 0); boss->unk_04A++; gPlayer[0].camEye.x = 0.0f; gPlayer[0].camEye.y = 200.0f; @@ -1620,9 +1620,9 @@ void SectorY_8019C888(Boss* boss) { } } if (D_edisplay_801615D0.x > 0.0f) { - gPlayer[0].unk_228 = 0x10; + gPlayer[0].flags_228 = 0x10; } else { - gPlayer[0].unk_228 = 0x20; + gPlayer[0].flags_228 = 0x20; } } else { @@ -1631,7 +1631,7 @@ void SectorY_8019C888(Boss* boss) { } } -s32 SectorY_8019DC4C(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* data) { +bool SectorY_8019DC4C(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* data) { Boss* boss = (Boss*) data; Vec3f sp10 = { 0.0f, 0.0f, 0.0f }; @@ -1671,7 +1671,7 @@ s32 SectorY_8019DC4C(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* d return false; } -s32 SectorY_8019DE10(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* data) { +bool SectorY_8019DE10(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* data) { Boss* boss = (Boss*) data; Vec3f sp38 = { 0.0f, 0.0f, 0.0f }; @@ -1909,7 +1909,7 @@ void SectorY_8019EB80(void) { } else { var_s1 = 2; } - Rand_SetSeed(1, 0x71AC, 0x263A); + Rand_SetSeed(1, 29100, 9786); for (i = 0; i <= (var_s1); i++, actor++) { if (((i == 0) && (gTeamShields[3] <= 0.0f)) || ((i == 1) && (gTeamShields[2] <= 0.0f)) || @@ -2043,7 +2043,7 @@ void SectorY_8019EE60(Player* player) { player->pos.z = 0.0f; player->unk_1D0++; func_8001C8B8(0); - AUDIO_PLAY_BGM(SEQ_ID_38); + AUDIO_PLAY_BGM(SEQ_ID_GOOD_END); D_ctx_80177A98 = 0; for (i = 0; i < 200; i++) { @@ -2117,7 +2117,7 @@ void SectorY_8019EE60(Player* player) { D_ctx_80178358 = 255; D_ctx_80178348 = D_ctx_80178350 = D_ctx_80178354 = 0; D_ctx_8017835C = 8; - if (D_ctx_80178340 == 0xFF) { + if (D_ctx_80178340 == 255) { Audio_FadeOutAll(10); player->state_1C8 = PLAYERSTATE_1C8_6; player->timer_1F8 = 0; @@ -2514,7 +2514,7 @@ void SectorY_801A0AC0(Player* player) { /* fallthrough */ case 1: if (gCsFrameCount < 3) { - D_ctx_80178340 = 0xFF; + D_ctx_80178340 = 255; } if ((gGameFrameCount & 0xC) && !(gGameFrameCount & 3)) { @@ -2668,7 +2668,7 @@ void SectorY_801A0AC0(Player* player) { func_enmy2_8006ECBC(PLAYERSHOT_1, &gPlayerShots[i], 100, gActors[8].obj.pos.x, gActors[8].obj.pos.y, gActors[8].obj.pos.z, sp98.x, sp98.y, sp98.z, sp88, sp84, 0.0f); - gPlayerShots[i].unk_64 = 0xAE; + gPlayerShots[i].unk_64 = 174; break; } } @@ -2897,7 +2897,7 @@ void SectorY_801A0AC0(Player* player) { gActors[7].fwork[5] = 0.0f; break; case 360: - AUDIO_PLAY_BGM(SEQ_ID_44); + AUDIO_PLAY_BGM(SEQ_ID_INTRO_44); break; case 389: gActors[5].iwork[4] = 1; @@ -3175,7 +3175,7 @@ void SectorY_801A0AC0(Player* player) { D_ctx_80177A48[0] = 1.0f; player->pos.z = player->unk_138 = 0.0f; player->unk_0D0 = D_play_80161A54; - AUDIO_PLAY_BGM(SEQ_ID_9 | 0x8000); + AUDIO_PLAY_BGM(SEQ_ID_SECTOR_Y | SEQ_FLAG); D_ctx_80177838 = 100; player->state_1C8 = PLAYERSTATE_1C8_3; player->unk_1D0 = 0; @@ -3249,7 +3249,7 @@ void SectorY_801A3B50(f32 xPos, f32 yPos, f32 zPos, f32 xVel, f32 yVel, f32 zVel } } -void SectorY_801A3BD4(Actor* actor) { +void SectorY_Actor204_Update(Actor* actor) { f32 sp1E4; f32 sp1E0; s32 i; @@ -3360,7 +3360,7 @@ void SectorY_801A3BD4(Actor* actor) { actor->timer_0C4 = 4; actor->fwork[19] = 30.0f; if (actor->iwork[19] < 0) { - func_enmy2_8006F254(actor); + ActorEvent_8006F254(actor); } else { sp1E4 = gPlayer[0].pos.x; sp1E0 = gPlayer[0].pos.y; @@ -3422,7 +3422,7 @@ void SectorY_801A3BD4(Actor* actor) { } if (actor->timer_0BE == 5U) { func_effect_8007BFFC(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, actor->vel.x, actor->vel.y, - actor->vel.z, 8.0f, 0xA); + actor->vel.z, 8.0f, 10); func_effect_8007B344(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 8.0f, 5); AUDIO_PLAY_SFX(0x2903A060, actor->sfxSource, 4); } @@ -3544,7 +3544,7 @@ static s32 D_i6_801A6B28[3] = { 255, 150, 150 }; static s32 D_i6_801A6B34[3] = { 150, 255, 150 }; static s32 D_i6_801A6B40[6] = { 150, 150, 255 }; -s32 SectorY_801A4A18(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* data) { +bool SectorY_801A4A18(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* data) { Actor* actor = (Actor*) data; if (limbIndex == 4) { @@ -3598,7 +3598,7 @@ static f32 D_i6_801A6B64[5] = { 0.3f, 0.7f, 1.3f, 0.7f, 0.3f, }; -void SectorY_801A4CB0(Actor* actor) { +void SectorY_Actor204_Draw(Actor* actor) { f32 scale; RCP_SetupDL_30(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); diff --git a/src/overlays/ovl_i6/fox_turret.c b/src/overlays/ovl_i6/fox_turret.c index 595a9a74..48b6bfab 100644 --- a/src/overlays/ovl_i6/fox_turret.c +++ b/src/overlays/ovl_i6/fox_turret.c @@ -95,7 +95,7 @@ void Turret_801A58A8(Player* player) { } for (i = 0; i < player->unk_1C0; i++) { - if ((gActors[i].obj.status == OBJ_ACTIVE) && (gActors[i].obj.id == OBJ_ACTOR_200)) { + if ((gActors[i].obj.status == OBJ_ACTIVE) && (gActors[i].obj.id == OBJ_ACTOR_EVENT)) { gTexturedLines[i].mode = 3; gTexturedLines[i].unk_24 = 1.0f; @@ -115,7 +115,7 @@ void Turret_801A58A8(Player* player) { gTexturedLines[i].unk_10.z = gActors[i].obj.pos.z; } } - if (gControllerHold[player->num].button & 0x10) { + if (gControllerHold[player->num].button & R_TRIG) { player->unk_1C0++; if (player->unk_1C0 > 60) { player->unk_1C0 = 60; @@ -186,21 +186,21 @@ void Turret_801A5AD4(Player* player) { if (player->unk_00C < -30.0f) { player->unk_00C = -30.0f; } - player->unk_228 = 0; + player->flags_228 = 0; if (player->unk_008 > 20.0f) { - player->unk_228 |= 1; + player->flags_228 |= 1; } if (player->unk_008 < -20.0f) { - player->unk_228 |= 2; + player->flags_228 |= 2; } if (player->unk_00C > 20.0f) { - player->unk_228 |= 8; + player->flags_228 |= 8; } if (player->unk_00C < -20.0f) { - player->unk_228 |= 4; + player->flags_228 |= 4; } - if (gControllerPress[player->num].button & 0x4000) { + if (gControllerPress[player->num].button & B_BUTTON) { player->unk_008 = player->unk_00C = 0.0f; } Math_SmoothStepToF(&player->unk_180, -player->unk_008, 0.5f, 3.0f, 0.00001f); diff --git a/src/overlays/ovl_i6/fox_ve2.c b/src/overlays/ovl_i6/fox_ve2.c index dd5f51e6..e5ce7c06 100644 --- a/src/overlays/ovl_i6/fox_ve2.c +++ b/src/overlays/ovl_i6/fox_ve2.c @@ -5,7 +5,7 @@ void Venom2_80196210(Boss* boss) { Math_SmoothStepToF(&boss->fwork[0], boss->fwork[1], 0.5f, 5.0f, 0.0f); } -s32 Venom2_8019624C(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* data) { +bool Venom2_8019624C(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* data) { Boss* boss = (Boss*) data; if ((limbIndex == 1) || (limbIndex == 2)) { @@ -199,7 +199,7 @@ void Venom2_80196968(void) { break; } - if ((D_ctx_80178310[i].id >= OBJ_ACTOR_176) && (D_ctx_80178310[i].id <= OBJ_ACTOR_291)) { + if ((D_ctx_80178310[i].id >= OBJ_ACTOR_176) && (D_ctx_80178310[i].id <= OBJ_ACTOR_SUPPLIES)) { Actor_Initialize(actor); actor->obj.status = OBJ_INIT; actor->obj.id = D_ctx_80178310[i].id; @@ -252,13 +252,15 @@ void Venom2_80196BF8(Player* player) { void Venom2_80196D88(Player* player) { s32 i; - f32 var_fa0; + s32 pad; f32 sp94; f32 sp90; f32 sp8C; - f32 temp_fv1; + f32 pad88; f32 sp84; - s32 pad[3]; + f32 pad80; + f32 var_fa0; + f32 temp_fv1; f32 sp74; f32 sp70; Vec3f sp64; @@ -268,17 +270,20 @@ void Venom2_80196D88(Player* player) { Math_SmoothStepToF(&player->unk_110, 0.0f, 0.1f, 1.5f, 0.0f); Math_SmoothStepToF(&player->unk_0E8, 0.0f, 0.1f, 1.5f, 0.0f); Math_SmoothStepToF(&player->unk_0E4, 0.0f, 0.1f, 1.5f, 0.0f); + var_fa0 = -player->unk_120; temp_fv1 = player->unk_0EC; + if (var_fa0 < -90.0f) { var_fa0 = 0.0f; } - sp70 = 0.0f; - sp74 = 0.0f; + + sp74 = sp70 = 0.0f; if (temp_fv1 < -5.0f) { sp74 = -temp_fv1; } + if (temp_fv1 > 5.0f) { sp70 = temp_fv1; } @@ -337,11 +342,10 @@ void Venom2_80196D88(Player* player) { } sp84 = Math_RadToDeg(Math_Atan2F(sp94, sp8C)); sp8C = sqrtf(SQ(sp94) + SQ(sp8C)); - Math_SmoothStepToAngle(&player->unk_120, Math_RadToDeg(-Math_Atan2F(sp90, sp8C)), 0.1f, D_ctx_80177A48[4], - 0.0f); - Math_SmoothStepToF(&player->unk_0EC, - Math_SmoothStepToAngle(&player->unk_114, sp84, 0.1f, D_ctx_80177A48[4], 0.0f) * 20.0f, - 0.1f, 3.0f, 0.0f); + pad88 = Math_RadToDeg(-Math_Atan2F(sp90, sp8C)); + Math_SmoothStepToAngle(&player->unk_120, pad88, 0.1f, D_ctx_80177A48[4], 0.0f); + pad80 = Math_SmoothStepToAngle(&player->unk_114, sp84, 0.1f, D_ctx_80177A48[4], 0.0f) * 20.0f; + Math_SmoothStepToF(&player->unk_0EC, pad80, 0.1f, 3.0f, 0.0f); Math_SmoothStepToF(&D_ctx_80177A48[4], 3.0f, 1.0f, 0.1f, 0.0f); Matrix_RotateX(gCalcMatrix, -(D_PI / 9), 0); Matrix_RotateY(gCalcMatrix, (D_ctx_80177A48[3] + player->unk_114) * M_DTOR, 1); @@ -429,7 +433,7 @@ void Venom2_80196D88(Player* player) { } if (player->timer_1FC == 150) { Radio_PlayMessage(gMsg_ID_8215, RCID_FOX); - AUDIO_PLAY_BGM(SEQ_ID_62 | 0x8000); + AUDIO_PLAY_BGM(SEQ_ID_TO_ANDROSS | SEQ_FLAG); } if (player->timer_1FC == 1) { if ((gTeamShields[2] > 0) || (gTeamShields[1] > 0) || (gTeamShields[3] > 0)) { diff --git a/src/overlays/ovl_menu/fox_map.c b/src/overlays/ovl_menu/fox_map.c index e85f74e6..d9f4114f 100644 --- a/src/overlays/ovl_menu/fox_map.c +++ b/src/overlays/ovl_menu/fox_map.c @@ -1117,7 +1117,7 @@ void Map_8019F97C(void); void Map_8019F83C(void); void Map_8019FA1C(void); void Map_8019FC04(void); -s32 Map_8019FD1C(LevelId levelId, s32 arg1); +bool Map_8019FD1C(LevelId levelId, s32 arg1); void Map_8019FF48(void); s32 Map_801A05B4(void); void Map_801A0788(void); @@ -1149,7 +1149,7 @@ void Map_801A4FC4(void); void Map_801A53C8(void); void Map_801A5834(void); void Map_801A5C90(void); -s32 Map_801A5770(void); +bool Map_801A5770(void); void Map_801A5E80(void); void Map_801A6368(void); void Map_801A61B4(LevelId level); @@ -1289,8 +1289,8 @@ void Map_8019E99C(void) { for (i = 0; i < 10; i++) { D_menu_801CEB58[1][i] = 0; D_menu_801CEB58[2][i] = 0; - D_menu_801CEBD0[1][i] = 0xFF; - D_menu_801CEBD0[2][i] = 0xFF; + D_menu_801CEBD0[1][i] = 255; + D_menu_801CEBD0[2][i] = 255; D_menu_801CEC48[1][i] = 0.0f; D_menu_801CEC48[2][i] = 0.0f; D_menu_801CECC0[1][i] = 0.5f + RAND_FLOAT(0.3f); @@ -1336,7 +1336,7 @@ void Map_8019E99C(void) { D_menu_801CD960 = 0; - D_ctx_80178340 = 0xFF; + D_ctx_80178340 = 255; D_ctx_80178348 = 0; D_ctx_80178350 = 0; D_ctx_80178354 = 0; @@ -1363,7 +1363,7 @@ void Map_8019E99C(void) { D_menu_801CEA6C = 0.0f; D_menu_801CEA70 = 0.002f; - AUDIO_PLAY_BGM(SEQ_ID_60); + AUDIO_PLAY_BGM(SEQ_ID_WORLD_MAP); D_menu_801CEFC4 = 0; D_menu_801CEFC8 = 0; @@ -1424,8 +1424,8 @@ void Map_8019E99C(void) { D_menu_801CEEC0 = 0.0f; D_menu_801CEEA0 = 0; D_menu_801CEEA4 = 0; - D_menu_801CEEA8 = 0xFF; - D_menu_801CEEAC = 0xFF; + D_menu_801CEEA8 = 255; + D_menu_801CEEAC = 255; D_menu_801CEB34 = -1; } @@ -1902,7 +1902,7 @@ void Map_801A01A8(void) { Map_801AC200(i); } - func_edisplay_80060D94(i); + TexturedLine_DrawPath(i); } } @@ -2132,7 +2132,7 @@ void Map_801A0954(void) { } if (gControllerPress[gMainController].button & START_BUTTON) { - AUDIO_PLAY_BGM(SEQ_ID_60); + AUDIO_PLAY_BGM(SEQ_ID_WORLD_MAP); AUDIO_PLAY_SFX(0x4900001FU, gDefaultSfxSource, 4U); @@ -2180,8 +2180,8 @@ void Map_801A0D14(void) { TextureRect_8bIA(&gMasterDisp, D_MAP_6019030, 8, 16, 0.0f, D_menu_801B694C, 40.0f, 1.66f); TextureRect_8bIA_MirY(&gMasterDisp, D_MAP_6019030, 8, 16, 0.0f, D_menu_801B6950, 40.0f, 1.68f); - func_bg_8003DE68(0x47, 0x76); - func_bg_8003DE68(0xCD, 0xEF); + func_bg_8003DE68(71, 118); + func_bg_8003DE68(205, 239); RCP_SetupDL(&gMasterDisp, 0x4C); @@ -2573,13 +2573,13 @@ bool Map_801A2304(void) { D_menu_801CEA78 = 5.5f; D_menu_801CEA80 = 4.6f; D_menu_801CD94C += 1; - D_menu_801CD9B8 = 0xD; + D_menu_801CD9B8 = 13; } break; case 1: D_menu_801CEA78 -= 2.5f; - D_menu_801CEA98 += 0xA; + D_menu_801CEA98 += 10; D_menu_801CEA80 -= 2.5f; if (D_menu_801CEA78 < 5.0f) { @@ -2602,8 +2602,8 @@ bool Map_801A2304(void) { } if (D_menu_801CD9B8 == 0) { - D_menu_801CEA98 = 0xFF; - D_menu_801CD94C = 0x64; + D_menu_801CEA98 = 255; + D_menu_801CD94C = 100; } break; @@ -3064,7 +3064,7 @@ void Map_801A36A8(void) { D_ctx_80178348 = 0; D_ctx_80178350 = 0; D_ctx_80178354 = 0; - D_ctx_80178340 = 0xFF; + D_ctx_80178340 = 255; for (i = 0; i < 8; i++) { D_menu_801CF020[i] = D_menu_801B69D4[i]; @@ -3081,7 +3081,7 @@ void Map_801A36A8(void) { D_menu_801CF080 = 1.0f; D_menu_801CD948 = 10; - AUDIO_PLAY_BGM(SEQ_ID_40); + AUDIO_PLAY_BGM(SEQ_ID_GAME_OVER); break; case 10: @@ -4623,7 +4623,7 @@ void Map_801A74F4(PlanetId planetId) { RCP_SetupDL(&gMasterDisp, 0x43); gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, alpha); - gDPSetEnvColor(gMasterDisp++, 0x1f, 0, 0, 0); + gDPSetEnvColor(gMasterDisp++, 31, 0, 0, 0); Matrix_Push(&gGfxMatrix); @@ -5138,31 +5138,31 @@ void Map_801A8F40(void) { void Map_801A914C(void) { D_menu_801CEAA8 = 140.0f; - if (sCurrentPlanetId == 9) { + if (sCurrentPlanetId == PLANET_CORNERIA) { D_menu_801CEAA8 = 230.0f; } - if (sCurrentPlanetId == 1) { + if (sCurrentPlanetId == PLANET_AREA_6) { D_menu_801CEAA8 = 210.0f; } - if (sCurrentPlanetId == 0xE) { + if (sCurrentPlanetId == PLANET_SOLAR) { D_menu_801CEAA8 = 250.0f; } - if (sCurrentPlanetId == 4) { + if (sCurrentPlanetId == PLANET_SECTOR_X) { D_menu_801CEAA8 = 150.0f; } - if (sCurrentPlanetId == 5) { + if (sCurrentPlanetId == PLANET_SECTOR_Y) { D_menu_801CEAA8 = 150.0f; } - if (sCurrentPlanetId == 3) { + if (sCurrentPlanetId == PLANET_SECTOR_Z) { D_menu_801CEAA8 = 150.0f; } - if (sCurrentPlanetId == 0xD) { + if (sCurrentPlanetId == PLANET_VENOM) { D_menu_801CEAA8 = 300.0f; } @@ -5978,7 +5978,7 @@ void Map_801AB978(s32 arg0) { switch (gSavedTeamShields[3 - i]) { case -1: case -2: - if (D_menu_801CEA74 > 0x20) { + if (D_menu_801CEA74 > 32) { sp90[i] = 32; } else { sp90[i] = D_menu_801CEA74; diff --git a/src/overlays/ovl_menu/fox_option.c b/src/overlays/ovl_menu/fox_option.c index 48ffff9f..2fb6801a 100644 --- a/src/overlays/ovl_menu/fox_option.c +++ b/src/overlays/ovl_menu/fox_option.c @@ -401,7 +401,7 @@ void Option_Setup(void) { D_ctx_80178354 = 0; D_ctx_80178340 = 0; - gBlurAlpha = 0xFF; + gBlurAlpha = 255; gBgColor = 0; @@ -534,7 +534,7 @@ void Option_Setup(void) { D_menu_801B91EC = 0; D_menu_801B9244 = 0; D_menu_801B9248 = 0; - AUDIO_PLAY_BGM(SEQ_ID_36); + AUDIO_PLAY_BGM(SEQ_ID_MENU); } void Option_Init(void) { @@ -686,7 +686,7 @@ void Option_DrawEntry(void) { } void Option_InitEntry(void) { - gBlurAlpha = 0xFF; + gBlurAlpha = 255; D_menu_801B912C = 0; switch (D_menu_801B9124) { @@ -769,7 +769,7 @@ void Option_80192738(void) { } void Option_MapUpdate(void) { - if (D_ctx_80178340 == 0xFF) { + if (D_ctx_80178340 == 255) { D_ctx_80178410 = 0; D_menu_801B9124 = 100; gGameState = GSTATE_MAP; @@ -778,15 +778,15 @@ void Option_MapUpdate(void) { gDrawMode = DRAWMODE_0; gControllerLock = 3; } else { - D_ctx_80178340 += 0x20; - if (D_ctx_80178340 > 0xFF) { - D_ctx_80178340 = 0xFF; + D_ctx_80178340 += 32; + if (D_ctx_80178340 > 255) { + D_ctx_80178340 = 255; } } } void Option_TrainingUpdate(void) { - if (D_ctx_80178340 == 0xFF) { + if (D_ctx_80178340 == 255) { gCurrentLevel = LEVEL_TRAINING; gGameState = GSTATE_PLAY; D_Timer_8017783C = 2; @@ -799,9 +799,9 @@ void Option_TrainingUpdate(void) { gControllerLock = 3; Audio_SetAudioSpec(0, 28); } else { - D_ctx_80178340 += 0x20; - if (D_ctx_80178340 > 0xFF) { - D_ctx_80178340 = 0xFF; + D_ctx_80178340 += 32; + if (D_ctx_80178340 > 255) { + D_ctx_80178340 = 255; } } } @@ -810,7 +810,7 @@ void Option_801929F0(void) { s32 i; D_game_800D2870 = 0; - gBlurAlpha = 0xFF; + gBlurAlpha = 255; gControllerLock = 0; D_ctx_80178410 = 800; D_menu_801B9248 = 0; @@ -903,7 +903,7 @@ void Option_MainMenuUpdate(void) { sOptionCardList[i].unk_00.unk_1C = sOptionCardCurTextPosY[i]; } D_menu_801B91BC = 1; - gBlurAlpha = 0xFF; + gBlurAlpha = 255; D_menu_801B912C = 1; } break; @@ -970,7 +970,7 @@ void Option_MainMenuUpdate(void) { break; case 11: - gBlurAlpha = 0x10; + gBlurAlpha = 16; D_menu_801B9178 = 3; sOptionCardList[D_menu_801B91A4].unk_38.unk_0C -= 0.01f; sOptionCardList[D_menu_801B91A4].unk_38.unk_10 -= 0.01f; @@ -1087,7 +1087,7 @@ void Option_MainMenuDraw(void) { void Option_80193B04(void) { s32 i; - gBlurAlpha = 0xFF; + gBlurAlpha = 255; gControllerLock = 0; D_ctx_80178410 = 800; @@ -1174,7 +1174,7 @@ void Option_VersusUpdate(void) { sOptionCardList[D_menu_801B91A4].unk_00.unk_1C = 25.0f; sOptionCardList[D_menu_801B91A4].unk_38.unk_04 = 90.0f; D_menu_801B91BC = 1; - gBlurAlpha = 0xFF; + gBlurAlpha = 255; D_menu_801B912C = 1; } break; @@ -1201,7 +1201,7 @@ void Option_VersusUpdate(void) { break; case 11: - gBlurAlpha = 0x10; + gBlurAlpha = 16; D_menu_801B9178 = 5; sOptionVSCardList[D_menu_801B91A8].unk_38.unk_0C -= 0.01f; sOptionVSCardList[D_menu_801B91A8].unk_38.unk_10 -= 0.01f; @@ -1253,7 +1253,7 @@ void Option_VersusUpdate(void) { if ((var_fs0 == sOptionVSCardList[D_menu_801B91A8].unk_00.unk_1C) && (sOptionVSCardList[D_menu_801B91A8].unk_38.unk_04 == -15.5f)) { - gBlurAlpha += 0xFF; + gBlurAlpha += 255; D_menu_801B9124 = (D_menu_801B91A8 + 1) * 10; D_ctx_801778AC = D_menu_801B91A8; D_menu_801B91C4 = 1; @@ -1664,7 +1664,7 @@ void Option_ExpertSoundUpdate(void) { if (gControllerPress[gMainController].button & B_BUTTON) { if (!D_menu_801B9320) { AUDIO_PLAY_SFX(0x49000021, gDefaultSfxSource, 4); - AUDIO_PLAY_BGM(SEQ_ID_36); + AUDIO_PLAY_BGM(SEQ_ID_MENU); gDrawMode = DRAWMODE_0; D_menu_801B9124 = 1000; D_menu_801B912C = 0; @@ -2613,7 +2613,7 @@ void Option_VersusMenuInit(void) { s32 i; if (D_menu_801B91C4) { - AUDIO_PLAY_BGM(SEQ_ID_56); + AUDIO_PLAY_BGM(SEQ_ID_VS_MENU); } D_menu_801B93D0 = D_menu_801B9124; @@ -2694,7 +2694,7 @@ void Option_8019949C(void) { AUDIO_PLAY_SFX(0x4900101D, gDefaultSfxSource, 4); D_menu_801B93C4 &= (1 << i) ^ 15; } else { - AUDIO_PLAY_BGM(SEQ_ID_36); + AUDIO_PLAY_BGM(SEQ_ID_MENU); AUDIO_PLAY_SFX(0x49000021, gDefaultSfxSource, 4); Option_8019B8A0(2); D_menu_801B9248 = 1; @@ -3355,7 +3355,7 @@ void Option_8019B1F8(void) { width = 56; } RCP_SetupDL(&gMasterDisp, 0x53); - gDPSetPrimColor(gMasterDisp++, 0, 0, 0xff, 0xff, 0xff, sp8C[i]); + gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, sp8C[i]); TextureRect_8bIA(&gMasterDisp, D_menu_801AF2BC[i], width, 10, D_menu_801AF2B4[i], D_menu_801AF2AC + 40.0f, 1.0f, 1.0f); } @@ -3911,9 +3911,9 @@ void Option_8019CBC0(void) { s32 temp; s32 i; - AUDIO_PLAY_BGM(SEQ_ID_36); + AUDIO_PLAY_BGM(SEQ_ID_MENU); - gBlurAlpha = 0xD0; + gBlurAlpha = 208; D_ctx_80178410 = 800; D_menu_801B9130 = 1; @@ -3943,7 +3943,7 @@ void Option_8019CBC0(void) { for (i = 0; i < 3; i++) { D_menu_801B90B0[i] = 0; D_menu_801B90A0[i] = 0; - D_menu_801B9150[i][0] = 0x41; + D_menu_801B9150[i][0] = 65; D_menu_801B9150[i][1] = 0; } } @@ -4326,7 +4326,8 @@ void Option_8019DD44(void) { void Option_8019DE74(void) { Option_8019715C(); - if (gControllerPress[gMainController].button & 0xD00E) { // START, A, B, C-UP, C-LEFT, C-DOWN + if (gControllerPress[gMainController].button & (START_BUTTON | A_BUTTON | B_BUTTON | D_CBUTTONS | L_CBUTTONS | + U_CBUTTONS)) { // START, A, B, C-UP, C-LEFT, C-DOWN AUDIO_PLAY_SFX(0x49000003, gDefaultSfxSource, 4); gDrawMode = DRAWMODE_0; @@ -4381,7 +4382,9 @@ void Option_InvoiceUpdate(void) { break; case 2: - if ((D_menu_801B9178 == 0) && (gControllerPress[gMainController].button & 0xD00E)) { + if ((D_menu_801B9178 == 0) && + (gControllerPress[gMainController].button & + (START_BUTTON | A_BUTTON | B_BUTTON | D_CBUTTONS | L_CBUTTONS | U_CBUTTONS))) { AUDIO_PLAY_SFX(0x19031083, gDefaultSfxSource, 4); D_menu_801B9090 = 1; D_menu_801B9178 = 60; diff --git a/src/overlays/ovl_menu/fox_title.c b/src/overlays/ovl_menu/fox_title.c index ea6468c9..156708de 100644 --- a/src/overlays/ovl_menu/fox_title.c +++ b/src/overlays/ovl_menu/fox_title.c @@ -212,7 +212,7 @@ void Title_801875E0(void) { Audio_SetAudioSpec(0, 0x16); D_menu_801B82C4 = 1; } - gControllerLock = 0x1E; + gControllerLock = 30; } void Title_80187754(void) { @@ -708,7 +708,7 @@ void Title_801881FC(void) { D_menu_801B86A4 = 0; D_menu_801B82B0 = 100; - AUDIO_PLAY_BGM(SEQ_ID_34); + AUDIO_PLAY_BGM(SEQ_ID_TITLE); } void Title_801888E8(void) { @@ -989,7 +989,7 @@ void Title_801894E8(void) { D_menu_801B7BF0 = 0; - AUDIO_PLAY_BGM(SEQ_ID_35); + AUDIO_PLAY_BGM(SEQ_ID_OPENING); } void Title_8018994C(void) { @@ -1568,12 +1568,12 @@ void Title_8018B058(void) { D_menu_801B8108[i] = 0; } - D_menu_801B869C = 0xFF; + D_menu_801B869C = 255; D_ctx_80178340 = 0; - D_ctx_80178348 = 0xFF; - D_ctx_80178350 = 0xFF; - D_ctx_80178354 = 0xFF; + D_ctx_80178348 = 255; + D_ctx_80178350 = 255; + D_ctx_80178354 = 255; D_ctx_80178410 = 0; D_menu_801B8334 = 0; @@ -1799,11 +1799,11 @@ void Title_8018B5C4(void) { D_ctx_80178340++; } - if (D_ctx_80178340 == 0x80) { + if (D_ctx_80178340 == 128) { D_menu_801B82A8 = 7; D_menu_801B84E8[3].unk_3C = 0; D_menu_801B84E8[3].unk_40 = 0; - D_ctx_80178340 = 0xFF; + D_ctx_80178340 = 255; D_menu_801B82C0++; } @@ -2078,7 +2078,7 @@ void Title_8018C644(void) { D_menu_801B869C = 1; } - if (D_ctx_80178340 == 0xFF) { + if (D_ctx_80178340 == 255) { Audio_KillSfxBySourceAndId(D_menu_801B8658.unk_24, 0x11030010); Audio_KillSfxBySourceAndId(D_menu_801B8658.unk_24, 0x31024059); D_menu_801B82C0++; @@ -2495,11 +2495,11 @@ void Title_8018E200(void) { break; case 1: - D_menu_801B7CC8[i] -= 0x10; + D_menu_801B7CC8[i] -= 16; if (D_menu_801B7CC8[i] < 0) { D_menu_801B7CC8[i] = 0; } - D_menu_801B7CF0[i] -= 0x10; + D_menu_801B7CF0[i] -= 16; if (D_menu_801B7CF0[i] < 0) { D_menu_801B7CF0[i] = 0; } @@ -3200,11 +3200,13 @@ void Title_80190E64(void) { void Title_80190EA4(void) { switch (D_menu_801B8280) { case 0: - if (gControllerPress[gMainController].button & 0xD00F) { // START, A, B, C-left, C-Down, C-Up, C-Right + if (gControllerPress[gMainController].button & + (START_BUTTON | A_BUTTON | B_BUTTON | D_CBUTTONS | L_CBUTTONS | U_CBUTTONS | + R_CBUTTONS)) { // START, A, B, C-left, C-Down, C-Up, C-Right AUDIO_PLAY_SFX(0x49000003, gDefaultSfxSource, 4); D_menu_801B8284 = 0; D_menu_801B8280 = 1; - gControllerLock = 0x1E; + gControllerLock = 30; } break; diff --git a/src/overlays/ovl_menu/fox_title.h b/src/overlays/ovl_menu/fox_title.h index a82cc3eb..f75cf80c 100644 --- a/src/overlays/ovl_menu/fox_title.h +++ b/src/overlays/ovl_menu/fox_title.h @@ -218,7 +218,7 @@ void Title_8018DDB8(s32); void Title_8018DF0C(f32 arg0); void Title_8018E058(void); void Title_8018E200(void); -s32 Title_8018EDC8(s32, Gfx **, Vec3f *, Vec3f *, void *); +bool Title_8018EDC8(s32, Gfx **, Vec3f *, Vec3f *, void *); void Title_8018E67C(s32); void Title_8018F438(void); void Title_80190144(void); diff --git a/src/sys/sys_main.c b/src/sys/sys_main.c index 17ff9b28..da8e19bd 100644 --- a/src/sys/sys_main.c +++ b/src/sys/sys_main.c @@ -1,9 +1,5 @@ #include "sys.h" - -void AudioLoad_Init(void); -SPTask* AudioThread_CreateTask(void); -void Audio_InitSounds(void); -void Audio_Update(void); +#include "sf64audio_external.h" s32 sGammaMode = 1; diff --git a/src/sys/sys_timer.c b/src/sys/sys_timer.c index 071c12ed..6e33932e 100644 --- a/src/sys/sys_timer.c +++ b/src/sys/sys_timer.c @@ -1,11 +1,11 @@ #include "sys.h" -TimerTask sTimerTasks[0x10]; +TimerTask sTimerTasks[16]; TimerTask* Timer_AllocateTask(void) { s32 i; - for (i = 0; i < 0x10; i++) { + for (i = 0; i < ARRAY_COUNT(sTimerTasks); i++) { if (!sTimerTasks[i].active) { return &sTimerTasks[i]; } diff --git a/tools/Torch b/tools/Torch index c567193d..ad667b70 160000 --- a/tools/Torch +++ b/tools/Torch @@ -1 +1 @@ -Subproject commit c567193d17d7fb9b706d5ca2d000520def55f3f8 +Subproject commit ad667b705dad3476a1ae803f23588c55baab2ee4 diff --git a/yamls/us/main.yaml b/yamls/us/main.yaml index 65663cee..cea5ffe8 100644 --- a/yamls/us/main.yaml +++ b/yamls/us/main.yaml @@ -346,8 +346,7 @@ - { type: .bss, vram: 0x80144F60, name: sys/sys_save } - { type: .bss, vram: 0x80145360, name: sys/sys_fault } - { type: .bss, vram: 0x80145D40, name: audio/audio_synthesis } - - { type: .bss, vram: 0x80146D80, name: audio/audio_heap } - - { type: .bss, vram: 0x80146D90, name: audio/audio_load } + - { type: .bss, vram: 0x80146D80, name: audio/audio_load } - { type: .bss, vram: 0x80146E60, name: audio/audio_general } - { type: .bss, vram: 0x8014BA40, name: audio/audio_context } - { type: .bss, vram: 0x80155DA0, name: audio/audio_thread }