From 93ed912319f410fad26a531847fcdacde36589a7 Mon Sep 17 00:00:00 2001 From: HailSanta <53960937+HailSanta@users.noreply.github.com> Date: Fri, 7 Apr 2023 13:18:12 -0400 Subject: [PATCH] fold doc 1 (#1009) * minor fold cleanup * fold doc I * enough * rename * last --------- Co-authored-by: HailSanta --- include/common_structs.h | 2 +- include/dead.h | 6 +- include/enums.h | 98 +- include/macros.h | 1 + include/npc.h | 2 +- include/script_api/common.h | 8 +- src/16c8e0.c | 2 +- src/182B30.c | 12 +- src/1A5830.c | 2 +- src/38F00.c | 4 +- src/77480.c | 4 +- src/7fd10_len_b40.c | 4 +- src/audio/2e230_len_2190.c | 13 +- src/audio/private.h | 2 +- src/battle/area/sam2/actor/monstar.c | 18 +- src/common/UnkBowserFunc1.inc.c | 6 +- src/d0a70_len_4fe0.c | 908 ++++++++++-------- src/entity/BlueWarpPipe.c | 4 +- src/entity/jan_iwa/Plants1.c | 2 +- src/evt/npc_api.c | 10 +- src/evt/player_api.c | 44 +- src/evt/script_list.c | 2 +- src/hud_element.c | 14 +- src/i_spy.c | 2 +- src/inspect_icon.c | 7 +- src/npc.c | 56 +- src/pause/pause_main.c | 2 +- src/pause/pause_partners.c | 2 +- src/pause/pause_spirits.c | 2 +- src/pause/pause_stats.c | 34 +- src/speech_bubble.c | 6 +- src/sprite.c | 12 +- src/world/area_arn/arn_03/arn_03_3_npc.c | 6 +- src/world/area_arn/arn_05/arn_05_3_npc.c | 26 +- src/world/area_arn/arn_07/arn_07_5_npc.c | 8 +- src/world/area_dro/dro_02/dro_02_5_npc.c | 6 +- src/world/area_dro/dro_02/npc_merlee.c | 16 +- src/world/area_end/common/Credits.inc.c | 20 +- src/world/area_end/end_00/end_00_7_boos.c | 12 +- src/world/area_flo/flo_21/flo_21_4_npc.c | 6 +- src/world/area_hos/hos_01/hos_01_4_npc.c | 28 +- src/world/area_hos/hos_03/hos_03_6_npc.c | 6 +- src/world/area_hos/hos_05/hos_05_5_intro.c | 46 +- src/world/area_isk/isk_05/isk_05_3_npc.c | 4 +- src/world/area_isk/isk_07/isk_07_7_ambush.c | 4 +- src/world/area_isk/isk_13/isk_13_3_npc.c | 4 +- src/world/area_isk/isk_14/isk_14_3_npc.c | 2 +- src/world/area_isk/isk_16/isk_16_3_boss.c | 22 +- src/world/area_jan/jan_03/jan_03_4_npc.c | 6 +- src/world/area_kkj/kkj_20/kkj_20_4_npc.c | 6 +- .../area_kkj/kkj_25/kkj_25_2_npc_initial.c | 4 +- .../area_kkj/kkj_25/kkj_25_3_npc_midpoint.c | 14 +- .../area_kkj/kkj_25/kkj_25_7_kammy_defeated.c | 28 +- src/world/area_kmr/kmr_00/kmr_00_4_npc.c | 4 +- src/world/area_kmr/kmr_02/kmr_02_3_npc.c | 16 +- src/world/area_kmr/kmr_02/kmr_02_4_rooms_1.c | 6 +- src/world/area_kmr/kmr_02/kmr_02_7_kammy.c | 24 +- .../area_kmr/kmr_03/kmr_03_6_fall_down.c | 6 +- .../area_kmr/kmr_06/kmr_06_5_sticker_sign.c | 2 +- src/world/area_kmr/kmr_09/kmr_09_3_npc.c | 10 +- src/world/area_kmr/kmr_12/kmr_12_3_npc.c | 6 +- src/world/area_kmr/kmr_20/kmr_20_10_npc.c | 4 +- .../area_kmr/kmr_20/kmr_20_11_npc_intro.c | 8 +- .../area_kmr/kmr_20/kmr_20_12_npc_epilogue.c | 8 +- src/world/area_kmr/kmr_20/kmr_20_8_bed.c | 6 +- src/world/area_kmr/kmr_22/npc/chapter_1.inc.c | 4 +- src/world/area_kmr/kmr_22/npc/chapter_2.inc.c | 14 +- src/world/area_kmr/kmr_22/npc/chapter_3.inc.c | 4 +- src/world/area_kmr/kmr_22/npc/chapter_4.inc.c | 6 +- src/world/area_kmr/kmr_22/npc/chapter_5.inc.c | 2 +- src/world/area_kmr/kmr_22/npc/chapter_6.inc.c | 12 +- src/world/area_kmr/kmr_22/npc/chapter_7.inc.c | 10 +- src/world/area_kmr/kmr_22/npc/chapter_8.inc.c | 2 +- .../area_kmr/kmr_22/npc/lava_piranha.inc.c | 6 +- src/world/area_kmr/kmr_23/kmr_23_2_npc.c | 2 +- src/world/area_kpa/kpa_91/kpa_91_3_npc.c | 6 +- src/world/area_kpa/kpa_95/kpa_95_4_npc.c | 6 +- src/world/area_kzn/common/SpinyTromp.inc.c | 4 +- src/world/area_kzn/kzn_17/kzn_17_3_npc.c | 4 +- src/world/area_mac/mac_00/mac_00_12_intro.c | 12 +- .../area_mac/mac_00/mac_00_14_epilogue.c | 12 +- src/world/area_mac/mac_01/mac_01_9_npc.c | 6 +- src/world/area_mac/mac_02/npc/bootler.inc.c | 4 +- src/world/area_mac/machi/machi_6_misstar.c | 4 +- src/world/area_mim/mim_10/mim_10_4_npc.c | 10 +- src/world/area_mim/mim_11/mim_11_3_gate.c | 4 +- src/world/area_mim/mim_11/mim_11_5_npc.c | 2 +- src/world/area_mim/mim_12/mim_12_3_main.c | 4 +- src/world/area_mim/mim_12/mim_12_5_gate.c | 8 +- src/world/area_nok/nok_01/nok_01_4_npc.c | 6 +- src/world/area_obk/common/TrafficBoos.inc.c | 2 +- .../area_obk/obk_01/obk_01_5_jump_scare.c | 2 +- src/world/area_obk/obk_01/obk_01_6_npc.c | 2 +- src/world/area_obk/obk_04/obk_04_3_npc.c | 22 +- src/world/area_obk/obk_04/obk_04_6_game.c | 12 +- .../area_obk/obk_07/obk_07_6_phonograph.c | 6 +- src/world/area_obk/obk_08/obk_08_5_npc.c | 22 +- src/world/area_obk/obk_08/obk_08_6_game.c | 12 +- src/world/area_obk/obk_09/obk_09_3_meet_bow.c | 4 +- src/world/area_obk/obk_09/obk_09_4_npc.c | 2 +- src/world/area_pra/common/Reflection.inc.c | 8 +- src/world/area_pra/pra_32/pra_32_3_npc.c | 10 +- src/world/area_sam/sam_02/sam_02_4_npc.c | 6 +- src/world/area_sam/sam_05/sam_05_4_npc.c | 6 +- src/world/area_sam/sam_05/sam_05_5_scenes.c | 2 +- src/world/area_sam/sam_06/sam_06_4_npc.c | 6 +- src/world/area_sam/sam_11/sam_11_3_rooms.c | 2 +- src/world/area_sam/sam_11/sam_11_5_npc.c | 2 +- src/world/area_sam/sam_12/sam_12_4_scenes.c | 8 +- src/world/area_trd/trd_00/trd_00_3_npc.c | 4 +- src/world/area_trd/trd_03/trd_03_3_npc.c | 4 +- src/world/area_trd/trd_05/trd_05_4_npc.c | 8 +- src/world/area_trd/trd_10/trd_10_2_npc.c | 4 +- src/world/area_tst/tst_11/tst_11_2_extra.c | 4 +- .../common/complete/KnockDownPlayer.inc.c | 2 +- src/world/common/enemy/ai/MagikoopaAI.inc.c | 4 +- src/world/common/enemy/ai/SentinelAI.inc.c | 6 +- src/world/common/entity/Pipe.inc.c | 20 +- src/world/dead/area_kzn/kzn_17/kzn_17_3_npc.c | 4 +- src/world/partner/bow.c | 6 +- src/world/partner/sushie.c | 16 +- tools/disasm_script.py | 6 +- tools/ignored_funcs.txt | 6 +- ver/ique/asm/bss3.s | 2 +- ver/ique/undefined_syms.txt | 6 +- ver/jp/undefined_syms.txt | 2 +- ver/pal/undefined_syms.txt | 10 +- ver/us/asm/bss3.s | 2 +- ver/us/symbol_addrs.txt | 36 +- ver/us/undefined_syms.txt | 6 +- 130 files changed, 1105 insertions(+), 1008 deletions(-) diff --git a/include/common_structs.h b/include/common_structs.h index a9eee451e0..0a0776737e 100644 --- a/include/common_structs.h +++ b/include/common_structs.h @@ -256,7 +256,7 @@ typedef struct Npc { /* 0x09C */ s16 foldArg2; /* 0x09E */ s16 foldArg3; /* 0x0A0 */ s16 foldArg4; - /* 0x0A2 */ u16 foldArg5; + /* 0x0A2 */ u16 foldFlags; /* 0x0A4 */ s8 npcID; /* 0x0A5 */ char unk_A5; /* 0x0A6 */ s16 collisionRadius; diff --git a/include/dead.h b/include/dead.h index 54fac40713..82752ca3c9 100644 --- a/include/dead.h +++ b/include/dead.h @@ -275,8 +275,8 @@ #define GetSelfVar dead_GetSelfVar #define GetPlayerTargetYaw dead_GetPlayerTargetYaw #define HidePlayerShadow dead_HidePlayerShadow -#define func_802D286C dead_func_802D286C -#define func_802D2520 dead_func_802D2520 +#define SetPlayerFoldFlags dead_SetPlayerFoldFlags +#define UpdatePlayerFold dead_UpdatePlayerFold #define SetPlayerFlagBits dead_SetPlayerFlagBits #define func_80044238 dead_func_80044238 #define SetCamType dead_SetCamType @@ -322,7 +322,7 @@ #define GetSelfAnimationFromTable dead_GetSelfAnimationFromTable #define EVS_NpcHitRecoil dead_EVS_NpcHitRecoil #define SelfEnemyOverrideSyncPos dead_SelfEnemyOverrideSyncPos -#define func_802CFD30 dead_func_802CFD30 +#define SetNpcFoldParams dead_SetNpcFoldParams #define SetGroupVisibility dead_SetGroupVisibility #define Entity_HeartBlock dead_Entity_HeartBlock #define GetCamDistance dead_GetCamDistance diff --git a/include/enums.h b/include/enums.h index 96a9b79e14..1e5c0d3071 100644 --- a/include/enums.h +++ b/include/enums.h @@ -5963,15 +5963,16 @@ enum FoldStateFlags { FOLD_STATE_FLAG_ENABLED = 0x00000001, FOLD_STATE_FLAG_G_CULL_BACK = 0x00000002, FOLD_STATE_FLAG_G_CULL_FRONT = 0x00000004, - FOLD_STATE_FLAG_10 = 0x00000010, - FOLD_STATE_FLAG_20 = 0x00000020, + FOLD_STATE_FLAG_8 = 0x00000008, + FOLD_STATE_FLAG_SKIP_GFX_SETUP = 0x00000010, + FOLD_STATE_FLAG_SKIP_TEX_SETUP = 0x00000020, FOLD_STATE_FLAG_40 = 0x00000040, - FOLD_STATE_FLAG_80 = 0x00000080, - FOLD_STATE_FLAG_100 = 0x00000100, + FOLD_STATE_FLAG_LOOP_ANIM = 0x00000080, + FOLD_STATE_FLAG_REVERSE_ANIM = 0x00000100, // fold animation plays backwards (from end to start) FOLD_STATE_FLAG_200 = 0x00000200, FOLD_STATE_FLAG_400 = 0x00000400, FOLD_STATE_FLAG_800 = 0x00000800, - FOLD_STATE_FLAG_1000 = 0x00001000, + FOLD_STATE_FLAG_ANIM_DONE = 0x00001000, FOLD_STATE_FLAG_2000 = 0x00002000, FOLD_STATE_FLAG_4000 = 0x00004000, FOLD_STATE_FLAG_8000 = 0x00008000, @@ -5983,50 +5984,73 @@ enum FoldStateFlags { }; typedef enum FoldType { - FOLD_TYPE_NONE = 0x0, - FOLD_TYPE_1 = 0x1, - FOLD_TYPE_2 = 0x2, - FOLD_TYPE_3 = 0x3, - FOLD_TYPE_4 = 0x4, - FOLD_TYPE_5 = 0x5, - FOLD_TYPE_6 = 0x6, - FOLD_TYPE_7 = 0x7, - FOLD_TYPE_8 = 0x8, // color overlay? + FOLD_UPD_CLEAR = 0x0, // or FOLD_UPD_INIT? + FOLD_TYPE_1 = 0x1, // unused? + FOLD_TYPE_2 = 0x2, // unused? + FOLD_TYPE_3 = 0x3, // after goomba 'sticker' ambush in kmr_09 unfurls + FOLD_UPD_WAVY = 0x4, // Kolorado when injured and Sushie when underwater (* note: Sushie fold rendering is bugged and only occurs *before* going underwater) + FOLD_UPD_SET_ANIM = 0x5, + FOLD_UPD_SET_COLOR = 0x6, // modulate color (args: R, G, B) + FOLD_UPD_SET_ALPHA = 0x7, // modulate alpha (args: A) + FOLD_UPD_SET_TINT = 0x8, // modulate color+alpha (args: R, G, B, A) FOLD_TYPE_9 = 0x9, FOLD_TYPE_A = 0xA, - FOLD_TYPE_B = 0xB, - FOLD_TYPE_C = 0xC, - FOLD_TYPE_D = 0xD, // noisy hologram -- used for ghostly star spirits and merlar + FOLD_UPD_COLOR_BUF_SET_B = 0xB, + FOLD_UPD_COLOR_BUF_SET_C = 0xC, + FOLD_UPD_HOLOGRAM = 0xD, // ghostly star spirits and merlar (args: ???, staticAmt, ???, alphaAmt) FOLD_TYPE_E = 0xE, FOLD_TYPE_F = 0xF, - FOLD_TYPE_10 = 0x10, - FOLD_TYPE_11 = 0x11, + FOLD_TYPE_10 = 0x10, // unused? + FOLD_UPD_ALLOC_COLOR_BUF = 0x11, // args: count } FoldType; +typedef enum FoldAnim { + FOLD_ANIM_SHOCK = 0x00, // used for Goombaria and Goompapa when Kammy drops the hammer block + FOLD_ANIM_SHIVER = 0x01, // used when Goombaria gives Mario a kiss + FOLD_ANIM_VERTICAL_PIPE_CURL = 0x02, // vertical pipe curl + FOLD_ANIM_HORIZONTAL_PIPE_CURL = 0x03, // horizontal pipe curl + FOLD_ANIM_STARTLE = 0x04, // used when Koopa Bros are surprised by Mario + FOLD_ANIM_FLUTTER_DOWN = 0x05, // player falling like paper + FOLD_ANIM_UNFURL = 0x06, // used by Goomba 'stickers' that ambush Mario in area_kmr + FOLD_ANIM_GET_IN_BED = 0x07, // Mario gets into bed + FOLD_ANIM_SPIRIT_CAPTURE = 0x08, // Eldstar being captured + FOLD_ANIM_UNUSED_1 = 0x09, // unused + FOLD_ANIM_UNUSED_2 = 0x0A, // unused + FOLD_ANIM_UNUSED_3 = 0x0B, // unused + FOLD_ANIM_TUTANKOOPA_GATHER = 0x0C, // tutankoopa 3 + FOLD_ANIM_TUTANKOOPA_SWIRL_2 = 0x0D, // tutankoopa 2 + FOLD_ANIM_TUTANKOOPA_SWIRL_1 = 0x0E, // tutankoopa 1 + FOLD_ANIM_SHUFFLE_CARDS = 0x0F, // merlee spell-casting card shuffle + FOLD_ANIM_FLIP_CARD_1 = 0x10, // merlee spell-casting card flip 1 + FOLD_ANIM_FLIP_CARD_2 = 0x11, // merlee spell-casting card flip 2 + FOLD_ANIM_FLIP_CARD_3 = 0x12, // merlee spell-casting card flip 3 + FOLD_ANIM_CYMBAL_CRUSH = 0x13, // used when Mario is crushed in a Cymbal Plant +} FoldAnim; + typedef enum FoldRenderType { - FOLD_RENDER_TYPE_0 = 0x0, - FOLD_RENDER_TYPE_1 = 0x1, - FOLD_RENDER_TYPE_2 = 0x2, - FOLD_RENDER_TYPE_3 = 0x3, - FOLD_RENDER_TYPE_4 = 0x4, - FOLD_RENDER_TYPE_5 = 0x5, - FOLD_RENDER_TYPE_6 = 0x6, - FOLD_RENDER_TYPE_7 = 0x7, - FOLD_RENDER_TYPE_8 = 0x8, - FOLD_RENDER_TYPE_9 = 0x9, - FOLD_RENDER_TYPE_A = 0xA, - FOLD_RENDER_TYPE_B = 0xB, - FOLD_RENDER_TYPE_C = 0xC, - FOLD_RENDER_TYPE_D = 0xD, - FOLD_RENDER_TYPE_E = 0xE, - FOLD_RENDER_TYPE_F = 0xF, - FOLD_RENDER_TYPE_10 = 0x10, + FOLD_RENDER_TYPE_0 = 0x0, + FOLD_RENDER_TYPE_1 = 0x1, + FOLD_RENDER_TYPE_2 = 0x2, + FOLD_RENDER_TYPE_3 = 0x3, + FOLD_RENDER_TYPE_4 = 0x4, + FOLD_RENDER_TYPE_5 = 0x5, + FOLD_RENDER_TYPE_6 = 0x6, + FOLD_RENDER_TYPE_7 = 0x7, + FOLD_RENDER_TYPE_8 = 0x8, + FOLD_RENDER_TYPE_9 = 0x9, + FOLD_RENDER_TYPE_A = 0xA, + FOLD_RENDER_TYPE_B = 0xB, + FOLD_RENDER_HOLOGRAM = 0xC, + FOLD_RENDER_TYPE_D = 0xD, + FOLD_RENDER_TYPE_E = 0xE, + FOLD_RENDER_TYPE_F = 0xF, + FOLD_RENDER_TYPE_10 = 0x10, } FoldRenderType; typedef enum FoldMeshType { FOLD_MESH_TYPE_0 = 0x0, FOLD_MESH_TYPE_1 = 0x1, - FOLD_MESH_TYPE_2 = 0x2, + FOLD_MESH_ANIMATED = 0x2, FOLD_MESH_TYPE_3 = 0x3, FOLD_MESH_TYPE_4 = 0x4, } FoldMeshType; diff --git a/include/macros.h b/include/macros.h index e8db412bf1..c5d1e99a0d 100644 --- a/include/macros.h +++ b/include/macros.h @@ -94,6 +94,7 @@ #define MAX_WORKERS 16 #define MAX_TEX_PANNERS 16 #define MAX_ITEM_ENTITIES 256 +#define MAX_FOLD_STATES 90 #define MAX_STAR_PIECES 222 diff --git a/include/npc.h b/include/npc.h index 89d64b4486..97ac152fc9 100644 --- a/include/npc.h +++ b/include/npc.h @@ -594,7 +594,7 @@ s32 npc_get_collider_below(Npc* npc); void func_8003D3BC(Npc* npc); -void func_8003D624(Npc* npc, s32 arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5, s32 arg6); +void npc_set_fold_params(Npc* npc, s32 arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5, s32 arg6); void spawn_surface_effects(Npc* npc, SurfaceInteractMode mode); diff --git a/include/script_api/common.h b/include/script_api/common.h index edc3c08649..7ded692aa1 100644 --- a/include/script_api/common.h +++ b/include/script_api/common.h @@ -292,8 +292,8 @@ ApiStatus func_802D2484(Evt* script, s32 isInitialCall); ApiStatus WaitForPlayerTouchingFloor(Evt* script, s32 isInitialCall); ApiStatus IsPlayerOnValidFloor(Evt* script, s32 isInitialCall); ApiStatus WaitForPlayerMoveToComplete(Evt* script, s32 isInitialCall); -ApiStatus func_802CFE2C(Evt* script, s32 isInitialCall); -ApiStatus func_802CFD30(Evt* script, s32 isInitialCall); +ApiStatus SetNpcFoldFlags(Evt* script, s32 isInitialCall); +ApiStatus SetNpcFoldParams(Evt* script, s32 isInitialCall); ApiStatus IsStartingConversation(Evt* script, s32 isInitialCall); ApiStatus SetTimeFreezeMode(Evt* script, s32 isInitialCall); ApiStatus CreateVirtualEntity(Evt* script, s32 isInitialCall); @@ -327,8 +327,8 @@ ApiStatus func_802CF56C(Evt* script, s32 isInitialCall); ApiStatus func_802CA988(Evt* script, s32 isInitialCall); ApiStatus SetNpcRotationPivot(Evt* script, s32 isInitialCall); ApiStatus SetSleepBubbleTimeLeft(Evt* script, s32 isInitialCall); -ApiStatus func_802D286C(Evt* script, s32 isInitialCall); -ApiStatus func_802D2520(Evt* script, s32 isInitialCall); +ApiStatus SetPlayerFoldFlags(Evt* script, s32 isInitialCall); +ApiStatus UpdatePlayerFold(Evt* script, s32 isInitialCall); ApiStatus PushSong(Evt* script, s32 isInitialCall); ApiStatus PopSong(Evt* script, s32 isInitialCall); ApiStatus func_802D62E4(Evt* script, s32 isInitialCall); diff --git a/src/16c8e0.c b/src/16c8e0.c index 01ec1cf909..e6f2083da6 100644 --- a/src/16c8e0.c +++ b/src/16c8e0.c @@ -1132,7 +1132,7 @@ void btl_delete_actor(Actor* actor) { } if (part->idleAnimations != NULL) { - func_802DE894(part->spriteInstanceID, FOLD_TYPE_NONE, 0, 0, 0, 0, 0); + func_802DE894(part->spriteInstanceID, FOLD_UPD_CLEAR, 0, 0, 0, 0, 0); ASSERT(spr_free_sprite(part->spriteInstanceID) == 0); diff --git a/src/182B30.c b/src/182B30.c index 54f187a07a..c5f9db0966 100644 --- a/src/182B30.c +++ b/src/182B30.c @@ -3223,9 +3223,9 @@ void func_8025C8A0(s32 isNpcSprite, ActorPart* part, s32 yaw, s32 arg3) { if (part->decorationTable->unk_751 != 0) { part->decorationTable->unk_751 = 0; if (isNpcSprite == SPRITE_MODE_PLAYER) { - func_802DDFF8(PLAYER_SPRITE_MAIN, FOLD_TYPE_NONE, 0, 0, 0, 0, 0); + func_802DDFF8(PLAYER_SPRITE_MAIN, FOLD_UPD_CLEAR, 0, 0, 0, 0, 0); } else { - func_802DE894(part->spriteInstanceID, FOLD_TYPE_NONE, 0, 0, 0, 0, 0); + func_802DE894(part->spriteInstanceID, FOLD_UPD_CLEAR, 0, 0, 0, 0, 0); } } } @@ -3246,9 +3246,9 @@ void func_8025C918(s32 isNpcSprite, ActorPart* part, s32 yaw, s32 arg3) { decor->unk_751 = 0; decor->unk758 = 0; if (isNpcSprite == SPRITE_MODE_PLAYER) { - func_802DDFF8(0, FOLD_TYPE_11, 20, 0, 0, 255, 0); + func_802DDFF8(PLAYER_SPRITE_MAIN, FOLD_UPD_ALLOC_COLOR_BUF, 20, 0, 0, 255, 0); } else { - func_802DE894(part->spriteInstanceID, FOLD_TYPE_11, 20, 0, 0, 255, 0); + func_802DE894(part->spriteInstanceID, FOLD_UPD_ALLOC_COLOR_BUF, 20, 0, 0, 255, 0); } } @@ -3276,9 +3276,9 @@ void func_8025C918(s32 isNpcSprite, ActorPart* part, s32 yaw, s32 arg3) { for (i = 0; i < ARRAY_COUNT(rbuf); i++) { color = (rbuf[i] << 0x18) | (gbuf[i] << 0x10) | (bbuf[i] << 8) | alpha; if (isNpcSprite == SPRITE_MODE_PLAYER) { - func_802DDFF8(PLAYER_SPRITE_MAIN, FOLD_TYPE_C, i, color, 0, 0xFF, 0); + func_802DDFF8(PLAYER_SPRITE_MAIN, FOLD_UPD_COLOR_BUF_SET_C, i, color, 0, 255, 0); } else { - func_802DE894(part->spriteInstanceID, FOLD_TYPE_C, i, color, 0, 0xFF, 0); + func_802DE894(part->spriteInstanceID, FOLD_UPD_COLOR_BUF_SET_C, i, color, 0, 255, 0); } } diff --git a/src/1A5830.c b/src/1A5830.c index ca716ae34d..422902c7c3 100644 --- a/src/1A5830.c +++ b/src/1A5830.c @@ -3336,7 +3336,7 @@ ApiStatus EnableActorGlow(Evt* script, s32 isInitialCall) { while (it != NULL) { if (it->idleAnimations != NULL) { - func_802DE894(it->spriteInstanceID, FOLD_TYPE_NONE, 0, 0, 0, 0, 0); + func_802DE894(it->spriteInstanceID, FOLD_UPD_CLEAR, 0, 0, 0, 0, 0); } it = it->nextPart; } diff --git a/src/38F00.c b/src/38F00.c index 989d640873..36071c7d0b 100644 --- a/src/38F00.c +++ b/src/38F00.c @@ -70,12 +70,12 @@ EvtScript D_800939B4 = { EVT_LOOP(30) EVT_CALL(SetNpcRotation, NPC_SELF, 0, LVar0, 0) EVT_CALL(func_8005DD54) - EVT_CALL(func_802CFD30, NPC_SELF, FOLD_TYPE_6, LVar2, LVar2, LVar2, 0) + EVT_CALL(SetNpcFoldParams, NPC_SELF, FOLD_UPD_SET_COLOR, LVar2, LVar2, LVar2, 0) EVT_ADD(LVar0, 30) EVT_WAIT(1) EVT_END_LOOP EVT_CALL(SetNpcRotation, NPC_SELF, 0, 0, 0) - EVT_CALL(func_802CFD30, NPC_SELF, FOLD_TYPE_6, 255, 255, 255, 0) + EVT_CALL(SetNpcFoldParams, NPC_SELF, FOLD_UPD_SET_COLOR, 255, 255, 255, 0) EVT_CALL(SetNpcFlagBits, NPC_SELF, NPC_FLAG_IGNORE_CAMERA_FOR_YAW, FALSE) EVT_CALL(SetSelfVar, 0, 0) EVT_CALL(func_8005DDF0) diff --git a/src/77480.c b/src/77480.c index 5b54f55800..bb28983f0f 100644 --- a/src/77480.c +++ b/src/77480.c @@ -1551,7 +1551,7 @@ void appendGfx_player(void* data) { playerStatus->animFlags = playerStatus->animFlags & ~PA_FLAG_SHIVERING; playerStatus->shiverTime = 22; func_802DDEE4(PLAYER_SPRITE_MAIN, -1, 0, 0, 0, 0, 0, 0); - func_802DDFF8(playerStatus->anim, 5, 1, 1, 1, 0, 0); + func_802DDFF8(playerStatus->anim, FOLD_UPD_SET_ANIM, FOLD_ANIM_SHIVER, 1, 1, 0, 0); } if (playerStatus->shiverTime != 0) { @@ -1614,7 +1614,7 @@ void appendGfx_player_spin(void* data) { tint = 100; } - func_802DDFF8(0, FOLD_TYPE_6, tint, tint, tint, 255, 0); + func_802DDFF8(PLAYER_SPRITE_MAIN, FOLD_UPD_SET_COLOR, tint, tint, tint, 255, 0); guRotateF(rotation, yaw, 0.0f, -1.0f, 0.0f); guRotateF(mtx, clamp_angle(playerStatus->pitch), 0.0f, 0.0f, 1.0f); diff --git a/src/7fd10_len_b40.c b/src/7fd10_len_b40.c index be6a6c5d6d..3e3114805e 100644 --- a/src/7fd10_len_b40.c +++ b/src/7fd10_len_b40.c @@ -31,8 +31,8 @@ void func_800E6860(void) { if (gPartnerStatus.partnerActionState != PARTNER_ACTION_NONE && gPartnerStatus.actingPartner == PARTNER_BOW) { Npc* partner = get_npc_unsafe(NPC_PARTNER); - func_802DDEE4(PLAYER_SPRITE_MAIN, -1, FOLD_TYPE_7, 0, 0, 0, playerStatus->alpha1, 0); - func_8003D624(partner, FOLD_TYPE_7, playerStatus->alpha1, 0, 0, 0, 0); + func_802DDEE4(PLAYER_SPRITE_MAIN, -1, FOLD_UPD_SET_ALPHA, 0, 0, 0, playerStatus->alpha1, 0); + npc_set_fold_params(partner, FOLD_UPD_SET_ALPHA, playerStatus->alpha1, 0, 0, 0, 0); playerStatus->alpha2 = 0; } } diff --git a/src/audio/2e230_len_2190.c b/src/audio/2e230_len_2190.c index 9808d7917b..567c28a4ec 100644 --- a/src/audio/2e230_len_2190.c +++ b/src/audio/2e230_len_2190.c @@ -599,8 +599,6 @@ AuResult func_80053E58(s32 songID, BGMHeader* bgmFile) { AuGlobals* soundData; InitSongEntry* songInfo; s32 i; - u32 data; - u32 offset; u16 bkFileIndex; soundData = gSoundGlobals; @@ -614,14 +612,11 @@ AuResult func_80053E58(s32 songID, BGMHeader* bgmFile) { if (bkFileIndex != 0) { bkFileEntry = &soundData->sbnFileList[bkFileIndex]; - offset = (bkFileEntry->offset & 0xFFFFFF) + soundData->baseRomOffset; - fileEntry.offset = offset; + fileEntry.offset = (bkFileEntry->offset & 0xFFFFFF) + soundData->baseRomOffset; + fileEntry.data = bkFileEntry->data; - data = bkFileEntry->data; - fileEntry.data = data; - - if ((data >> 0x18) == AU_FMT_BK) { - snd_load_BK(offset, i); + if ((fileEntry.data >> 0x18) == AU_FMT_BK) { + snd_load_BK(fileEntry.offset, i); } else { status = AU_ERROR_SBN_FORMAT_MISMATCH; } diff --git a/src/audio/private.h b/src/audio/private.h index 7946e5554f..dffb845d4c 100644 --- a/src/audio/private.h +++ b/src/audio/private.h @@ -54,7 +54,7 @@ Instrument* au_get_instrument(AuGlobals* globals, u32 bank, u32 patch, EnvelopeD void au_get_bgm_player_and_file(u32 playerIndex, BGMHeader** outCurrentTrackData, BGMPlayer** outPlayer); void au_get_bgm_player(u32 playerIndex, BGMPlayer** outPlayer); AuResult au_load_song_files(u32 arg0, BGMHeader* arg1, BGMPlayer* arg2); -AuResult func_80053E58(s32 arg0, BGMHeader* arg1); +AuResult func_80053E58(s32 songID, BGMHeader* arg1); BGMPlayer* func_80053F64(s32 arg0); AuResult au_ambient_load(u32 arg0); BGMPlayer* func_80054248(u8 arg0); diff --git a/src/battle/area/sam2/actor/monstar.c b/src/battle/area/sam2/actor/monstar.c index a8bb6aa26e..e6cce93d5f 100644 --- a/src/battle/area/sam2/actor/monstar.c +++ b/src/battle/area/sam2/actor/monstar.c @@ -149,16 +149,16 @@ FoldImageRecPart D_8021A2B8_63F498 = { API_CALLABLE(func_80218000_63D1E0) { ActorPart* part = get_actor_part(get_actor(script->owner1.actorID), 1); s32 i; - u8 sp20[20]; - u8 sp38[20]; - u8 sp50[20]; - u8 sp68[20]; + u8 colR[20]; + u8 colG[20]; + u8 colB[20]; + u8 colA[20]; if (isInitialCall) { script->functionTemp[1] = 0; script->functionTemp[2] = 0; script->functionTemp[0] = 0; - func_802DE780(part->spriteInstanceID, 0, FOLD_TYPE_11, 20, 0, 0, 255, 0); + func_802DE780(part->spriteInstanceID, 0, FOLD_UPD_ALLOC_COLOR_BUF, 20, 0, 0, 255, 0); } func_802DE780(part->spriteInstanceID, 1, FOLD_TYPE_F, (s32)&D_8021A2B8_63F498, 255, 0, 255, 0); @@ -168,13 +168,13 @@ API_CALLABLE(func_80218000_63D1E0) { } for (i = 0; i < 20; i++) { - sp20[i] = (cosine(script->functionTemp[1] + i * 25) + 1.0) * 56.0; - sp38[i] = (cosine(script->functionTemp[1] + i * 25 + 45) + 1.0) * 56.0; - sp50[i] = (cosine(script->functionTemp[1] + i * 25 + 90) + 1.0) * 56.0; + colR[i] = (cosine(script->functionTemp[1] + i * 25) + 1.0) * 56.0; + colG[i] = (cosine(script->functionTemp[1] + i * 25 + 45) + 1.0) * 56.0; + colB[i] = (cosine(script->functionTemp[1] + i * 25 + 90) + 1.0) * 56.0; } for (i = 0; i < 20; i++) { - func_802DE780(part->spriteInstanceID, 0, FOLD_TYPE_C, i, sp20[i] << 0x18 | sp38[i] << 0x10 | sp50[i] << 8 | 0xFF, 0, 255, 0); + func_802DE780(part->spriteInstanceID, 0, FOLD_UPD_COLOR_BUF_SET_C, i, colR[i] << 0x18 | colG[i] << 0x10 | colB[i] << 8 | 255, 0, 255, 0); } return ApiStatus_BLOCK; diff --git a/src/common/UnkBowserFunc1.inc.c b/src/common/UnkBowserFunc1.inc.c index fff0a5d892..f4c4dcb713 100644 --- a/src/common/UnkBowserFunc1.inc.c +++ b/src/common/UnkBowserFunc1.inc.c @@ -30,7 +30,7 @@ API_CALLABLE(N(UnkBowserFunc1)) { script->functionTemp[0] = 0; for (i = 0; i < 10; i++) { - func_802DE780(part->spriteInstanceID, i, FOLD_TYPE_11, 20, 0, 0, 255, 0); + func_802DE780(part->spriteInstanceID, i, FOLD_UPD_ALLOC_COLOR_BUF, 20, 0, 0, 255, 0); } } @@ -50,7 +50,7 @@ API_CALLABLE(N(UnkBowserFunc1)) { for (j = 0; j < 20; j++) { colorRGBA = sp20[j] << 0x18 | sp38[j] << 0x10 | sp50[j] << 8 | 0xFF; for (i = 0; i < 10; i++) { - func_802DE780(part->spriteInstanceID, i, FOLD_TYPE_C, j, colorRGBA, 0, 255, 0); + func_802DE780(part->spriteInstanceID, i, FOLD_UPD_COLOR_BUF_SET_C, j, colorRGBA, 0, 255, 0); } } return ApiStatus_BLOCK; @@ -60,7 +60,7 @@ API_CALLABLE(N(UnkBowserFunc1)) { colorRGBA = 255; for (i = 0; i < 10; i++) { // TODO find better match for opacity - func_802DE780(part->spriteInstanceID, i, FOLD_TYPE_C, j, colorRGBA, 0, opacity & 0xFFFF, 0); + func_802DE780(part->spriteInstanceID, i, FOLD_UPD_COLOR_BUF_SET_C, j, colorRGBA, 0, opacity & 0xFFFF, 0); } } script->functionTemp[1] = 0; diff --git a/src/d0a70_len_4fe0.c b/src/d0a70_len_4fe0.c index f08eec6a1f..70d932daf8 100644 --- a/src/d0a70_len_4fe0.c +++ b/src/d0a70_len_4fe0.c @@ -7,6 +7,38 @@ extern Addr fold_gfx_data_ROM_START; #endif +typedef union FoldIntVars { + s32 raw[2][4]; + Color4i color[2]; + s32 savedArgs[2][4]; + struct { + s32 type; + } anim; + struct { + Vec3i mag; + } wavy; + struct { + char unk_00[0x10]; + s32 mode; + s32 noiseAmt; + char unk_18[4]; + s32 alphaAmt; + } hologram; +} FoldIntVars; + +typedef union FoldFloatVars { + f32 raw[2][4]; + struct { + f32 curFrame; + f32 curIdx; + } anim; + struct { + f32 phase1; + f32 phase2; + f32 phase3; + } wavy; +} FoldFloatVars; + typedef struct { /* 0x00 */ u8 arrayIdx; /* 0x01 */ u8 meshType; @@ -23,15 +55,15 @@ typedef struct { /* 0x10 */ s16 unk_10; /* 0x14 */ s32 flags; /* 0x18 */ char unk_18[0x4]; - /* 0x1C */ s32 unk_1C[2][4]; - /* 0x3C */ f32 unk_3C[2][4]; - /* 0x5C */ u8* buf; - /* 0x60 */ u16 bufSize; + /* 0x1C */ FoldIntVars ints; + /* 0x3C */ FoldFloatVars floats; + /* 0x5C */ Color_RGBA8* colorBuf; + /* 0x60 */ u16 colorBufCount; /* 0x62 */ char unk_62[0x2]; - /* 0x64 */ u8* unk_64; + /* 0x64 */ u8* curAnimOffset; /* 0x68 */ Vtx* vtxBufs[2]; /* 0x70 */ Gfx* gfxBufs[2]; - /* 0x78 */ s32 unk_78; + /* 0x78 */ s32 otherModeL; } FoldState; // size = 0x7C typedef struct FoldDataCache { @@ -41,14 +73,18 @@ typedef struct FoldDataCache { /* 0x06 */ char unk_06[0x2]; } FoldDataCache; // size = 0x8 -typedef struct FoldGfxDescriptor { - /* 0x00 */ Vtx* vtx; - /* 0x04 */ Gfx* gfx; - /* 0x08 */ u16 vtxCount; +typedef struct FoldAnimHeader { + /* 0x00 */ s32 keyframesOffset; + /* 0x04 */ Gfx* gfxOffset; // Gfx for creating mesh from vertices + /* 0x08 */ u16 vtxCount; // conserved across keyframes /* 0x0A */ u16 gfxCount; - /* 0x0C */ u16 unk_0C; - /* 0x0E */ u16 useAbsoluteValues; -} FoldGfxDescriptor; // size = 0x10 + /* 0x0C */ u16 keyframesCount; + /* 0x0E */ u16 flags; +} FoldAnimHeader; // size = 0x10 + +enum FoldAnimFlags { + FOLD_ANIM_FLAG_ABSOLUTE_COORDS = 1, // image-relative (in percent) when unset +}; typedef struct FoldRenderMode { /* 0x0 */ s32 mode1; @@ -66,14 +102,15 @@ typedef struct UnkFoldStruct { /* 0x14 */ Gfx* unk_14; } UnkFoldStruct; // size = 0x18 -typedef struct PackedVtx { +// 'compressed' vertex data for animated fold keyframes +typedef struct FoldVtx { /* 0x00 */ s16 ob[3]; /* 0x06 */ u8 tc[2]; /* 0x08 */ s8 cn[3]; /* 0x0B */ char unk_0B; -} PackedVtx; // size = 0x0C +} FoldVtx; // size = 0x0C -typedef FoldState FoldStateList[90]; +typedef FoldState FoldStateList[MAX_FOLD_STATES]; extern HeapNode heap_spriteHead; @@ -86,14 +123,14 @@ extern s8 D_80156958[2]; extern s32 D_80156960[2]; extern s32 D_80156968[2]; extern s8 D_80156970; -extern FoldGfxDescriptor fold_groupDescriptors[4]; +extern FoldAnimHeader FoldAnimHeaders[4]; // Data FoldImageRec* fold_currentImage = &D_80156920; u16 fold_vtxCount = 0; -Lights2 D_8014EE18 = gdSPDefLights2(144, 144, 144, 255, 255, 255, 0, 0, 120, 255, 255, 255, 0, 0, 136); +Lights2 FoldLights = gdSPDefLights2(144, 144, 144, 255, 255, 255, 0, 0, 120, 255, 255, 255, 0, 0, 136); Vp D_8014EE40 = { .vp = { @@ -109,7 +146,7 @@ Vp D_8014EE50 = { } }; -u16 D_8014EE60 = 300; +u16 FoldVtxBufferCapacity = 300; Gfx DefaultFoldSetupGfx[] = { gsSPClearGeometryMode(G_CULL_BOTH | G_LIGHTING), @@ -121,30 +158,49 @@ Gfx DefaultFoldSetupGfx[] = { gsSPEndDisplayList(), }; +//TODO figure out bits FoldRenderMode D_8014EE98[17] = { - { 0x00441208, 0x00111208, FALSE }, - { 0x00441208, 0x00111208, FALSE }, - { 0x00404B40, 0x00104B40, TRUE }, - { 0x00404B40, 0x00104B40, TRUE }, - { 0x00441208, 0x00111208, FALSE }, - { 0x00404B40, 0x00104B40, TRUE }, - { 0x00441208, 0x00111208, FALSE }, - { 0x00404B40, 0x00104B40, TRUE }, - { 0x00404B40, 0x00104B40, TRUE }, - { 0x00441208, 0x00111208, FALSE }, - { 0x00404B40, 0x00104B40, TRUE }, - { 0x00441208, 0x00111208, FALSE }, - { 0x00404B40, 0x00104B40, TRUE }, - { 0x00441208, 0x00111208, FALSE }, - { 0x00441208, 0x00111208, FALSE }, - { 0x00404B40, 0x00104B40, TRUE }, - { 0x00441208, 0x00111208, FALSE }, + [FOLD_RENDER_TYPE_0] { 0x00441208, 0x00111208, FALSE }, + [FOLD_RENDER_TYPE_1] { 0x00441208, 0x00111208, FALSE }, + [FOLD_RENDER_TYPE_2] { 0x00404B40, 0x00104B40, TRUE }, + [FOLD_RENDER_TYPE_3] { 0x00404B40, 0x00104B40, TRUE }, + [FOLD_RENDER_TYPE_4] { 0x00441208, 0x00111208, FALSE }, + [FOLD_RENDER_TYPE_5] { 0x00404B40, 0x00104B40, TRUE }, + [FOLD_RENDER_TYPE_6] { 0x00441208, 0x00111208, FALSE }, + [FOLD_RENDER_TYPE_7] { 0x00404B40, 0x00104B40, TRUE }, + [FOLD_RENDER_TYPE_8] { 0x00404B40, 0x00104B40, TRUE }, + [FOLD_RENDER_TYPE_9] { 0x00441208, 0x00111208, FALSE }, + [FOLD_RENDER_TYPE_A] { 0x00404B40, 0x00104B40, TRUE }, + [FOLD_RENDER_TYPE_B] { 0x00441208, 0x00111208, FALSE }, + [FOLD_RENDER_HOLOGRAM] { 0x00404B40, 0x00104B40, TRUE }, + [FOLD_RENDER_TYPE_D] { 0x00441208, 0x00111208, FALSE }, + [FOLD_RENDER_TYPE_E] { 0x00441208, 0x00111208, FALSE }, + [FOLD_RENDER_TYPE_F] { 0x00404B40, 0x00104B40, TRUE }, + [FOLD_RENDER_TYPE_10] { 0x00441208, 0x00111208, FALSE }, }; -s32 fold_groupOffsets[] = { - 0x00014358, 0x00018200, 0x0001A858, 0x0001E830, 0x00029458, 0x000314E0, 0x00033498, 0x00038988, 0x00039228, - 0x0005B7A8, 0x0007CF10, 0x00086490, 0x00096258, 0x000A1820, 0x000ACDE8, 0x000BBF68, 0x000C0490, 0x000C49B8, - 0x000C6150, 0x000CA380 +// all relative to fold_gfx_data_ROM_START +s32 FoldAnimOffsets[] = { + [FOLD_ANIM_SHOCK] 0x14358, + [FOLD_ANIM_SHIVER] 0x18200, + [FOLD_ANIM_VERTICAL_PIPE_CURL] 0x1A858, + [FOLD_ANIM_HORIZONTAL_PIPE_CURL] 0x1E830, + [FOLD_ANIM_STARTLE] 0x29458, + [FOLD_ANIM_FLUTTER_DOWN] 0x314E0, + [FOLD_ANIM_UNFURL] 0x33498, + [FOLD_ANIM_GET_IN_BED] 0x38988, + [FOLD_ANIM_SPIRIT_CAPTURE] 0x39228, + [FOLD_ANIM_UNUSED_1] 0x5B7A8, + [FOLD_ANIM_UNUSED_2] 0x7CF10, + [FOLD_ANIM_UNUSED_3] 0x86490, + [FOLD_ANIM_TUTANKOOPA_GATHER] 0x96258, + [FOLD_ANIM_TUTANKOOPA_SWIRL_2] 0xA1820, + [FOLD_ANIM_TUTANKOOPA_SWIRL_1] 0xACDE8, + [FOLD_ANIM_SHUFFLE_CARDS] 0xBBF68, + [FOLD_ANIM_FLIP_CARD_1] 0xC0490, + [FOLD_ANIM_FLIP_CARD_2] 0xC49B8, + [FOLD_ANIM_FLIP_CARD_3] 0xC6150, + [FOLD_ANIM_CYMBAL_CRUSH] 0xCA380, }; extern FoldDataCache fold_gfxDataCache[8]; @@ -154,27 +210,27 @@ void fold_clear_state_data(FoldState* state); void fold_init_state(FoldState* state); void func_8013B0EC(FoldState* state); void func_8013B1B0(FoldState* state, Matrix4f mtx); -void func_8013BC88(FoldState* state); -void func_8013C048(FoldState* state); -//FoldGfxDescriptor* fold_load_gfx(FoldState* state); -void func_8013C3F0(FoldState* state); +void fold_mesh_make_strip(FoldState* state); +void fold_mesh_make_grid(FoldState* state); +//FoldAnimHeader* fold_load_anim(FoldState* state); +void fold_mesh_anim_update(FoldState* state); void func_8013CFA8(FoldState*, Matrix4f mtx); void func_8013DAB4(FoldState*, Matrix4f mtx); void func_8013E2F0(FoldState*, Matrix4f mtx); void func_8013E904(FoldState*, Matrix4f mtx); -void func_8013EE48(FoldState* state); -void func_8013EE68(FoldState* state); -void func_8013F1F8(FoldState* state); +void fold_wavy_init(FoldState* state); +void fold_mesh_wavy_update(FoldState* state); +void fold_mesh_load_colors(FoldState* state); -void func_8013A370(s16 arg0) { - D_8014EE60 = arg0; +void fold_set_vtx_buf_capacity(s16 arg0) { + FoldVtxBufferCapacity = arg0; } void fold_init(void) { s32 i; for (i = 0; i < ARRAY_COUNT(D_80156948); i++) { - D_80156948[i] = _heap_malloc(&heap_spriteHead, D_8014EE60 * sizeof(*(D_80156948[0]))); + D_80156948[i] = _heap_malloc(&heap_spriteHead, FoldVtxBufferCapacity * sizeof(Vtx)); } D_80156954 = (FoldStateList*)_heap_malloc(&heap_spriteHead, ARRAY_COUNT(*D_80156954) * sizeof((*D_80156954)[0])); @@ -211,22 +267,22 @@ void func_8013A4D0(void) { (*D_80156954)[0].flags |= FOLD_STATE_FLAG_ENABLED; for (i = 1; i < ARRAY_COUNT(*D_80156954); i++) { - if (((*D_80156954)[i].flags & FOLD_STATE_FLAG_ENABLED) && (*D_80156954)[i].savedType1 != FOLD_TYPE_5) { + if (((*D_80156954)[i].flags & FOLD_STATE_FLAG_ENABLED) && (*D_80156954)[i].savedType1 != FOLD_UPD_SET_ANIM) { fold_clear_state_gfx(&(*D_80156954)[i]); } } for (i = 1; i < ARRAY_COUNT(*D_80156954); i++) { - if ((*D_80156954)[i].flags & FOLD_STATE_FLAG_ENABLED && (*D_80156954)[i].buf != NULL) { - s32 temp = (*D_80156954)[i].savedType2; // TODO find a better way to match - - if (temp == FOLD_TYPE_B || (*D_80156954)[i].savedType2 == FOLD_TYPE_C) { + if ((*D_80156954)[i].flags & FOLD_STATE_FLAG_ENABLED && (*D_80156954)[i].colorBuf != NULL) { + if ((*D_80156954)[i].savedType2 == FOLD_UPD_COLOR_BUF_SET_B) { continue; } - - general_heap_free((*D_80156954)[i].buf); - (*D_80156954)[i].buf = NULL; - (*D_80156954)[i].bufSize = 0; + if ((*D_80156954)[i].savedType2 == FOLD_UPD_COLOR_BUF_SET_C) { + continue; + } + general_heap_free((*D_80156954)[i].colorBuf); + (*D_80156954)[i].colorBuf = NULL; + (*D_80156954)[i].colorBufCount = 0; } } } @@ -318,14 +374,14 @@ s32 func_8013A704(s32 arg0) { } void func_8013A854(u32 idx) { - if (idx < 90) { + if (idx < MAX_FOLD_STATES) { (*D_80156954)[idx].flags = 0; (*D_80156954)[idx].unk_10 = -1; } } void func_8013A888(u32 idx) { - if (idx < 90) { + if (idx < MAX_FOLD_STATES) { s32 temp_s0; do { @@ -337,12 +393,11 @@ void func_8013A888(u32 idx) { } s16 func_8013A8E0(s32 idx) { - // TODO find better match - if ((u32)idx >= 90) { + if (idx < 0 || idx >= MAX_FOLD_STATES) { return -1; } - if (idx >= 90) { + if (idx >= MAX_FOLD_STATES) { return 0xFF; } else { return (*D_80156954)[idx].unk_10; @@ -354,8 +409,8 @@ FoldState* fold_get_state(s32 idx) { } void fold_clear_state_gfx(FoldState* state) { - if (state->unk_64 != NULL) { - state->unk_64 = NULL; + if (state->curAnimOffset != NULL) { + state->curAnimOffset = NULL; } if (state->vtxBufs[0] != NULL) { fold_add_to_gfx_cache(state->vtxBufs[0], TRUE); @@ -376,13 +431,13 @@ void fold_clear_state_gfx(FoldState* state) { } void fold_clear_state_data(FoldState* state) { - state->unk_64 = NULL; + state->curAnimOffset = NULL; state->vtxBufs[0] = NULL; state->vtxBufs[1] = NULL; state->gfxBufs[0] = NULL; state->gfxBufs[1] = NULL; - state->buf = NULL; - state->bufSize = 0; + state->colorBuf = NULL; + state->colorBufCount = 0; } void fold_init_state(FoldState* state) { @@ -390,8 +445,8 @@ void fold_init_state(FoldState* state) { s32 j; state->unk_10 = -1; - state->savedType1 = FOLD_TYPE_NONE; - state->savedType2 = FOLD_TYPE_NONE; + state->savedType1 = FOLD_UPD_CLEAR; + state->savedType2 = FOLD_UPD_CLEAR; state->flags = 0; state->meshType = FOLD_MESH_TYPE_0; state->renderType = FOLD_RENDER_TYPE_0; @@ -399,48 +454,49 @@ void fold_init_state(FoldState* state) { state->lastVtxIdx = 0; state->unk_0C = 0; state->unk_0E = 0; - state->unk_1C[0][3] = 255; - state->unk_1C[1][3] = 255; + state->ints.raw[0][3] = 255; + state->ints.raw[1][3] = 255; state->subdivX = 0; state->subdivY = 0; state->firstVtxIdx = 0; state->lastVtxIdx = 0; - for (i = 0; i < ARRAY_COUNT(state->unk_1C); i++) { - for (j = 0; j < ARRAY_COUNT(state->unk_1C[0]); j++) { - state->unk_1C[i][j] = 0; + for (i = 0; i < ARRAY_COUNT(state->ints.raw); i++) { + for (j = 0; j < ARRAY_COUNT(state->ints.raw[0]); j++) { + state->ints.raw[i][j] = 0; } } - for (i = 0; i < ARRAY_COUNT(state->unk_3C); i++) { - for (j = 0; j < ARRAY_COUNT(state->unk_3C[0]); j++) { - state->unk_3C[i][j] = 0; + for (i = 0; i < ARRAY_COUNT(state->floats.raw); i++) { + for (j = 0; j < ARRAY_COUNT(state->floats.raw[0]); j++) { + state->floats.raw[i][j] = 0; } } } -void fold_update(u32 idx, FoldType type, s32 arg2, s32 arg3, s32 arg4, s32 arg5, s32 flags) { +void fold_update(u32 idx, FoldType type, s32 foldArg1, s32 foldArg2, s32 foldArg3, s32 foldArg4, s32 flags) { FoldState* state = &(*D_80156954)[idx]; s32 oldFlags; s32 t1; + u8 r, g, b, a; - if (!(state->flags & FOLD_STATE_FLAG_ENABLED) || (idx >= 90)) { + if (!(state->flags & FOLD_STATE_FLAG_ENABLED) || (idx >= MAX_FOLD_STATES)) { return; } switch (type) { - case FOLD_TYPE_NONE: + case FOLD_UPD_CLEAR: case FOLD_TYPE_3: oldFlags = state->flags; fold_clear_state_gfx(state); fold_init_state(state); state->flags = oldFlags; - state->savedType1 = FOLD_TYPE_NONE; - state->savedType2 = FOLD_TYPE_NONE; + state->savedType1 = FOLD_UPD_CLEAR; + state->savedType2 = FOLD_UPD_CLEAR; state->meshType = FOLD_MESH_TYPE_0; state->renderType = FOLD_RENDER_TYPE_0; - state->unk_1C[0][0] = -1; - state->unk_1C[1][0] = -1; + state->ints.raw[0][0] = -1; + state->ints.raw[1][0] = -1; state->flags &= FOLD_STATE_FLAG_ENABLED; if (flags != 0) { @@ -450,37 +506,37 @@ void fold_update(u32 idx, FoldType type, s32 arg2, s32 arg3, s32 arg4, s32 arg5, } return; case FOLD_TYPE_1: - state->savedType1 = FOLD_TYPE_NONE; + state->savedType1 = FOLD_UPD_CLEAR; state->renderType = FOLD_RENDER_TYPE_0; - state->unk_1C[0][0] = -1; + state->ints.raw[0][0] = -1; return; case FOLD_TYPE_2: - state->savedType2 = FOLD_TYPE_NONE; + state->savedType2 = FOLD_UPD_CLEAR; state->meshType = FOLD_MESH_TYPE_0; - state->unk_1C[1][0] = -1; + state->ints.raw[1][0] = -1; return; - case FOLD_TYPE_11: - if (state->buf != NULL) { - heap_free(state->buf); + case FOLD_UPD_ALLOC_COLOR_BUF: + if (state->colorBuf != NULL) { + heap_free(state->colorBuf); } - state->bufSize = arg2 * 4; - state->buf = heap_malloc(state->bufSize); + state->colorBufCount = foldArg1 * 4; + state->colorBuf = heap_malloc(state->colorBufCount); return; case FOLD_TYPE_F: case FOLD_TYPE_10: - if (type == state->savedType2 && arg2 == state->unk_1C[1][0] && arg3 == state->unk_1C[1][1]) { + if (type == state->savedType2 && foldArg1 == state->ints.raw[1][0] && foldArg2 == state->ints.raw[1][1]) { return; } break; - case FOLD_TYPE_5: - if (state->savedType1 == type && state->unk_1C[0][0] == arg2 && state->unk_1C[0][1] == arg3 && - state->unk_1C[0][2] == arg4) + case FOLD_UPD_SET_ANIM: + if (state->savedType1 == type && state->ints.raw[0][0] == foldArg1 && state->ints.raw[0][1] == foldArg2 && + state->ints.raw[0][2] == foldArg3) { return; } break; default: - if (type != FOLD_TYPE_D && state->savedType2 == FOLD_TYPE_D) { + if (type != FOLD_UPD_HOLOGRAM && state->savedType2 == FOLD_UPD_HOLOGRAM) { state->meshType = FOLD_MESH_TYPE_0; state->subdivX = 1; state->subdivY = 1; @@ -488,22 +544,22 @@ void fold_update(u32 idx, FoldType type, s32 arg2, s32 arg3, s32 arg4, s32 arg5, break; } - if (type != FOLD_TYPE_5 && state->savedType1 == FOLD_TYPE_5) { - state->savedType1 = FOLD_TYPE_NONE; + if (type != FOLD_UPD_SET_ANIM && state->savedType1 == FOLD_UPD_SET_ANIM) { + state->savedType1 = FOLD_UPD_CLEAR; } - if (type == FOLD_TYPE_4 || type == FOLD_TYPE_5) { + if (type == FOLD_UPD_WAVY || type == FOLD_UPD_SET_ANIM) { state->savedType1 = type; - state->unk_1C[0][0] = arg2; - state->unk_1C[0][1] = arg3; - state->unk_1C[0][2] = arg4; - state->unk_1C[0][3] = arg5; - } else if (type >= FOLD_TYPE_6 && type <= FOLD_TYPE_10) { + state->ints.savedArgs[0][0] = foldArg1; + state->ints.savedArgs[0][1] = foldArg2; + state->ints.savedArgs[0][2] = foldArg3; + state->ints.savedArgs[0][3] = foldArg4; + } else if (type >= FOLD_UPD_SET_COLOR && type <= FOLD_TYPE_10) { state->savedType2 = type; - state->unk_1C[1][0] = arg2; - state->unk_1C[1][1] = arg3; - state->unk_1C[1][2] = arg4; - state->unk_1C[1][3] = arg5; + state->ints.savedArgs[1][0] = foldArg1; + state->ints.savedArgs[1][1] = foldArg2; + state->ints.savedArgs[1][2] = foldArg3; + state->ints.savedArgs[1][3] = foldArg4; } state->flags &= FOLD_STATE_FLAG_ENABLED; @@ -517,80 +573,88 @@ void fold_update(u32 idx, FoldType type, s32 arg2, s32 arg3, s32 arg4, s32 arg5, state->meshType = FOLD_MESH_TYPE_0; state->renderType = FOLD_RENDER_TYPE_0; break; - case FOLD_TYPE_4: + case FOLD_UPD_WAVY: state->subdivX = 4; state->subdivY = 4; state->meshType = FOLD_MESH_TYPE_1; - func_8013EE48(state); + fold_wavy_init(state); break; - case FOLD_TYPE_5: - state->meshType = FOLD_MESH_TYPE_2; + case FOLD_UPD_SET_ANIM: + state->meshType = FOLD_MESH_ANIMATED; state->renderType = FOLD_RENDER_TYPE_B; - state->unk_3C[0][0] = 0.0f; - state->unk_3C[0][1] = 0.0f; + state->floats.anim.curFrame = 0.0f; + state->floats.anim.curIdx = 0.0f; state->flags |= FOLD_STATE_FLAG_200; break; - case FOLD_TYPE_6: - case FOLD_TYPE_7: - case FOLD_TYPE_8: - if (arg2 >= 0xFF && arg3 >= 0xFF && arg4 >= 0xFF && arg5 >= 0xFF) { + case FOLD_UPD_SET_COLOR: + case FOLD_UPD_SET_ALPHA: + case FOLD_UPD_SET_TINT: + if (foldArg1 >= 255 && foldArg2 >= 255 && foldArg3 >= 255 && foldArg4 >= 255) { + // no color + no transparency state->renderType = FOLD_RENDER_TYPE_0; - } else if (arg5 >= 0xFF) { + } else if (foldArg4 >= 255) { + // some color + no transparency state->renderType = FOLD_RENDER_TYPE_1; - } else if (arg2 >= 0xFF && arg3 >= 0xFF && arg4 >= 0xFF) { + } else if (foldArg1 >= 255 && foldArg2 >= 255 && foldArg3 >= 255) { + // no color + transparency state->renderType = FOLD_RENDER_TYPE_2; } else { + // some color + transparency state->renderType = FOLD_RENDER_TYPE_3; } break; case FOLD_TYPE_9: case FOLD_TYPE_A: - if (arg5 == 255.0) { + if (foldArg4 == 255.0) { state->renderType = FOLD_RENDER_TYPE_4; } else { state->renderType = FOLD_RENDER_TYPE_5; } break; - case FOLD_TYPE_B: - if (arg2 < state->bufSize) { - t1 = (u32) arg3 >> 0x18; // required to match - state->buf[arg2 * 4 + 0] = (u32) arg3 >> 0x18; - state->buf[arg2 * 4 + 1] = (u32) arg3 >> 0x10; - state->buf[arg2 * 4 + 2] = (u32) arg3 >> 0x08; - do { - state->buf[arg2 * 4 + 3] = arg3; - } while (0); // required to match + case FOLD_UPD_COLOR_BUF_SET_B: + if (foldArg1 < state->colorBufCount) { + // unpack and store color + r = (foldArg2 & 0xFF000000) >> 24; + g = (foldArg2 & 0xFF0000) >> 16; + b = (foldArg2 & 0xFF00) >> 8; + a = (foldArg2 & 0xFF); + state->colorBuf[foldArg1].r = r; + state->colorBuf[foldArg1].g = g; + state->colorBuf[foldArg1].b = b; + state->colorBuf[foldArg1].a = a; state->meshType = FOLD_MESH_TYPE_0; - if ((arg3 & 0xFF) == 0xFF) { + if (a == 255) { state->renderType = FOLD_RENDER_TYPE_6; } else { state->renderType = FOLD_RENDER_TYPE_8; } } break; - case FOLD_TYPE_C: - if (arg2 < state->bufSize) { - t1 = (u32) arg3 >> 0x18; // required to match - state->buf[arg2 * 4 + 0] = t1; - state->buf[arg2 * 4 + 1] = (u32) arg3 >> 0x10; - state->buf[arg2 * 4 + 2] = (u32) arg3 >> 0x08; - do { - state->buf[arg2 * 4 + 3] = arg3; - } while (0); // required to match + case FOLD_UPD_COLOR_BUF_SET_C: + if (foldArg1 < state->colorBufCount) { + // unpack and store color + r = (foldArg2 & 0xFF000000) >> 24; + g = (foldArg2 & 0xFF0000) >> 16; + b = (foldArg2 & 0xFF00) >> 8; + a = (foldArg2 & 0xFF); + state->colorBuf[foldArg1].r = r; + state->colorBuf[foldArg1].g = g; + state->colorBuf[foldArg1].b = b; + state->colorBuf[foldArg1].a = a; state->meshType = FOLD_MESH_TYPE_0; - if ((arg3 & 0xFF) == 0xFF) { + if (a == 255) { state->renderType = FOLD_RENDER_TYPE_9; } else { state->renderType = FOLD_RENDER_TYPE_A; } } break; - case FOLD_TYPE_D: - state->renderType = FOLD_RENDER_TYPE_C; + case FOLD_UPD_HOLOGRAM: + state->renderType = FOLD_RENDER_HOLOGRAM; break; case FOLD_TYPE_E: state->renderType = FOLD_RENDER_TYPE_D; @@ -598,13 +662,13 @@ void fold_update(u32 idx, FoldType type, s32 arg2, s32 arg3, s32 arg4, s32 arg5, case FOLD_TYPE_F: case FOLD_TYPE_10: state->meshType = FOLD_MESH_TYPE_4; - if (arg3 >= 0xFF) { + if (foldArg2 >= 255) { state->renderType = FOLD_RENDER_TYPE_E; } else { state->renderType = FOLD_RENDER_TYPE_F; } - state->unk_3C[1][0] = 0.0f; - state->unk_3C[1][1] = 0.0f; + state->floats.raw[1][0] = 0.0f; + state->floats.raw[1][1] = 0.0f; break; } } @@ -639,35 +703,35 @@ s32 fold_appendGfx_component(s32 idx, FoldImageRecPart* image, u32 flagBits, Mat fold_currentImage->unk_1E = 0; fold_currentImage->alphaMultiplier = image->opacity; - if ((u32)idx >= 90) { + if ((u32)idx >= MAX_FOLD_STATES) { return 0; } - if (idx >= 90 || state == NULL) { + if (idx >= MAX_FOLD_STATES || state == NULL) { return 0; } func_8013B0EC(state); func_8013B1B0(state, mtx); - if (state->flags & FOLD_STATE_FLAG_1000) { - state->unk_1C[0][0] = -1; - state->unk_1C[1][0] = -1; - state->savedType1 = FOLD_TYPE_NONE; + if (state->flags & FOLD_STATE_FLAG_ANIM_DONE) { + state->ints.raw[0][0] = -1; + state->ints.raw[1][0] = -1; + state->savedType1 = FOLD_UPD_CLEAR; state->meshType = 0; state->renderType = FOLD_RENDER_TYPE_0; - state->flags &= ~(FOLD_STATE_FLAG_1000 | FOLD_STATE_FLAG_800 | FOLD_STATE_FLAG_100 | FOLD_STATE_FLAG_80); + state->flags &= ~(FOLD_STATE_FLAG_ANIM_DONE | FOLD_STATE_FLAG_800 | FOLD_STATE_FLAG_REVERSE_ANIM | FOLD_STATE_FLAG_LOOP_ANIM); fold_clear_state_gfx(state); ret = 1; } else if (state->flags & FOLD_STATE_FLAG_4000) { ret = 2; } else if (state->flags & FOLD_STATE_FLAG_20000) { - state->savedType1 = FOLD_TYPE_NONE; - state->savedType2 = FOLD_TYPE_NONE; + state->savedType1 = FOLD_UPD_CLEAR; + state->savedType2 = FOLD_UPD_CLEAR; state->meshType = FOLD_MESH_TYPE_0; state->renderType = FOLD_RENDER_TYPE_0; - state->unk_1C[0][0] = -1; - state->unk_1C[1][0] = -1; + state->ints.raw[0][0] = -1; + state->ints.raw[1][0] = -1; state->flags &= FOLD_STATE_FLAG_ENABLED; ret = 1; } @@ -677,7 +741,7 @@ s32 fold_appendGfx_component(s32 idx, FoldImageRecPart* image, u32 flagBits, Mat void func_8013B0EC(FoldState* state) { switch (state->meshType) { case FOLD_MESH_TYPE_3: - if (state->unk_1C[1][2] == 0) { + if (state->ints.raw[1][2] == 0) { state->subdivX = 1; state->subdivY = 16; } else { @@ -685,48 +749,47 @@ void func_8013B0EC(FoldState* state) { state->subdivY = 1; } case FOLD_MESH_TYPE_1: - func_8013C048(state); + fold_mesh_make_grid(state); break; - case FOLD_MESH_TYPE_2: - func_8013C3F0(state); + case FOLD_MESH_ANIMATED: + fold_mesh_anim_update(state); break; case FOLD_MESH_TYPE_0: case FOLD_MESH_TYPE_4: - func_8013BC88(state); + fold_mesh_make_strip(state); break; default: return; } - if (state->savedType1 == FOLD_TYPE_4) { - func_8013EE68(state); + if (state->savedType1 == FOLD_UPD_WAVY) { + fold_mesh_wavy_update(state); } switch (state->savedType2) { - case FOLD_TYPE_B: - case FOLD_TYPE_C: - func_8013F1F8(state); + case FOLD_UPD_COLOR_BUF_SET_B: + case FOLD_UPD_COLOR_BUF_SET_C: + fold_mesh_load_colors(state); break; } } void func_8013B1B0(FoldState* state, Matrix4f mtx) { s16 cond = FALSE; - s32 primColor = state->unk_1C[1][3]; + s32 primAlpha = state->ints.color[1].a; s32 renderType = state->renderType; s8 angle1; s8 angle2; - f32 alphaComp; - s32 blendColor; + f32 foldImgAlpha; FoldRenderMode* fold; s32 mode1; s32 mode2; - s32 t1; - s32 t2; + s32 dirX1; + s32 dirZ2; gDPPipeSync(gMainGfxPos++); - if (!(state->flags & FOLD_STATE_FLAG_10)) { + if (!(state->flags & FOLD_STATE_FLAG_SKIP_GFX_SETUP)) { gSPDisplayList(gMainGfxPos++, DefaultFoldSetupGfx); if (state->flags & FOLD_STATE_FLAG_NO_FILTERING) { gDPSetTextureFilter(gMainGfxPos++, G_TF_POINT); @@ -746,10 +809,10 @@ void func_8013B1B0(FoldState* state, Matrix4f mtx) { cond = TRUE; } - alphaComp = (f32) fold_currentImage->alphaMultiplier / 255.0; + foldImgAlpha = (f32) fold_currentImage->alphaMultiplier / 255.0; - if (!cond && (fold_currentImage->alphaMultiplier < 0xFF)) { - state->unk_1C[1][3] = 0xFF; + if (!cond && (fold_currentImage->alphaMultiplier < 255)) { + state->ints.color[1].a = 255; switch (state->renderType) { case FOLD_RENDER_TYPE_0: case FOLD_RENDER_TYPE_B: @@ -763,17 +826,18 @@ void func_8013B1B0(FoldState* state, Matrix4f mtx) { renderType = FOLD_RENDER_TYPE_A; break; } - primColor = state->unk_1C[1][3] * alphaComp; + primAlpha = state->ints.color[1].a * foldImgAlpha; + //TODO figure out bits mode1 = 0x404B40; mode2 = 0x104B40; cond = TRUE; } if ((state->flags & FOLD_STATE_FLAG_400) && !cond) { - mode1 &= ~0x200; - mode2 &= ~0x200; - mode1 |= 0x2040; - mode2 |= 0x2040; + mode1 &= ~CVG_DST_FULL; + mode2 &= ~CVG_DST_FULL; + mode1 |= (ALPHA_CVG_SEL | IM_RD); + mode2 |= (ALPHA_CVG_SEL | IM_RD); } if (state->flags & FOLD_STATE_FLAG_40) { @@ -781,50 +845,52 @@ void func_8013B1B0(FoldState* state, Matrix4f mtx) { } else { gSPSetGeometryMode(gMainGfxPos++, G_ZBUFFER); if (cond) { - mode1 |= 0x10; - mode2 |= 0x10; + mode1 |= Z_CMP; + mode2 |= Z_CMP; } else { - mode1 |= 0x30; - mode2 |= 0x30; + mode1 |= (Z_CMP | Z_UPD); + mode2 |= (Z_CMP | Z_UPD); } } - state->unk_78 = mode2; + state->otherModeL = mode2; gDPSetRenderMode(gMainGfxPos++, mode1, mode2); switch (renderType) { case FOLD_RENDER_TYPE_1: gDPSetCombineMode(gMainGfxPos++, G_CC_MODULATEIDECALA_PRIM, G_CC_MODULATEIDECALA_PRIM); - gDPSetPrimColor(gMainGfxPos++, 0, 0, state->unk_1C[1][0], state->unk_1C[1][1], state->unk_1C[1][2], 0); + gDPSetPrimColor(gMainGfxPos++, 0, 0, state->ints.color[1].r, state->ints.color[1].g, + state->ints.color[1].b, 0); break; case FOLD_RENDER_TYPE_2: - if (primColor <= 0) { + if (primAlpha <= 0) { return; } gDPSetCombineLERP(gMainGfxPos++, 0, 0, 0, TEXEL0, TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, TEXEL0, TEXEL0, 0, PRIMITIVE, 0); - gDPSetPrimColor(gMainGfxPos++, 0, 0, 0, 0, 0, primColor); + gDPSetPrimColor(gMainGfxPos++, 0, 0, 0, 0, 0, primAlpha); break; case FOLD_RENDER_TYPE_3: - if (primColor <= 0) { + if (primAlpha <= 0) { return; } gDPSetCombineMode(gMainGfxPos++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM); - gDPSetPrimColor(gMainGfxPos++, 0, 0, state->unk_1C[1][0], state->unk_1C[1][1], - state->unk_1C[1][2], primColor); + gDPSetPrimColor(gMainGfxPos++, 0, 0, state->ints.color[1].r, state->ints.color[1].g, + state->ints.color[1].b, primAlpha); break; case FOLD_RENDER_TYPE_4: gDPSetCombineLERP(gMainGfxPos++, 1, PRIMITIVE, TEXEL0, PRIMITIVE, 0, 0, 0, TEXEL0, 1, PRIMITIVE, TEXEL0, PRIMITIVE, 0, 0, 0, TEXEL0); - gDPSetPrimColor(gMainGfxPos++, 0, 0, state->unk_1C[1][0], state->unk_1C[1][1], state->unk_1C[1][2], 0); + gDPSetPrimColor(gMainGfxPos++, 0, 0, state->ints.color[1].r, state->ints.color[1].g, + state->ints.color[1].b, 0); break; case FOLD_RENDER_TYPE_5: - if (primColor <= 0) { + if (primAlpha <= 0) { return; } gDPSetCombineLERP(gMainGfxPos++, 1, 0, TEXEL0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0, 1, 0, TEXEL0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0); - gDPSetPrimColor(gMainGfxPos++, 0, 0, state->unk_1C[1][0], state->unk_1C[1][1], - state->unk_1C[1][2], primColor); + gDPSetPrimColor(gMainGfxPos++, 0, 0, state->ints.color[1].r, state->ints.color[1].g, + state->ints.color[1].b, primAlpha); break; case FOLD_RENDER_TYPE_6: gDPSetCombineMode(gMainGfxPos++, G_CC_MODULATEIDECALA, G_CC_MODULATEIDECALA); @@ -863,49 +929,53 @@ void func_8013B1B0(FoldState* state, Matrix4f mtx) { angle1 = cosine(currentCam->currentYaw) * 120.0f; angle2 = cosine(currentCam->currentYaw + 90.0f) * 120.0f; - t1 = -angle1; - t2 = -angle2; - D_8014EE18.l[0].l.dir[0] = t1; - D_8014EE18.l[1].l.dir[0] = angle1; - D_8014EE18.l[0].l.dir[2] = angle2; - D_8014EE18.l[1].l.dir[2] = t2; - gSPSetLights2(gMainGfxPos++, D_8014EE18); + dirX1 = -angle1; + dirZ2 = -angle2; + FoldLights.l[0].l.dir[0] = dirX1; + FoldLights.l[1].l.dir[0] = angle1; + FoldLights.l[0].l.dir[2] = angle2; + FoldLights.l[1].l.dir[2] = dirZ2; + gSPSetLights2(gMainGfxPos++, FoldLights); break; } gDPSetCombineMode(gMainGfxPos++, G_CC_DECALRGBA, G_CC_DECALRGBA); break; - case FOLD_RENDER_TYPE_C: - if (state->unk_1C[1][0] == 0) { - primColor = state->unk_1C[1][3] * alphaComp; + case FOLD_RENDER_HOLOGRAM: + if (state->ints.hologram.mode == 0) { + primAlpha = state->ints.hologram.alphaAmt * foldImgAlpha; gDPSetCombineLERP(gMainGfxPos++, NOISE, PRIMITIVE, PRIMITIVE, TEXEL0, TEXEL0, 0, PRIMITIVE, 0, NOISE, PRIMITIVE, PRIMITIVE, TEXEL0, TEXEL0, 0, PRIMITIVE, 0); - gDPSetPrimColor(gMainGfxPos++, 0, 0, state->unk_1C[1][1], state->unk_1C[1][1], - state->unk_1C[1][1],primColor); - } else if (state->unk_1C[1][0] == 1) { - primColor = state->unk_1C[1][3] * alphaComp; + gDPSetPrimColor(gMainGfxPos++, 0, 0, + state->ints.hologram.noiseAmt, + state->ints.hologram.noiseAmt, + state->ints.hologram.noiseAmt, + primAlpha); + } else if (state->ints.hologram.mode == 1) { + primAlpha = state->ints.hologram.alphaAmt * foldImgAlpha; gDPSetCombineLERP(gMainGfxPos++, 0, 0, 0, TEXEL0, TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, TEXEL0, TEXEL0, 0, PRIMITIVE, 0); - gDPSetPrimColor(gMainGfxPos++, 0, 0, 0, 0, 0, primColor); + gDPSetPrimColor(gMainGfxPos++, 0, 0, 0, 0, 0, primAlpha); gDPSetAlphaCompare(gMainGfxPos++, G_AC_DITHER); - } else if (state->unk_1C[1][0] == 2) { - blendColor = state->unk_1C[1][3] + state->unk_1C[1][1]; - if (blendColor > 255) { - blendColor = 255; + } else if (state->ints.hologram.mode == 2) { + s32 blendAlpha = state->ints.hologram.alphaAmt + state->ints.hologram.noiseAmt; + if (blendAlpha > 255) { + blendAlpha = 255; } - primColor = state->unk_1C[1][3] * alphaComp; + primAlpha = state->ints.hologram.alphaAmt * foldImgAlpha; gDPSetCombineLERP(gMainGfxPos++, 0, 0, 0, TEXEL0, TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, TEXEL0, TEXEL0, 0, PRIMITIVE, 0); gDPSetAlphaDither(gMainGfxPos++, G_AD_NOISE); gDPSetAlphaCompare(gMainGfxPos++, G_AC_THRESHOLD); - gDPSetPrimColor(gMainGfxPos++, 0, 0, 0, 0, 0, primColor); - gDPSetBlendColor(gMainGfxPos++, 0, 0, 0, blendColor); + gDPSetPrimColor(gMainGfxPos++, 0, 0, 0, 0, 0, primAlpha); + gDPSetBlendColor(gMainGfxPos++, 0, 0, 0, blendAlpha); } break; case FOLD_RENDER_TYPE_D: gDPSetCombineLERP(gMainGfxPos++, 0, 0, 0, PRIMITIVE, 0, 0, 0, TEXEL0, 0, 0, 0, PRIMITIVE, 0, 0, 0, TEXEL0); - gDPSetPrimColor(gMainGfxPos++, 0, 0, state->unk_1C[1][0], state->unk_1C[1][1], state->unk_1C[1][2], 0); + gDPSetPrimColor(gMainGfxPos++, 0, 0, state->ints.color[1].r, state->ints.color[1].g, + state->ints.color[1].b, 0); break; case FOLD_RENDER_TYPE_0: case FOLD_RENDER_TYPE_E: @@ -915,7 +985,7 @@ void func_8013B1B0(FoldState* state, Matrix4f mtx) { case FOLD_RENDER_TYPE_F: gDPSetCombineLERP(gMainGfxPos++, 0, 0, 0, TEXEL0, TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, TEXEL0, TEXEL0, 0, PRIMITIVE, 0); - gDPSetPrimColor(gMainGfxPos++, 0, 0, 0, 0, 0, state->unk_1C[1][1]); + gDPSetPrimColor(gMainGfxPos++, 0, 0, 0, 0, 0, state->ints.raw[1][1]); break; } } @@ -928,7 +998,7 @@ void func_8013B1B0(FoldState* state, Matrix4f mtx) { case FOLD_MESH_TYPE_3: func_8013DAB4(state, mtx); break; - case FOLD_MESH_TYPE_2: + case FOLD_MESH_ANIMATED: func_8013E2F0(state, mtx); break; case FOLD_MESH_TYPE_4: @@ -940,13 +1010,13 @@ void func_8013B1B0(FoldState* state, Matrix4f mtx) { gDPPipeSync(gMainGfxPos++); - if (state->renderType == FOLD_RENDER_TYPE_C) { + if (state->renderType == FOLD_RENDER_HOLOGRAM) { gDPSetAlphaCompare(gMainGfxPos++, G_AC_NONE); gDPSetAlphaDither(gMainGfxPos++, G_AD_DISABLE); } } -void func_8013BC88(FoldState* state) { +void fold_mesh_make_strip(FoldState* state) { s32 yOffset; s32 xOffset; s32 widthIncrement; @@ -1018,7 +1088,7 @@ void func_8013BC88(FoldState* state) { state->subdivY = ((state->lastVtxIdx - state->firstVtxIdx) - 1) / 2; } -void func_8013C048(FoldState* state) { +void fold_mesh_make_grid(FoldState* state) { f32 divSizeX; f32 divSizeY; f32 posX; @@ -1065,17 +1135,17 @@ void func_8013C048(FoldState* state) { state->lastVtxIdx = fold_vtxCount - 1; } -FoldGfxDescriptor* fold_load_gfx(FoldState* state) { - u8* romStart = fold_groupOffsets[state->unk_1C[0][0]] + fold_gfx_data_ROM_START; - FoldGfxDescriptor* descriptor = &fold_groupDescriptors[state->arrayIdx]; +FoldAnimHeader* fold_load_anim(FoldState* state) { + u8* romStart = FoldAnimOffsets[state->ints.anim.type] + fold_gfx_data_ROM_START; + FoldAnimHeader* anim = &FoldAnimHeaders[state->arrayIdx]; - if (state->unk_64 != romStart) { + if (state->curAnimOffset != romStart) { u8* romEnd; s32 i; - state->unk_64 = romStart; + state->curAnimOffset = romStart; - dma_copy(state->unk_64, state->unk_64 + 0x10, descriptor); + dma_copy(state->curAnimOffset, state->curAnimOffset + sizeof(*anim), anim); if (state->vtxBufs[0] != NULL) { fold_add_to_gfx_cache(state->vtxBufs[0], 1); @@ -1095,13 +1165,13 @@ FoldGfxDescriptor* fold_load_gfx(FoldState* state) { fold_add_to_gfx_cache(state->gfxBufs[1], 1); state->gfxBufs[1] = NULL; } - state->vtxBufs[0] = heap_malloc(descriptor->vtxCount * 0x10); - state->vtxBufs[1] = heap_malloc(descriptor->vtxCount * 0x10); - state->gfxBufs[0] = heap_malloc(descriptor->gfxCount * 8); - state->gfxBufs[1] = heap_malloc(descriptor->gfxCount * 8); + state->vtxBufs[0] = heap_malloc(anim->vtxCount * sizeof(Vtx)); + state->vtxBufs[1] = heap_malloc(anim->vtxCount * sizeof(Vtx)); + state->gfxBufs[0] = heap_malloc(anim->gfxCount * sizeof(Gfx)); + state->gfxBufs[1] = heap_malloc(anim->gfxCount * sizeof(Gfx)); - romStart = (s32)descriptor->gfx + fold_gfx_data_ROM_START; - romEnd = &romStart[descriptor->gfxCount * sizeof(*descriptor->gfx)]; + romStart = fold_gfx_data_ROM_START + (s32)anim->gfxOffset; + romEnd = romStart + anim->gfxCount * sizeof(Gfx); dma_copy(romStart, romEnd, state->gfxBufs[0]); dma_copy(romStart, romEnd, state->gfxBufs[1]); @@ -1119,213 +1189,219 @@ FoldGfxDescriptor* fold_load_gfx(FoldState* state) { // If this command is a vertex command, adjust the vertex buffer address if (cmd == G_VTX) { - gfxBuffer[j-1].words.w1 = ((((s32) gfxBuffer[j-1].words.w1 - (s32) descriptor->vtx) / 3) * 4) + + gfxBuffer[j-1].words.w1 = ((((s32) gfxBuffer[j-1].words.w1 - anim->keyframesOffset) / 3) * 4) + (s32) state->vtxBufs[i]; } } while (cmd != G_ENDDL); } } - return descriptor; + return anim; } -void func_8013C3F0(FoldState* state) { - s32 sp10; - s32 nextStateIdx; - s32 currentStateIdx; - PackedVtx* currentAnimState; - PackedVtx* nextAnimState = NULL; - s32 animationPeriod = state->unk_1C[0][1]; - s32 currentFrame = state->unk_3C[0][0]; - s32 sp14 = state->unk_1C[0][2]; - FoldGfxDescriptor* descriptor = fold_load_gfx(state); +void fold_mesh_anim_update(FoldState* state) { + s32 absKeyframeInterval; + s32 nextKeyIdx; + s32 curKeyIdx; + FoldVtx* curKeyframe = NULL; + FoldVtx* nextKeyframe = NULL; + s32 keyframeInterval = state->ints.raw[0][1]; + s32 animStep = state->ints.raw[0][2]; + s32 curSubframe = state->floats.anim.curFrame; + FoldAnimHeader* header = fold_load_anim(state); u8* romStart; - s32 i; f32 lerpAlpha; + s32 i; - if (descriptor == NULL) { + if (header == NULL) { return; } if (state->flags & FOLD_STATE_FLAG_200) { state->flags &= ~FOLD_STATE_FLAG_200; - if (state->flags & FOLD_STATE_FLAG_100) { - state->unk_3C[0][1] = descriptor->unk_0C - 1; + if (state->flags & FOLD_STATE_FLAG_REVERSE_ANIM) { + state->floats.anim.curIdx = header->keyframesCount - 1; } } - currentStateIdx = state->unk_3C[0][1]; - sp10 = abs(animationPeriod); + curKeyIdx = state->floats.anim.curIdx; + absKeyframeInterval = abs(keyframeInterval); if (state->flags & FOLD_STATE_FLAG_4000) { - nextStateIdx = currentStateIdx; + nextKeyIdx = curKeyIdx; } else { - if (state->flags & FOLD_STATE_FLAG_100) { - nextStateIdx = currentStateIdx - 1; - if (nextStateIdx < 0) { - nextStateIdx = currentStateIdx; - if (state->flags & FOLD_STATE_FLAG_80) { - nextStateIdx = descriptor->unk_0C - 1; + if (state->flags & FOLD_STATE_FLAG_REVERSE_ANIM) { + nextKeyIdx = curKeyIdx - 1; + if (nextKeyIdx < 0) { + nextKeyIdx = curKeyIdx; + if (state->flags & FOLD_STATE_FLAG_LOOP_ANIM) { + nextKeyIdx = header->keyframesCount - 1; } } } else { - nextStateIdx = currentStateIdx + 1; - if (nextStateIdx == descriptor->unk_0C) { - nextStateIdx = currentStateIdx; - if (state->flags & FOLD_STATE_FLAG_80) { - nextStateIdx = 0; + nextKeyIdx = curKeyIdx + 1; + if (nextKeyIdx == header->keyframesCount) { + nextKeyIdx = curKeyIdx; + if (state->flags & FOLD_STATE_FLAG_LOOP_ANIM) { + nextKeyIdx = 0; } } } } - currentAnimState = heap_malloc(descriptor->vtxCount * sizeof(*currentAnimState)); - romStart = (u8*)((s32)fold_gfx_data_ROM_START + (s32)descriptor->vtx + currentStateIdx * descriptor->vtxCount * sizeof(*currentAnimState)); - dma_copy(romStart, romStart + descriptor->vtxCount * sizeof(*currentAnimState), currentAnimState); - if (animationPeriod >= 2) { - nextAnimState = heap_malloc(descriptor->vtxCount * sizeof(*nextAnimState)); - romStart = (u8*)((s32)fold_gfx_data_ROM_START + (s32)descriptor->vtx + nextStateIdx * descriptor->vtxCount * sizeof(*currentAnimState)); - dma_copy(romStart, romStart + descriptor->vtxCount * sizeof(*nextAnimState), nextAnimState); + // find the current + next keyframe vertex data + curKeyframe = heap_malloc(header->vtxCount * sizeof(FoldVtx)); + romStart = (u8*)((s32)fold_gfx_data_ROM_START + header->keyframesOffset + curKeyIdx * header->vtxCount * sizeof(FoldVtx)); + dma_copy(romStart, romStart + header->vtxCount * sizeof(FoldVtx), curKeyframe); + if (keyframeInterval > 1) { + nextKeyframe = heap_malloc(header->vtxCount * sizeof(*nextKeyframe)); + romStart = (u8*)((s32)fold_gfx_data_ROM_START + header->keyframesOffset + nextKeyIdx * header->vtxCount * sizeof(FoldVtx)); + dma_copy(romStart, romStart + header->vtxCount * sizeof(FoldVtx), nextKeyframe); } - lerpAlpha = (f32) currentFrame / (f32) animationPeriod; - for (i = 0; i < descriptor->vtxCount; i++) { - if (state->meshType != FOLD_MESH_TYPE_2) { + lerpAlpha = (f32) curSubframe / (f32) keyframeInterval; + for (i = 0; i < header->vtxCount; i++) { + if (state->meshType != FOLD_MESH_ANIMATED) { return; } - if (animationPeriod >= 2) { - if (descriptor->useAbsoluteValues & 1) { - state->vtxBufs[gCurrentDisplayContextIndex][i].v.ob[0] = currentAnimState[i].ob[0] + (nextAnimState[i].ob[0] - currentAnimState[i].ob[0]) * lerpAlpha; - state->vtxBufs[gCurrentDisplayContextIndex][i].v.ob[1] = currentAnimState[i].ob[1] + (nextAnimState[i].ob[1] - currentAnimState[i].ob[1]) * lerpAlpha; - state->vtxBufs[gCurrentDisplayContextIndex][i].v.ob[2] = currentAnimState[i].ob[2] + (nextAnimState[i].ob[2] - currentAnimState[i].ob[2]) * lerpAlpha; + if (keyframeInterval > 1) { + // get vertex position + if (header->flags & FOLD_ANIM_FLAG_ABSOLUTE_COORDS) { + state->vtxBufs[gCurrentDisplayContextIndex][i].v.ob[0] = (s16)(curKeyframe[i].ob[0] + (nextKeyframe[i].ob[0] - curKeyframe[i].ob[0]) * lerpAlpha); + state->vtxBufs[gCurrentDisplayContextIndex][i].v.ob[1] = (s16)(curKeyframe[i].ob[1] + (nextKeyframe[i].ob[1] - curKeyframe[i].ob[1]) * lerpAlpha); + state->vtxBufs[gCurrentDisplayContextIndex][i].v.ob[2] = (s16)(curKeyframe[i].ob[2] + (nextKeyframe[i].ob[2] - curKeyframe[i].ob[2]) * lerpAlpha); } else { - state->vtxBufs[gCurrentDisplayContextIndex][i].v.ob[0] = (s16)(currentAnimState[i].ob[0] + (nextAnimState[i].ob[0] - currentAnimState[i].ob[0]) * lerpAlpha) * 0.01 * fold_currentImage->width; - state->vtxBufs[gCurrentDisplayContextIndex][i].v.ob[1] = (s16)(currentAnimState[i].ob[1] + (nextAnimState[i].ob[1] - currentAnimState[i].ob[1]) * lerpAlpha) * 0.01 * fold_currentImage->height; - state->vtxBufs[gCurrentDisplayContextIndex][i].v.ob[2] = (s16)(currentAnimState[i].ob[2] + (nextAnimState[i].ob[2] - currentAnimState[i].ob[2]) * lerpAlpha) * 0.01 * ((fold_currentImage->width + fold_currentImage->height) / 2); + state->vtxBufs[gCurrentDisplayContextIndex][i].v.ob[0] = (s16)(curKeyframe[i].ob[0] + (nextKeyframe[i].ob[0] - curKeyframe[i].ob[0]) * lerpAlpha) * 0.01 * fold_currentImage->width; + state->vtxBufs[gCurrentDisplayContextIndex][i].v.ob[1] = (s16)(curKeyframe[i].ob[1] + (nextKeyframe[i].ob[1] - curKeyframe[i].ob[1]) * lerpAlpha) * 0.01 * fold_currentImage->height; + state->vtxBufs[gCurrentDisplayContextIndex][i].v.ob[2] = (s16)(curKeyframe[i].ob[2] + (nextKeyframe[i].ob[2] - curKeyframe[i].ob[2]) * lerpAlpha) * 0.01 * ((fold_currentImage->width + fold_currentImage->height) / 2); } + // get vertex color if (state->flags & (FOLD_STATE_FLAG_8000 | FOLD_STATE_FLAG_2000)) { - state->vtxBufs[gCurrentDisplayContextIndex][i].v.cn[0] = (s32)(currentAnimState[i].cn[0] + (nextAnimState[i].cn[0] - currentAnimState[i].cn[0]) * lerpAlpha); - state->vtxBufs[gCurrentDisplayContextIndex][i].v.cn[1] = (s32)(currentAnimState[i].cn[1] + (nextAnimState[i].cn[1] - currentAnimState[i].cn[1]) * lerpAlpha); - state->vtxBufs[gCurrentDisplayContextIndex][i].v.cn[2] = (s32)(currentAnimState[i].cn[2] + (nextAnimState[i].cn[2] - currentAnimState[i].cn[2]) * lerpAlpha); + state->vtxBufs[gCurrentDisplayContextIndex][i].v.cn[0] = (s16)(curKeyframe[i].cn[0] + (nextKeyframe[i].cn[0] - curKeyframe[i].cn[0]) * lerpAlpha); + state->vtxBufs[gCurrentDisplayContextIndex][i].v.cn[1] = (s16)(curKeyframe[i].cn[1] + (nextKeyframe[i].cn[1] - curKeyframe[i].cn[1]) * lerpAlpha); + state->vtxBufs[gCurrentDisplayContextIndex][i].v.cn[2] = (s16)(curKeyframe[i].cn[2] + (nextKeyframe[i].cn[2] - curKeyframe[i].cn[2]) * lerpAlpha); } else { state->vtxBufs[gCurrentDisplayContextIndex][i].v.cn[0] = state->vtxBufs[gCurrentDisplayContextIndex][i].v.cn[1] = - state->vtxBufs[gCurrentDisplayContextIndex][i].v.cn[2] = 240.0 - (currentAnimState[i].tc[0] + currentAnimState[i].tc[1]) * 1.2; + state->vtxBufs[gCurrentDisplayContextIndex][i].v.cn[2] = 240.0 - (curKeyframe[i].tc[0] + curKeyframe[i].tc[1]) * 1.2; } } else { - if (descriptor->useAbsoluteValues & 1) { - state->vtxBufs[gCurrentDisplayContextIndex][i].v.ob[0] = currentAnimState[i].ob[0]; - state->vtxBufs[gCurrentDisplayContextIndex][i].v.ob[1] = currentAnimState[i].ob[1]; - state->vtxBufs[gCurrentDisplayContextIndex][i].v.ob[2] = currentAnimState[i].ob[2]; + // get vertex position + if (header->flags & FOLD_ANIM_FLAG_ABSOLUTE_COORDS) { + state->vtxBufs[gCurrentDisplayContextIndex][i].v.ob[0] = curKeyframe[i].ob[0]; + state->vtxBufs[gCurrentDisplayContextIndex][i].v.ob[1] = curKeyframe[i].ob[1]; + state->vtxBufs[gCurrentDisplayContextIndex][i].v.ob[2] = curKeyframe[i].ob[2]; } else { - state->vtxBufs[gCurrentDisplayContextIndex][i].v.ob[0] = currentAnimState[i].ob[0] * 0.01 * fold_currentImage->width; - state->vtxBufs[gCurrentDisplayContextIndex][i].v.ob[1] = currentAnimState[i].ob[1] * 0.01 * fold_currentImage->height; - state->vtxBufs[gCurrentDisplayContextIndex][i].v.ob[2] = currentAnimState[i].ob[2] * 0.01 * ((fold_currentImage->width + fold_currentImage->height) / 2); + state->vtxBufs[gCurrentDisplayContextIndex][i].v.ob[0] = curKeyframe[i].ob[0] * 0.01 * fold_currentImage->width; + state->vtxBufs[gCurrentDisplayContextIndex][i].v.ob[1] = curKeyframe[i].ob[1] * 0.01 * fold_currentImage->height; + state->vtxBufs[gCurrentDisplayContextIndex][i].v.ob[2] = curKeyframe[i].ob[2] * 0.01 * ((fold_currentImage->width + fold_currentImage->height) / 2); } + // get vertex color if (state->flags & (FOLD_STATE_FLAG_8000 | FOLD_STATE_FLAG_2000)) { - state->vtxBufs[gCurrentDisplayContextIndex][i].v.cn[0] = currentAnimState[i].cn[0]; - state->vtxBufs[gCurrentDisplayContextIndex][i].v.cn[1] = currentAnimState[i].cn[1]; - state->vtxBufs[gCurrentDisplayContextIndex][i].v.cn[2] = currentAnimState[i].cn[2]; + state->vtxBufs[gCurrentDisplayContextIndex][i].v.cn[0] = curKeyframe[i].cn[0]; + state->vtxBufs[gCurrentDisplayContextIndex][i].v.cn[1] = curKeyframe[i].cn[1]; + state->vtxBufs[gCurrentDisplayContextIndex][i].v.cn[2] = curKeyframe[i].cn[2]; } else { state->vtxBufs[gCurrentDisplayContextIndex][i].v.cn[0] = state->vtxBufs[gCurrentDisplayContextIndex][i].v.cn[1] = - state->vtxBufs[gCurrentDisplayContextIndex][i].v.cn[2] = 240.0 - (currentAnimState[i].tc[0] + currentAnimState[i].tc[1]) * 1.2; + state->vtxBufs[gCurrentDisplayContextIndex][i].v.cn[2] = 240.0 - (curKeyframe[i].tc[0] + curKeyframe[i].tc[1]) * 1.2; } } - if (descriptor->useAbsoluteValues & 1) { - state->vtxBufs[gCurrentDisplayContextIndex][i].v.tc[0] = (currentAnimState[i].tc[0] + 0x100) << 5; - state->vtxBufs[gCurrentDisplayContextIndex][i].v.tc[1] = (currentAnimState[i].tc[1] + 0x100) << 5; + // get vertex tex coords + if (header->flags & FOLD_ANIM_FLAG_ABSOLUTE_COORDS) { + state->vtxBufs[gCurrentDisplayContextIndex][i].v.tc[0] = (curKeyframe[i].tc[0] + 256) * 32; + state->vtxBufs[gCurrentDisplayContextIndex][i].v.tc[1] = (curKeyframe[i].tc[1] + 256) * 32; } else { - state->vtxBufs[gCurrentDisplayContextIndex][i].v.tc[0] = ((s32)(currentAnimState[i].tc[0] * 0.01 * fold_currentImage->width) + 0x100) << 5; - state->vtxBufs[gCurrentDisplayContextIndex][i].v.tc[1] = ((s32)(currentAnimState[i].tc[1] * 0.01 * fold_currentImage->height) + 0x100) << 5; + state->vtxBufs[gCurrentDisplayContextIndex][i].v.tc[0] = ((s32)(curKeyframe[i].tc[0] * 0.01 * fold_currentImage->width) + 256) * 32; + state->vtxBufs[gCurrentDisplayContextIndex][i].v.tc[1] = ((s32)(curKeyframe[i].tc[1] * 0.01 * fold_currentImage->height) + 256) * 32; } } state->firstVtxIdx = 0; - state->lastVtxIdx = descriptor->vtxCount - 1; + state->lastVtxIdx = header->vtxCount - 1; - heap_free(currentAnimState); - if (nextAnimState != NULL) { - heap_free(nextAnimState); + heap_free(curKeyframe); + if (nextKeyframe != NULL) { + heap_free(nextKeyframe); } - if (sp14 == 0 || gGameStatusPtr->frameCounter % sp14 != 0) { + if (animStep == 0 || gGameStatusPtr->frameCounter % animStep != 0) { return; } - if (animationPeriod > 0) { - currentFrame++; - if (currentFrame >= animationPeriod) { - if (state->flags & FOLD_STATE_FLAG_100) { - currentStateIdx--; - if (currentStateIdx < 0) { - if (state->flags & FOLD_STATE_FLAG_80) { - currentStateIdx = descriptor->unk_0C - 1; + if (keyframeInterval > 0) { + curSubframe++; + if (curSubframe >= keyframeInterval) { + if (state->flags & FOLD_STATE_FLAG_REVERSE_ANIM) { + curKeyIdx--; + if (curKeyIdx < 0) { + if (state->flags & FOLD_STATE_FLAG_LOOP_ANIM) { + curKeyIdx = header->keyframesCount - 1; } else { if (state->flags & FOLD_STATE_FLAG_800) { - currentStateIdx = 0; + curKeyIdx = 0; state->flags |= FOLD_STATE_FLAG_4000; } else { - state->flags |= FOLD_STATE_FLAG_1000; + state->flags |= FOLD_STATE_FLAG_ANIM_DONE; } } } } else { - currentStateIdx++; - if (currentStateIdx >= descriptor->unk_0C) { - if (state->flags & FOLD_STATE_FLAG_80) { - currentStateIdx = 0; + curKeyIdx++; + if (curKeyIdx >= header->keyframesCount) { + if (state->flags & FOLD_STATE_FLAG_LOOP_ANIM) { + curKeyIdx = 0; } else { if (state->flags & FOLD_STATE_FLAG_800) { - currentStateIdx--; + curKeyIdx--; state->flags |= FOLD_STATE_FLAG_4000; } else { - state->flags |= FOLD_STATE_FLAG_1000; + state->flags |= FOLD_STATE_FLAG_ANIM_DONE; } } } } - currentFrame = 0; + curSubframe = 0; } - } else if (animationPeriod < 0) { - if (state->flags & FOLD_STATE_FLAG_100) { - currentStateIdx -= sp10; - if (currentStateIdx < 0) { - if (state->flags & FOLD_STATE_FLAG_80) { - currentStateIdx += descriptor->unk_0C; + } else if (keyframeInterval < 0) { + if (state->flags & FOLD_STATE_FLAG_REVERSE_ANIM) { + curKeyIdx -= absKeyframeInterval; + if (curKeyIdx < 0) { + if (state->flags & FOLD_STATE_FLAG_LOOP_ANIM) { + curKeyIdx += header->keyframesCount; } else { if (state->flags & FOLD_STATE_FLAG_800) { - currentStateIdx = 0; + curKeyIdx = 0; state->flags |= FOLD_STATE_FLAG_4000; } else { - state->flags |= FOLD_STATE_FLAG_1000; + state->flags |= FOLD_STATE_FLAG_ANIM_DONE; } } } } else { - currentStateIdx += sp10; - if (currentStateIdx >= descriptor->unk_0C) { - if (state->flags & FOLD_STATE_FLAG_80) { - currentStateIdx %= descriptor->unk_0C; + curKeyIdx += absKeyframeInterval; + if (curKeyIdx >= header->keyframesCount) { + if (state->flags & FOLD_STATE_FLAG_LOOP_ANIM) { + curKeyIdx %= header->keyframesCount; } else { if (state->flags & FOLD_STATE_FLAG_800) { - currentStateIdx = descriptor->unk_0C - 1; + curKeyIdx = header->keyframesCount - 1; state->flags |= FOLD_STATE_FLAG_4000; } else { - state->flags |= FOLD_STATE_FLAG_1000; + state->flags |= FOLD_STATE_FLAG_ANIM_DONE; } } } } } - state->unk_3C[0][0] = currentFrame; - state->unk_3C[0][1] = currentStateIdx; + state->floats.anim.curFrame = curSubframe; + state->floats.anim.curIdx = curKeyIdx; } void func_8013CFA8(FoldState* state, Matrix4f mtx) { s32 i; - if (!(state->flags & FOLD_STATE_FLAG_20)) { + if (!(state->flags & FOLD_STATE_FLAG_SKIP_TEX_SETUP)) { gDPSetTextureLUT(gMainGfxPos++, G_TT_RGBA16); gDPLoadTLUT_pal16(gMainGfxPos++, 0, fold_currentImage->palette); } @@ -1342,7 +1418,7 @@ void func_8013CFA8(FoldState* state, Matrix4f mtx) { s32 alpha; s32 alpha2; - if (!(state->flags & FOLD_STATE_FLAG_20)) { + if (!(state->flags & FOLD_STATE_FLAG_SKIP_TEX_SETUP)) { if ((gSpriteShadingProfile->flags & 1) && (state->arrayIdx != 0) && (state->flags & someFlags) @@ -1372,7 +1448,7 @@ void func_8013CFA8(FoldState* state, Matrix4f mtx) { break; case FOLD_RENDER_TYPE_2: case FOLD_RENDER_TYPE_F: - alpha = state->unk_1C[1][3]; + alpha = state->ints.color[1].a; break; case FOLD_RENDER_TYPE_7: alpha = -1; @@ -1388,7 +1464,7 @@ void func_8013CFA8(FoldState* state, Matrix4f mtx) { gSPViewport(gMainGfxPos++, &cam->vpAlt); } - gDPSetRenderMode(gMainGfxPos++, G_RM_PASS, state->unk_78); + gDPSetRenderMode(gMainGfxPos++, G_RM_PASS, state->otherModeL); if (alpha == -1) { gDPSetCombineLERP(gMainGfxPos++, 0, 0, 0, 0, SHADE, 0, TEXEL1, 0, 0, 0, 0, 0, 0, @@ -1403,7 +1479,7 @@ void func_8013CFA8(FoldState* state, Matrix4f mtx) { gSP2Triangles(gMainGfxPos++, 0, 2, 1, 0, 1, 2, 3, 0); gDPPipeSync(gMainGfxPos++); } - create_shading_palette(mtx, uls, ult, lrs, lrt, alpha, state->unk_78); + create_shading_palette(mtx, uls, ult, lrs, lrt, alpha, state->otherModeL); } else { gDPScrollTextureTile_4b(gMainGfxPos++, fold_currentImage->raster, G_IM_FMT_CI, @@ -1438,7 +1514,7 @@ void func_8013CFA8(FoldState* state, Matrix4f mtx) { break; case FOLD_RENDER_TYPE_2: case FOLD_RENDER_TYPE_F: - alpha2 = state->unk_1C[1][3]; + alpha2 = state->ints.color[1].a; break; case FOLD_RENDER_TYPE_7: alpha2 = -1; @@ -1498,7 +1574,7 @@ void func_8013DAB4(FoldState* state, Matrix4f mtx) { s32 i, j; s32 firstVtxIdx; - if (!(state->flags & FOLD_STATE_FLAG_20)) { + if (!(state->flags & FOLD_STATE_FLAG_SKIP_TEX_SETUP)) { gDPSetTextureLUT(gMainGfxPos++, G_TT_RGBA16); gDPLoadTLUT_pal16(gMainGfxPos++, 0, fold_currentImage->palette); } @@ -1510,7 +1586,7 @@ void func_8013DAB4(FoldState* state, Matrix4f mtx) { s32 urIdx = firstVtxIdx + i * (state->subdivX + 1) + j + 1; s32 llIdx = firstVtxIdx + (i + 1) * (state->subdivX + 1) + j; s32 lrIdx = firstVtxIdx + (i + 1) * (state->subdivX + 1) + j + 1; - if (!(state->flags & FOLD_STATE_FLAG_20)) { + if (!(state->flags & FOLD_STATE_FLAG_SKIP_TEX_SETUP)) { if ((gSpriteShadingProfile->flags & 1) && (*D_80156954)[0].arrayIdx != 0 && (state->flags & (FOLD_STATE_FLAG_100000 | FOLD_STATE_FLAG_80000)) && @@ -1535,7 +1611,7 @@ void func_8013DAB4(FoldState* state, Matrix4f mtx) { alpha = 255; break; case FOLD_RENDER_TYPE_2: - alpha = state->unk_1C[1][3]; + alpha = state->ints.color[1].a; break; case FOLD_RENDER_TYPE_7: alpha = -1; @@ -1545,7 +1621,7 @@ void func_8013DAB4(FoldState* state, Matrix4f mtx) { create_shading_palette(mtx, (fold_vtxBuf[ulIdx].v.tc[0] >> 5) - 0x100, (fold_vtxBuf[ulIdx].v.tc[1] >> 5) - 0x100, (fold_vtxBuf[lrIdx].v.tc[0] >> 5) - 0x100, (fold_vtxBuf[lrIdx].v.tc[1] >> 5) - 0x100, - alpha, state->unk_78); + alpha, state->otherModeL); } else { gDPScrollTextureTile_4b(gMainGfxPos++, fold_currentImage->raster, G_IM_FMT_CI, @@ -1577,7 +1653,7 @@ void func_8013E2F0(FoldState* state, Matrix4f mtx) { guScale(&gDisplayContext->matrixStack[gMatrixListPos], 0.1f, 0.1f, 0.1f); gSPMatrix(gMainGfxPos++, VIRTUAL_TO_PHYSICAL(&gDisplayContext->matrixStack[gMatrixListPos++]), G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); - if (!(state->flags & FOLD_STATE_FLAG_20)) { + if (!(state->flags & FOLD_STATE_FLAG_SKIP_TEX_SETUP)) { gDPSetTextureLUT(gMainGfxPos++, G_TT_RGBA16); gDPLoadTLUT_pal16(gMainGfxPos++, 0, fold_currentImage->palette); if ((gSpriteShadingProfile->flags & 1) @@ -1603,14 +1679,14 @@ void func_8013E2F0(FoldState* state, Matrix4f mtx) { alpha = 255; break; case FOLD_RENDER_TYPE_2: - alpha = state->unk_1C[1][3]; + alpha = state->ints.color[1].a; break; case FOLD_RENDER_TYPE_7: alpha = -1; break; } - create_shading_palette(mtx, 0, 0, fold_currentImage->width, fold_currentImage->height, alpha, state->unk_78); + create_shading_palette(mtx, 0, 0, fold_currentImage->width, fold_currentImage->height, alpha, state->otherModeL); } else { gDPScrollTextureTile_4b(gMainGfxPos++, fold_currentImage->raster, G_IM_FMT_CI, fold_currentImage->width, fold_currentImage->height, @@ -1624,7 +1700,7 @@ void func_8013E2F0(FoldState* state, Matrix4f mtx) { } void func_8013E904(FoldState* state, Matrix4f mtx) { - UnkFoldStruct* ufs = (UnkFoldStruct*)state->unk_1C[1][0]; + UnkFoldStruct* ufs = (UnkFoldStruct*)state->ints.raw[1][0]; s32 shifts = integer_log(ufs->width, 2); s32 shiftt = integer_log(ufs->height, 2); s32 uls, ult; @@ -1635,7 +1711,7 @@ void func_8013E904(FoldState* state, Matrix4f mtx) { gDPSetRenderMode(gMainGfxPos++, G_RM_ZB_XLU_DECAL, G_RM_ZB_XLU_DECAL2); if (state->renderType == FOLD_RENDER_TYPE_F) { - s32 temp = state->unk_1C[1][1]; + s32 temp = state->ints.raw[1][1]; gDPSetPrimColor(gMainGfxPos++, 0, 0, 0, 0, 0, temp); gDPSetCombineLERP(gMainGfxPos++, TEXEL0, 0, SHADE, 0, TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, SHADE, 0, TEXEL0, 0, PRIMITIVE, 0); } else { @@ -1648,71 +1724,71 @@ void func_8013E904(FoldState* state, Matrix4f mtx) { G_TX_WRAP, G_TX_WRAP, shifts, shiftt, G_TX_NOLOD, G_TX_NOLOD, 256, 256); - uls = state->unk_3C[1][0]; - ult = state->unk_3C[1][1]; - lrs = ufs->width * 4 + state->unk_3C[1][0]; - lrt = ufs->height * 4 + state->unk_3C[1][1]; + uls = state->floats.raw[1][0]; + ult = state->floats.raw[1][1]; + lrs = ufs->width * 4 + state->floats.raw[1][0]; + lrt = ufs->height * 4 + state->floats.raw[1][1]; gDPSetTileSize(gMainGfxPos++, G_TX_RENDERTILE, uls, ult, lrs, lrt); - state->unk_3C[1][0] = (s32)(state->unk_3C[1][0] + ufs->unk_0C) % (ufs->width * 4); - state->unk_3C[1][1] = (s32)(state->unk_3C[1][1] + ufs->unk_10) % (ufs->height * 4); + state->floats.raw[1][0] = (s32)(state->floats.raw[1][0] + ufs->unk_0C) % (ufs->width * 4); + state->floats.raw[1][1] = (s32)(state->floats.raw[1][1] + ufs->unk_10) % (ufs->height * 4); gSPDisplayList(gMainGfxPos++, ufs->unk_14); gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW); } -void func_8013EE48(FoldState* state) { - state->unk_3C[0][0] = 0.0f; - state->unk_3C[0][1] = 50.0f; - state->unk_3C[0][2] = 30.0f; +void fold_wavy_init(FoldState* state) { + state->floats.wavy.phase1 = 0.0f; + state->floats.wavy.phase2 = 50.0f; + state->floats.wavy.phase3 = 30.0f; } -void func_8013EE68(FoldState* state) { +void fold_mesh_wavy_update(FoldState* state) { Vtx* v1; Vtx* v2; Vtx* v3; - f32 temp_f20; - f32 temp_f20_2; - f32 temp_f20_3; + f32 vx; + f32 vy; + f32 vz; + f32 angle1; f32 angle2; f32 angle3; - f32 angle1; - s32 amt; - f32 phi_f8; - f32 phi_f6; - f32 phi_f4; + f32 phase1; + f32 phase2; + f32 phase3; s32 angleInc; + s32 amt; s32 sign; s32 i; - phi_f8 = (f32) gGameStatusPtr->frameCounter / 10.3; - while (phi_f8 > 360.0) { - phi_f8 -= 360.0; + phase1 = (f32) gGameStatusPtr->frameCounter / 10.3; + while (phase1 > 360.0) { + phase1 -= 360.0; } - phi_f6 = (f32) (gGameStatusPtr->frameCounter + 40) / 11.2; - while (phi_f6 > 360.0) { - phi_f6 -= 360.0; + phase2 = (f32) (gGameStatusPtr->frameCounter + 40) / 11.2; + while (phase2 > 360.0) { + phase2 -= 360.0; } - phi_f4 = (f32) (gGameStatusPtr->frameCounter + 25) / 10.8; - while (phi_f4 > 360.0) { - phi_f4 -= 360.0; + phase3 = (f32) (gGameStatusPtr->frameCounter + 25) / 10.8; + while (phase3 > 360.0) { + phase3 -= 360.0; } - state->unk_3C[0][0] = phi_f8; - state->unk_3C[0][1] = phi_f6; - state->unk_3C[0][2] = phi_f4; + state->floats.wavy.phase1 = phase1; + state->floats.wavy.phase2 = phase2; + state->floats.wavy.phase3 = phase3; - if (state->unk_3C[0][0] >= 360.0) { - state->unk_3C[0][0] -= 360.0; + if (state->floats.wavy.phase1 >= 360.0) { + state->floats.wavy.phase1-= 360.0; } - if (state->unk_3C[0][1] >= 360.0) { - state->unk_3C[0][1] -= 360.0; + if (state->floats.wavy.phase2 >= 360.0) { + state->floats.wavy.phase2 -= 360.0; } - if (state->unk_3C[0][2] >= 360.0) { - state->unk_3C[0][2] -= 360.0; + if (state->floats.wavy.phase3 >= 360.0) { + state->floats.wavy.phase3 -= 360.0; } sign = 0; @@ -1720,40 +1796,40 @@ void func_8013EE68(FoldState* state) { amt = (state->lastVtxIdx - state->firstVtxIdx) - state->subdivX; for (i = 0; i < amt; i++) { - angle1 = state->unk_3C[0][0] + (angleInc * 45) + (sign * 180); - angle2 = state->unk_3C[0][1] + (angleInc * 45) + (sign * 180); - angle3 = state->unk_3C[0][2] + (angleInc * 45) + (sign * 180); + angle1 = state->floats.wavy.phase1 + (angleInc * 45) + (sign * 180); + angle2 = state->floats.wavy.phase2 + (angleInc * 45) + (sign * 180); + angle3 = state->floats.wavy.phase3 + (angleInc * 45) + (sign * 180); //TODO find better match - v1 = (Vtx*)((state->firstVtxIdx + i) * 16 + (s32)fold_vtxBuf); - temp_f20 = v1->v.ob[0]; - v1->v.ob[0] = (temp_f20 + (sin_rad(angle1) * state->unk_1C[0][0])); // @bug? should be sin_deg? + v1 = (Vtx*)((state->firstVtxIdx + i) * sizeof(Vtx) + (s32)fold_vtxBuf); + vx = v1->v.ob[0]; + v1->v.ob[0] = (vx + (sin_rad(angle1) * state->ints.wavy.mag.x)); // @bug? should be sin_deg? - v2 = (Vtx*)((state->firstVtxIdx + i) * 16 + (s32)fold_vtxBuf); - temp_f20_2 = v2->v.ob[1]; - v2->v.ob[1] = (temp_f20_2 + (sin_rad(angle2) * state->unk_1C[0][1])); + v2 = (Vtx*)((state->firstVtxIdx + i) * sizeof(Vtx) + (s32)fold_vtxBuf); + vy = v2->v.ob[1]; + v2->v.ob[1] = (vy + (sin_rad(angle2) * state->ints.wavy.mag.y)); - v3 = (Vtx*)((state->firstVtxIdx + i) * 16 + (s32)fold_vtxBuf); - temp_f20_3 = v3->v.ob[2]; - v3->v.ob[2] = (temp_f20_3 + (sin_rad(angle3) * state->unk_1C[0][2])); + v3 = (Vtx*)((state->firstVtxIdx + i) * sizeof(Vtx) + (s32)fold_vtxBuf); + vz = v3->v.ob[2]; + v3->v.ob[2] = (vz + (sin_rad(angle3) * state->ints.wavy.mag.z)); angleInc++; - if ((i % (s32) (state->subdivX + 1)) == 0) { + if (i % (state->subdivX + 1) == 0) { angleInc = 0; sign = !sign; } } } -void func_8013F1F8(FoldState* state) { +void fold_mesh_load_colors(FoldState* state) { f32 alpha = (f32)fold_currentImage->alphaMultiplier / 255.0; s32 vtxCount = state->lastVtxIdx - state->firstVtxIdx; s32 i; for (i = 0; i <= vtxCount; i++) { - fold_vtxBuf[state->firstVtxIdx + i].v.cn[0] = state->buf[i * 4 + 0]; - fold_vtxBuf[state->firstVtxIdx + i].v.cn[1] = state->buf[i * 4 + 1]; - fold_vtxBuf[state->firstVtxIdx + i].v.cn[2] = state->buf[i * 4 + 2]; - fold_vtxBuf[state->firstVtxIdx + i].v.cn[3] = state->buf[i * 4 + 3] * alpha; + fold_vtxBuf[state->firstVtxIdx + i].v.cn[0] = state->colorBuf[i].r; + fold_vtxBuf[state->firstVtxIdx + i].v.cn[1] = state->colorBuf[i].g; + fold_vtxBuf[state->firstVtxIdx + i].v.cn[2] = state->colorBuf[i].b; + fold_vtxBuf[state->firstVtxIdx + i].v.cn[3] = state->colorBuf[i].a * alpha; } } diff --git a/src/entity/BlueWarpPipe.c b/src/entity/BlueWarpPipe.c index 40b2b7fa76..061ad13fbe 100644 --- a/src/entity/BlueWarpPipe.c +++ b/src/entity/BlueWarpPipe.c @@ -115,7 +115,7 @@ void entity_BlueWarpPipe_enter_pipe_init(Entity* bluePipe) { pipeData->timer = 25; playerStatus->renderMode = RENDER_MODE_ALPHATEST; - func_802DDFF8(ANIM_Mario1_Idle, FOLD_TYPE_5, 2, 1, 1, 0, 0); + func_802DDFF8(ANIM_Mario1_Idle, FOLD_UPD_SET_ANIM, FOLD_ANIM_VERTICAL_PIPE_CURL, 1, 1, 0, 0); sfx_play_sound(SOUND_ENTER_PIPE); disable_player_shadow(); } @@ -130,7 +130,7 @@ void entity_BlueWarpPipe_enter_pipe_update(Entity* entity) { if (pipeData->timer == -1) { playerStatus->renderMode = RENDER_MODE_ALPHATEST; playerStatus->position.y -= 50.0f; - func_802DDFF8(ANIM_Mario1_Idle, 0, 0, 0, 0, 0, 0); + func_802DDFF8(ANIM_Mario1_Idle, FOLD_UPD_CLEAR, 0, 0, 0, 0, 0); exec_entity_commandlist(entity); } } diff --git a/src/entity/jan_iwa/Plants1.c b/src/entity/jan_iwa/Plants1.c index 2d21384a44..65b4f53f23 100644 --- a/src/entity/jan_iwa/Plants1.c +++ b/src/entity/jan_iwa/Plants1.c @@ -309,7 +309,7 @@ void entity_CymbalPlant_idle(Entity* entity) { if (--data->timer == 0) { data->state++; func_802DDEE4(PLAYER_SPRITE_MAIN, -1, 0, 0, 0, 0, 0, 0); - func_802DDFF8(ANIM_Mario1_Idle, 5, 19, 1, 1, 0, 0); + func_802DDFF8(ANIM_Mario1_Idle, FOLD_UPD_SET_ANIM, FOLD_ANIM_CYMBAL_CRUSH, 1, 1, 0, 0); } break; case 3: diff --git a/src/evt/npc_api.c b/src/evt/npc_api.c index 46e174f077..f612f8fcb9 100644 --- a/src/evt/npc_api.c +++ b/src/evt/npc_api.c @@ -965,7 +965,7 @@ ApiStatus PartnerIsFlying(Evt* script, s32 isInitialCall) { return ApiStatus_DONE2; } -ApiStatus func_802CFD30(Evt* script, s32 isInitialCall) { +ApiStatus SetNpcFoldParams(Evt* script, s32 isInitialCall) { Bytecode* args = script->ptrReadPos; s32 npcId = evt_get_variable(script, *args++); Bytecode foldType = evt_get_variable(script, *args++); @@ -979,21 +979,21 @@ ApiStatus func_802CFD30(Evt* script, s32 isInitialCall) { return ApiStatus_DONE2; } - func_8003D624(npc, foldType, var2, var3, var4, var5, npc->foldArg5); + npc_set_fold_params(npc, foldType, var2, var3, var4, var5, npc->foldFlags); return ApiStatus_DONE2; } -ApiStatus func_802CFE2C(Evt* script, s32 isInitialCall) { +ApiStatus SetNpcFoldFlags(Evt* script, s32 isInitialCall) { Bytecode* args = script->ptrReadPos; s32 npcId = evt_get_variable(script, *args++); - Bytecode arg1 = *args; + Bytecode flags = *args; Npc* npc = resolve_npc(script, npcId); if (npc == NULL) { return ApiStatus_DONE2; } - npc->foldArg5 = arg1; + npc->foldFlags = flags; return ApiStatus_DONE2; } diff --git a/src/evt/player_api.c b/src/evt/player_api.c index d48736c199..e947d28c2d 100644 --- a/src/evt/player_api.c +++ b/src/evt/player_api.c @@ -4,7 +4,7 @@ #include "world/partners.h" extern Npc playerNpcData; -extern u16 D_802DB5B0; +extern u16 PlayerFoldFlags; extern s32 D_802DB5B4[3]; // unused Npc* playerNpc = &playerNpcData; @@ -630,78 +630,78 @@ ApiStatus WaitForPlayerInputEnabled(Evt* script, s32 isInitialCall) { } } -ApiStatus func_802D2520(Evt* script, s32 isInitialCall) { +ApiStatus UpdatePlayerFold(Evt* script, s32 isInitialCall) { Bytecode* args = script->ptrReadPos; PlayerStatus* playerStatus = &gPlayerStatus; s32 a0 = *args++; s32 foldType = evt_get_variable(script, *args++); s32 a2, a3, a4, a5; - func_802DDFF8(a0, FOLD_TYPE_NONE, 0, 0, 0, 0, 0); + func_802DDFF8(a0, FOLD_UPD_CLEAR, 0, 0, 0, 0, 0); switch (foldType) { - case FOLD_TYPE_NONE: + case FOLD_UPD_CLEAR: playerStatus->renderMode = RENDER_MODE_ALPHATEST; - func_802DDFF8(a0, FOLD_TYPE_NONE, 0, 0, 0, 0, D_802DB5B0); + func_802DDFF8(a0, FOLD_UPD_CLEAR, 0, 0, 0, 0, PlayerFoldFlags); break; case FOLD_TYPE_2: case FOLD_TYPE_3: playerStatus->renderMode = RENDER_MODE_ALPHATEST; case FOLD_TYPE_1: - func_802DDFF8(a0, foldType, 0, 0, 0, 0, D_802DB5B0); + func_802DDFF8(a0, foldType, 0, 0, 0, 0, PlayerFoldFlags); break; - case FOLD_TYPE_4: + case FOLD_UPD_WAVY: playerStatus->renderMode = RENDER_MODE_ALPHATEST; a2 = evt_get_variable(script, *args++); a3 = evt_get_variable(script, *args++); a4 = evt_get_variable(script, *args++); - func_802DDFF8(a0, FOLD_TYPE_4, a2, a3, a4, 0, D_802DB5B0); + func_802DDFF8(a0, FOLD_UPD_WAVY, a2, a3, a4, 0, PlayerFoldFlags); break; - case FOLD_TYPE_6: + case FOLD_UPD_SET_COLOR: playerStatus->renderMode = RENDER_MODE_ALPHATEST; a2 = evt_get_variable(script, *args++); a3 = evt_get_variable(script, *args++); a4 = evt_get_variable(script, *args++); - func_802DDFF8(a0, FOLD_TYPE_6, a2, a3, a4, 255, D_802DB5B0); + func_802DDFF8(a0, FOLD_UPD_SET_COLOR, a2, a3, a4, 255, PlayerFoldFlags); break; - case FOLD_TYPE_7: + case FOLD_UPD_SET_ALPHA: playerStatus->renderMode = RENDER_MODE_SURFACE_XLU_LAYER2; a5 = evt_get_variable(script, *args++); - func_802DDFF8(a0, FOLD_TYPE_7, 255, 255, 255, a5, D_802DB5B0); + func_802DDFF8(a0, FOLD_UPD_SET_ALPHA, 255, 255, 255, a5, PlayerFoldFlags); break; - case FOLD_TYPE_8: + case FOLD_UPD_SET_TINT: playerStatus->renderMode = RENDER_MODE_SURFACE_XLU_LAYER2; a2 = evt_get_variable(script, *args++); a3 = evt_get_variable(script, *args++); a4 = evt_get_variable(script, *args++); a5 = evt_get_variable(script, *args++); - func_802DDFF8(a0, FOLD_TYPE_8, a2, a3, a4, a5, D_802DB5B0); + func_802DDFF8(a0, FOLD_UPD_SET_TINT, a2, a3, a4, a5, PlayerFoldFlags); break; - case FOLD_TYPE_5: + case FOLD_UPD_SET_ANIM: playerStatus->renderMode = RENDER_MODE_ALPHATEST; a2 = evt_get_variable(script, *args++); a3 = evt_get_variable(script, *args++); a4 = evt_get_variable(script, *args++); - func_802DDFF8(a0, FOLD_TYPE_5, a2, a3, a4, 0, D_802DB5B0); + func_802DDFF8(a0, FOLD_UPD_SET_ANIM, a2, a3, a4, 0, PlayerFoldFlags); break; - case FOLD_TYPE_D: + case FOLD_UPD_HOLOGRAM: playerStatus->renderMode = RENDER_MODE_SURFACE_XLU_LAYER2; a2 = evt_get_variable(script, *args++); a3 = evt_get_variable(script, *args++); a4 = evt_get_variable(script, *args++); a5 = evt_get_variable(script, *args++); - func_802DDFF8(a0, FOLD_TYPE_D, a2, a3, a4, a5, D_802DB5B0); + func_802DDFF8(a0, FOLD_UPD_HOLOGRAM, a2, a3, a4, a5, PlayerFoldFlags); break; } - D_802DB5B0 = 0; + PlayerFoldFlags = 0; return ApiStatus_DONE2; } -ApiStatus func_802D286C(Evt* script, s32 isInitialCall) { - s32 temp = *script->ptrReadPos; +ApiStatus SetPlayerFoldFlags(Evt* script, s32 isInitialCall) { + s32 foldFlags = *script->ptrReadPos; - D_802DB5B0 = temp; + PlayerFoldFlags = foldFlags; return ApiStatus_DONE2; } diff --git a/src/evt/script_list.c b/src/evt/script_list.c index 7956b664f4..23ef994729 100644 --- a/src/evt/script_list.c +++ b/src/evt/script_list.c @@ -50,7 +50,7 @@ BSS s32 D_802DB26C; // unused? // player_api BSS Npc playerNpcData; -BSS u16 D_802DB5B0; +BSS u16 PlayerFoldFlags; BSS s32 D_802DB5B4[3]; // unused BSS VirtualEntityList bBattleVirtualEntityList; BSS VirtualEntityList wWorldVirtualEntityList; diff --git a/src/hud_element.c b/src/hud_element.c index ef33210d17..906e6ec571 100644 --- a/src/hud_element.c +++ b/src/hud_element.c @@ -1511,15 +1511,15 @@ void render_hud_element(HudElement* hudElement) { case 1: if (hudElement->flags & HUD_ELEMENT_FLAG_NO_FOLD) { if (hudElement->flags & HUD_ELEMENT_FLAG_TRANSPARENT) { - fold_update(0, FOLD_TYPE_7, 255, 255, 255, hudElement->opacity, 0); + fold_update(0, FOLD_UPD_SET_ALPHA, 255, 255, 255, hudElement->opacity, 0); } else { - fold_update(0, FOLD_TYPE_NONE, 0, 0, 0, 0, 0); + fold_update(0, FOLD_UPD_CLEAR, 0, 0, 0, 0, 0); } } else { if (hudElement->flags & HUD_ELEMENT_FLAG_TRANSPARENT) { - fold_update(transform->foldIdx, FOLD_TYPE_7, 255, 255, 255, hudElement->opacity, 0); + fold_update(transform->foldIdx, FOLD_UPD_SET_ALPHA, 255, 255, 255, hudElement->opacity, 0); } else { - fold_update(transform->foldIdx, FOLD_TYPE_NONE, 0, 0, 0, 0, 0); + fold_update(transform->foldIdx, FOLD_UPD_CLEAR, 0, 0, 0, 0, 0); } } @@ -1534,12 +1534,12 @@ void render_hud_element(HudElement* hudElement) { if (hudElement->flags & HUD_ELEMENT_FLAG_NO_FOLD) { if (hudElement->flags & HUD_ELEMENT_FLAG_ANTIALIASING) { - fold_appendGfx_component(0, &sp2A0, 0x40, sp60); + fold_appendGfx_component(0, &sp2A0, FOLD_STATE_FLAG_40, sp60); } else { - fold_appendGfx_component(0, &sp2A0, 0x40, sp60); + fold_appendGfx_component(0, &sp2A0, FOLD_STATE_FLAG_40, sp60); } } else { - fold_appendGfx_component(transform->foldIdx, &sp2A0, 0x40, sp60); + fold_appendGfx_component(transform->foldIdx, &sp2A0, FOLD_STATE_FLAG_40, sp60); } break; case 2: diff --git a/src/i_spy.c b/src/i_spy.c index 96095c83f5..9b36ab1012 100644 --- a/src/i_spy.c +++ b/src/i_spy.c @@ -73,7 +73,7 @@ void appendGfx_ispy_icon(void) { foldImage.palette = ispy_icon_3_pal; break; } - fold_update(0, FOLD_TYPE_7, 255, 255, 255, ISpyPtr->alpha, 0); + fold_update(0, FOLD_UPD_SET_ALPHA, 255, 255, 255, ISpyPtr->alpha, 0); foldImage.raster = ispy_icon_img; foldImage.width = ispy_icon_img_width; diff --git a/src/inspect_icon.c b/src/inspect_icon.c index a393f83eb0..485ea487dd 100644 --- a/src/inspect_icon.c +++ b/src/inspect_icon.c @@ -80,9 +80,10 @@ void appendGfx_interact_prompt(void) { sp20.xOffset = -16; sp20.yOffset = 26; sp20.opacity = 255; - fold_update(0, FOLD_TYPE_NONE, 0, 0, 0, 0, 0x440); - fold_update(0, FOLD_TYPE_6, - InspectIconPtr->brightness, InspectIconPtr->brightness, InspectIconPtr->brightness, 255, 0x448); + fold_update(0, FOLD_UPD_CLEAR, 0, 0, 0, 0, FOLD_STATE_FLAG_400 | FOLD_STATE_FLAG_40); + fold_update(0, FOLD_UPD_SET_COLOR, + InspectIconPtr->brightness, InspectIconPtr->brightness, InspectIconPtr->brightness, 255, + FOLD_STATE_FLAG_400 | FOLD_STATE_FLAG_40 | FOLD_STATE_FLAG_8); fold_appendGfx_component(0, &sp20, 0, sp78); gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW); diff --git a/src/npc.c b/src/npc.c index e85acbabde..e29698e871 100644 --- a/src/npc.c +++ b/src/npc.c @@ -141,7 +141,7 @@ s32 create_npc_impl(NpcBlueprint* blueprint, AnimID* animList, s32 isPeachNpc) { npc->animationSpeed = 1.0f; npc->renderYaw = 0.0f; npc->foldType = 0; - npc->foldArg5 = 0; + npc->foldFlags = 0; npc->collisionChannel = COLLISION_CHANNEL_20000; npc->isFacingAway = FALSE; npc->yawCamOffset = 0; @@ -1148,7 +1148,7 @@ void appendGfx_npc_blur(void* data) { x = blur->x[index]; y = blur->y[index]; z = blur->z[index]; - func_802DE894(npc->spriteInstanceID, FOLD_TYPE_7, 255, 255, 255, 120 - (var_s5 * 20), 0); + func_802DE894(npc->spriteInstanceID, FOLD_UPD_SET_ALPHA, 255, 255, 255, 120 - (var_s5 * 20), 0); yaw = npc->renderYaw; guTranslateF(sp20, x, y, z); @@ -1928,7 +1928,7 @@ void npc_update_decoration_charged(Npc* npc, s32 idx) { s32 temp3; if (!npc->decorationInitialised[idx]) { - func_802DE894(npc->spriteInstanceID, FOLD_TYPE_11, 20, 0, 0, 255, 0); + func_802DE894(npc->spriteInstanceID, FOLD_UPD_ALLOC_COLOR_BUF, 20, 0, 0, 255, 0); npc->decorationInitialised[idx] = TRUE; } if (npc->decorationInitialised[idx] == TRUE) { @@ -1944,7 +1944,7 @@ void npc_update_decoration_charged(Npc* npc, s32 idx) { } for (temp3 = 255, i = 0; i < 20; i++) { - func_802DE894(npc->spriteInstanceID, FOLD_TYPE_C, i, (sp50[i] << 24) | (sp38[i] << 16) | (sp20[i] << 8) | temp3, 0, 255, 0); + func_802DE894(npc->spriteInstanceID, FOLD_UPD_COLOR_BUF_SET_C, i, (sp50[i] << 24) | (sp38[i] << 16) | (sp20[i] << 8) | temp3, 0, 255, 0); } } } @@ -2086,76 +2086,76 @@ void func_8003D3BC(Npc* npc) { s32 foldArg2 = npc->foldArg2; s32 foldArg3 = npc->foldArg3; s32 foldArg4 = npc->foldArg4; - s32 foldArg5 = npc->foldArg5; + s32 foldFlags = npc->foldFlags; - func_802DE894(npc->spriteInstanceID, FOLD_TYPE_NONE, 0, 0, 0, 0, 0); + func_802DE894(npc->spriteInstanceID, FOLD_UPD_CLEAR, 0, 0, 0, 0, 0); switch (foldType) { - case FOLD_TYPE_NONE: + case FOLD_UPD_CLEAR: npc->renderMode = RENDER_MODE_ALPHATEST; - func_802DE894(npc->spriteInstanceID, FOLD_TYPE_NONE, 0, 0, 0, 0, foldArg5); + func_802DE894(npc->spriteInstanceID, FOLD_UPD_CLEAR, 0, 0, 0, 0, foldFlags); break; case FOLD_TYPE_2: case FOLD_TYPE_3: npc->renderMode = RENDER_MODE_ALPHATEST; // fallthrough case FOLD_TYPE_1: - func_802DE894(npc->spriteInstanceID, foldType, 0, 0, 0, 0, foldArg5); + func_802DE894(npc->spriteInstanceID, foldType, 0, 0, 0, 0, foldFlags); break; - case FOLD_TYPE_4: + case FOLD_UPD_WAVY: npc->renderMode = RENDER_MODE_ALPHATEST; - func_802DE894(npc->spriteInstanceID, FOLD_TYPE_4, foldArg1, foldArg2, foldArg3, 0, foldArg5); + func_802DE894(npc->spriteInstanceID, FOLD_UPD_WAVY, foldArg1, foldArg2, foldArg3, 0, foldFlags); break; - case FOLD_TYPE_6: + case FOLD_UPD_SET_COLOR: npc->renderMode = RENDER_MODE_ALPHATEST; - func_802DE894(npc->spriteInstanceID, FOLD_TYPE_6, foldArg1, foldArg2, foldArg3, 255, foldArg5); + func_802DE894(npc->spriteInstanceID, FOLD_UPD_SET_COLOR, foldArg1, foldArg2, foldArg3, 255, foldFlags); break; - case FOLD_TYPE_7: + case FOLD_UPD_SET_ALPHA: npc->renderMode = RENDER_MODE_SURFACE_XLU_LAYER2; - func_802DE894(npc->spriteInstanceID, FOLD_TYPE_7, 255, 255, 255, foldArg1, foldArg5); + func_802DE894(npc->spriteInstanceID, FOLD_UPD_SET_ALPHA, 255, 255, 255, foldArg1, foldFlags); break; - case FOLD_TYPE_8: + case FOLD_UPD_SET_TINT: npc->renderMode = RENDER_MODE_SURFACE_XLU_LAYER2; - func_802DE894(npc->spriteInstanceID, FOLD_TYPE_8, foldArg1, foldArg2, foldArg3, foldArg4, foldArg5); + func_802DE894(npc->spriteInstanceID, FOLD_UPD_SET_TINT, foldArg1, foldArg2, foldArg3, foldArg4, foldFlags); break; case FOLD_TYPE_9: npc->renderMode = RENDER_MODE_ALPHATEST; - func_802DE894(npc->spriteInstanceID, FOLD_TYPE_9, foldArg1, foldArg2, foldArg3, 255, foldArg5); + func_802DE894(npc->spriteInstanceID, FOLD_TYPE_9, foldArg1, foldArg2, foldArg3, 255, foldFlags); break; case FOLD_TYPE_A: npc->renderMode = RENDER_MODE_SURFACE_XLU_LAYER2; - func_802DE894(npc->spriteInstanceID, FOLD_TYPE_A, foldArg1, foldArg2, foldArg3, foldArg4, foldArg5); + func_802DE894(npc->spriteInstanceID, FOLD_TYPE_A, foldArg1, foldArg2, foldArg3, foldArg4, foldFlags); break; - case FOLD_TYPE_5: + case FOLD_UPD_SET_ANIM: npc->renderMode = RENDER_MODE_ALPHATEST; - func_802DE894(npc->spriteInstanceID, FOLD_TYPE_5, foldArg1, foldArg2, foldArg3, 0, foldArg5); + func_802DE894(npc->spriteInstanceID, FOLD_UPD_SET_ANIM, foldArg1, foldArg2, foldArg3, 0, foldFlags); break; - case FOLD_TYPE_D: + case FOLD_UPD_HOLOGRAM: npc->renderMode = RENDER_MODE_SURFACE_XLU_LAYER2; - func_802DE894(npc->spriteInstanceID, FOLD_TYPE_D, foldArg1, foldArg2, foldArg3, foldArg4, foldArg5); + func_802DE894(npc->spriteInstanceID, FOLD_UPD_HOLOGRAM, foldArg1, foldArg2, foldArg3, foldArg4, foldFlags); break; case FOLD_TYPE_E: npc->renderMode = RENDER_MODE_ALPHATEST; - func_802DE894(npc->spriteInstanceID, FOLD_TYPE_E, foldArg1, foldArg2, foldArg3, 255, foldArg5); + func_802DE894(npc->spriteInstanceID, FOLD_TYPE_E, foldArg1, foldArg2, foldArg3, 255, foldFlags); break; case FOLD_TYPE_F: npc->renderMode = RENDER_MODE_ALPHATEST; - func_802DE894(npc->spriteInstanceID, FOLD_TYPE_F, foldArg1, 255, 0, 255, foldArg5); + func_802DE894(npc->spriteInstanceID, FOLD_TYPE_F, foldArg1, 255, 0, 255, foldFlags); break; case FOLD_TYPE_10: npc->renderMode = RENDER_MODE_SURFACE_XLU_LAYER2; - func_802DE894(npc->spriteInstanceID, FOLD_TYPE_F, foldArg1, foldArg2, 0, foldArg2, foldArg5); + func_802DE894(npc->spriteInstanceID, FOLD_TYPE_F, foldArg1, foldArg2, 0, foldArg2, foldFlags); break; } } -void func_8003D624(Npc* npc, s32 foldType, s32 arg2, s32 arg3, s32 arg4, s32 arg5, s32 arg6) { +void npc_set_fold_params(Npc* npc, s32 foldType, s32 arg2, s32 arg3, s32 arg4, s32 arg5, s32 arg6) { npc->foldType = foldType; npc->foldArg1 = arg2; npc->foldArg2 = arg3; npc->foldArg3 = arg4; npc->foldArg4 = arg5; - npc->foldArg5 = arg6; + npc->foldFlags = arg6; func_8003D3BC(npc); } diff --git a/src/pause/pause_main.c b/src/pause/pause_main.c index 018e67c618..95df2c4b11 100644 --- a/src/pause/pause_main.c +++ b/src/pause/pause_main.c @@ -578,7 +578,7 @@ void pause_tutorial_draw_contents(MenuPanel* menu, s32 baseX, s32 baseY, s32 wid guMtxCatF(matrix2ptr, matrix1, matrix1); guMtxF2L(matrix1, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - func_802DE894(gPauseTutorialSprites[i], FOLD_TYPE_6, 255, 255, 255, 255, 64); + func_802DE894(gPauseTutorialSprites[i], FOLD_UPD_SET_COLOR, 255, 255, 255, 255, 64); spr_draw_npc_sprite(gPauseTutorialSprites[i], 0, 0, 0, matrix1); gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW); } diff --git a/src/pause/pause_partners.c b/src/pause/pause_partners.c index cf145eeff2..890cd56868 100644 --- a/src/pause/pause_partners.c +++ b/src/pause/pause_partners.c @@ -341,7 +341,7 @@ void pause_partners_draw_contents(MenuPanel* menu, s32 baseX, s32 baseY, s32 wid } else { color = 255.0f - offsetZ * 95.0f * 0.125f; } - func_802DE894(gPausePartnersSpriteIDs[gPausePartnersPartnerIdx[index]], FOLD_TYPE_6, color, color, color, 255, 0x40); + func_802DE894(gPausePartnersSpriteIDs[gPausePartnersPartnerIdx[index]], FOLD_UPD_SET_COLOR, color, color, color, 255, 64); spr_draw_npc_sprite(gPausePartnersSpriteIDs[gPausePartnersPartnerIdx[index]], 0, 0, NULL, matrix); } diff --git a/src/pause/pause_spirits.c b/src/pause/pause_spirits.c index e310c0a44b..d81a8ccd11 100644 --- a/src/pause/pause_spirits.c +++ b/src/pause/pause_spirits.c @@ -196,7 +196,7 @@ void pause_spirits_draw_contents(MenuPanel* menu, s32 baseX, s32 baseY, s32 widt } - func_802DE894(gPauseSpiritsSpriteIDs[gPauseSpiritsIndexes[index]], FOLD_TYPE_8, color, color, color, alpha, 0x40); + func_802DE894(gPauseSpiritsSpriteIDs[gPauseSpiritsIndexes[index]], FOLD_UPD_SET_TINT, color, color, color, alpha, 64); guTranslateF(matrix1, baseX + 22 + x, baseY + 77 + y + offsetY, 0.0f); guRotateF(matrix2, 180.0f, 0.0f, 0.0f, 1.0f); guMtxCatF(matrix2, matrix1, matrix1); diff --git a/src/pause/pause_stats.c b/src/pause/pause_stats.c index 6819ea32c6..bad05ba32a 100644 --- a/src/pause/pause_stats.c +++ b/src/pause/pause_stats.c @@ -594,8 +594,8 @@ void pause_stats_init(MenuPanel* panel) { void pause_stats_handle_input(MenuPanel* panel) { s32 initialSelection = panel->selected; - s16 adjustedBootsLevel; - s16 adjustedHammerLevel; + s16 bootsMsgIdx; + s16 hammerMsgIdx; s32 msgOffset; if (gPauseHeldButtons & BUTTON_STICK_LEFT) { @@ -652,33 +652,33 @@ void pause_stats_handle_input(MenuPanel* panel) { } msgOffset = 0; - adjustedBootsLevel = gPlayerData.bootsLevel; - adjustedHammerLevel = gPlayerData.hammerLevel; + bootsMsgIdx = gPlayerData.bootsLevel; + hammerMsgIdx = gPlayerData.hammerLevel; - adjustedBootsLevel++; - if (adjustedBootsLevel < 0) { - adjustedBootsLevel = 0; + bootsMsgIdx++; + if (bootsMsgIdx < 0) { + bootsMsgIdx = 0; } - if (adjustedBootsLevel > 3) { - adjustedBootsLevel = 3; + if (bootsMsgIdx > 3) { + bootsMsgIdx = 3; } - adjustedHammerLevel++; - if (adjustedHammerLevel < 0) { - adjustedHammerLevel = 0; + hammerMsgIdx++; + if (hammerMsgIdx < 0) { + hammerMsgIdx = 0; } - if (adjustedHammerLevel > 3) { - adjustedHammerLevel = 3; + if (hammerMsgIdx > 3) { + hammerMsgIdx = 3; } switch (gStatsMenuEntries[panel->selected].baseMsgID) { case PAUSE_MSG_TIP_BOOTS_1: - if (adjustedBootsLevel > 1) { - msgOffset = adjustedBootsLevel - 1; + if (bootsMsgIdx > 1) { + msgOffset = bootsMsgIdx - 1; } break; case PAUSE_MSG_TIP_HAMMER_0: - msgOffset = adjustedHammerLevel; + msgOffset = hammerMsgIdx; break; case PAUSE_MSG_TIP_SECRETS: if (evt_get_variable(NULL, GF_Tutorial_GotStarPiece)) { diff --git a/src/speech_bubble.c b/src/speech_bubble.c index c08b40fb55..74ca264fbc 100644 --- a/src/speech_bubble.c +++ b/src/speech_bubble.c @@ -67,10 +67,10 @@ void appendGfx_speech_bubble(void) { foldImg.xOffset = -16; foldImg.yOffset = 26; foldImg.opacity = 255; - fold_update(0, FOLD_TYPE_NONE, 0, 0, 0, 0, 0x440); - fold_update(0, FOLD_TYPE_6, + fold_update(0, FOLD_UPD_CLEAR, 0, 0, 0, 0, FOLD_STATE_FLAG_400 | FOLD_STATE_FLAG_40); + fold_update(0, FOLD_UPD_SET_COLOR, SpeechBubblePtr->brightness, SpeechBubblePtr->brightness, SpeechBubblePtr->brightness, 255, 0x440); - fold_appendGfx_component(0, &foldImg, 0x40, mtxTransform); + fold_appendGfx_component(0, &foldImg, FOLD_STATE_FLAG_40, mtxTransform); gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW); } diff --git a/src/sprite.c b/src/sprite.c index f68e72af3e..dac7f79ec6 100644 --- a/src/sprite.c +++ b/src/sprite.c @@ -391,7 +391,7 @@ void spr_appendGfx_component( foldImg.xOffset = -(width / 2); foldImg.yOffset = height; foldImg.opacity = opacity; - if (fold_appendGfx_component((u8) (u16) D_802DF540, &foldImg, 0x80000, mtxTransform) == 1) { // todo bitfield? + if (fold_appendGfx_component((u8) (u16) D_802DF540, &foldImg, FOLD_STATE_FLAG_80000, mtxTransform) == 1) { // todo bitfield? D_802DF540 &= ~(0x80000000 | 0x40000000 | 0x20000000 | 0x10000000); } } @@ -1228,7 +1228,7 @@ s32 func_802DE748(s32 spriteIdx, s32 compIdx) { } } -void func_802DE780(s32 spriteIdx, s32 compIdx, FoldType foldType, s32 foldArg0, s32 foldArg1, s32 foldArg2, s32 foldArg3, s32 foldArg4) { +void func_802DE780(s32 spriteIdx, s32 compIdx, FoldType foldType, s32 foldArg1, s32 foldArg2, s32 foldArg3, s32 foldArg4, s32 foldArg5) { SpriteInstance* sprite = &SpriteInstances[spriteIdx]; SpriteComponent** componentList; s32 i; @@ -1241,8 +1241,8 @@ void func_802DE780(s32 spriteIdx, s32 compIdx, FoldType foldType, s32 foldArg0, SpriteComponent* comp = *componentList; if (compIdx == -1 || i == compIdx) { - fold_update((u8)comp->unk_4C, foldType, foldArg0, foldArg1, foldArg2, foldArg3, foldArg4); - if (foldType != FOLD_TYPE_NONE) { + fold_update((u8)comp->unk_4C, foldType, foldArg1, foldArg2, foldArg3, foldArg4, foldArg5); + if (foldType != FOLD_UPD_CLEAR) { comp->unk_4C |= 0x10000000; } else { comp->unk_4C &= ~0xF0000000; @@ -1254,8 +1254,8 @@ void func_802DE780(s32 spriteIdx, s32 compIdx, FoldType foldType, s32 foldArg0, } } -void func_802DE894(s32 spriteIdx, FoldType foldType, s32 foldArg0, s32 foldArg1, s32 foldArg2, s32 foldArg3, s32 foldArg4) { - func_802DE780(spriteIdx, -1, foldType, foldArg0, foldArg1, foldArg2, foldArg3, foldArg4); +void func_802DE894(s32 spriteIdx, FoldType foldType, s32 foldArg1, s32 foldArg2, s32 foldArg3, s32 foldArg4, s32 foldArg5) { + func_802DE780(spriteIdx, -1, foldType, foldArg1, foldArg2, foldArg3, foldArg4, foldArg5); } s32 func_802DE8DC(s32 spriteIdx, s32 compListIdx, s32* outX, s32* outY, s32* outZ) { diff --git a/src/world/area_arn/arn_03/arn_03_3_npc.c b/src/world/area_arn/arn_03/arn_03_3_npc.c index cffb8d5f31..8ec8a63e22 100644 --- a/src/world/area_arn/arn_03/arn_03_3_npc.c +++ b/src/world/area_arn/arn_03/arn_03_3_npc.c @@ -192,7 +192,7 @@ EvtScript N(802428CC) = { EVT_END_IF EVT_ADD(LVar1, 20) EVT_CALL(SetNpcPos, NPC_Boo_05, LVar0, LVar1, LVar2) - EVT_CALL(func_802CFD30, NPC_Boo_05, FOLD_TYPE_7, 0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_Boo_05, FOLD_UPD_SET_ALPHA, 0, 0, 0, 0) EVT_WAIT(1) EVT_RETURN EVT_END @@ -210,7 +210,7 @@ EvtScript N(802429D4) = { EVT_CALL(MakeLerp, 0, 255, 40, EASING_LINEAR) EVT_LABEL(10) EVT_CALL(UpdateLerp) - EVT_CALL(func_802CFD30, NPC_Boo_05, FOLD_TYPE_7, LVar0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_Boo_05, FOLD_UPD_SET_ALPHA, LVar0, 0, 0, 0) EVT_WAIT(1) EVT_IF_EQ(LVar1, 1) EVT_GOTO(10) @@ -233,7 +233,7 @@ EvtScript N(80242B0C) = { EVT_CALL(MakeLerp, 255, 0, 40, EASING_LINEAR) EVT_LABEL(10) EVT_CALL(UpdateLerp) - EVT_CALL(func_802CFD30, NPC_Boo_05, FOLD_TYPE_7, LVar0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_Boo_05, FOLD_UPD_SET_ALPHA, LVar0, 0, 0, 0) EVT_WAIT(1) EVT_IF_EQ(LVar1, 1) EVT_GOTO(10) diff --git a/src/world/area_arn/arn_05/arn_05_3_npc.c b/src/world/area_arn/arn_05/arn_05_3_npc.c index 6d4999d1d5..ef28025a6e 100644 --- a/src/world/area_arn/arn_05/arn_05_3_npc.c +++ b/src/world/area_arn/arn_05/arn_05_3_npc.c @@ -370,9 +370,9 @@ EvtScript N(EVS_Scene_TubbaRaid) = { EVT_SETF(LVar0, EVT_FLOAT(240.0)) EVT_LOOP(20 * DT) EVT_SUBF(LVar0, EVT_FLOAT(240.0 / (s32) (20 * DT))) - EVT_CALL(func_802CFD30, NPC_Boo_01, FOLD_TYPE_7, LVar0, 0, 0, 0) - EVT_CALL(func_802CFD30, NPC_Boo_02, FOLD_TYPE_7, LVar0, 0, 0, 0) - EVT_CALL(func_802CFD30, NPC_Boo_05, FOLD_TYPE_7, LVar0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_Boo_01, FOLD_UPD_SET_ALPHA, LVar0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_Boo_02, FOLD_UPD_SET_ALPHA, LVar0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_Boo_05, FOLD_UPD_SET_ALPHA, LVar0, 0, 0, 0) EVT_WAIT(1) EVT_END_LOOP EVT_CALL(SetNpcPos, NPC_Boo_01, 420, 300, 220) @@ -385,8 +385,8 @@ EvtScript N(EVS_Scene_TubbaRaid) = { EVT_SETF(LVar0, EVT_FLOAT(0.0)) EVT_LOOP(20 * DT) EVT_ADDF(LVar0, EVT_FLOAT(240.0 / (s32) (20 * DT))) - EVT_CALL(func_802CFD30, NPC_Boo_01, FOLD_TYPE_7, LVar0, 0, 0, 0) - EVT_CALL(func_802CFD30, NPC_Boo_02, FOLD_TYPE_7, LVar0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_Boo_01, FOLD_UPD_SET_ALPHA, LVar0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_Boo_02, FOLD_UPD_SET_ALPHA, LVar0, 0, 0, 0) EVT_WAIT(1) EVT_END_LOOP EVT_CALL(SpeakToPlayer, NPC_Boo_03, ANIM_Boo_Tan_Flail, ANIM_Boo_Tan_Flail, 0, MSG_CH3_00A1) @@ -445,8 +445,8 @@ EvtScript N(EVS_Scene_TubbaRaid) = { EVT_SETF(LVar0, EVT_FLOAT(240.0)) EVT_LOOP(20 * DT) EVT_SUBF(LVar0, EVT_FLOAT(240.0 / (s32) (20 * DT))) - EVT_CALL(func_802CFD30, NPC_Boo_01, FOLD_TYPE_7, LVar0, 0, 0, 0) - EVT_CALL(func_802CFD30, NPC_Boo_02, FOLD_TYPE_7, LVar0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_Boo_01, FOLD_UPD_SET_ALPHA, LVar0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_Boo_02, FOLD_UPD_SET_ALPHA, LVar0, 0, 0, 0) EVT_WAIT(1) EVT_END_LOOP EVT_CALL(SetNpcPos, NPC_Boo_01, NPC_DISPOSE_LOCATION) @@ -565,14 +565,14 @@ EvtScript N(EVS_Scene_TubbaRaid) = { EVT_SETF(LVar0, EVT_FLOAT(0.0)) EVT_LOOP(20 * DT) EVT_ADDF(LVar0, EVT_FLOAT(250.0 / (s32) (20 * DT))) - EVT_CALL(func_802CFD30, NPC_Boo_01, FOLD_TYPE_7, LVar0, 0, 0, 0) - EVT_CALL(func_802CFD30, NPC_Boo_02, FOLD_TYPE_7, LVar0, 0, 0, 0) - EVT_CALL(func_802CFD30, NPC_Boo_05, FOLD_TYPE_7, LVar0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_Boo_01, FOLD_UPD_SET_ALPHA, LVar0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_Boo_02, FOLD_UPD_SET_ALPHA, LVar0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_Boo_05, FOLD_UPD_SET_ALPHA, LVar0, 0, 0, 0) EVT_WAIT(1) EVT_END_LOOP - EVT_CALL(func_802CFD30, NPC_Boo_01, FOLD_TYPE_NONE, 0, 0, 0, 0) - EVT_CALL(func_802CFD30, NPC_Boo_02, FOLD_TYPE_NONE, 0, 0, 0, 0) - EVT_CALL(func_802CFD30, NPC_Boo_05, FOLD_TYPE_NONE, 0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_Boo_01, FOLD_UPD_CLEAR, 0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_Boo_02, FOLD_UPD_CLEAR, 0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_Boo_05, FOLD_UPD_CLEAR, 0, 0, 0, 0) EVT_WAIT(10 * DT) EVT_CALL(SetCamType, CAM_DEFAULT, 4, FALSE) EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(3.0 / DT)) diff --git a/src/world/area_arn/arn_07/arn_07_5_npc.c b/src/world/area_arn/arn_07/arn_07_5_npc.c index 8c16ae98fe..cf3b8d4799 100644 --- a/src/world/area_arn/arn_07/arn_07_5_npc.c +++ b/src/world/area_arn/arn_07/arn_07_5_npc.c @@ -133,12 +133,12 @@ EvtScript N(EVS_Scene_BossDefeated) = { EVT_IF_NE(LVar6, PARTNER_BOW) EVT_SET(LVar5, 8) EVT_CALL(SetNpcPos, NPC_Bow, 257, 25, 0) - EVT_CALL(func_802CFD30, NPC_Bow, FOLD_TYPE_7, 0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_Bow, FOLD_UPD_SET_ALPHA, 0, 0, 0, 0) EVT_CALL(NpcFacePlayer, NPC_Bow, 0) EVT_CALL(MakeLerp, 0, 240, 20 * DT, EASING_LINEAR) EVT_LOOP(0) EVT_CALL(UpdateLerp) - EVT_CALL(func_802CFD30, NPC_Bow, FOLD_TYPE_7, LVar0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_Bow, FOLD_UPD_SET_ALPHA, LVar0, 0, 0, 0) EVT_WAIT(1) EVT_IF_EQ(LVar1, 0) EVT_BREAK_LOOP @@ -217,7 +217,7 @@ EvtScript N(EVS_Scene_BossDefeated) = { EVT_CALL(MakeLerp, 240, 0, 20 * DT, EASING_LINEAR) EVT_LOOP(0) EVT_CALL(UpdateLerp) - EVT_CALL(func_802CFD30, NPC_Bow, FOLD_TYPE_7, LVar0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_Bow, FOLD_UPD_SET_ALPHA, LVar0, 0, 0, 0) EVT_WAIT(1) EVT_IF_EQ(LVar1, 0) EVT_BREAK_LOOP @@ -282,7 +282,7 @@ EvtScript N(EVS_NpcIdle_Boo) = { EVT_CALL(MakeLerp, LVar2, 240, LVar3, EASING_LINEAR) EVT_LOOP(0) EVT_CALL(UpdateLerp) - EVT_CALL(func_802CFD30, NPC_SELF, FOLD_TYPE_7, LVar0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_SELF, FOLD_UPD_SET_ALPHA, LVar0, 0, 0, 0) EVT_WAIT(1) EVT_IF_EQ(LVar1, 0) EVT_BREAK_LOOP diff --git a/src/world/area_dro/dro_02/dro_02_5_npc.c b/src/world/area_dro/dro_02/dro_02_5_npc.c index d49fd300b6..895cd8b03f 100644 --- a/src/world/area_dro/dro_02/dro_02_5_npc.c +++ b/src/world/area_dro/dro_02/dro_02_5_npc.c @@ -318,8 +318,8 @@ EvtScript N(EVS_ToadHouse_GetInBed) = { EVT_CALL(InterpPlayerYaw, 230, 1) EVT_CALL(HidePlayerShadow, TRUE) EVT_CALL(SetPlayerAnimation, ANIM_Mario1_Idle) - EVT_CALL(func_802D286C, 0x800) - EVT_CALL(func_802D2520, ANIM_Mario1_Idle, 5, 7, 1, 1, 0) + EVT_CALL(SetPlayerFoldFlags, FOLD_STATE_FLAG_800) + EVT_CALL(UpdatePlayerFold, ANIM_Mario1_Idle, FOLD_UPD_SET_ANIM, FOLD_ANIM_GET_IN_BED, 1, 1, 0) EVT_THREAD EVT_WAIT(60) EVT_CALL(SetPlayerAnimation, ANIM_MarioW2_SleepStanding) @@ -339,7 +339,7 @@ EvtScript N(EVS_ToadHouse_GetInBed) = { EvtScript N(EVS_ToadHouse_ReturnFromRest) = { EVT_CALL(HidePlayerShadow, FALSE) - EVT_CALL(func_802D2520, ANIM_Mario1_Idle, 0, 0, 0, 0, 0) + EVT_CALL(UpdatePlayerFold, ANIM_Mario1_Idle, FOLD_UPD_CLEAR, 0, 0, 0, 0) EVT_CALL(SetPlayerPos, -187, 0, -240) EVT_CALL(SetPlayerSpeed, EVT_FLOAT(3.0)) EVT_CALL(PlayerMoveTo, -168, -195, 0) diff --git a/src/world/area_dro/dro_02/npc_merlee.c b/src/world/area_dro/dro_02/npc_merlee.c index 24e8d42921..d80f85220f 100644 --- a/src/world/area_dro/dro_02/npc_merlee.c +++ b/src/world/area_dro/dro_02/npc_merlee.c @@ -173,16 +173,16 @@ API_CALLABLE(N(CreateRitualCards)) { N(CreatorScript) = script; ret = func_8013A704(1); - fold_update(ret, FOLD_TYPE_5, 0xF, 1, 1, 0, 0x800); + fold_update(ret, FOLD_UPD_SET_ANIM, FOLD_ANIM_SHUFFLE_CARDS, 1, 1, 0, FOLD_STATE_FLAG_800); evt_set_variable(script, RITUAL_VAR_FOLDER_1, ret); ret = func_8013A704(1); - fold_update(ret, FOLD_TYPE_5, 0x10, 1, 1, 0, 0x800); + fold_update(ret, FOLD_UPD_SET_ANIM, FOLD_ANIM_FLIP_CARD_1, 1, 1, 0, FOLD_STATE_FLAG_800); evt_set_variable(script, RITUAL_VAR_FOLDER_2, ret); ret = func_8013A704(1); - fold_update(ret, FOLD_TYPE_5, 0x11, 1, 1, 0, 0x800); + fold_update(ret, FOLD_UPD_SET_ANIM, FOLD_ANIM_FLIP_CARD_2, 1, 1, 0, FOLD_STATE_FLAG_800); evt_set_variable(script, RITUAL_VAR_FOLDER_3, ret); ret = func_8013A704(1); - fold_update(ret, FOLD_TYPE_5, 0x12, 1, 1, 0, 0x800); + fold_update(ret, FOLD_UPD_SET_ANIM, FOLD_ANIM_FLIP_CARD_3, 1, 1, 0, FOLD_STATE_FLAG_800); evt_set_variable(script, RITUAL_VAR_FOLDER_4, ret); evt_set_variable(script, RITUAL_VAR_WORKER, create_worker_world( @@ -250,7 +250,7 @@ u32 N(appendGfx_ritual_card)(RitualCard* card, Matrix4f mtxParent) { guMtxCatF(mtxTemp, mtxParent, mtxTransform); guMtxF2L(mtxTransform, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, VIRTUAL_TO_PHYSICAL(&gDisplayContext->matrixStack[gMatrixListPos++]), G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - ret = fold_appendGfx_component(evt_get_variable(N(CreatorScript), RITUAL_VAR_FOLDER_1), &foldImage, FOLD_STATE_FLAG_10 | FOLD_STATE_FLAG_20, mtxTransform); + ret = fold_appendGfx_component(evt_get_variable(N(CreatorScript), RITUAL_VAR_FOLDER_1), &foldImage, FOLD_STATE_FLAG_SKIP_GFX_SETUP | FOLD_STATE_FLAG_SKIP_TEX_SETUP, mtxTransform); gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW); return ret; } @@ -261,8 +261,8 @@ u32 N(appendGfx_ritual_card)(RitualCard* card, Matrix4f mtxParent) { guMtxCatF(mtxTemp, mtxParent, mtxTransform); guMtxF2L(mtxTransform, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, VIRTUAL_TO_PHYSICAL(&gDisplayContext->matrixStack[gMatrixListPos++]), G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - fold_appendGfx_component(evt_get_variable(N(CreatorScript), RITUAL_VAR_FOLDER_2), &foldImage, FOLD_STATE_FLAG_10 | FOLD_STATE_FLAG_20, mtxTransform); - fold_appendGfx_component(evt_get_variable(N(CreatorScript), RITUAL_VAR_FOLDER_3), &foldImage, FOLD_STATE_FLAG_10 | FOLD_STATE_FLAG_20, mtxTransform); + fold_appendGfx_component(evt_get_variable(N(CreatorScript), RITUAL_VAR_FOLDER_2), &foldImage, FOLD_STATE_FLAG_SKIP_GFX_SETUP | FOLD_STATE_FLAG_SKIP_TEX_SETUP, mtxTransform); + fold_appendGfx_component(evt_get_variable(N(CreatorScript), RITUAL_VAR_FOLDER_3), &foldImage, FOLD_STATE_FLAG_SKIP_GFX_SETUP | FOLD_STATE_FLAG_SKIP_TEX_SETUP, mtxTransform); gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW); guTranslateF(mtxTemp, N(RitualCards)[0].pos.x, N(RitualCards)[0].pos.y, N(RitualCards)[0].pos.z); guMtxCatF(mtxTemp, mtxParent, mtxTransform); @@ -276,7 +276,7 @@ u32 N(appendGfx_ritual_card)(RitualCard* card, Matrix4f mtxParent) { foldImage.xOffset = -(rasterInfo.width / 2); foldImage.yOffset = rasterInfo.height / 2; foldImage.opacity = 255; - ret = fold_appendGfx_component(evt_get_variable(N(CreatorScript), RITUAL_VAR_FOLDER_4), &foldImage, FOLD_STATE_FLAG_10, mtxTransform); + ret = fold_appendGfx_component(evt_get_variable(N(CreatorScript), RITUAL_VAR_FOLDER_4), &foldImage, FOLD_STATE_FLAG_SKIP_GFX_SETUP, mtxTransform); gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW); return ret; } diff --git a/src/world/area_end/common/Credits.inc.c b/src/world/area_end/common/Credits.inc.c index 4fddc78343..c863e307f7 100644 --- a/src/world/area_end/common/Credits.inc.c +++ b/src/world/area_end/common/Credits.inc.c @@ -119,7 +119,7 @@ void N(CharAnim_FadeIn_0)(CreditsLine* line, CreditsChar* chr) { if (alpha > 255.0f) { alpha = 255.0; } - fold_update(0, FOLD_TYPE_7, 255, 255, 255, alpha, 0); + fold_update(0, FOLD_UPD_SET_ALPHA, 255, 255, 255, alpha, 0); msg_get_glyph(chr->font, chr->variation, chr->charIndex, chr->palette, glyphPtr); posX += (glyphPtr->charWidth * 0.5); @@ -163,7 +163,7 @@ void N(CharAnim_FadeIn_1)(CreditsLine* line, CreditsChar* chr) { } else if (chr->fadeInTime == (line->appearTime - 1)) { fold_update(0, FOLD_TYPE_A, 80, 80, 80, alpha, 0); } else { - fold_update(0, FOLD_TYPE_7, 255, 255, 255, alpha, 0); + fold_update(0, FOLD_UPD_SET_ALPHA, 255, 255, 255, alpha, 0); } msg_get_glyph(chr->font, chr->variation, chr->charIndex, chr->palette, glyphPtr); @@ -198,7 +198,7 @@ void N(CharAnim_FadeIn_2)(CreditsLine* line, CreditsChar* chr) { if (alpha > 255.0f) { alpha = 255.0f; } - fold_update(0, FOLD_TYPE_7, 255, 255, 255, alpha, 0); + fold_update(0, FOLD_UPD_SET_ALPHA, 255, 255, 255, alpha, 0); scaleAmt = update_lerp(EASING_LINEAR, 0.2f, 2.0f, chr->fadeInTime, line->appearTime); if (scaleAmt > 1.0) { @@ -241,7 +241,7 @@ void N(CharAnim_FadeIn_3)(CreditsLine* line, CreditsChar* chr) { if (alpha > 255.0f) { alpha = 255.0f; } - fold_update(0, FOLD_TYPE_7, 255, 255, 255, alpha, 0); + fold_update(0, FOLD_UPD_SET_ALPHA, 255, 255, 255, alpha, 0); rotAngle = update_lerp(EASING_LINEAR, -75.0f, 30.0f, chr->fadeInTime, line->appearTime); if (rotAngle >= 0.0f) { @@ -292,14 +292,14 @@ void N(CharAnim_FadeIn_4)(CreditsLine* line, CreditsChar* chr) { scaleAmt = update_lerp(EASING_QUADRATIC_OUT, 2.0f, 1.0f, chr->fadeInTime, line->appearTime); if (chr->fadeInTime == line->appearTime) { - fold_update(0, FOLD_TYPE_NONE, 0, 0, 0, 0, 0); + fold_update(0, FOLD_UPD_CLEAR, 0, 0, 0, 0, 0); foldFlags |= FOLD_STATE_FLAG_NO_FILTERING; } else { f32 alpha = update_lerp(EASING_LINEAR, 16.0f, 300.0f, chr->fadeInTime, line->appearTime); if (alpha > 255.0f) { alpha = 255.0f; } - fold_update(0, FOLD_TYPE_7, 255, 255, 255, alpha, 0); + fold_update(0, FOLD_UPD_SET_ALPHA, 255, 255, 255, alpha, 0); } msg_get_glyph(chr->font, chr->variation, chr->charIndex, chr->palette, glyphPtr); @@ -349,7 +349,7 @@ void N(CharAnim_HoldClearFold)(CreditsLine* line, CreditsChar* chr) { f32 posX = chr->posX; f32 posY = chr->posY; - fold_update(0, FOLD_TYPE_NONE, 0, 0, 0, 0, 0); + fold_update(0, FOLD_UPD_CLEAR, 0, 0, 0, 0, 0); guTranslateF(transformMtx, posX, -posY, 0.0f); guMtxF2L (transformMtx, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, OS_PHYSICAL_TO_K0(&gDisplayContext->matrixStack[gMatrixListPos++]), @@ -391,7 +391,7 @@ void N(CharAnim_FadeOut_0)(CreditsLine* line, CreditsChar* chr) { f32 alpha; alpha = update_lerp(EASING_SIN_OUT, 255.0f, 0.0f, chr->fadeInTime, line->vanishTime); - fold_update(0, FOLD_TYPE_7, 255, 255, 255, alpha, 0); + fold_update(0, FOLD_UPD_SET_ALPHA, 255, 255, 255, alpha, 0); msg_get_glyph(chr->font, chr->variation, chr->charIndex, chr->palette, glyphPtr); @@ -423,7 +423,7 @@ void N(CharAnim_FadeOut_1)(CreditsLine* line, CreditsChar* chr) { f32 posY = chr->posY; alpha = update_lerp(EASING_SIN_OUT, 255.0f, 0.0f, chr->fadeInTime, line->vanishTime); - fold_update(0, FOLD_TYPE_7, 255, 255, 255, alpha, 0); + fold_update(0, FOLD_UPD_SET_ALPHA, 255, 255, 255, alpha, 0); scaleAmt = update_lerp(EASING_LINEAR, 1.0f, 0.2f, chr->fadeInTime, line->vanishTime); msg_get_glyph(chr->font, chr->variation, chr->charIndex, chr->palette, glyphPtr); @@ -458,7 +458,7 @@ void N(CharAnim_FadeOut_2)(CreditsLine* line, CreditsChar* chr) { f32 posY = chr->posY; alpha = update_lerp(EASING_SIN_OUT, 255.0f, 0.0f, chr->fadeInTime, line->vanishTime); - fold_update(0, FOLD_TYPE_7, 255, 255, 255, alpha, 0); + fold_update(0, FOLD_UPD_SET_ALPHA, 255, 255, 255, alpha, 0); rotAngle = update_lerp(EASING_LINEAR, 0.0f, 60.0f, chr->fadeInTime, line->vanishTime); msg_get_glyph(chr->font, chr->variation, chr->charIndex, chr->palette, glyphPtr); diff --git a/src/world/area_end/end_00/end_00_7_boos.c b/src/world/area_end/end_00/end_00_7_boos.c index 61cd849e31..220f866b7b 100644 --- a/src/world/area_end/end_00/end_00_7_boos.c +++ b/src/world/area_end/end_00/end_00_7_boos.c @@ -77,9 +77,9 @@ EvtScript N(EVS_ParadePhase_Boos) = { EVT_END_LOOP EVT_WAIT(10 * DT) EVT_CALL(N(SetUnusedAlpha), 255) - EVT_CALL(func_802CFD30, NPC_Boo1, FOLD_TYPE_7, 0, 0, 0, 0) - EVT_CALL(func_802CFD30, NPC_Boo2, FOLD_TYPE_7, 0, 0, 0, 0) - EVT_CALL(func_802CFD30, NPC_Boo3, FOLD_TYPE_7, 0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_Boo1, FOLD_UPD_SET_ALPHA, 0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_Boo2, FOLD_UPD_SET_ALPHA, 0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_Boo3, FOLD_UPD_SET_ALPHA, 0, 0, 0, 0) EVT_CALL(EnableNpcShadow, NPC_Boo1, FALSE) EVT_CALL(EnableNpcShadow, NPC_Boo2, FALSE) EVT_CALL(EnableNpcShadow, NPC_Boo3, FALSE) @@ -97,9 +97,9 @@ EvtScript N(EVS_ParadePhase_Boos) = { EVT_CALL(MakeLerp, 0, 255, 30 * DT, EASING_LINEAR) EVT_LOOP(30 * DT) EVT_CALL(UpdateLerp) - EVT_CALL(func_802CFD30, NPC_Boo1, FOLD_TYPE_7, LVar0, 0, 0, 0) - EVT_CALL(func_802CFD30, NPC_Boo2, FOLD_TYPE_7, LVar0, 0, 0, 0) - EVT_CALL(func_802CFD30, NPC_Boo3, FOLD_TYPE_7, LVar0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_Boo1, FOLD_UPD_SET_ALPHA, LVar0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_Boo2, FOLD_UPD_SET_ALPHA, LVar0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_Boo3, FOLD_UPD_SET_ALPHA, LVar0, 0, 0, 0) EVT_WAIT(1) EVT_END_LOOP EVT_CALL(EnableNpcShadow, NPC_Boo1, TRUE) diff --git a/src/world/area_flo/flo_21/flo_21_4_npc.c b/src/world/area_flo/flo_21/flo_21_4_npc.c index 939c603927..7708173ea5 100644 --- a/src/world/area_flo/flo_21/flo_21_4_npc.c +++ b/src/world/area_flo/flo_21/flo_21_4_npc.c @@ -294,9 +294,9 @@ EvtScript N(EVS_HuffNPuff_Defeat_Flashing) = { EVT_CALL(MakeLerp, 0, 255, 10, EASING_QUADRATIC_OUT) EVT_LOOP(0) EVT_CALL(UpdateLerp) - EVT_CALL(func_802CFD30, NPC_HuffNPuff_01, FOLD_TYPE_9, LVar0, LVar0, LVar0, 0) - EVT_CALL(func_802CFD30, NPC_HuffNPuff_02, FOLD_TYPE_9, LVar0, LVar0, LVar0, 0) - EVT_CALL(func_802CFD30, NPC_HuffNPuff_03, FOLD_TYPE_9, LVar0, LVar0, LVar0, 0) + EVT_CALL(SetNpcFoldParams, NPC_HuffNPuff_01, FOLD_TYPE_9, LVar0, LVar0, LVar0, 0) + EVT_CALL(SetNpcFoldParams, NPC_HuffNPuff_02, FOLD_TYPE_9, LVar0, LVar0, LVar0, 0) + EVT_CALL(SetNpcFoldParams, NPC_HuffNPuff_03, FOLD_TYPE_9, LVar0, LVar0, LVar0, 0) EVT_WAIT(1) EVT_IF_EQ(LVar1, 0) EVT_BREAK_LOOP diff --git a/src/world/area_hos/hos_01/hos_01_4_npc.c b/src/world/area_hos/hos_01/hos_01_4_npc.c index 409d14c78a..bc083c38bd 100644 --- a/src/world/area_hos/hos_01/hos_01_4_npc.c +++ b/src/world/area_hos/hos_01/hos_01_4_npc.c @@ -386,13 +386,13 @@ EvtScript N(EVS_NpcAux_Eldstar) = { EVT_IF_LT(LVar3, 0) EVT_SETF(LVar3, EVT_FLOAT(0.0)) EVT_END_IF - EVT_CALL(func_802CFD30, NPC_Eldstar, FOLD_TYPE_D, 0, AB_HOS_StatcAmt_Eldstar, 1, LVar2) - EVT_CALL(func_802CFD30, NPC_Mamar, FOLD_TYPE_D, 0, AB_HOS_StatcAmt_Mamar, 1, LVar3) - EVT_CALL(func_802CFD30, NPC_Skolar, FOLD_TYPE_D, 0, AB_HOS_StatcAmt_Skolar, 1, LVar3) - EVT_CALL(func_802CFD30, NPC_Muskular, FOLD_TYPE_D, 0, AB_HOS_StatcAmt_Muskular, 1, LVar3) - EVT_CALL(func_802CFD30, NPC_Misstar, FOLD_TYPE_D, 0, AB_HOS_StatcAmt_Misstar, 1, LVar3) - EVT_CALL(func_802CFD30, NPC_Klevar, FOLD_TYPE_D, 0, AB_HOS_StatcAmt_Klevar, 1, LVar3) - EVT_CALL(func_802CFD30, NPC_Kalmar, FOLD_TYPE_D, 0, AB_HOS_StatcAmt_Kalmar, 1, LVar3) + EVT_CALL(SetNpcFoldParams, NPC_Eldstar, FOLD_UPD_HOLOGRAM, 0, AB_HOS_StatcAmt_Eldstar, 1, LVar2) + EVT_CALL(SetNpcFoldParams, NPC_Mamar, FOLD_UPD_HOLOGRAM, 0, AB_HOS_StatcAmt_Mamar, 1, LVar3) + EVT_CALL(SetNpcFoldParams, NPC_Skolar, FOLD_UPD_HOLOGRAM, 0, AB_HOS_StatcAmt_Skolar, 1, LVar3) + EVT_CALL(SetNpcFoldParams, NPC_Muskular, FOLD_UPD_HOLOGRAM, 0, AB_HOS_StatcAmt_Muskular, 1, LVar3) + EVT_CALL(SetNpcFoldParams, NPC_Misstar, FOLD_UPD_HOLOGRAM, 0, AB_HOS_StatcAmt_Misstar, 1, LVar3) + EVT_CALL(SetNpcFoldParams, NPC_Klevar, FOLD_UPD_HOLOGRAM, 0, AB_HOS_StatcAmt_Klevar, 1, LVar3) + EVT_CALL(SetNpcFoldParams, NPC_Kalmar, FOLD_UPD_HOLOGRAM, 0, AB_HOS_StatcAmt_Kalmar, 1, LVar3) EVT_WAIT(1) EVT_END_LOOP EVT_LOOP(20) @@ -408,13 +408,13 @@ EvtScript N(EVS_NpcAux_Eldstar) = { EVT_IF_LT(LVar3, 0) EVT_SETF(LVar3, EVT_FLOAT(0.0)) EVT_END_IF - EVT_CALL(func_802CFD30, NPC_Eldstar, FOLD_TYPE_D, 0, AB_HOS_StatcAmt_Eldstar, 1, LVar2) - EVT_CALL(func_802CFD30, NPC_Mamar, FOLD_TYPE_D, 0, AB_HOS_StatcAmt_Mamar, 1, LVar3) - EVT_CALL(func_802CFD30, NPC_Skolar, FOLD_TYPE_D, 0, AB_HOS_StatcAmt_Skolar, 1, LVar3) - EVT_CALL(func_802CFD30, NPC_Muskular, FOLD_TYPE_D, 0, AB_HOS_StatcAmt_Muskular, 1, LVar3) - EVT_CALL(func_802CFD30, NPC_Misstar, FOLD_TYPE_D, 0, AB_HOS_StatcAmt_Misstar, 1, LVar3) - EVT_CALL(func_802CFD30, NPC_Klevar, FOLD_TYPE_D, 0, AB_HOS_StatcAmt_Klevar, 1, LVar3) - EVT_CALL(func_802CFD30, NPC_Kalmar, FOLD_TYPE_D, 0, AB_HOS_StatcAmt_Kalmar, 1, LVar3) + EVT_CALL(SetNpcFoldParams, NPC_Eldstar, FOLD_UPD_HOLOGRAM, 0, AB_HOS_StatcAmt_Eldstar, 1, LVar2) + EVT_CALL(SetNpcFoldParams, NPC_Mamar, FOLD_UPD_HOLOGRAM, 0, AB_HOS_StatcAmt_Mamar, 1, LVar3) + EVT_CALL(SetNpcFoldParams, NPC_Skolar, FOLD_UPD_HOLOGRAM, 0, AB_HOS_StatcAmt_Skolar, 1, LVar3) + EVT_CALL(SetNpcFoldParams, NPC_Muskular, FOLD_UPD_HOLOGRAM, 0, AB_HOS_StatcAmt_Muskular, 1, LVar3) + EVT_CALL(SetNpcFoldParams, NPC_Misstar, FOLD_UPD_HOLOGRAM, 0, AB_HOS_StatcAmt_Misstar, 1, LVar3) + EVT_CALL(SetNpcFoldParams, NPC_Klevar, FOLD_UPD_HOLOGRAM, 0, AB_HOS_StatcAmt_Klevar, 1, LVar3) + EVT_CALL(SetNpcFoldParams, NPC_Kalmar, FOLD_UPD_HOLOGRAM, 0, AB_HOS_StatcAmt_Kalmar, 1, LVar3) EVT_WAIT(1) EVT_END_LOOP EVT_END_LOOP diff --git a/src/world/area_hos/hos_03/hos_03_6_npc.c b/src/world/area_hos/hos_03/hos_03_6_npc.c index 063bc77d57..6cc4f13c10 100644 --- a/src/world/area_hos/hos_03/hos_03_6_npc.c +++ b/src/world/area_hos/hos_03/hos_03_6_npc.c @@ -90,8 +90,8 @@ EvtScript N(EVS_ToadHouse_GetInBed) = { EVT_CALL(InterpPlayerYaw, 204, 1) EVT_CALL(HidePlayerShadow, TRUE) EVT_CALL(SetPlayerAnimation, ANIM_Mario1_Idle) - EVT_CALL(func_802D286C, 0x800) - EVT_CALL(func_802D2520, ANIM_Mario1_Idle, 5, 7, 1, 1, 0) + EVT_CALL(SetPlayerFoldFlags, FOLD_STATE_FLAG_800) + EVT_CALL(UpdatePlayerFold, ANIM_Mario1_Idle, FOLD_UPD_SET_ANIM, FOLD_ANIM_GET_IN_BED, 1, 1, 0) EVT_WAIT(61) EVT_CALL(SetPlayerAnimation, ANIM_MarioW2_SleepStanding) EVT_THREAD @@ -108,7 +108,7 @@ EvtScript N(EVS_ToadHouse_GetInBed) = { EvtScript N(EVS_ToadHouse_ReturnFromRest) = { EVT_EXEC(N(EVS_SetupMusic)) EVT_CALL(N(ToadHouse_CamSetFOV), 0, 25) - EVT_CALL(func_802D2520, ANIM_Mario1_Idle, 0, 0, 0, 0, 0) + EVT_CALL(UpdatePlayerFold, ANIM_Mario1_Idle, FOLD_UPD_CLEAR, 0, 0, 0, 0) EVT_CALL(SetPlayerPos, 445, 25, 185) EVT_CALL(PlayerMoveTo, 440, 215, 20) EVT_RETURN diff --git a/src/world/area_hos/hos_05/hos_05_5_intro.c b/src/world/area_hos/hos_05/hos_05_5_intro.c index fd68d69499..5bbf32c091 100644 --- a/src/world/area_hos/hos_05/hos_05_5_intro.c +++ b/src/world/area_hos/hos_05/hos_05_5_intro.c @@ -1108,7 +1108,7 @@ EvtScript N(EVS_CaptureSpirits) = { EVT_END_IF EVT_CALL(N(SetCardCaptureState1)) EVT_CALL(SetNpcAnimation, NPC_Klevar, ANIM_WorldKlevar_Panic) - EVT_CALL(func_802CFD30, NPC_Klevar, FOLD_TYPE_NONE, 0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_Klevar, FOLD_UPD_CLEAR, 0, 0, 0, 0) EVT_CALL(SetNpcFlagBits, NPC_Klevar, NPC_FLAG_INVISIBLE, TRUE) EVT_CALL(func_802D7B10, ArrayVar(13)) EVT_END_THREAD @@ -1136,7 +1136,7 @@ EvtScript N(EVS_CaptureSpirits) = { EVT_END_IF EVT_CALL(N(SetCardCaptureState1)) EVT_CALL(SetNpcAnimation, NPC_Skolar, ANIM_WorldSkolar_IdleSad) - EVT_CALL(func_802CFD30, NPC_Skolar, FOLD_TYPE_NONE, 0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_Skolar, FOLD_UPD_CLEAR, 0, 0, 0, 0) EVT_CALL(SetNpcFlagBits, NPC_Skolar, NPC_FLAG_INVISIBLE, TRUE) EVT_CALL(func_802D7B10, ArrayVar(10)) EVT_END_THREAD @@ -1164,7 +1164,7 @@ EvtScript N(EVS_CaptureSpirits) = { EVT_END_IF EVT_CALL(N(SetCardCaptureState1)) EVT_CALL(SetNpcAnimation, NPC_Muskular, ANIM_WorldMuskular_Panic) - EVT_CALL(func_802CFD30, NPC_Muskular, FOLD_TYPE_NONE, 0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_Muskular, FOLD_UPD_CLEAR, 0, 0, 0, 0) EVT_CALL(SetNpcFlagBits, NPC_Muskular, NPC_FLAG_INVISIBLE, TRUE) EVT_CALL(func_802D7B10, ArrayVar(11)) EVT_END_THREAD @@ -1192,7 +1192,7 @@ EvtScript N(EVS_CaptureSpirits) = { EVT_END_IF EVT_CALL(N(SetCardCaptureState1)) EVT_CALL(SetNpcAnimation, NPC_Kalmar, ANIM_WorldKalmar_Panic) - EVT_CALL(func_802CFD30, NPC_Kalmar, FOLD_TYPE_NONE, 0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_Kalmar, FOLD_UPD_CLEAR, 0, 0, 0, 0) EVT_CALL(SetNpcFlagBits, NPC_Kalmar, NPC_FLAG_INVISIBLE, TRUE) EVT_CALL(func_802D7B10, ArrayVar(14)) EVT_END_THREAD @@ -1220,7 +1220,7 @@ EvtScript N(EVS_CaptureSpirits) = { EVT_END_IF EVT_CALL(N(SetCardCaptureState1)) EVT_CALL(SetNpcAnimation, NPC_Misstar, ANIM_WorldMisstar_Panic) - EVT_CALL(func_802CFD30, NPC_Misstar, FOLD_TYPE_NONE, 0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_Misstar, FOLD_UPD_CLEAR, 0, 0, 0, 0) EVT_CALL(SetNpcFlagBits, NPC_Misstar, NPC_FLAG_INVISIBLE, TRUE) EVT_CALL(func_802D7B10, ArrayVar(12)) EVT_END_THREAD @@ -1248,7 +1248,7 @@ EvtScript N(EVS_CaptureSpirits) = { EVT_END_IF EVT_CALL(N(SetCardCaptureState1)) EVT_CALL(SetNpcAnimation, NPC_Mamar, ANIM_WorldMamar_Panic) - EVT_CALL(func_802CFD30, NPC_Mamar, FOLD_TYPE_NONE, 0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_Mamar, FOLD_UPD_CLEAR, 0, 0, 0, 0) EVT_CALL(SetNpcFlagBits, NPC_Mamar, NPC_FLAG_INVISIBLE, TRUE) EVT_CALL(func_802D7B10, ArrayVar(9)) EVT_END_THREAD @@ -2037,8 +2037,8 @@ EvtScript N(EVS_Scene_IntroStory) = { EVT_CALL(LoadSettings, CAM_DEFAULT, EVT_PTR(N(IntroCamSettings6))) EVT_CALL(N(AnimateStorybookPages)) EVT_WAIT(50 * DT) - EVT_CALL(func_802CFD30, NPC_Bowser_Body, FOLD_TYPE_8, 0, 0, 0, 0) - EVT_CALL(func_802CFD30, NPC_Bowser_Prop, FOLD_TYPE_8, 0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_Bowser_Body, FOLD_UPD_SET_TINT, 0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_Bowser_Prop, FOLD_UPD_SET_TINT, 0, 0, 0, 0) EVT_CALL(SetNpcPos, NPC_Bowser_Body, -64, 135, 85) EVT_CALL(SetNpcPos, NPC_Bowser_Prop, -64, 135, 85) EVT_THREAD @@ -2048,8 +2048,8 @@ EvtScript N(EVS_Scene_IntroStory) = { EVT_IF_GT(LVar0, 255) EVT_SET(LVar0, 255) EVT_END_IF - EVT_CALL(func_802CFD30, NPC_Bowser_Body, FOLD_TYPE_8, 0, 0, 0, LVar0) - EVT_CALL(func_802CFD30, NPC_Bowser_Prop, FOLD_TYPE_8, 0, 0, 0, LVar0) + EVT_CALL(SetNpcFoldParams, NPC_Bowser_Body, FOLD_UPD_SET_TINT, 0, 0, 0, LVar0) + EVT_CALL(SetNpcFoldParams, NPC_Bowser_Prop, FOLD_UPD_SET_TINT, 0, 0, 0, LVar0) EVT_WAIT(1) EVT_END_LOOP EVT_END_THREAD @@ -2088,8 +2088,8 @@ EvtScript N(EVS_Scene_IntroStory) = { EVT_WAIT(5) EVT_END_LOOP EVT_WAIT(30 * DT) - EVT_CALL(func_802CFD30, NPC_Bowser_Body, FOLD_TYPE_8, 0, 0, 0, 255) - EVT_CALL(func_802CFD30, NPC_Bowser_Prop, FOLD_TYPE_8, 0, 0, 0, 255) + EVT_CALL(SetNpcFoldParams, NPC_Bowser_Body, FOLD_UPD_SET_TINT, 0, 0, 0, 255) + EVT_CALL(SetNpcFoldParams, NPC_Bowser_Prop, FOLD_UPD_SET_TINT, 0, 0, 0, 255) EVT_THREAD EVT_SET(LVar0, 0) EVT_LOOP(4) @@ -2097,8 +2097,8 @@ EvtScript N(EVS_Scene_IntroStory) = { EVT_IF_GT(LVar0, 255) EVT_SET(LVar0, 255) EVT_END_IF - EVT_CALL(func_802CFD30, NPC_Bowser_Body, FOLD_TYPE_8, LVar0, LVar0, LVar0, 255) - EVT_CALL(func_802CFD30, NPC_Bowser_Prop, FOLD_TYPE_8, LVar0, LVar0, LVar0, 255) + EVT_CALL(SetNpcFoldParams, NPC_Bowser_Body, FOLD_UPD_SET_TINT, LVar0, LVar0, LVar0, 255) + EVT_CALL(SetNpcFoldParams, NPC_Bowser_Prop, FOLD_UPD_SET_TINT, LVar0, LVar0, LVar0, 255) EVT_WAIT(1) EVT_END_LOOP EVT_END_THREAD @@ -2421,20 +2421,20 @@ EvtScript N(EVS_Scene_IntroStory) = { EVT_END_THREAD EVT_THREAD EVT_WAIT(28) - EVT_CALL(func_802CFD30, NPC_Eldstar, FOLD_TYPE_5, 8, 1, 1, 0) + EVT_CALL(SetNpcFoldParams, NPC_Eldstar, FOLD_UPD_SET_ANIM, FOLD_ANIM_SPIRIT_CAPTURE, 1, 1, 0) EVT_END_THREAD EVT_SET(LVar0, 255) EVT_LOOP(20) - EVT_CALL(func_802CFD30, NPC_Mamar, FOLD_TYPE_7, LVar0, 0, 0, 0) - EVT_CALL(func_802CFD30, NPC_Skolar, FOLD_TYPE_7, LVar0, 0, 0, 0) - EVT_CALL(func_802CFD30, NPC_Muskular, FOLD_TYPE_7, LVar0, 0, 0, 0) - EVT_CALL(func_802CFD30, NPC_Misstar, FOLD_TYPE_7, LVar0, 0, 0, 0) - EVT_CALL(func_802CFD30, NPC_Klevar, FOLD_TYPE_7, LVar0, 0, 0, 0) - EVT_CALL(func_802CFD30, NPC_Kalmar, FOLD_TYPE_7, LVar0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_Mamar, FOLD_UPD_SET_ALPHA, LVar0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_Skolar, FOLD_UPD_SET_ALPHA, LVar0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_Muskular, FOLD_UPD_SET_ALPHA, LVar0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_Misstar, FOLD_UPD_SET_ALPHA, LVar0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_Klevar, FOLD_UPD_SET_ALPHA, LVar0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_Kalmar, FOLD_UPD_SET_ALPHA, LVar0, 0, 0, 0) EVT_WAIT(1) EVT_END_LOOP EVT_WAIT(15 * DT) - EVT_CALL(func_802CFD30, NPC_Eldstar, FOLD_TYPE_7, 255, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_Eldstar, FOLD_UPD_SET_ALPHA, 255, 0, 0, 0) EVT_PLAY_EFFECT(EFFECT_SOMETHING_ROTATING, 2, -130, 220, 130, 1, 0) EVT_SET(ArrayVar(0), LVarF) EVT_SET(LVar0, -130) @@ -2466,7 +2466,7 @@ EvtScript N(EVS_Scene_IntroStory) = { EVT_END_IF EVT_CALL(N(SetCardCaptureState1)) EVT_CALL(SetNpcAnimation, NPC_Eldstar, ANIM_WorldEldstar_Panic) - EVT_CALL(func_802CFD30, NPC_Eldstar, FOLD_TYPE_NONE, 0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_Eldstar, FOLD_UPD_CLEAR, 0, 0, 0, 0) EVT_CALL(SetNpcFlagBits, NPC_Eldstar, NPC_FLAG_INVISIBLE, TRUE) EVT_CALL(func_802D7B10, ArrayVar(8)) EVT_END_THREAD diff --git a/src/world/area_isk/isk_05/isk_05_3_npc.c b/src/world/area_isk/isk_05/isk_05_3_npc.c index 92b1357067..a7c0a38e12 100644 --- a/src/world/area_isk/isk_05/isk_05_3_npc.c +++ b/src/world/area_isk/isk_05/isk_05_3_npc.c @@ -71,7 +71,7 @@ void N(func_80241610_97F0E0)(void) { foldImg.yOffset = (spriteRaster.height / 2); foldImg.opacity = 255; - fold_update(ambush->foldID, FOLD_TYPE_7, 255, 255, 255, ambush->alpha, 0); + fold_update(ambush->foldID, FOLD_UPD_SET_ALPHA, 255, 255, 255, ambush->alpha, 0); fold_appendGfx_component(ambush->foldID, &foldImg, 0, transformMtx); gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW); } @@ -218,7 +218,7 @@ EvtScript N(EVS_NpcIdle_StoneChomp) = { EVT_CALL(EnableNpcShadow, NPC_SELF, TRUE) EVT_WAIT(1) EVT_CALL(N(DestroyAmbushWorker)) - EVT_CALL(func_802CFD30, NPC_SELF, FOLD_TYPE_NONE, 0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_SELF, FOLD_UPD_CLEAR, 0, 0, 0, 0) EVT_CALL(DisablePlayerInput, FALSE) EVT_CALL(BindNpcAI, NPC_SELF, EVT_PTR(N(EVS_NpcAI_StoneChomp))) EVT_RETURN diff --git a/src/world/area_isk/isk_07/isk_07_7_ambush.c b/src/world/area_isk/isk_07/isk_07_7_ambush.c index d50a86d0f0..1d4e02b3d6 100644 --- a/src/world/area_isk/isk_07/isk_07_7_ambush.c +++ b/src/world/area_isk/isk_07/isk_07_7_ambush.c @@ -28,10 +28,10 @@ EvtScript N(EVS_SetupSarcophagi) = { EVT_WAIT(12) EVT_CALL(InterpPlayerYaw, 109, 0) EVT_WAIT(3) - EVT_CALL(func_802D2520, ANIM_Mario1_Idle, 5, 0, 1, 1, 0) + EVT_CALL(UpdatePlayerFold, ANIM_Mario1_Idle, FOLD_UPD_SET_ANIM, FOLD_ANIM_SHOCK, 1, 1, 0) EVT_CALL(SetPlayerAnimation, ANIM_MarioW2_Shocked) EVT_WAIT(20) - EVT_CALL(func_802D2520, ANIM_Mario1_Idle, 0, 0, 0, 0, 0) + EVT_CALL(UpdatePlayerFold, ANIM_Mario1_Idle, FOLD_UPD_CLEAR, 0, 0, 0, 0) EVT_CALL(SetPlayerAnimation, ANIM_Mario1_Idle) EVT_END_THREAD EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(2.0)) diff --git a/src/world/area_isk/isk_13/isk_13_3_npc.c b/src/world/area_isk/isk_13/isk_13_3_npc.c index 741293c3d0..4d839b6136 100644 --- a/src/world/area_isk/isk_13/isk_13_3_npc.c +++ b/src/world/area_isk/isk_13/isk_13_3_npc.c @@ -77,7 +77,7 @@ void N(func_80241610_990DF0)(void) { foldImg.yOffset = (spriteRaster.height / 2); foldImg.opacity = 255; - fold_update(ambush->foldID, FOLD_TYPE_8, ambush->color.r, ambush->color.g, ambush->color.b, ambush->color.a, 0); + fold_update(ambush->foldID, FOLD_UPD_SET_TINT, ambush->color.r, ambush->color.g, ambush->color.b, ambush->color.a, 0); fold_appendGfx_component(ambush->foldID, &foldImg, 0, transformMtx); gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW); } @@ -268,7 +268,7 @@ EvtScript N(EVS_NpcDefeat_StoneChomp_Override) = { EVT_SET(GF_ISK13_Defeated_StoneChomp, TRUE) EVT_CALL(SetNpcFlagBits, NPC_SELF, NPC_FLAG_INVISIBLE, FALSE) EVT_CALL(EnableNpcShadow, NPC_SELF, TRUE) - EVT_CALL(func_802CFD30, NPC_SELF, FOLD_TYPE_NONE, 0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_SELF, FOLD_UPD_CLEAR, 0, 0, 0, 0) EVT_CALL(N(DestroyAmbushWorker)) EVT_CALL(GetBattleOutcome, LVar0) EVT_SWITCH(LVar0) diff --git a/src/world/area_isk/isk_14/isk_14_3_npc.c b/src/world/area_isk/isk_14/isk_14_3_npc.c index 284e358aa9..4ff66c0b2e 100644 --- a/src/world/area_isk/isk_14/isk_14_3_npc.c +++ b/src/world/area_isk/isk_14/isk_14_3_npc.c @@ -165,7 +165,7 @@ EvtScript N(EVS_NpcIdle_StoneChomp) = { EVT_CALL(EnableNpcShadow, NPC_SELF, TRUE) EVT_WAIT(1) EVT_CALL(N(DestroyAmbushWorker)) - EVT_CALL(func_802CFD30, NPC_SELF, FOLD_TYPE_NONE, 0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_SELF, FOLD_UPD_CLEAR, 0, 0, 0, 0) EVT_CALL(SetSelfEnemyFlagBits, ENEMY_FLAG_4 | ENEMY_FLAG_100000, 0) EVT_WAIT(3) EVT_CALL(GetPlayerPos, LVar0, LVar1, LVar2) diff --git a/src/world/area_isk/isk_16/isk_16_3_boss.c b/src/world/area_isk/isk_16/isk_16_3_boss.c index 7204a79e35..c46e2d158c 100644 --- a/src/world/area_isk/isk_16/isk_16_3_boss.c +++ b/src/world/area_isk/isk_16/isk_16_3_boss.c @@ -48,18 +48,18 @@ EvtScript N(EVS_Scene_TutankoopaAppears) = { EVT_WAIT(30 * DT) EVT_CALL(SetPlayerAnimation, ANIM_Mario1_Idle) EVT_END_THREAD - EVT_CALL(func_802CFD30, NPC_Tutankoopa_02, FOLD_TYPE_7, 0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_Tutankoopa_02, FOLD_UPD_SET_ALPHA, 0, 0, 0, 0) EVT_CALL(SetNpcPos, NPC_Tutankoopa_02, 410, -905, 410) EVT_CALL(SetNpcAnimation, NPC_Tutankoopa_02, ANIM_Tutankoopa_Anim10) EVT_CALL(MakeLerp, 0, 255, 100 * DT, EASING_QUADRATIC_IN) EVT_LABEL(2) EVT_CALL(UpdateLerp) - EVT_CALL(func_802CFD30, NPC_Tutankoopa_02, FOLD_TYPE_7, LVar0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_Tutankoopa_02, FOLD_UPD_SET_ALPHA, LVar0, 0, 0, 0) EVT_WAIT(1) EVT_IF_EQ(LVar1, 1) EVT_GOTO(2) EVT_END_IF - EVT_CALL(func_802CFD30, NPC_Tutankoopa_02, FOLD_TYPE_NONE, 0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_Tutankoopa_02, FOLD_UPD_CLEAR, 0, 0, 0, 0) EVT_WAIT(30 * DT) EVT_SET(LVar0, 255) EVT_LOOP(60 * DT) @@ -110,17 +110,17 @@ EvtScript N(EVS_Scene_TutankoopaAppears) = { EVT_WAIT(59) EVT_CALL(PlaySoundAtNpc, NPC_Tutankoopa_01, SOUND_3EF, SOUND_SPACE_MODE_0) EVT_END_THREAD - EVT_CALL(func_802CFD30, NPC_Tutankoopa_01, FOLD_TYPE_7, 255, 0, 0, 0) - EVT_CALL(func_802CFE2C, NPC_Tutankoopa_01, 0x800) - EVT_CALL(func_802CFD30, NPC_Tutankoopa_01, FOLD_TYPE_5, 14, 2, 1, 0) + EVT_CALL(SetNpcFoldParams, NPC_Tutankoopa_01, FOLD_UPD_SET_ALPHA, 255, 0, 0, 0) + EVT_CALL(SetNpcFoldFlags, NPC_Tutankoopa_01, FOLD_STATE_FLAG_800) + EVT_CALL(SetNpcFoldParams, NPC_Tutankoopa_01, FOLD_UPD_SET_ANIM, FOLD_ANIM_TUTANKOOPA_SWIRL_1, 2, 1, 0) EVT_WAIT(39) - EVT_CALL(func_802CFE2C, NPC_Tutankoopa_01, 0x800) - EVT_CALL(func_802CFD30, NPC_Tutankoopa_01, FOLD_TYPE_5, 13, 2, 1, 0) + EVT_CALL(SetNpcFoldFlags, NPC_Tutankoopa_01, FOLD_STATE_FLAG_800) + EVT_CALL(SetNpcFoldParams, NPC_Tutankoopa_01, FOLD_UPD_SET_ANIM, FOLD_ANIM_TUTANKOOPA_SWIRL_2, 2, 1, 0) EVT_WAIT(39) - EVT_CALL(func_802CFE2C, NPC_Tutankoopa_01, 0x0800) - EVT_CALL(func_802CFD30, NPC_Tutankoopa_01, FOLD_TYPE_5, 12, 2, 1, 0) + EVT_CALL(SetNpcFoldFlags, NPC_Tutankoopa_01, FOLD_STATE_FLAG_800) + EVT_CALL(SetNpcFoldParams, NPC_Tutankoopa_01, FOLD_UPD_SET_ANIM, FOLD_ANIM_TUTANKOOPA_GATHER, 2, 1, 0) EVT_WAIT(55) - EVT_CALL(func_802CFD30, NPC_Tutankoopa_01, FOLD_TYPE_NONE, 0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_Tutankoopa_01, FOLD_UPD_CLEAR, 0, 0, 0, 0) EVT_CALL(SetNpcPos, NPC_Tutankoopa_02, 457, -1300, 316) EVT_WAIT(10 * DT) EVT_CALL(SetPanTarget, CAM_DEFAULT, 438, -800, 332) diff --git a/src/world/area_jan/jan_03/jan_03_4_npc.c b/src/world/area_jan/jan_03/jan_03_4_npc.c index a07ecc4a9c..ca6f3a31a5 100644 --- a/src/world/area_jan/jan_03/jan_03_4_npc.c +++ b/src/world/area_jan/jan_03/jan_03_4_npc.c @@ -175,8 +175,8 @@ EvtScript N(EVS_ToadHouse_GetInBed) = { EVT_CALL(InterpPlayerYaw, 229, 1) EVT_CALL(HidePlayerShadow, TRUE) EVT_CALL(SetPlayerAnimation, ANIM_Mario1_Idle) - EVT_CALL(func_802D286C, 0x800) - EVT_CALL(func_802D2520, ANIM_Mario1_Idle, 5, 7, 1, 1, 0) + EVT_CALL(SetPlayerFoldFlags, FOLD_STATE_FLAG_800) + EVT_CALL(UpdatePlayerFold, ANIM_Mario1_Idle, FOLD_UPD_SET_ANIM, FOLD_ANIM_GET_IN_BED, 1, 1, 0) EVT_THREAD EVT_WAIT(60) EVT_CALL(SetPlayerAnimation, ANIM_MarioW2_SleepStanding) @@ -196,7 +196,7 @@ EvtScript N(EVS_ToadHouse_GetInBed) = { EvtScript N(EVS_ToadHouse_ReturnFromRest) = { EVT_CALL(HidePlayerShadow, FALSE) - EVT_CALL(func_802D2520, ANIM_Mario1_Idle, 0, 0, 0, 0, 0) + EVT_CALL(UpdatePlayerFold, ANIM_Mario1_Idle, FOLD_UPD_CLEAR, 0, 0, 0, 0) EVT_CALL(SetPlayerPos, 345, 0, -186) EVT_CALL(SetPlayerSpeed, EVT_FLOAT(3.0)) EVT_CALL(PlayerMoveTo, 291, -100, 0) diff --git a/src/world/area_kkj/kkj_20/kkj_20_4_npc.c b/src/world/area_kkj/kkj_20/kkj_20_4_npc.c index 46343346be..8cda0f108c 100644 --- a/src/world/area_kkj/kkj_20/kkj_20_4_npc.c +++ b/src/world/area_kkj/kkj_20/kkj_20_4_npc.c @@ -150,8 +150,8 @@ EvtScript N(EVS_ToadHouse_GetInBed) = { EVT_CALL(InterpPlayerYaw, 229, 1) EVT_CALL(HidePlayerShadow, TRUE) EVT_CALL(SetPlayerAnimation, ANIM_Mario1_Idle) - EVT_CALL(func_802D286C, 0x800) - EVT_CALL(func_802D2520, ANIM_Mario1_Idle, FOLD_TYPE_5, 7, 1, 1, 0) + EVT_CALL(SetPlayerFoldFlags, FOLD_STATE_FLAG_800) + EVT_CALL(UpdatePlayerFold, ANIM_Mario1_Idle, FOLD_UPD_SET_ANIM, FOLD_ANIM_GET_IN_BED, 1, 1, 0) EVT_THREAD EVT_WAIT(60) EVT_CALL(SetPlayerAnimation, ANIM_MarioW2_SleepStanding) @@ -172,7 +172,7 @@ EvtScript N(EVS_ToadHouse_GetInBed) = { EvtScript N(EVS_ToadHouse_ReturnFromRest) = { EVT_CALL(HidePlayerShadow, FALSE) - EVT_CALL(func_802D2520, ANIM_Mario1_Idle, FOLD_TYPE_NONE, 0, 0, 0, 0) + EVT_CALL(UpdatePlayerFold, ANIM_Mario1_Idle, FOLD_UPD_CLEAR, 0, 0, 0, 0) EVT_CALL(SetPlayerPos, 85, 0, -85) EVT_CALL(SetPlayerSpeed, EVT_FLOAT(3.0)) EVT_CALL(PlayerMoveTo, 60, -50, 0) diff --git a/src/world/area_kkj/kkj_25/kkj_25_2_npc_initial.c b/src/world/area_kkj/kkj_25/kkj_25_2_npc_initial.c index fef4009929..814500e0d5 100644 --- a/src/world/area_kkj/kkj_25/kkj_25_2_npc_initial.c +++ b/src/world/area_kkj/kkj_25/kkj_25_2_npc_initial.c @@ -61,8 +61,8 @@ EvtScript N(EVS_NpcIdle_Kammy_Broom) = { EVT_END_IF EVT_WAIT(1) EVT_END_LOOP - EVT_CALL(func_802D286C, 0x2000) - EVT_CALL(func_802D2520, ANIM_Mario1_Idle, 8, 0, 0, 0, 0) + EVT_CALL(SetPlayerFoldFlags, FOLD_STATE_FLAG_2000) + EVT_CALL(UpdatePlayerFold, ANIM_Mario1_Idle, FOLD_UPD_SET_TINT, 0, 0, 0, 0) EVT_CALL(HidePlayerShadow, TRUE) EVT_CALL(DisablePartnerAI, 0) EVT_WAIT(1) diff --git a/src/world/area_kkj/kkj_25/kkj_25_3_npc_midpoint.c b/src/world/area_kkj/kkj_25/kkj_25_3_npc_midpoint.c index 3f7fc2e6be..e4da8e5fb4 100644 --- a/src/world/area_kkj/kkj_25/kkj_25_3_npc_midpoint.c +++ b/src/world/area_kkj/kkj_25/kkj_25_3_npc_midpoint.c @@ -109,7 +109,7 @@ EvtScript N(EVS_NpcInit_Twink) = { }; EvtScript N(EVS_NpcInit_Eldstar) = { - EVT_CALL(func_802CFD30, NPC_Eldstar, FOLD_TYPE_7, 0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_Eldstar, FOLD_UPD_SET_ALPHA, 0, 0, 0, 0) EVT_CALL(EnableNpcShadow, NPC_Eldstar, FALSE) EVT_CALL(SetNpcPos, NPC_Eldstar, 100, 45, 0) EVT_RETURN @@ -117,7 +117,7 @@ EvtScript N(EVS_NpcInit_Eldstar) = { }; EvtScript N(EVS_NpcInit_Mamar) = { - EVT_CALL(func_802CFD30, NPC_Mamar, FOLD_TYPE_7, 0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_Mamar, FOLD_UPD_SET_ALPHA, 0, 0, 0, 0) EVT_CALL(EnableNpcShadow, NPC_Mamar, FALSE) EVT_CALL(SetNpcPos, NPC_Mamar, 46, 45, -27) EVT_RETURN @@ -125,7 +125,7 @@ EvtScript N(EVS_NpcInit_Mamar) = { }; EvtScript N(EVS_NpcInit_Skolar) = { - EVT_CALL(func_802CFD30, NPC_Skolar, FOLD_TYPE_7, 0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_Skolar, FOLD_UPD_SET_ALPHA, 0, 0, 0, 0) EVT_CALL(EnableNpcShadow, NPC_Skolar, FALSE) EVT_CALL(SetNpcPos, NPC_Skolar, 33, 45, -95) EVT_RETURN @@ -133,7 +133,7 @@ EvtScript N(EVS_NpcInit_Skolar) = { }; EvtScript N(EVS_NpcInit_Muskular) = { - EVT_CALL(func_802CFD30, NPC_Muskular, FOLD_TYPE_7, 0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_Muskular, FOLD_UPD_SET_ALPHA, 0, 0, 0, 0) EVT_CALL(EnableNpcShadow, NPC_Muskular, FALSE) EVT_CALL(SetNpcPos, NPC_Muskular, 71, 45, -132) EVT_RETURN @@ -141,7 +141,7 @@ EvtScript N(EVS_NpcInit_Muskular) = { }; EvtScript N(EVS_NpcInit_Misstar) = { - EVT_CALL(func_802CFD30, NPC_Misstar, FOLD_TYPE_7, 0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_Misstar, FOLD_UPD_SET_ALPHA, 0, 0, 0, 0) EVT_CALL(EnableNpcShadow, NPC_Misstar, FALSE) EVT_CALL(SetNpcPos, NPC_Misstar, 131, 45, -132) EVT_RETURN @@ -149,7 +149,7 @@ EvtScript N(EVS_NpcInit_Misstar) = { }; EvtScript N(EVS_NpcInit_Klevar) = { - EVT_CALL(func_802CFD30, NPC_Klevar, FOLD_TYPE_7, 0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_Klevar, FOLD_UPD_SET_ALPHA, 0, 0, 0, 0) EVT_CALL(EnableNpcShadow, NPC_Klevar, FALSE) EVT_CALL(SetNpcPos, NPC_Klevar, 169, 45, -95) EVT_RETURN @@ -157,7 +157,7 @@ EvtScript N(EVS_NpcInit_Klevar) = { }; EvtScript N(EVS_NpcInit_Kalmar) = { - EVT_CALL(func_802CFD30, NPC_Kalmar, FOLD_TYPE_7, 0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_Kalmar, FOLD_UPD_SET_ALPHA, 0, 0, 0, 0) EVT_CALL(EnableNpcShadow, NPC_Kalmar, FALSE) EVT_CALL(SetNpcPos, NPC_Kalmar, 156, 45, -27) EVT_RETURN diff --git a/src/world/area_kkj/kkj_25/kkj_25_7_kammy_defeated.c b/src/world/area_kkj/kkj_25/kkj_25_7_kammy_defeated.c index d0c31cb41b..b3b93cae21 100644 --- a/src/world/area_kkj/kkj_25/kkj_25_7_kammy_defeated.c +++ b/src/world/area_kkj/kkj_25/kkj_25_7_kammy_defeated.c @@ -200,7 +200,7 @@ EvtScript N(EVS_Scene_KammyDefeated) = { EVT_SETF(LVar0, 0) EVT_LOOP(20) EVT_ADDF(LVar0, EVT_FLOAT(12.0)) - EVT_CALL(func_802CFD30, NPC_Eldstar, FOLD_TYPE_7, LVar0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_Eldstar, FOLD_UPD_SET_ALPHA, LVar0, 0, 0, 0) EVT_WAIT(1) EVT_END_LOOP EVT_WAIT(10) @@ -236,21 +236,21 @@ EvtScript N(EVS_Scene_KammyDefeated) = { EVT_SETF(LVar0, 0) EVT_LOOP(20) EVT_ADDF(LVar0, EVT_FLOAT(12.0)) - EVT_CALL(func_802CFD30, NPC_Mamar, FOLD_TYPE_7, LVar0, 0, 0, 0) - EVT_CALL(func_802CFD30, NPC_Skolar, FOLD_TYPE_7, LVar0, 0, 0, 0) - EVT_CALL(func_802CFD30, NPC_Muskular, FOLD_TYPE_7, LVar0, 0, 0, 0) - EVT_CALL(func_802CFD30, NPC_Misstar, FOLD_TYPE_7, LVar0, 0, 0, 0) - EVT_CALL(func_802CFD30, NPC_Klevar, FOLD_TYPE_7, LVar0, 0, 0, 0) - EVT_CALL(func_802CFD30, NPC_Kalmar, FOLD_TYPE_7, LVar0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_Mamar, FOLD_UPD_SET_ALPHA, LVar0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_Skolar, FOLD_UPD_SET_ALPHA, LVar0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_Muskular, FOLD_UPD_SET_ALPHA, LVar0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_Misstar, FOLD_UPD_SET_ALPHA, LVar0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_Klevar, FOLD_UPD_SET_ALPHA, LVar0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_Kalmar, FOLD_UPD_SET_ALPHA, LVar0, 0, 0, 0) EVT_WAIT(1) EVT_END_LOOP - EVT_CALL(func_802CFD30, NPC_Eldstar, FOLD_TYPE_NONE, 0, 0, 0, 0) - EVT_CALL(func_802CFD30, NPC_Mamar, FOLD_TYPE_NONE, 0, 0, 0, 0) - EVT_CALL(func_802CFD30, NPC_Skolar, FOLD_TYPE_NONE, 0, 0, 0, 0) - EVT_CALL(func_802CFD30, NPC_Muskular, FOLD_TYPE_NONE, 0, 0, 0, 0) - EVT_CALL(func_802CFD30, NPC_Misstar, FOLD_TYPE_NONE, 0, 0, 0, 0) - EVT_CALL(func_802CFD30, NPC_Klevar, FOLD_TYPE_NONE, 0, 0, 0, 0) - EVT_CALL(func_802CFD30, NPC_Kalmar, FOLD_TYPE_NONE, 0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_Eldstar, FOLD_UPD_CLEAR, 0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_Mamar, FOLD_UPD_CLEAR, 0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_Skolar, FOLD_UPD_CLEAR, 0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_Muskular, FOLD_UPD_CLEAR, 0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_Misstar, FOLD_UPD_CLEAR, 0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_Klevar, FOLD_UPD_CLEAR, 0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_Kalmar, FOLD_UPD_CLEAR, 0, 0, 0, 0) EVT_CALL(SetNpcJumpscale, NPC_Twink_01, EVT_FLOAT(0.0)) EVT_CALL(NpcJump0, NPC_Twink_01, 140, 65, 30, 20) EVT_CALL(GetNpcPos, NPC_Eldstar, LVar0, LVar1, LVar2) diff --git a/src/world/area_kmr/kmr_00/kmr_00_4_npc.c b/src/world/area_kmr/kmr_00/kmr_00_4_npc.c index d377f14fc8..e2f37292b8 100644 --- a/src/world/area_kmr/kmr_00/kmr_00_4_npc.c +++ b/src/world/area_kmr/kmr_00/kmr_00_4_npc.c @@ -75,12 +75,12 @@ EvtScript N(EVS_NpcAux_StarSpirit) = { EVT_LABEL(1) EVT_LOOP(50) EVT_ADDF(LVar0, EVT_FLOAT(0.8)) - EVT_CALL(func_802CFD30, NPC_SELF, FOLD_TYPE_D, 0, ArrayVar(0), MV_Unk_01, LVar0) + EVT_CALL(SetNpcFoldParams, NPC_SELF, FOLD_UPD_HOLOGRAM, 0, ArrayVar(0), MV_Unk_01, LVar0) EVT_WAIT(1) EVT_END_LOOP EVT_LOOP(50) EVT_ADDF(LVar0, EVT_FLOAT(-0.8)) - EVT_CALL(func_802CFD30, NPC_SELF, FOLD_TYPE_D, 0, ArrayVar(0), MV_Unk_01, LVar0) + EVT_CALL(SetNpcFoldParams, NPC_SELF, FOLD_UPD_HOLOGRAM, 0, ArrayVar(0), MV_Unk_01, LVar0) EVT_WAIT(1) EVT_END_LOOP EVT_GOTO(1) diff --git a/src/world/area_kmr/kmr_02/kmr_02_3_npc.c b/src/world/area_kmr/kmr_02/kmr_02_3_npc.c index c792173989..1cc495d72a 100644 --- a/src/world/area_kmr/kmr_02/kmr_02_3_npc.c +++ b/src/world/area_kmr/kmr_02/kmr_02_3_npc.c @@ -231,11 +231,11 @@ EvtScript N(EVS_Goombaria_RequestDolly) = { EVT_CALL(SetNpcJumpscale, NPC_Goombaria, EVT_FLOAT(1.0)) EVT_CALL(NpcJump0, NPC_Goombaria, LVar0, LVar1, LVar2, 10) EVT_WAIT(10) - EVT_CALL(func_802D2520, ANIM_Mario1_Idle, FOLD_TYPE_5, 1, 1, 1, 0) + EVT_CALL(UpdatePlayerFold, ANIM_Mario1_Idle, FOLD_UPD_SET_ANIM, FOLD_ANIM_SHIVER, 1, 1, 0) EVT_WAIT(35) EVT_CALL(SetNpcAnimation, NPC_Goombaria, ANIM_Goombaria_Idle) EVT_CALL(NpcFacePlayer, NPC_Goombaria, 3) - EVT_CALL(func_802D2520, ANIM_Mario1_Idle, FOLD_TYPE_NONE, 0, 0, 0, 0) + EVT_CALL(UpdatePlayerFold, ANIM_Mario1_Idle, FOLD_UPD_CLEAR, 0, 0, 0, 0) EVT_WAIT(20) EVT_ELSE EVT_CALL(ContinueSpeech, NPC_Goombaria, ANIM_Goombaria_Talk, ANIM_Goombaria_Idle, 0, MSG_CH0_0099) @@ -559,14 +559,14 @@ EvtScript N(EVS_ReturnToVillage) = { EVT_CALL(SetNpcJumpscale, NPC_Goombaria, EVT_FLOAT(1.0)) EVT_CALL(NpcJump0, NPC_Goombaria, -30, 0, -19, 10) EVT_WAIT(10 * DT) - EVT_CALL(func_802D2520, ANIM_Mario1_Idle, FOLD_TYPE_5, 1, 1, 1, 0) + EVT_CALL(UpdatePlayerFold, ANIM_Mario1_Idle, FOLD_UPD_SET_ANIM, FOLD_ANIM_SHIVER, 1, 1, 0) EVT_WAIT(35 * DT) EVT_CALL(SetNpcSpeed, NPC_Goombaria, EVT_FLOAT(3.0 / DT)) EVT_CALL(SetNpcAnimation, NPC_Goombaria, ANIM_Goombaria_Walk) EVT_CALL(NpcMoveTo, NPC_Goombaria, -23, -21, 0) EVT_CALL(SetNpcAnimation, NPC_Goombaria, ANIM_Goombaria_Idle) EVT_CALL(NpcFacePlayer, NPC_Goombaria, 3) - EVT_CALL(func_802D2520, ANIM_Mario1_Idle, FOLD_TYPE_NONE, 0, 0, 0, 0) + EVT_CALL(UpdatePlayerFold, ANIM_Mario1_Idle, FOLD_UPD_CLEAR, 0, 0, 0, 0) EVT_CALL(PlayerMoveTo, -85, -10, 0) EVT_CALL(PlayerFaceNpc, NPC_Goombaria, TRUE) EVT_WAIT(20 * DT) @@ -1457,7 +1457,7 @@ EvtScript N(EVS_Scene_EldstarsPlea) = { EVT_CALL(MakeLerp, 0, 120, 80 * DT, EASING_LINEAR) EVT_LABEL(0) EVT_CALL(UpdateLerp) - EVT_CALL(func_802CFD30, NPC_Eldstar_02, FOLD_TYPE_7, LVar0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_Eldstar_02, FOLD_UPD_SET_ALPHA, LVar0, 0, 0, 0) EVT_WAIT(1) EVT_IF_EQ(LVar1, 1) EVT_GOTO(0) @@ -1517,7 +1517,7 @@ EvtScript N(EVS_Scene_EldstarsPlea) = { EVT_CALL(MakeLerp, 60, 0, 40 * DT, EASING_LINEAR) EVT_LABEL(6) EVT_CALL(UpdateLerp) - EVT_CALL(func_802CFD30, NPC_Eldstar_02, FOLD_TYPE_7, LVar0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_Eldstar_02, FOLD_UPD_SET_ALPHA, LVar0, 0, 0, 0) EVT_WAIT(1) EVT_IF_EQ(LVar1, 1) EVT_GOTO(6) @@ -1727,11 +1727,11 @@ EvtScript N(EVS_NpcAI_Eldstar_02) = { EVT_SETF(LVar0, EVT_FLOAT(100.0)) EVT_LABEL(1) EVT_LOOP(50) - EVT_CALL(func_802CFD30, NPC_SELF, FOLD_TYPE_D, 0, ArrayVar(0), 0, MV_Unk_01) + EVT_CALL(SetNpcFoldParams, NPC_SELF, FOLD_UPD_HOLOGRAM, 0, ArrayVar(0), 0, MV_Unk_01) EVT_WAIT(1) EVT_END_LOOP EVT_LOOP(50) - EVT_CALL(func_802CFD30, NPC_SELF, FOLD_TYPE_D, 0, ArrayVar(0), 0, MV_Unk_01) + EVT_CALL(SetNpcFoldParams, NPC_SELF, FOLD_UPD_HOLOGRAM, 0, ArrayVar(0), 0, MV_Unk_01) EVT_WAIT(1) EVT_END_LOOP EVT_GOTO(1) diff --git a/src/world/area_kmr/kmr_02/kmr_02_4_rooms_1.c b/src/world/area_kmr/kmr_02/kmr_02_4_rooms_1.c index f22515d7cf..dd6a7cdb74 100644 --- a/src/world/area_kmr/kmr_02/kmr_02_4_rooms_1.c +++ b/src/world/area_kmr/kmr_02/kmr_02_4_rooms_1.c @@ -276,8 +276,8 @@ EvtScript N(EVS_ToadHouse_GetInBed) = { EVT_CALL(InterpPlayerYaw, 114, 1) EVT_CALL(HidePlayerShadow, TRUE) EVT_CALL(SetPlayerAnimation, ANIM_Mario1_Idle) - EVT_CALL(func_802D286C, 0x00000800) - EVT_CALL(func_802D2520, ANIM_Mario1_Idle, 5, 7, 1, 1, 0) + EVT_CALL(SetPlayerFoldFlags, FOLD_STATE_FLAG_800) + EVT_CALL(UpdatePlayerFold, ANIM_Mario1_Idle, FOLD_UPD_SET_ANIM, FOLD_ANIM_GET_IN_BED, 1, 1, 0) EVT_WAIT(61) EVT_CALL(SetPlayerAnimation, ANIM_MarioW2_SleepStanding) EVT_THREAD @@ -295,7 +295,7 @@ EvtScript N(EVS_ToadHouse_GetInBed) = { EvtScript N(EVS_ToadHouse_ReturnFromRest) = { EVT_EXEC(N(EVS_SetupMusic)) EVT_CALL(HidePlayerShadow, FALSE) - EVT_CALL(func_802D2520, ANIM_Mario1_Idle, 0, 0, 0, 0, 0) + EVT_CALL(UpdatePlayerFold, ANIM_Mario1_Idle, FOLD_UPD_CLEAR, 0, 0, 0, 0) EVT_CALL(SetPlayerPos, -183, 19, -341) EVT_CALL(PlayerMoveTo, -132, -325, 20) EVT_RETURN diff --git a/src/world/area_kmr/kmr_02/kmr_02_7_kammy.c b/src/world/area_kmr/kmr_02/kmr_02_7_kammy.c index f0cfb5e2a2..9ed649d6b0 100644 --- a/src/world/area_kmr/kmr_02/kmr_02_7_kammy.c +++ b/src/world/area_kmr/kmr_02/kmr_02_7_kammy.c @@ -216,15 +216,15 @@ EvtScript N(EVS_Scene_KammyStrikes) = { EVT_EXEC_WAIT(N(EVS_SummonGateBlock)) EVT_THREAD EVT_CALL(SetPlayerAnimation, ANIM_MarioW2_PanicHoverStill) - EVT_CALL(func_802D286C, 256) - EVT_CALL(func_802D2520, ANIM_MarioW2_PanicHoverStill, 5, 0, 1, 1, 0) + EVT_CALL(SetPlayerFoldFlags, FOLD_STATE_FLAG_REVERSE_ANIM) + EVT_CALL(UpdatePlayerFold, ANIM_MarioW2_PanicHoverStill, FOLD_UPD_SET_ANIM, FOLD_ANIM_SHOCK, 1, 1, 0) EVT_WAIT(13 * DT) - EVT_CALL(func_802D2520, ANIM_MarioW2_PanicHoverStill, 0, 0, 0, 0, 0) + EVT_CALL(UpdatePlayerFold, ANIM_MarioW2_PanicHoverStill, FOLD_UPD_CLEAR, 0, 0, 0, 0) EVT_CALL(SetPlayerAnimation, ANIM_MarioW2_PanicHover) - EVT_CALL(func_802D286C, 256) - EVT_CALL(func_802D2520, ANIM_MarioW2_PanicHover, 5, 0, 1, 1, 0) + EVT_CALL(SetPlayerFoldFlags, FOLD_STATE_FLAG_REVERSE_ANIM) + EVT_CALL(UpdatePlayerFold, ANIM_MarioW2_PanicHover, FOLD_UPD_SET_ANIM, FOLD_ANIM_SHOCK, 1, 1, 0) EVT_WAIT(13 * DT) - EVT_CALL(func_802D2520, ANIM_MarioW2_PanicHover, 0, 0, 0, 0, 0) + EVT_CALL(UpdatePlayerFold, ANIM_MarioW2_PanicHover, FOLD_UPD_CLEAR, 0, 0, 0, 0) EVT_END_THREAD EVT_THREAD EVT_CALL(SetPlayerJumpscale, EVT_FLOAT(0.8)) @@ -234,22 +234,22 @@ EvtScript N(EVS_Scene_KammyStrikes) = { EVT_END_THREAD EVT_THREAD EVT_CALL(SetNpcAnimation, NPC_Goombaria, ANIM_Goombaria_Shock) - EVT_CALL(func_802CFE2C, NPC_Goombaria, 0x100) - EVT_CALL(func_802CFD30, NPC_Goombaria, FOLD_TYPE_5, 0, 1, 1, 0) + EVT_CALL(SetNpcFoldFlags, NPC_Goombaria, FOLD_STATE_FLAG_REVERSE_ANIM) + EVT_CALL(SetNpcFoldParams, NPC_Goombaria, FOLD_UPD_SET_ANIM, FOLD_ANIM_SHOCK, 1, 1, 0) EVT_CALL(SetNpcJumpscale, NPC_Goombaria, EVT_FLOAT(1.5)) EVT_CALL(GetNpcPos, NPC_Goombaria, LVar0, LVar1, LVar2) EVT_CALL(NpcJump0, NPC_Goombaria, LVar0, LVar1, LVar2, 25 * DT) EVT_CALL(SetNpcAnimation, NPC_Goombaria, ANIM_Goombaria_LookUp) - EVT_CALL(func_802CFD30, NPC_Goombaria, FOLD_TYPE_NONE, 0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_Goombaria, FOLD_UPD_CLEAR, 0, 0, 0, 0) EVT_END_THREAD - EVT_CALL(func_802CFE2C, NPC_Goompapa, 0x100) - EVT_CALL(func_802CFD30, NPC_Goompapa, FOLD_TYPE_5, 0, 1, 1, 0) + EVT_CALL(SetNpcFoldFlags, NPC_Goompapa, FOLD_STATE_FLAG_REVERSE_ANIM) + EVT_CALL(SetNpcFoldParams, NPC_Goompapa, FOLD_UPD_SET_ANIM, FOLD_ANIM_SHOCK, 1, 1, 0) EVT_CALL(SetNpcAnimation, NPC_Goompapa, ANIM_Goompapa_Shock) EVT_CALL(SetNpcJumpscale, NPC_Goompapa, EVT_FLOAT(1.2)) EVT_CALL(GetNpcPos, NPC_Goompapa, LVar0, LVar1, LVar2) EVT_CALL(NpcJump0, NPC_Goompapa, LVar0, LVar1, LVar2, 25 * DT) EVT_CALL(SetNpcAnimation, NPC_Goompapa, ANIM_Goompapa_LookUp) - EVT_CALL(func_802CFD30, NPC_Goompapa, FOLD_TYPE_NONE, 0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_Goompapa, FOLD_UPD_CLEAR, 0, 0, 0, 0) EVT_WAIT(10 * DT) EVT_CALL(SetNpcAnimation, NPC_Kammy, ANIM_WorldKammy_Anim13) EVT_CALL(SetCamType, CAM_DEFAULT, 4, FALSE) diff --git a/src/world/area_kmr/kmr_03/kmr_03_6_fall_down.c b/src/world/area_kmr/kmr_03/kmr_03_6_fall_down.c index 85315f5591..4048153441 100644 --- a/src/world/area_kmr/kmr_03/kmr_03_6_fall_down.c +++ b/src/world/area_kmr/kmr_03/kmr_03_6_fall_down.c @@ -62,11 +62,11 @@ EvtScript N(EVS_Scene_FallingDown) = { EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(0.2 / DT)) EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1) EVT_END_THREAD - EVT_CALL(func_802D286C, 0x00002800) - EVT_CALL(func_802D2520, ANIM_Mario1_Idle, 5, 5, 1, 1, 0) + EVT_CALL(SetPlayerFoldFlags, FOLD_STATE_FLAG_2000 | FOLD_STATE_FLAG_800) + EVT_CALL(UpdatePlayerFold, ANIM_Mario1_Idle, FOLD_UPD_SET_ANIM, FOLD_ANIM_FLUTTER_DOWN, 1, 1, 0) EVT_WAIT(100 * DT) EVT_CALL(WaitForCam, CAM_DEFAULT, EVT_FLOAT(1.0)) - EVT_CALL(func_802D2520, ANIM_Mario1_Idle, 0, 0, 0, 0, 0) + EVT_CALL(UpdatePlayerFold, ANIM_Mario1_Idle, FOLD_UPD_CLEAR, 0, 0, 0, 0) EVT_CALL(HidePlayerShadow, FALSE) EVT_CALL(SetPlayerAnimation, ANIM_Mario1_BeforeJump) EVT_WAIT(10 * DT) diff --git a/src/world/area_kmr/kmr_06/kmr_06_5_sticker_sign.c b/src/world/area_kmr/kmr_06/kmr_06_5_sticker_sign.c index 0536d8e0f8..2894256783 100644 --- a/src/world/area_kmr/kmr_06/kmr_06_5_sticker_sign.c +++ b/src/world/area_kmr/kmr_06/kmr_06_5_sticker_sign.c @@ -52,7 +52,7 @@ void N(appendGfx_sticker)(void* renderData) { if (sticker->yaw != 0.0 || sticker->pitch != 0.0) { foldFlags |= FOLD_STATE_FLAG_2000; } - fold_update(0, FOLD_TYPE_NONE, 0, 0, 0, 0, 0); + fold_update(0, FOLD_UPD_CLEAR, 0, 0, 0, 0, 0); fold_appendGfx_component(0, &foldImage, foldFlags, mtxTransform); gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW); diff --git a/src/world/area_kmr/kmr_09/kmr_09_3_npc.c b/src/world/area_kmr/kmr_09/kmr_09_3_npc.c index 3260c3c666..bbe60eae9f 100644 --- a/src/world/area_kmr/kmr_09/kmr_09_3_npc.c +++ b/src/world/area_kmr/kmr_09/kmr_09_3_npc.c @@ -88,11 +88,11 @@ EvtScript N(EVS_NpcIdle_Goomba_Ambush) = { EVT_GOTO(0) EVT_END_IF EVT_CALL(PlaySoundAtNpc, NPC_SELF, SOUND_F8, SOUND_SPACE_MODE_0) - EVT_CALL(func_802CFE2C, NPC_SELF, 0x2000) - EVT_CALL(func_802CFD30, NPC_SELF, FOLD_TYPE_5, 6, 1, 1, 0) + EVT_CALL(SetNpcFoldFlags, NPC_SELF, FOLD_STATE_FLAG_2000) + EVT_CALL(SetNpcFoldParams, NPC_SELF, FOLD_UPD_SET_ANIM, FOLD_ANIM_UNFURL, 1, 1, 0) EVT_WAIT(15) - EVT_CALL(func_802CFE2C, NPC_SELF, 0x2000) - EVT_CALL(func_802CFD30, NPC_SELF, FOLD_TYPE_3, 0, 0, 0, 0) + EVT_CALL(SetNpcFoldFlags, NPC_SELF, FOLD_STATE_FLAG_2000) + EVT_CALL(SetNpcFoldParams, NPC_SELF, FOLD_TYPE_3, 0, 0, 0, 0) EVT_THREAD EVT_WAIT(2) EVT_SETF(LVar0, EVT_FLOAT(0.0)) @@ -107,7 +107,7 @@ EvtScript N(EVS_NpcIdle_Goomba_Ambush) = { EVT_CALL(EnableNpcShadow, NPC_SELF, TRUE) EVT_CALL(SetNpcJumpscale, NPC_SELF, EVT_FLOAT(0.6)) EVT_CALL(NpcJump0, NPC_SELF, -35, 0, 25, 23) - EVT_CALL(func_802CFD30, NPC_SELF, FOLD_TYPE_NONE, 0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_SELF, FOLD_UPD_CLEAR, 0, 0, 0, 0) EVT_CALL(InterpNpcYaw, NPC_SELF, 90, 0) EVT_CALL(SetNpcFlagBits, NPC_SELF, NPC_FLAG_NO_SHADOW_RAYCAST, TRUE) EVT_CALL(SetNpcFlagBits, NPC_SELF, NPC_FLAG_IGNORE_WORLD_COLLISION, FALSE) diff --git a/src/world/area_kmr/kmr_12/kmr_12_3_npc.c b/src/world/area_kmr/kmr_12/kmr_12_3_npc.c index 85166c31b0..0a411635d6 100644 --- a/src/world/area_kmr/kmr_12/kmr_12_3_npc.c +++ b/src/world/area_kmr/kmr_12/kmr_12_3_npc.c @@ -62,15 +62,15 @@ EvtScript N(EVS_NpcIdle_Goomba) = { EVT_WAIT(20) EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_Goomba_Idle) EVT_CALL(PlaySoundAtNpc, NPC_SELF, SOUND_F8, SOUND_SPACE_MODE_0) - EVT_CALL(func_802CFE2C, NPC_SELF, 0x2000) - EVT_CALL(func_802CFD30, NPC_SELF, FOLD_TYPE_5, 6, 1, 1, 0) + EVT_CALL(SetNpcFoldFlags, NPC_SELF, FOLD_STATE_FLAG_2000) + EVT_CALL(SetNpcFoldParams, NPC_SELF, FOLD_UPD_SET_ANIM, FOLD_ANIM_UNFURL, 1, 1, 0) EVT_WAIT(12) EVT_WAIT(5) EVT_CALL(PlaySoundAtNpc, NPC_SELF, SOUND_32C, SOUND_SPACE_MODE_0) EVT_CALL(EnableNpcShadow, NPC_SELF, TRUE) EVT_CALL(SetNpcJumpscale, NPC_SELF, EVT_FLOAT(0.6)) EVT_CALL(NpcJump0, NPC_SELF, -35, 0, 30, 23) - EVT_CALL(func_802CFD30, NPC_SELF, FOLD_TYPE_NONE, 0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_SELF, FOLD_UPD_CLEAR, 0, 0, 0, 0) EVT_CALL(InterpNpcYaw, NPC_SELF, 90, 0) EVT_CALL(SetNpcFlagBits, NPC_SELF, NPC_FLAG_IGNORE_CAMERA_FOR_YAW | NPC_FLAG_200000, FALSE) EVT_CALL(SetSelfEnemyFlagBits, ENEMY_FLAG_DISABLE_AI, 0) diff --git a/src/world/area_kmr/kmr_20/kmr_20_10_npc.c b/src/world/area_kmr/kmr_20/kmr_20_10_npc.c index 899d18f08a..61acb838e3 100644 --- a/src/world/area_kmr/kmr_20/kmr_20_10_npc.c +++ b/src/world/area_kmr/kmr_20/kmr_20_10_npc.c @@ -675,8 +675,8 @@ EvtScript N(EVS_NpcAI_ShyGuy) = { EVT_CALL(PlaySoundAtNpc, NPC_SELF, SOUND_32C, SOUND_SPACE_MODE_0) EVT_CALL(NpcJump0, NPC_SELF, 594, 30, -220, 15) EVT_CALL(PlaySoundAtNpc, NPC_SELF, SOUND_ENTER_PIPE, SOUND_SPACE_MODE_0) - EVT_CALL(func_802CFE2C, NPC_SELF, 0x00000800) - EVT_CALL(func_802CFD30, NPC_SELF, FOLD_TYPE_5, 2, 1, 1, 0) + EVT_CALL(SetNpcFoldFlags, NPC_SELF, FOLD_STATE_FLAG_800) + EVT_CALL(SetNpcFoldParams, NPC_SELF, FOLD_UPD_SET_ANIM, FOLD_ANIM_VERTICAL_PIPE_CURL, 1, 1, 0) EVT_CALL(GetNpcPos, NPC_SELF, LVar0, LVar1, LVar2) EVT_SUB(LVar1, 10) EVT_LOOP(30) diff --git a/src/world/area_kmr/kmr_20/kmr_20_11_npc_intro.c b/src/world/area_kmr/kmr_20/kmr_20_11_npc_intro.c index aef6e0a7c7..a8aeb0dfaf 100644 --- a/src/world/area_kmr/kmr_20/kmr_20_11_npc_intro.c +++ b/src/world/area_kmr/kmr_20/kmr_20_11_npc_intro.c @@ -77,8 +77,8 @@ EvtScript N(EVS_Player_EnterPipe_Intro) = { EVT_WAIT(1) EVT_END_LOOP EVT_END_THREAD - EVT_CALL(func_802D286C, 0x00000800) - EVT_CALL(func_802D2520, ANIM_Mario1_Idle, FOLD_TYPE_5, 2, 1, 1, 0) + EVT_CALL(SetPlayerFoldFlags, FOLD_STATE_FLAG_800) + EVT_CALL(UpdatePlayerFold, ANIM_Mario1_Idle, FOLD_UPD_SET_ANIM, FOLD_ANIM_VERTICAL_PIPE_CURL, 1, 1, 0) EVT_WAIT(25) EVT_RETURN EVT_END @@ -107,8 +107,8 @@ EvtScript N(EVS_Luigi_EnterPipe_Intro) = { EVT_WAIT(1) EVT_END_LOOP EVT_END_THREAD - EVT_CALL(func_802CFE2C, NPC_Scene_Luigi, 0x00000800) - EVT_CALL(func_802CFD30, NPC_Scene_Luigi, FOLD_TYPE_5, 2, 1, 1, 0) + EVT_CALL(SetNpcFoldFlags, NPC_Scene_Luigi, FOLD_STATE_FLAG_800) + EVT_CALL(SetNpcFoldParams, NPC_Scene_Luigi, FOLD_UPD_SET_ANIM, FOLD_ANIM_VERTICAL_PIPE_CURL, 1, 1, 0) EVT_WAIT(25) EVT_RETURN EVT_END diff --git a/src/world/area_kmr/kmr_20/kmr_20_12_npc_epilogue.c b/src/world/area_kmr/kmr_20/kmr_20_12_npc_epilogue.c index c371049cbd..a40fd8b505 100644 --- a/src/world/area_kmr/kmr_20/kmr_20_12_npc_epilogue.c +++ b/src/world/area_kmr/kmr_20/kmr_20_12_npc_epilogue.c @@ -149,8 +149,8 @@ EvtScript N(EVS_Player_EnterPipe_Epilogue) = { EVT_WAIT(1) EVT_END_LOOP EVT_END_THREAD - EVT_CALL(func_802D286C, 0x00000800) - EVT_CALL(func_802D2520, ANIM_Mario1_Idle, FOLD_TYPE_5, 2, 1, 1, 0) + EVT_CALL(SetPlayerFoldFlags, FOLD_STATE_FLAG_800) + EVT_CALL(UpdatePlayerFold, ANIM_Mario1_Idle, FOLD_UPD_SET_ANIM, FOLD_ANIM_VERTICAL_PIPE_CURL, 1, 1, 0) EVT_WAIT(25) EVT_RETURN EVT_END @@ -179,8 +179,8 @@ EvtScript N(EVS_Luigi_EnterPipe_Epilogue) = { EVT_WAIT(1) EVT_END_LOOP EVT_END_THREAD - EVT_CALL(func_802CFE2C, NPC_Luigi_1, 0x00000800) - EVT_CALL(func_802CFD30, NPC_Luigi_1, FOLD_TYPE_5, 2, 1, 1, 0) + EVT_CALL(SetNpcFoldFlags, NPC_Luigi_1, FOLD_STATE_FLAG_800) + EVT_CALL(SetNpcFoldParams, NPC_Luigi_1, FOLD_UPD_SET_ANIM, FOLD_ANIM_VERTICAL_PIPE_CURL, 1, 1, 0) EVT_WAIT(25) EVT_RETURN EVT_END diff --git a/src/world/area_kmr/kmr_20/kmr_20_8_bed.c b/src/world/area_kmr/kmr_20/kmr_20_8_bed.c index f55be49de5..851a38d44c 100644 --- a/src/world/area_kmr/kmr_20/kmr_20_8_bed.c +++ b/src/world/area_kmr/kmr_20/kmr_20_8_bed.c @@ -64,8 +64,8 @@ EvtScript N(EVS_ToadHouse_GetInBed) = { EVT_END_LOOP EVT_CALL(HidePlayerShadow, TRUE) EVT_CALL(SetPlayerAnimation, ANIM_Mario1_Idle) - EVT_CALL(func_802D286C, 0x00000800) - EVT_CALL(func_802D2520, 0x00010002, 5, 7, 1, 1, 0) + EVT_CALL(SetPlayerFoldFlags, FOLD_STATE_FLAG_800) + EVT_CALL(UpdatePlayerFold, 0x00010002, FOLD_UPD_SET_ANIM, FOLD_ANIM_GET_IN_BED, 1, 1, 0) EVT_THREAD EVT_WAIT(60) EVT_CALL(SetPlayerAnimation, ANIM_MarioW2_SleepStanding) @@ -99,7 +99,7 @@ EvtScript N(EVS_ToadHouse_ReturnFromRest) = { EVT_CALL(N(SetAmbienceVolumeHalf_Bed)) EVT_CALL(SetPlayerAnimation, ANIM_Mario1_Idle) EVT_CALL(HidePlayerShadow, FALSE) - EVT_CALL(func_802D2520, ANIM_Mario1_Idle, 0, 0, 0, 0, 0) + EVT_CALL(UpdatePlayerFold, ANIM_Mario1_Idle, FOLD_UPD_CLEAR, 0, 0, 0, 0) EVT_CALL(SetPlayerPos, -45, 30, -70) EVT_CALL(InterpPlayerYaw, 90, 0) EVT_CALL(SetNpcPos, NPC_PARTNER, -75, 30, -70) diff --git a/src/world/area_kmr/kmr_22/npc/chapter_1.inc.c b/src/world/area_kmr/kmr_22/npc/chapter_1.inc.c index 1642e5cbea..b6baee22ca 100644 --- a/src/world/area_kmr/kmr_22/npc/chapter_1.inc.c +++ b/src/world/area_kmr/kmr_22/npc/chapter_1.inc.c @@ -1,13 +1,13 @@ EvtScript N(EVS_NpcInit_Eldstar) = { EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_WorldEldstar_Still) - EVT_CALL(func_802CFD30, NPC_SELF, FOLD_TYPE_8, 0, 0, 0, 128) + EVT_CALL(SetNpcFoldParams, NPC_SELF, FOLD_UPD_SET_TINT, 0, 0, 0, 128) EVT_RETURN EVT_END }; EvtScript N(EVS_NpcInit_KoopaBros) = { EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_KoopaBros_Black_Anim1B) - EVT_CALL(func_802CFD30, NPC_SELF, FOLD_TYPE_E, 80, 80, 80, 0) + EVT_CALL(SetNpcFoldParams, NPC_SELF, FOLD_TYPE_E, 80, 80, 80, 0) EVT_RETURN EVT_END }; diff --git a/src/world/area_kmr/kmr_22/npc/chapter_2.inc.c b/src/world/area_kmr/kmr_22/npc/chapter_2.inc.c index db68ad07dc..249a287eb0 100644 --- a/src/world/area_kmr/kmr_22/npc/chapter_2.inc.c +++ b/src/world/area_kmr/kmr_22/npc/chapter_2.inc.c @@ -1,32 +1,32 @@ EvtScript N(EVS_NpcInit_Mamar) = { EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_WorldMamar_Still) - EVT_CALL(func_802CFD30, NPC_SELF, FOLD_TYPE_8, 0, 0, 0, 128) + EVT_CALL(SetNpcFoldParams, NPC_SELF, FOLD_UPD_SET_TINT, 0, 0, 0, 128) EVT_RETURN EVT_END }; EvtScript N(EVS_NpcInit_Tutankoopa) = { EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_Tutankoopa_Anim08) - EVT_CALL(func_802CFD30, NPC_SELF, FOLD_TYPE_E, 80, 80, 80, 0) + EVT_CALL(SetNpcFoldParams, NPC_SELF, FOLD_TYPE_E, 80, 80, 80, 0) EVT_RETURN EVT_END }; EvtScript N(EVS_NpcInit_ChainChomp) = { EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_ChainChomp_Anim03) - EVT_CALL(func_802CFD30, NPC_SELF, FOLD_TYPE_E, 80, 80, 80, 0) + EVT_CALL(SetNpcFoldParams, NPC_SELF, FOLD_TYPE_E, 80, 80, 80, 0) EVT_CALL(SetNpcPos, NPC_SELF, 5, -25, -180) EVT_CALL(SetNpcAnimation, NPC_ChainChomp_02, ANIM_ChainChomp_Anim02) - EVT_CALL(func_802CFD30, NPC_ChainChomp_02, FOLD_TYPE_E, 80, 80, 80, 0) + EVT_CALL(SetNpcFoldParams, NPC_ChainChomp_02, FOLD_TYPE_E, 80, 80, 80, 0) EVT_CALL(SetNpcPos, NPC_ChainChomp_02, 35, -14, -180) EVT_CALL(SetNpcAnimation, NPC_ChainChomp_03, ANIM_ChainChomp_Anim02) - EVT_CALL(func_802CFD30, NPC_ChainChomp_03, FOLD_TYPE_E, 80, 80, 80, 0) + EVT_CALL(SetNpcFoldParams, NPC_ChainChomp_03, FOLD_TYPE_E, 80, 80, 80, 0) EVT_CALL(SetNpcPos, NPC_ChainChomp_03, 52, -18, -180) EVT_CALL(SetNpcAnimation, NPC_ChainChomp_04, ANIM_ChainChomp_Anim02) - EVT_CALL(func_802CFD30, NPC_ChainChomp_04, FOLD_TYPE_E, 80, 80, 80, 0) + EVT_CALL(SetNpcFoldParams, NPC_ChainChomp_04, FOLD_TYPE_E, 80, 80, 80, 0) EVT_CALL(SetNpcPos, NPC_ChainChomp_04, 69, -19, -180) EVT_CALL(SetNpcAnimation, NPC_ChainChomp_05, ANIM_ChainChomp_Anim02) - EVT_CALL(func_802CFD30, NPC_ChainChomp_05, FOLD_TYPE_E, 80, 80, 80, 0) + EVT_CALL(SetNpcFoldParams, NPC_ChainChomp_05, FOLD_TYPE_E, 80, 80, 80, 0) EVT_CALL(SetNpcPos, NPC_ChainChomp_05, 86, -19, -180) EVT_RETURN EVT_END diff --git a/src/world/area_kmr/kmr_22/npc/chapter_3.inc.c b/src/world/area_kmr/kmr_22/npc/chapter_3.inc.c index 6c721e5574..b7e8823d18 100644 --- a/src/world/area_kmr/kmr_22/npc/chapter_3.inc.c +++ b/src/world/area_kmr/kmr_22/npc/chapter_3.inc.c @@ -1,13 +1,13 @@ EvtScript N(EVS_NpcInit_Skolar) = { EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_WorldSkolar_Still) - EVT_CALL(func_802CFD30, NPC_SELF, FOLD_TYPE_8, 0, 0, 0, 128) + EVT_CALL(SetNpcFoldParams, NPC_SELF, FOLD_UPD_SET_TINT, 0, 0, 0, 128) EVT_RETURN EVT_END }; EvtScript N(EVS_NpcInit_Tubba) = { EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_WorldTubba_Anim10) - EVT_CALL(func_802CFD30, NPC_SELF, FOLD_TYPE_E, 80, 80, 80, 0) + EVT_CALL(SetNpcFoldParams, NPC_SELF, FOLD_TYPE_E, 80, 80, 80, 0) EVT_RETURN EVT_END }; diff --git a/src/world/area_kmr/kmr_22/npc/chapter_4.inc.c b/src/world/area_kmr/kmr_22/npc/chapter_4.inc.c index 211a356345..ecc147e085 100644 --- a/src/world/area_kmr/kmr_22/npc/chapter_4.inc.c +++ b/src/world/area_kmr/kmr_22/npc/chapter_4.inc.c @@ -1,20 +1,20 @@ EvtScript N(EVS_NpcInit_Muskular) = { EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_WorldMuskular_Still) - EVT_CALL(func_802CFD30, NPC_SELF, FOLD_TYPE_8, 0, 0, 0, 128) + EVT_CALL(SetNpcFoldParams, NPC_SELF, FOLD_UPD_SET_TINT, 0, 0, 0, 128) EVT_RETURN EVT_END }; EvtScript N(EVS_NpcInit_GeneralGuy) = { EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_GeneralGuy_Anim03) - EVT_CALL(func_802CFD30, NPC_SELF, FOLD_TYPE_E, 80, 80, 80, 0) + EVT_CALL(SetNpcFoldParams, NPC_SELF, FOLD_TYPE_E, 80, 80, 80, 0) EVT_RETURN EVT_END }; EvtScript N(EVS_NpcInit_ShyGuy) = { EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_ShyGuy_Red_Anim02) - EVT_CALL(func_802CFD30, NPC_SELF, FOLD_TYPE_E, 80, 80, 80, 0) + EVT_CALL(SetNpcFoldParams, NPC_SELF, FOLD_TYPE_E, 80, 80, 80, 0) EVT_RETURN EVT_END }; diff --git a/src/world/area_kmr/kmr_22/npc/chapter_5.inc.c b/src/world/area_kmr/kmr_22/npc/chapter_5.inc.c index 5c4f717263..efc13c81d0 100644 --- a/src/world/area_kmr/kmr_22/npc/chapter_5.inc.c +++ b/src/world/area_kmr/kmr_22/npc/chapter_5.inc.c @@ -1,6 +1,6 @@ EvtScript N(EVS_NpcInit_Misstar) = { EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_WorldMisstar_Still) - EVT_CALL(func_802CFD30, NPC_SELF, FOLD_TYPE_8, 0, 0, 0, 128) + EVT_CALL(SetNpcFoldParams, NPC_SELF, FOLD_UPD_SET_TINT, 0, 0, 0, 128) EVT_RETURN EVT_END }; diff --git a/src/world/area_kmr/kmr_22/npc/chapter_6.inc.c b/src/world/area_kmr/kmr_22/npc/chapter_6.inc.c index 78c94b40f3..8d7ff88c66 100644 --- a/src/world/area_kmr/kmr_22/npc/chapter_6.inc.c +++ b/src/world/area_kmr/kmr_22/npc/chapter_6.inc.c @@ -1,13 +1,13 @@ EvtScript N(EVS_NpcInit_Klevar) = { EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_WorldKlevar_Still) - EVT_CALL(func_802CFD30, NPC_SELF, FOLD_TYPE_8, 0, 0, 0, 128) + EVT_CALL(SetNpcFoldParams, NPC_SELF, FOLD_UPD_SET_TINT, 0, 0, 0, 128) EVT_RETURN EVT_END }; EvtScript N(EVS_NpcInit_HuffNPuff_Body) = { EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_HuffNPuff_Anim1A) - EVT_CALL(func_802CFD30, NPC_SELF, FOLD_TYPE_E, 80, 80, 80, 0) + EVT_CALL(SetNpcFoldParams, NPC_SELF, FOLD_TYPE_E, 80, 80, 80, 0) EVT_CALL(SetNpcPos, NPC_SELF, 40, 45, 1) EVT_RETURN EVT_END @@ -15,7 +15,7 @@ EvtScript N(EVS_NpcInit_HuffNPuff_Body) = { EvtScript N(EVS_NpcInit_HuffNPuff_Face) = { EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_HuffNPuff_Anim1B) - EVT_CALL(func_802CFD30, NPC_SELF, FOLD_TYPE_E, 80, 80, 80, 0) + EVT_CALL(SetNpcFoldParams, NPC_SELF, FOLD_TYPE_E, 80, 80, 80, 0) EVT_CALL(SetNpcPos, NPC_SELF, 40, 45, 1) EVT_RETURN EVT_END @@ -23,7 +23,7 @@ EvtScript N(EVS_NpcInit_HuffNPuff_Face) = { EvtScript N(EVS_NpcInit_HuffNPuff_Arms) = { EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_HuffNPuff_Anim1C) - EVT_CALL(func_802CFD30, NPC_SELF, FOLD_TYPE_E, 80, 80, 80, 0) + EVT_CALL(SetNpcFoldParams, NPC_SELF, FOLD_TYPE_E, 80, 80, 80, 0) EVT_CALL(SetNpcPos, NPC_SELF, 40, 45, 1) EVT_RETURN EVT_END @@ -31,10 +31,10 @@ EvtScript N(EVS_NpcInit_HuffNPuff_Arms) = { EvtScript N(EVS_NpcInit_TuffPuff_01) = { EVT_CALL(SetNpcAnimation, NPC_TuffPuff_01, ANIM_TuffPuff_Idle) - EVT_CALL(func_802CFD30, NPC_TuffPuff_01, FOLD_TYPE_E, 80, 80, 80, 0) + EVT_CALL(SetNpcFoldParams, NPC_TuffPuff_01, FOLD_TYPE_E, 80, 80, 80, 0) EVT_CALL(SetNpcPos, NPC_TuffPuff_01, 120, -1, -51) EVT_CALL(SetNpcAnimation, NPC_TuffPuff_02, ANIM_TuffPuff_Idle) - EVT_CALL(func_802CFD30, NPC_TuffPuff_02, FOLD_TYPE_E, 80, 80, 80, 0) + EVT_CALL(SetNpcFoldParams, NPC_TuffPuff_02, FOLD_TYPE_E, 80, 80, 80, 0) EVT_CALL(SetNpcPos, NPC_TuffPuff_02, -40, 59, 1) EVT_RETURN EVT_END diff --git a/src/world/area_kmr/kmr_22/npc/chapter_7.inc.c b/src/world/area_kmr/kmr_22/npc/chapter_7.inc.c index 19a3434e41..f4f4f66d35 100644 --- a/src/world/area_kmr/kmr_22/npc/chapter_7.inc.c +++ b/src/world/area_kmr/kmr_22/npc/chapter_7.inc.c @@ -1,34 +1,34 @@ EvtScript N(EVS_NpcInit_Kalmar) = { EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_WorldKalmar_Still) - EVT_CALL(func_802CFD30, NPC_SELF, FOLD_TYPE_8, 0, 0, 0, 128) + EVT_CALL(SetNpcFoldParams, NPC_SELF, FOLD_UPD_SET_TINT, 0, 0, 0, 128) EVT_RETURN EVT_END }; EvtScript N(EVS_NpcInit_CrystalKing) = { EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_CrystalKing_Anim09) - EVT_CALL(func_802CFD30, NPC_SELF, FOLD_TYPE_E, 80, 80, 80, 0) + EVT_CALL(SetNpcFoldParams, NPC_SELF, FOLD_TYPE_E, 80, 80, 80, 0) EVT_RETURN EVT_END }; EvtScript N(EVS_NpcInit_IceCube) = { EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_CrystalKing_Anim0A) - EVT_CALL(func_802CFD30, NPC_SELF, FOLD_TYPE_E, 80, 80, 80, 0) + EVT_CALL(SetNpcFoldParams, NPC_SELF, FOLD_TYPE_E, 80, 80, 80, 0) EVT_RETURN EVT_END }; EvtScript N(EVS_NpcInit_IceSphere) = { EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_CrystalKing_Anim0B) - EVT_CALL(func_802CFD30, NPC_SELF, FOLD_TYPE_E, 80, 80, 80, 0) + EVT_CALL(SetNpcFoldParams, NPC_SELF, FOLD_TYPE_E, 80, 80, 80, 0) EVT_RETURN EVT_END }; EvtScript N(EVS_NpcInit_IceSpike) = { EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_CrystalKing_Anim0C) - EVT_CALL(func_802CFD30, NPC_SELF, FOLD_TYPE_E, 80, 80, 80, 0) + EVT_CALL(SetNpcFoldParams, NPC_SELF, FOLD_TYPE_E, 80, 80, 80, 0) EVT_RETURN EVT_END }; diff --git a/src/world/area_kmr/kmr_22/npc/chapter_8.inc.c b/src/world/area_kmr/kmr_22/npc/chapter_8.inc.c index 8e0ebe41ff..3bce022feb 100644 --- a/src/world/area_kmr/kmr_22/npc/chapter_8.inc.c +++ b/src/world/area_kmr/kmr_22/npc/chapter_8.inc.c @@ -1,6 +1,6 @@ EvtScript N(EVS_NpcInit_Bowser) = { EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_WorldBowser_Talk) - EVT_CALL(func_802CFD30, NPC_SELF, FOLD_TYPE_E, 80, 80, 80, 0) + EVT_CALL(SetNpcFoldParams, NPC_SELF, FOLD_TYPE_E, 80, 80, 80, 0) EVT_RETURN EVT_END }; diff --git a/src/world/area_kmr/kmr_22/npc/lava_piranha.inc.c b/src/world/area_kmr/kmr_22/npc/lava_piranha.inc.c index 068f62a541..a3221d3292 100644 --- a/src/world/area_kmr/kmr_22/npc/lava_piranha.inc.c +++ b/src/world/area_kmr/kmr_22/npc/lava_piranha.inc.c @@ -179,9 +179,9 @@ EvtScript N(EVS_NpcAux_LavaPiranhaHead) = { }; EvtScript N(EVS_NpcInit_LavaPiranhaHead) = { - EVT_CALL(func_802CFD30, NPC_LavaPiranhaHead, FOLD_TYPE_E, 80, 80, 80, 0) - EVT_CALL(func_802CFD30, NPC_LavaBud_01, FOLD_TYPE_E, 80, 80, 80, 0) - EVT_CALL(func_802CFD30, NPC_LavaBud_02, FOLD_TYPE_E, 80, 80, 80, 0) + EVT_CALL(SetNpcFoldParams, NPC_LavaPiranhaHead, FOLD_TYPE_E, 80, 80, 80, 0) + EVT_CALL(SetNpcFoldParams, NPC_LavaBud_01, FOLD_TYPE_E, 80, 80, 80, 0) + EVT_CALL(SetNpcFoldParams, NPC_LavaBud_02, FOLD_TYPE_E, 80, 80, 80, 0) EVT_CALL(SetNpcAnimation, NPC_LavaPiranhaHead, ANIM_LavaPiranha_Anim03) EVT_CALL(SetNpcAnimation, NPC_LavaBud_01, ANIM_LavaBud_Anim03) EVT_CALL(SetNpcAnimation, NPC_LavaBud_02, ANIM_LavaBud_Anim03) diff --git a/src/world/area_kmr/kmr_23/kmr_23_2_npc.c b/src/world/area_kmr/kmr_23/kmr_23_2_npc.c index e8d8a1b3de..2a2054d5b9 100644 --- a/src/world/area_kmr/kmr_23/kmr_23_2_npc.c +++ b/src/world/area_kmr/kmr_23/kmr_23_2_npc.c @@ -528,7 +528,7 @@ EvtScript N(EVS_NpcInit_Eldstar_01) = { EvtScript N(EVS_NpcInit_Eldstar_02) = { EVT_CALL(SetNpcAnimation, NPC_SELF, ENEMY_ANIM_8) - EVT_CALL(func_802CFD30, NPC_SELF, FOLD_TYPE_8, 0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_SELF, FOLD_UPD_SET_TINT, 0, 0, 0, 0) EVT_CALL(SetNpcPos, NPC_SELF, 0, 94, 0) EVT_CALL(EnableNpcShadow, NPC_SELF, FALSE) EVT_RETURN diff --git a/src/world/area_kpa/kpa_91/kpa_91_3_npc.c b/src/world/area_kpa/kpa_91/kpa_91_3_npc.c index 9a538aef54..5dae66205b 100644 --- a/src/world/area_kpa/kpa_91/kpa_91_3_npc.c +++ b/src/world/area_kpa/kpa_91/kpa_91_3_npc.c @@ -41,8 +41,8 @@ EvtScript N(EVS_ToadHouse_GetInBed) = { EVT_CALL(InterpPlayerYaw, 114, 1) EVT_CALL(HidePlayerShadow, TRUE) EVT_CALL(SetPlayerAnimation, ANIM_Mario1_Idle) - EVT_CALL(func_802D286C, 0x00002800) - EVT_CALL(func_802D2520, ANIM_Mario1_Idle, 5, 7, 1, 1, 0) + EVT_CALL(SetPlayerFoldFlags, FOLD_STATE_FLAG_2000 | FOLD_STATE_FLAG_800) + EVT_CALL(UpdatePlayerFold, ANIM_Mario1_Idle, FOLD_UPD_SET_ANIM, FOLD_ANIM_GET_IN_BED, 1, 1, 0) EVT_WAIT(61) EVT_CALL(SetPlayerAnimation, ANIM_MarioW2_SleepStanding) EVT_THREAD @@ -62,7 +62,7 @@ EvtScript N(EVS_ToadHouse_ReturnFromRest) = { EVT_CALL(UseSettingsFrom, CAM_DEFAULT, MV_LastPlayerPosX, MV_LastPlayerPosY, MV_LastPlayerPosZ) EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(90.0)) EVT_CALL(SetPanTarget, CAM_DEFAULT, MV_LastPlayerPosX, MV_LastPlayerPosY, MV_LastPlayerPosZ) - EVT_CALL(func_802D2520, ANIM_Mario1_Idle, 0, 0, 0, 0, 0) + EVT_CALL(UpdatePlayerFold, ANIM_Mario1_Idle, FOLD_UPD_CLEAR, 0, 0, 0, 0) EVT_CALL(HidePlayerShadow, FALSE) EVT_CALL(SetPlayerPos, -139, 0, -90) EVT_CALL(PlayerMoveTo, -102, -130, 20) diff --git a/src/world/area_kpa/kpa_95/kpa_95_4_npc.c b/src/world/area_kpa/kpa_95/kpa_95_4_npc.c index afc1ceda82..349cccdccd 100644 --- a/src/world/area_kpa/kpa_95/kpa_95_4_npc.c +++ b/src/world/area_kpa/kpa_95/kpa_95_4_npc.c @@ -42,8 +42,8 @@ EvtScript N(EVS_ToadHouse_GetInBed) = { EVT_CALL(InterpPlayerYaw, 114, 1) EVT_CALL(HidePlayerShadow, TRUE) EVT_CALL(SetPlayerAnimation, ANIM_Mario1_Idle) - EVT_CALL(func_802D286C, 0x00002800) - EVT_CALL(func_802D2520, ANIM_Mario1_Idle, FOLD_TYPE_5, 7, 1, 1, 0) + EVT_CALL(SetPlayerFoldFlags, FOLD_STATE_FLAG_2000 | FOLD_STATE_FLAG_800) + EVT_CALL(UpdatePlayerFold, ANIM_Mario1_Idle, FOLD_UPD_SET_ANIM, FOLD_ANIM_GET_IN_BED, 1, 1, 0) EVT_WAIT(61) EVT_CALL(SetPlayerAnimation, ANIM_MarioW2_SleepStanding) EVT_THREAD @@ -63,7 +63,7 @@ EvtScript N(EVS_ToadHouse_ReturnFromRest) = { EVT_CALL(UseSettingsFrom, CAM_DEFAULT, MV_LastPlayerPosX, MV_LastPlayerPosY, MV_LastPlayerPosZ) EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(90.0)) EVT_CALL(SetPanTarget, CAM_DEFAULT, MV_LastPlayerPosX, MV_LastPlayerPosY, MV_LastPlayerPosZ) - EVT_CALL(func_802D2520, ANIM_Mario1_Idle, 0, 0, 0, 0, 0) + EVT_CALL(UpdatePlayerFold, ANIM_Mario1_Idle, FOLD_UPD_CLEAR, 0, 0, 0, 0) EVT_CALL(HidePlayerShadow, FALSE) EVT_CALL(SetPlayerPos, -139, 0, -90) EVT_CALL(PlayerMoveTo, -102, -130, 20) diff --git a/src/world/area_kzn/common/SpinyTromp.inc.c b/src/world/area_kzn/common/SpinyTromp.inc.c index ad18e3c2d8..fb7beff474 100644 --- a/src/world/area_kzn/common/SpinyTromp.inc.c +++ b/src/world/area_kzn/common/SpinyTromp.inc.c @@ -62,14 +62,14 @@ EvtScript N(D_80240D10_C7EE90) = { EVT_CALL(SetPlayerAnimation, ANIM_Mario1_Fallen) EVT_WAIT(1) EVT_CALL(N(SpinyTrompHit)) - EVT_CALL(func_802D2520, ANIM_Mario1_Fallen, 4, EVT_FLOAT(3.0), EVT_FLOAT(3.0), 0, 0) + EVT_CALL(UpdatePlayerFold, ANIM_Mario1_Fallen, FOLD_UPD_WAVY, EVT_FLOAT(3.0), EVT_FLOAT(3.0), 0, 0) EVT_LABEL(1) EVT_WAIT(1) EVT_IF_EQ(AF_KZN_TrompRollingDone, FALSE) EVT_GOTO(1) EVT_END_IF EVT_WAIT(30) - EVT_CALL(func_802D2520, ANIM_Mario1_Fallen, 0, 0, 0, 0, 0) + EVT_CALL(UpdatePlayerFold, ANIM_Mario1_Fallen, FOLD_UPD_CLEAR, 0, 0, 0, 0) EVT_CALL(SetPlayerAnimation, ANIM_Mario1_GetUp) EVT_CALL(N(UnkFunc48), 0) EVT_LABEL(2) diff --git a/src/world/area_kzn/kzn_17/kzn_17_3_npc.c b/src/world/area_kzn/kzn_17/kzn_17_3_npc.c index 842091d02e..46ac770a92 100644 --- a/src/world/area_kzn/kzn_17/kzn_17_3_npc.c +++ b/src/world/area_kzn/kzn_17/kzn_17_3_npc.c @@ -45,7 +45,7 @@ EvtScript N(EVS_Kolorado_TrompImpact) = { EVT_CALL(SetNpcRotationPivot, NPC_Kolorado, 13) EVT_CALL(SetNpcRotation, NPC_Kolorado, 0, 0, 250) EVT_CALL(SetNpcAnimation, NPC_Kolorado, ANIM_Kolorado_HurtStill) - EVT_CALL(func_802CFD30, NPC_Kolorado, FOLD_TYPE_4, EVT_FLOAT(3.0), EVT_FLOAT(3.0), 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_Kolorado, FOLD_UPD_WAVY, EVT_FLOAT(3.0), EVT_FLOAT(3.0), 0, 0) EVT_CALL(PlaySoundAtNpc, NPC_Kolorado, SOUND_HIT_PLAYER_NORMAL, SOUND_SPACE_MODE_0) EVT_THREAD EVT_CALL(SetNpcCollisionSize, NPC_Kolorado, 20, 24) @@ -70,7 +70,7 @@ EvtScript N(EVS_Kolorado_HurtInit) = { EVT_CALL(SetNpcRotationPivot, NPC_Kolorado, 13) EVT_CALL(SetNpcRotation, NPC_Kolorado, 0, 0, 250) EVT_CALL(SetNpcAnimation, NPC_Kolorado, ANIM_Kolorado_HurtStill) - EVT_CALL(func_802CFD30, NPC_Kolorado, FOLD_TYPE_4, EVT_FLOAT(3.0), EVT_FLOAT(3.0), 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_Kolorado, FOLD_UPD_WAVY, EVT_FLOAT(3.0), EVT_FLOAT(3.0), 0, 0) EVT_RETURN EVT_END }; diff --git a/src/world/area_mac/mac_00/mac_00_12_intro.c b/src/world/area_mac/mac_00/mac_00_12_intro.c index 4ce2ab22f7..9eac3ae456 100644 --- a/src/world/area_mac/mac_00/mac_00_12_intro.c +++ b/src/world/area_mac/mac_00/mac_00_12_intro.c @@ -7,15 +7,15 @@ EvtScript N(EVS_PlayerExitPipe_Intro) = { EVT_CALL(InterpPlayerYaw, 135, 0) EVT_WAIT(2) EVT_CALL(PlaySoundAtPlayer, SOUND_ENTER_PIPE, SOUND_SPACE_MODE_0) - EVT_CALL(func_802D286C, 0x100) - EVT_CALL(func_802D2520, ANIM_Mario1_Idle, 5, 2, 1, 1, 0) + EVT_CALL(SetPlayerFoldFlags, FOLD_STATE_FLAG_REVERSE_ANIM) + EVT_CALL(UpdatePlayerFold, ANIM_Mario1_Idle, FOLD_UPD_SET_ANIM, FOLD_ANIM_VERTICAL_PIPE_CURL, 1, 1, 0) EVT_CALL(GetPlayerPos, LVar0, LVar1, LVar2) EVT_LOOP(40) EVT_ADD(LVar1, 1) EVT_CALL(SetPlayerPos, LVar0, LVar1, LVar2) EVT_WAIT(1) EVT_END_LOOP - EVT_CALL(func_802D2520, ANIM_Mario1_Idle, 0, 0, 0, 0, 0) + EVT_CALL(UpdatePlayerFold, ANIM_Mario1_Idle, FOLD_UPD_CLEAR, 0, 0, 0, 0) EVT_CALL(HidePlayerShadow, FALSE) EVT_CALL(DisablePlayerPhysics, FALSE) EVT_RETURN @@ -28,8 +28,8 @@ EvtScript N(EVS_LuigiExitPipe_Intro) = { EVT_CALL(SetNpcYaw, NPC_Luigi_Intro, 135) EVT_WAIT(2) EVT_CALL(PlaySoundAtNpc, NPC_Luigi_Intro, SOUND_ENTER_PIPE, SOUND_SPACE_MODE_0) - EVT_CALL(func_802CFE2C, NPC_Luigi_Intro, 0x100) - EVT_CALL(func_802CFD30, NPC_Luigi_Intro, FOLD_TYPE_5, 2, 1, 1, 0) + EVT_CALL(SetNpcFoldFlags, NPC_Luigi_Intro, FOLD_STATE_FLAG_REVERSE_ANIM) + EVT_CALL(SetNpcFoldParams, NPC_Luigi_Intro, FOLD_UPD_SET_ANIM, FOLD_ANIM_VERTICAL_PIPE_CURL, 1, 1, 0) EVT_CALL(SetNpcPos, NPC_Luigi_Intro, -100, -10, -370) EVT_CALL(GetNpcPos, NPC_Luigi_Intro, LVar0, LVar1, LVar2) EVT_LOOP(45) @@ -37,7 +37,7 @@ EvtScript N(EVS_LuigiExitPipe_Intro) = { EVT_CALL(SetNpcPos, NPC_Luigi_Intro, LVar0, LVar1, LVar2) EVT_WAIT(1) EVT_END_LOOP - EVT_CALL(func_802CFD30, NPC_Luigi_Intro, FOLD_TYPE_NONE, 0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_Luigi_Intro, FOLD_UPD_CLEAR, 0, 0, 0, 0) EVT_CALL(SetNpcPos, NPC_Luigi_Intro, -100, 30, -370) EVT_WAIT(3) EVT_CALL(EnableNpcShadow, NPC_Luigi_Intro, TRUE) diff --git a/src/world/area_mac/mac_00/mac_00_14_epilogue.c b/src/world/area_mac/mac_00/mac_00_14_epilogue.c index 54566e4ab6..e079e90f09 100644 --- a/src/world/area_mac/mac_00/mac_00_14_epilogue.c +++ b/src/world/area_mac/mac_00/mac_00_14_epilogue.c @@ -7,15 +7,15 @@ EvtScript N(EVS_PlayerExitPipe_Epilogue) = { EVT_CALL(InterpPlayerYaw, 135, 0) EVT_WAIT(2) EVT_CALL(PlaySoundAtPlayer, SOUND_ENTER_PIPE, SOUND_SPACE_MODE_0) - EVT_CALL(func_802D286C, 0x100) - EVT_CALL(func_802D2520, ANIM_Mario1_Idle, 5, 2, 1, 1, 0) + EVT_CALL(SetPlayerFoldFlags, FOLD_STATE_FLAG_REVERSE_ANIM) + EVT_CALL(UpdatePlayerFold, ANIM_Mario1_Idle, FOLD_UPD_SET_ANIM, FOLD_ANIM_VERTICAL_PIPE_CURL, 1, 1, 0) EVT_CALL(GetPlayerPos, LVar0, LVar1, LVar2) EVT_LOOP(40) EVT_ADD(LVar1, 1) EVT_CALL(SetPlayerPos, LVar0, LVar1, LVar2) EVT_WAIT(1) EVT_END_LOOP - EVT_CALL(func_802D2520, ANIM_Mario1_Idle, 0, 0, 0, 0, 0) + EVT_CALL(UpdatePlayerFold, ANIM_Mario1_Idle, FOLD_UPD_CLEAR, 0, 0, 0, 0) EVT_CALL(HidePlayerShadow, FALSE) EVT_CALL(DisablePlayerPhysics, FALSE) EVT_RETURN @@ -28,8 +28,8 @@ EvtScript N(EVS_LuigiExitPipe_Epilogue) = { EVT_CALL(SetNpcYaw, NPC_Luigi_Epilogue, 135) EVT_WAIT(2) EVT_CALL(PlaySoundAtNpc, NPC_Luigi_Epilogue, SOUND_ENTER_PIPE, SOUND_SPACE_MODE_0) - EVT_CALL(func_802CFE2C, NPC_Luigi_Epilogue, 0x100) - EVT_CALL(func_802CFD30, NPC_Luigi_Epilogue, FOLD_TYPE_5, 2, 1, 1, 0) + EVT_CALL(SetNpcFoldFlags, NPC_Luigi_Epilogue, FOLD_STATE_FLAG_REVERSE_ANIM) + EVT_CALL(SetNpcFoldParams, NPC_Luigi_Epilogue, FOLD_UPD_SET_ANIM, FOLD_ANIM_VERTICAL_PIPE_CURL, 1, 1, 0) EVT_CALL(SetNpcPos, NPC_Luigi_Epilogue, -100, -10, -370) EVT_CALL(GetNpcPos, NPC_Luigi_Epilogue, LVar0, LVar1, LVar2) EVT_LOOP(45) @@ -37,7 +37,7 @@ EvtScript N(EVS_LuigiExitPipe_Epilogue) = { EVT_CALL(SetNpcPos, NPC_Luigi_Epilogue, LVar0, LVar1, LVar2) EVT_WAIT(1) EVT_END_LOOP - EVT_CALL(func_802CFD30, NPC_Luigi_Epilogue, FOLD_TYPE_NONE, 0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_Luigi_Epilogue, FOLD_UPD_CLEAR, 0, 0, 0, 0) EVT_CALL(SetNpcPos, NPC_Luigi_Epilogue, -100, 30, -370) EVT_WAIT(3) EVT_CALL(EnableNpcShadow, NPC_Luigi_Epilogue, TRUE) diff --git a/src/world/area_mac/mac_01/mac_01_9_npc.c b/src/world/area_mac/mac_01/mac_01_9_npc.c index be6bd3a185..0e28bcff1d 100644 --- a/src/world/area_mac/mac_01/mac_01_9_npc.c +++ b/src/world/area_mac/mac_01/mac_01_9_npc.c @@ -1792,8 +1792,8 @@ EvtScript N(EVS_ToadHouse_GetInBed) = { EVT_CALL(InterpPlayerYaw, 263, 1) EVT_CALL(HidePlayerShadow, TRUE) EVT_CALL(SetPlayerAnimation, ANIM_Mario1_Still) - EVT_CALL(func_802D286C, 0x800) - EVT_CALL(func_802D2520, ANIM_Mario1_Idle, 5, 7, 1, 1, 0) + EVT_CALL(SetPlayerFoldFlags, FOLD_STATE_FLAG_800) + EVT_CALL(UpdatePlayerFold, ANIM_Mario1_Idle, FOLD_UPD_SET_ANIM, FOLD_ANIM_GET_IN_BED, 1, 1, 0) EVT_THREAD EVT_WAIT(60) EVT_CALL(SetPlayerAnimation, ANIM_MarioW2_SleepStanding) @@ -1814,7 +1814,7 @@ EvtScript N(EVS_ToadHouse_GetInBed) = { EvtScript N(EVS_ToadHouse_ReturnFromRest) = { EVT_EXEC(N(EVS_SetupMusic)) EVT_CALL(HidePlayerShadow, FALSE) - EVT_CALL(func_802D2520, ANIM_Mario1_Idle, 0, 0, 0, 0, 0) + EVT_CALL(UpdatePlayerFold, ANIM_Mario1_Idle, FOLD_UPD_CLEAR, 0, 0, 0, 0) EVT_CALL(SetPlayerSpeed, EVT_FLOAT(3.0)) EVT_CALL(SetPlayerPos, 568, 20, -186) EVT_CALL(PlayerMoveTo, 525, -168, 20) diff --git a/src/world/area_mac/mac_02/npc/bootler.inc.c b/src/world/area_mac/mac_02/npc/bootler.inc.c index 17f4be02b0..3ec51afd21 100644 --- a/src/world/area_mac/mac_02/npc/bootler.inc.c +++ b/src/world/area_mac/mac_02/npc/bootler.inc.c @@ -8,7 +8,7 @@ EvtScript N(D_8024ACA4_82DF64) = { EVT_END_IF EVT_LOOP(10) EVT_ADDF(LVar0, LVar1) - EVT_CALL(func_802CFD30, NPC_Bootler, FOLD_TYPE_7, LVar0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_Bootler, FOLD_UPD_SET_ALPHA, LVar0, 0, 0, 0) EVT_WAIT(1) EVT_END_LOOP EVT_RETURN @@ -67,7 +67,7 @@ EvtScript N(EVS_NpcIdle_Bootler) = { EVT_WAIT(20 * DT) EVT_SETF(LVar0, EVT_FLOAT(0.0)) EVT_CALL(SetNpcAnimation, NPC_Bootler, ANIM_Bootler_Spook) - EVT_CALL(func_802CFD30, NPC_SELF, FOLD_TYPE_7, 0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_SELF, FOLD_UPD_SET_ALPHA, 0, 0, 0, 0) EVT_CALL(SetNpcYaw, NPC_SELF, 270) EVT_CALL(SetNpcPos, NPC_SELF, 500, 50, 30) EVT_EXEC_WAIT(N(D_8024ACA4_82DF64)) diff --git a/src/world/area_mac/machi/machi_6_misstar.c b/src/world/area_mac/machi/machi_6_misstar.c index be2dc6b3c5..17b77a986f 100644 --- a/src/world/area_mac/machi/machi_6_misstar.c +++ b/src/world/area_mac/machi/machi_6_misstar.c @@ -49,12 +49,12 @@ EvtScript N(EVS_NpcAux_Misstar) = { EVT_SETF(LVar0, EVT_FLOAT(40.0)) EVT_LOOP(20) EVT_ADDF(LVar0, EVT_FLOAT(4.0)) - EVT_CALL(func_802CFD30, NPC_SELF, FOLD_TYPE_7, LVar0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_SELF, FOLD_UPD_SET_ALPHA, LVar0, 0, 0, 0) EVT_WAIT(1) EVT_END_LOOP EVT_LOOP(20) EVT_ADDF(LVar0, EVT_FLOAT(-4.0)) - EVT_CALL(func_802CFD30, NPC_SELF, FOLD_TYPE_7, LVar0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_SELF, FOLD_UPD_SET_ALPHA, LVar0, 0, 0, 0) EVT_WAIT(1) EVT_END_LOOP EVT_GOTO(0) diff --git a/src/world/area_mim/mim_10/mim_10_4_npc.c b/src/world/area_mim/mim_10/mim_10_4_npc.c index 35870f828a..4de657815d 100644 --- a/src/world/area_mim/mim_10/mim_10_4_npc.c +++ b/src/world/area_mim/mim_10/mim_10_4_npc.c @@ -113,7 +113,7 @@ EvtScript N(EVS_Scene_BootlersInvitation) = { EVT_END_THREAD EVT_CALL(DisablePlayerInput, TRUE) EVT_CALL(SetNpcPos, NPC_Bootler, 200, 44, 0) - EVT_CALL(func_802CFD30, NPC_Bootler, FOLD_TYPE_7, 0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_Bootler, FOLD_UPD_SET_ALPHA, 0, 0, 0, 0) EVT_SET(MV_Unk_00, TRUE) EVT_CALL(SetMusicTrack, 0, SONG_BOOS_MANSION, 0, 8) EVT_WAIT(20 * DT) @@ -131,7 +131,7 @@ EvtScript N(EVS_Scene_BootlersInvitation) = { EVT_SETF(LVar0, EVT_FLOAT(0.0)) EVT_LOOP(20 * DT) EVT_ADDF(LVar0, EVT_FLOAT(VAR_1)) - EVT_CALL(func_802CFD30, NPC_Bootler, FOLD_TYPE_7, LVar0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_Bootler, FOLD_UPD_SET_ALPHA, LVar0, 0, 0, 0) EVT_WAIT(1) EVT_END_LOOP EVT_WAIT(20 * DT) @@ -156,7 +156,7 @@ EvtScript N(EVS_Scene_BootlersInvitation) = { EVT_SETF(LVar0, EVT_FLOAT(240.0)) EVT_LOOP(20 * DT) EVT_SUBF(LVar0, EVT_FLOAT(VAR_1)) - EVT_CALL(func_802CFD30, NPC_Bootler, FOLD_TYPE_7, LVar0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_Bootler, FOLD_UPD_SET_ALPHA, LVar0, 0, 0, 0) EVT_WAIT(1) EVT_END_LOOP EVT_WAIT(25 * DT) @@ -169,7 +169,7 @@ EvtScript N(EVS_Scene_BootlersInvitation) = { EVT_SETF(LVar0, EVT_FLOAT(0.0)) EVT_LOOP(20 * DT) EVT_ADDF(LVar0, EVT_FLOAT(VAR_1)) - EVT_CALL(func_802CFD30, NPC_Bootler, FOLD_TYPE_7, LVar0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_Bootler, FOLD_UPD_SET_ALPHA, LVar0, 0, 0, 0) EVT_WAIT(1) EVT_END_LOOP EVT_END_THREAD @@ -182,7 +182,7 @@ EvtScript N(EVS_Scene_BootlersInvitation) = { EVT_SETF(LVar0, EVT_FLOAT(240.0)) EVT_LOOP(20 * DT) EVT_SUBF(LVar0, EVT_FLOAT(VAR_1)) - EVT_CALL(func_802CFD30, NPC_Bootler, FOLD_TYPE_7, LVar0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_Bootler, FOLD_UPD_SET_ALPHA, LVar0, 0, 0, 0) EVT_WAIT(1) EVT_END_LOOP EVT_SET(GB_StoryProgress, STORY_CH3_INVITED_TO_BOOS_MANSION) diff --git a/src/world/area_mim/mim_11/mim_11_3_gate.c b/src/world/area_mim/mim_11/mim_11_3_gate.c index 2e7d943e00..e59827c5de 100644 --- a/src/world/area_mim/mim_11/mim_11_3_gate.c +++ b/src/world/area_mim/mim_11/mim_11_3_gate.c @@ -46,7 +46,7 @@ EvtScript N(D_80242560_BB95D0) = { EVT_SETF(LVar0, EVT_FLOAT(0.0)) EVT_LOOP(90 * DT) EVT_ADDF(LVar0, EVT_FLOAT(2.6667 / DT)) - EVT_CALL(func_802CFD30, NPC_Bootler, FOLD_TYPE_7, LVar0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_Bootler, FOLD_UPD_SET_ALPHA, LVar0, 0, 0, 0) EVT_WAIT(1) EVT_END_LOOP EVT_CALL(SpeakToPlayer, NPC_Bootler, ANIM_Bootler_Talk, ANIM_Bootler_Idle, 0, MSG_CH3_0028) @@ -69,7 +69,7 @@ EvtScript N(D_80242560_BB95D0) = { EVT_SETF(LVar0, EVT_FLOAT(240.0)) EVT_LOOP(90 * DT) EVT_SUBF(LVar0, EVT_FLOAT(2.6667 / DT)) - EVT_CALL(func_802CFD30, NPC_Bootler, FOLD_TYPE_7, LVar0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_Bootler, FOLD_UPD_SET_ALPHA, LVar0, 0, 0, 0) EVT_WAIT(1) EVT_END_LOOP EVT_CALL(RemoveNpc, NPC_Bootler) diff --git a/src/world/area_mim/mim_11/mim_11_5_npc.c b/src/world/area_mim/mim_11/mim_11_5_npc.c index 5c41ca36cf..9a0fa7472d 100644 --- a/src/world/area_mim/mim_11/mim_11_5_npc.c +++ b/src/world/area_mim/mim_11/mim_11_5_npc.c @@ -66,7 +66,7 @@ EvtScript N(EVS_NpcInit_Bootler) = { EVT_SWITCH(GB_StoryProgress) EVT_CASE_LT(STORY_CH3_OPENED_BOOS_MANSION_GATE) EVT_CALL(EnableNpcShadow, NPC_SELF, FALSE) - EVT_CALL(func_802CFD30, NPC_SELF, FOLD_TYPE_7, 0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_SELF, FOLD_UPD_SET_ALPHA, 0, 0, 0, 0) EVT_CASE_DEFAULT EVT_CALL(RemoveNpc, NPC_SELF) EVT_END_SWITCH diff --git a/src/world/area_mim/mim_12/mim_12_3_main.c b/src/world/area_mim/mim_12/mim_12_3_main.c index d2ec281564..1663dfe541 100644 --- a/src/world/area_mim/mim_12/mim_12_3_main.c +++ b/src/world/area_mim/mim_12/mim_12_3_main.c @@ -18,8 +18,8 @@ EvtScript N(EVS_EnterMap) = { EVT_SETF(LVar0, EVT_FLOAT(240.0)) EVT_LOOP(20) EVT_SUBF(LVar0, EVT_FLOAT(12.0)) - EVT_CALL(func_802CFD30, NPC_GateBoo_01, FOLD_TYPE_7, LVar0, 0, 0, 0) - EVT_CALL(func_802CFD30, NPC_GateBoo_02, FOLD_TYPE_7, LVar0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_GateBoo_01, FOLD_UPD_SET_ALPHA, LVar0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_GateBoo_02, FOLD_UPD_SET_ALPHA, LVar0, 0, 0, 0) EVT_WAIT(1) EVT_END_LOOP EVT_WAIT(10) diff --git a/src/world/area_mim/mim_12/mim_12_5_gate.c b/src/world/area_mim/mim_12/mim_12_5_gate.c index 7a9d1a896f..c4b250c353 100644 --- a/src/world/area_mim/mim_12/mim_12_5_gate.c +++ b/src/world/area_mim/mim_12/mim_12_5_gate.c @@ -329,8 +329,8 @@ EvtScript N(EVS_Scene_UnlockGate) = { EVT_SETF(LVar0, EVT_FLOAT(0.0)) EVT_LOOP(20 * DT) EVT_ADDF(LVar0, EVT_FLOAT(240.0 / (s32)(20 * DT))) - EVT_CALL(func_802CFD30, NPC_GateBoo_01, FOLD_TYPE_7, LVar0, 0, 0, 0) - EVT_CALL(func_802CFD30, NPC_GateBoo_02, FOLD_TYPE_7, LVar0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_GateBoo_01, FOLD_UPD_SET_ALPHA, LVar0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_GateBoo_02, FOLD_UPD_SET_ALPHA, LVar0, 0, 0, 0) EVT_WAIT(1) EVT_END_LOOP EVT_WAIT(10 * DT) @@ -359,8 +359,8 @@ EvtScript N(EVS_Scene_UnlockGate) = { EVT_SETF(LVar0, EVT_FLOAT(240.0)) EVT_LOOP(20 * DT) EVT_SUBF(LVar0, EVT_FLOAT(240.0 / (s32)(20 * DT))) - EVT_CALL(func_802CFD30, NPC_GateBoo_01, FOLD_TYPE_7, LVar0, 0, 0, 0) - EVT_CALL(func_802CFD30, NPC_GateBoo_02, FOLD_TYPE_7, LVar0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_GateBoo_01, FOLD_UPD_SET_ALPHA, LVar0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_GateBoo_02, FOLD_UPD_SET_ALPHA, LVar0, 0, 0, 0) EVT_WAIT(1) EVT_END_LOOP EVT_CALL(SetNpcPos, NPC_GateBoo_01, NPC_DISPOSE_LOCATION) diff --git a/src/world/area_nok/nok_01/nok_01_4_npc.c b/src/world/area_nok/nok_01/nok_01_4_npc.c index 484fe52a14..7e79ccf31a 100644 --- a/src/world/area_nok/nok_01/nok_01_4_npc.c +++ b/src/world/area_nok/nok_01/nok_01_4_npc.c @@ -333,8 +333,8 @@ EvtScript N(EVS_ToadHouse_GetInBed) = { EVT_CALL(InterpPlayerYaw, 160, 1) EVT_CALL(HidePlayerShadow, TRUE) EVT_CALL(SetPlayerAnimation, ANIM_Mario1_Still) - EVT_CALL(func_802D286C, 0x800) - EVT_CALL(func_802D2520, ANIM_Mario1_Idle, 5, 7, 1, 1, 0) + EVT_CALL(SetPlayerFoldFlags, FOLD_STATE_FLAG_800) + EVT_CALL(UpdatePlayerFold, ANIM_Mario1_Idle, FOLD_UPD_SET_ANIM, FOLD_ANIM_GET_IN_BED, 1, 1, 0) EVT_THREAD EVT_WAIT(60) EVT_CALL(SetPlayerAnimation, ANIM_MarioW2_SleepStanding) @@ -354,7 +354,7 @@ EvtScript N(EVS_ToadHouse_GetInBed) = { EvtScript N(EVS_ToadHouse_ReturnFromRest) = { EVT_CALL(HidePlayerShadow, FALSE) - EVT_CALL(func_802D2520, ANIM_Mario1_Idle, 0, 0, 0, 0, 0) + EVT_CALL(UpdatePlayerFold, ANIM_Mario1_Idle, FOLD_UPD_CLEAR, 0, 0, 0, 0) EVT_CALL(SetPlayerPos, -380, 0, 5) EVT_CALL(SetPlayerSpeed, EVT_FLOAT(3.0)) EVT_CALL(PlayerMoveTo, -325, 79, 0) diff --git a/src/world/area_obk/common/TrafficBoos.inc.c b/src/world/area_obk/common/TrafficBoos.inc.c index 7aad366e9d..6cd2bb29fb 100644 --- a/src/world/area_obk/common/TrafficBoos.inc.c +++ b/src/world/area_obk/common/TrafficBoos.inc.c @@ -101,7 +101,7 @@ EvtScript N(EVS_NpcIdle_TrafficBoo) = { EVT_LOOP(0) EVT_CALL(N(UpdateTrafficBooMotion)) EVT_CALL(N(UpdateTrafficBooAlpha)) - EVT_CALL(func_802CFD30, NPC_SELF, FOLD_TYPE_7, LVar0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_SELF, FOLD_UPD_SET_ALPHA, LVar0, 0, 0, 0) EVT_CALL(SetNpcRenderMode, NPC_SELF, RENDER_MODE_SURFACE_XLU_LAYER1) EVT_WAIT(1) EVT_END_LOOP diff --git a/src/world/area_obk/obk_01/obk_01_5_jump_scare.c b/src/world/area_obk/obk_01/obk_01_5_jump_scare.c index f1187893aa..187cadddf5 100644 --- a/src/world/area_obk/obk_01/obk_01_5_jump_scare.c +++ b/src/world/area_obk/obk_01/obk_01_5_jump_scare.c @@ -32,7 +32,7 @@ EvtScript N(EVS_Scene_JumpScareBoo) = { EVT_SETF(LVar0, EVT_FLOAT(240.0)) EVT_LOOP(20 * DT) EVT_SUBF(LVar0, EVT_FLOAT(240.0 / (s32)(20 * DT))) - EVT_CALL(func_802CFD30, NPC_JumpScareBoo, FOLD_TYPE_7, LVar0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_JumpScareBoo, FOLD_UPD_SET_ALPHA, LVar0, 0, 0, 0) EVT_WAIT(1) EVT_END_LOOP EVT_CALL(RemoveNpc, NPC_JumpScareBoo) diff --git a/src/world/area_obk/obk_01/obk_01_6_npc.c b/src/world/area_obk/obk_01/obk_01_6_npc.c index bf577bfef6..fa8dd10ffa 100644 --- a/src/world/area_obk/obk_01/obk_01_6_npc.c +++ b/src/world/area_obk/obk_01/obk_01_6_npc.c @@ -109,7 +109,7 @@ EvtScript N(EVS_NpcAux_TrafficBoo) = { EVT_SET(LVar1, 0) EVT_LOOP(0) EVT_CALL(N(UpdateTrafficBooAlpha)) - EVT_CALL(func_802CFD30, NPC_SELF, FOLD_TYPE_7, LVar0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_SELF, FOLD_UPD_SET_ALPHA, LVar0, 0, 0, 0) EVT_WAIT(1) EVT_END_LOOP EVT_RETURN diff --git a/src/world/area_obk/obk_04/obk_04_3_npc.c b/src/world/area_obk/obk_04/obk_04_3_npc.c index 60defb5a6c..b93250a840 100644 --- a/src/world/area_obk/obk_04/obk_04_3_npc.c +++ b/src/world/area_obk/obk_04/obk_04_3_npc.c @@ -34,11 +34,11 @@ API_CALLABLE(N(InitHiddenBoo)) { void N(func_802400D0_BC7F30)(Npc* npc) { if (npc->yaw > 340.0f || npc->yaw < 20.0f) { npc->renderMode = RENDER_MODE_ALPHATEST; - npc->foldArg5 = 0; - func_8003D624(npc, FOLD_TYPE_NONE, 0, 0, 0, 0, npc->foldArg5); + npc->foldFlags = 0; + npc_set_fold_params(npc, FOLD_UPD_CLEAR, 0, 0, 0, 0, npc->foldFlags); } else { npc->renderMode = RENDER_MODE_SURFACE_XLU_LAYER2; - func_8003D624(npc, FOLD_TYPE_7, gPlayerStatusPtr->alpha1, 255, 0, 0, npc->foldArg5); + npc_set_fold_params(npc, FOLD_UPD_SET_ALPHA, gPlayerStatusPtr->alpha1, 255, 0, 0, npc->foldFlags); npc->foldArg1 = 255; } } @@ -55,14 +55,14 @@ void N(func_80240198_BC7FF8)(void) { } void N(func_8024022C_BC808C)(void) { - get_npc_unsafe(NPC_KeepAwayBoo1)->foldArg5 = 0; - get_npc_unsafe(NPC_KeepAwayBoo2)->foldArg5 = 0; - get_npc_unsafe(NPC_KeepAwayBoo3)->foldArg5 = 0; - get_npc_unsafe(NPC_KeepAwayBoo4)->foldArg5 = 0; - get_npc_unsafe(NPC_KeepAwayBoo5)->foldArg5 = 0; - get_npc_unsafe(NPC_KeepAwayBoo6)->foldArg5 = 0; - get_npc_unsafe(NPC_KeepAwayBoo7)->foldArg5 = 0; - get_npc_unsafe(NPC_KeepAwayBoo8)->foldArg5 = 0; + get_npc_unsafe(NPC_KeepAwayBoo1)->foldFlags = 0; + get_npc_unsafe(NPC_KeepAwayBoo2)->foldFlags = 0; + get_npc_unsafe(NPC_KeepAwayBoo3)->foldFlags = 0; + get_npc_unsafe(NPC_KeepAwayBoo4)->foldFlags = 0; + get_npc_unsafe(NPC_KeepAwayBoo5)->foldFlags = 0; + get_npc_unsafe(NPC_KeepAwayBoo6)->foldFlags = 0; + get_npc_unsafe(NPC_KeepAwayBoo7)->foldFlags = 0; + get_npc_unsafe(NPC_KeepAwayBoo8)->foldFlags = 0; } s32 N(SetRingMovement)(s32 arg0) { diff --git a/src/world/area_obk/obk_04/obk_04_6_game.c b/src/world/area_obk/obk_04/obk_04_6_game.c index b597d0cba5..f4379192a8 100644 --- a/src/world/area_obk/obk_04/obk_04_6_game.c +++ b/src/world/area_obk/obk_04/obk_04_6_game.c @@ -203,7 +203,7 @@ EvtScript N(EVS_BooAppear) = { EVT_CALL(MakeLerp, 0, 255, 60, EASING_LINEAR) EVT_LABEL(0) EVT_CALL(UpdateLerp) - EVT_CALL(func_802CFD30, LVarA, FOLD_TYPE_7, LVar0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, LVarA, FOLD_UPD_SET_ALPHA, LVar0, 0, 0, 0) EVT_WAIT(1) EVT_IF_EQ(LVar1, 1) EVT_GOTO(0) @@ -221,7 +221,7 @@ EvtScript N(EVS_BooSpookAndVanish) = { EVT_CALL(MakeLerp, 255, 0, 60, EASING_LINEAR) EVT_LABEL(0) EVT_CALL(UpdateLerp) - EVT_CALL(func_802CFD30, LVarA, FOLD_TYPE_7, LVar0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, LVarA, FOLD_UPD_SET_ALPHA, LVar0, 0, 0, 0) EVT_WAIT(1) EVT_IF_EQ(LVar1, 1) EVT_GOTO(0) @@ -290,7 +290,7 @@ EvtScript N(EVS_Scene_BoosUnleashed) = { EVT_CALL(MakeLerp, 0, 255, 30, EASING_LINEAR) EVT_LOOP(0) EVT_CALL(UpdateLerp) - EVT_CALL(func_802CFD30, NPC_LeaderBoo, FOLD_TYPE_7, LVar0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_LeaderBoo, FOLD_UPD_SET_ALPHA, LVar0, 0, 0, 0) EVT_CALL(SetItemAlpha, MV_KeepAwayItem, LVar0) EVT_WAIT(1) EVT_IF_EQ(LVar1, 0) @@ -332,7 +332,7 @@ EvtScript N(EVS_Scene_BoosUnleashed) = { EVT_CALL(MakeLerp, 255, 0, 10, EASING_LINEAR) EVT_LOOP(0) EVT_CALL(UpdateLerp) - EVT_CALL(func_802CFD30, NPC_LeaderBoo, FOLD_TYPE_7, LVar0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_LeaderBoo, FOLD_UPD_SET_ALPHA, LVar0, 0, 0, 0) EVT_WAIT(1) EVT_IF_EQ(LVar1, 0) EVT_BREAK_LOOP @@ -377,7 +377,7 @@ EvtScript N(EVS_Scene_BoosUnleashed) = { EVT_CALL(MakeLerp, 0, 255, 10, EASING_LINEAR) EVT_LOOP(0) EVT_CALL(UpdateLerp) - EVT_CALL(func_802CFD30, NPC_LeaderBoo, FOLD_TYPE_7, LVar0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_LeaderBoo, FOLD_UPD_SET_ALPHA, LVar0, 0, 0, 0) EVT_WAIT(1) EVT_IF_EQ(LVar1, 0) EVT_BREAK_LOOP @@ -499,7 +499,7 @@ EvtScript N(EVS_Scene_BoosUnleashed) = { EVT_EXEC(N(EVS_BooSpookAndVanish)) EVT_WAIT(60) EVT_CALL(SetNpcPos, NPC_TutorialBoo, -160, 10, -175) - EVT_CALL(func_802CFD30, NPC_TutorialBoo, FOLD_TYPE_7, 0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_TutorialBoo, FOLD_UPD_SET_ALPHA, 0, 0, 0, 0) EVT_SET(LVarA, NPC_TutorialBoo) EVT_EXEC(N(EVS_BooAppear)) EVT_WAIT(60) diff --git a/src/world/area_obk/obk_07/obk_07_6_phonograph.c b/src/world/area_obk/obk_07/obk_07_6_phonograph.c index ae3199c9bb..255bbf71d9 100644 --- a/src/world/area_obk/obk_07/obk_07_6_phonograph.c +++ b/src/world/area_obk/obk_07/obk_07_6_phonograph.c @@ -982,7 +982,7 @@ EvtScript N(EVS_GuardBoo_ReturnToPost) = { EVT_CALL(MakeLerp, 180, 0, 10, EASING_LINEAR) EVT_LOOP(0) EVT_CALL(UpdateLerp) - EVT_CALL(func_802CFD30, NPC_GuardBoo, FOLD_TYPE_7, LVar0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_GuardBoo, FOLD_UPD_SET_ALPHA, LVar0, 0, 0, 0) EVT_IF_EQ(LVar1, 0) EVT_BREAK_LOOP EVT_END_IF @@ -992,7 +992,7 @@ EvtScript N(EVS_GuardBoo_ReturnToPost) = { EVT_CALL(MakeLerp, 0, 180, 10, EASING_LINEAR) EVT_LOOP(0) EVT_CALL(UpdateLerp) - EVT_CALL(func_802CFD30, NPC_GuardBoo, FOLD_TYPE_7, LVar0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_GuardBoo, FOLD_UPD_SET_ALPHA, LVar0, 0, 0, 0) EVT_IF_EQ(LVar1, 0) EVT_BREAK_LOOP EVT_END_IF @@ -1086,7 +1086,7 @@ EvtScript N(EVS_GuardBooVanish) = { EVT_CALL(MakeLerp, 255, 0, 60, EASING_LINEAR) EVT_LABEL(0) EVT_CALL(UpdateLerp) - EVT_CALL(func_802CFD30, NPC_GuardBoo, FOLD_TYPE_7, LVar0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_GuardBoo, FOLD_UPD_SET_ALPHA, LVar0, 0, 0, 0) EVT_WAIT(1) EVT_IF_EQ(LVar1, 1) EVT_GOTO(0) diff --git a/src/world/area_obk/obk_08/obk_08_5_npc.c b/src/world/area_obk/obk_08/obk_08_5_npc.c index 354b0b224b..aa8f3af45c 100644 --- a/src/world/area_obk/obk_08/obk_08_5_npc.c +++ b/src/world/area_obk/obk_08/obk_08_5_npc.c @@ -34,11 +34,11 @@ API_CALLABLE(N(func_802408A0_BD4110)) { void N(func_80240920_BD4190)(Npc* npc) { if (npc->yaw > 340.0f || npc->yaw < 20.0f) { npc->renderMode = RENDER_MODE_ALPHATEST; - npc->foldArg5 = 0; - func_8003D624(npc, FOLD_TYPE_NONE, 0, 0, 0, 0, npc->foldArg5); + npc->foldFlags = 0; + npc_set_fold_params(npc, FOLD_UPD_CLEAR, 0, 0, 0, 0, npc->foldFlags); } else { npc->renderMode = RENDER_MODE_SURFACE_XLU_LAYER2; - func_8003D624(npc, FOLD_TYPE_7, gPlayerStatusPtr->alpha1, 0, 0, 0, npc->foldArg5); + npc_set_fold_params(npc, FOLD_UPD_SET_ALPHA, gPlayerStatusPtr->alpha1, 0, 0, 0, npc->foldFlags); npc->foldArg1 = 255; } } @@ -55,14 +55,14 @@ void func_802409E8_BD4258(void) { } void func_80240A7C_BD42EC(void) { - get_npc_unsafe(NPC_KeepAwayBoo1)->foldArg5 = 0; - get_npc_unsafe(NPC_KeepAwayBoo2)->foldArg5 = 0; - get_npc_unsafe(NPC_KeepAwayBoo3)->foldArg5 = 0; - get_npc_unsafe(NPC_KeepAwayBoo4)->foldArg5 = 0; - get_npc_unsafe(NPC_KeepAwayBoo5)->foldArg5 = 0; - get_npc_unsafe(NPC_KeepAwayBoo6)->foldArg5 = 0; - get_npc_unsafe(NPC_KeepAwayBoo7)->foldArg5 = 0; - get_npc_unsafe(NPC_KeepAwayBoo8)->foldArg5 = 0; + get_npc_unsafe(NPC_KeepAwayBoo1)->foldFlags = 0; + get_npc_unsafe(NPC_KeepAwayBoo2)->foldFlags = 0; + get_npc_unsafe(NPC_KeepAwayBoo3)->foldFlags = 0; + get_npc_unsafe(NPC_KeepAwayBoo4)->foldFlags = 0; + get_npc_unsafe(NPC_KeepAwayBoo5)->foldFlags = 0; + get_npc_unsafe(NPC_KeepAwayBoo6)->foldFlags = 0; + get_npc_unsafe(NPC_KeepAwayBoo7)->foldFlags = 0; + get_npc_unsafe(NPC_KeepAwayBoo8)->foldFlags = 0; } API_CALLABLE(N(func_80240AF0_BD4360)) { diff --git a/src/world/area_obk/obk_08/obk_08_6_game.c b/src/world/area_obk/obk_08/obk_08_6_game.c index 64128cd168..d7775c05f5 100644 --- a/src/world/area_obk/obk_08/obk_08_6_game.c +++ b/src/world/area_obk/obk_08/obk_08_6_game.c @@ -153,7 +153,7 @@ EvtScript N(EVS_BooSpookAndVanish) = { EVT_CALL(MakeLerp, 255, 0, 60, EASING_LINEAR) EVT_LABEL(0) EVT_CALL(UpdateLerp) - EVT_CALL(func_802CFD30, LVarA, FOLD_TYPE_7, LVar0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, LVarA, FOLD_UPD_SET_ALPHA, LVar0, 0, 0, 0) EVT_WAIT(1) EVT_IF_EQ(LVar1, 1) EVT_GOTO(0) @@ -182,7 +182,7 @@ EvtScript N(EVS_Scene_BoosUnleashed) = { EVT_CALL(MakeLerp, 0, 255, 30, EASING_LINEAR) EVT_LOOP(0) EVT_CALL(UpdateLerp) - EVT_CALL(func_802CFD30, NPC_LeaderBoo, FOLD_TYPE_7, LVar0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_LeaderBoo, FOLD_UPD_SET_ALPHA, LVar0, 0, 0, 0) EVT_CALL(SetItemAlpha, MV_KeepAwayItem, LVar0) EVT_WAIT(1) EVT_IF_EQ(LVar1, 0) @@ -196,7 +196,7 @@ EvtScript N(EVS_Scene_BoosUnleashed) = { EVT_CALL(MakeLerp, 255, 0, 30, EASING_LINEAR) EVT_LOOP(0) EVT_CALL(UpdateLerp) - EVT_CALL(func_802CFD30, NPC_LeaderBoo, FOLD_TYPE_7, LVar0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_LeaderBoo, FOLD_UPD_SET_ALPHA, LVar0, 0, 0, 0) EVT_CALL(SetItemAlpha, MV_KeepAwayItem, LVar0) EVT_WAIT(1) EVT_IF_EQ(LVar1, 0) @@ -216,7 +216,7 @@ EvtScript N(EVS_Scene_BoosUnleashed) = { EVT_CALL(MakeLerp, 0, 255, 30, EASING_LINEAR) EVT_LOOP(0) EVT_CALL(UpdateLerp) - EVT_CALL(func_802CFD30, NPC_LeaderBoo, FOLD_TYPE_7, LVar0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_LeaderBoo, FOLD_UPD_SET_ALPHA, LVar0, 0, 0, 0) EVT_CALL(GetNpcPos, NPC_LeaderBoo, LVar3, LVar4, LVar5) EVT_ADD(LVar4, 20) EVT_CALL(SetItemPos, MV_KeepAwayItem, LVar3, LVar4, LVar5) @@ -409,7 +409,7 @@ EvtScript N(EVS_Scene_BoosUnleashed) = { EVT_CALL(MakeLerp, 255, 0, 20, EASING_LINEAR) EVT_LOOP(0) EVT_CALL(UpdateLerp) - EVT_CALL(func_802CFD30, MV_ItemCarrierNpc, FOLD_TYPE_7, LVar0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, MV_ItemCarrierNpc, FOLD_UPD_SET_ALPHA, LVar0, 0, 0, 0) EVT_WAIT(1) EVT_IF_EQ(LVar1, 0) EVT_BREAK_LOOP @@ -421,7 +421,7 @@ EvtScript N(EVS_Scene_BoosUnleashed) = { EVT_CALL(MakeLerp, 0, 255, 20, EASING_LINEAR) EVT_LOOP(0) EVT_CALL(UpdateLerp) - EVT_CALL(func_802CFD30, MV_ItemCarrierNpc, FOLD_TYPE_7, LVar0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, MV_ItemCarrierNpc, FOLD_UPD_SET_ALPHA, LVar0, 0, 0, 0) EVT_WAIT(1) EVT_IF_EQ(LVar1, 0) EVT_BREAK_LOOP diff --git a/src/world/area_obk/obk_09/obk_09_3_meet_bow.c b/src/world/area_obk/obk_09/obk_09_3_meet_bow.c index 0deae598b2..b6c0c6b014 100644 --- a/src/world/area_obk/obk_09/obk_09_3_meet_bow.c +++ b/src/world/area_obk/obk_09/obk_09_3_meet_bow.c @@ -48,8 +48,8 @@ EvtScript N(EVS_Scene_MeetBow) = { EVT_SETF(LVar0, EVT_FLOAT(0.0)) EVT_LOOP(20 * DT) EVT_ADDF(LVar0, EVT_FLOAT(240.0 / (s32)(20 * DT))) - EVT_CALL(func_802CFD30, NPC_Bow, FOLD_TYPE_7, LVar0, 0, 0, 0) - EVT_CALL(func_802CFD30, NPC_Bootler, FOLD_TYPE_7, LVar0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_Bow, FOLD_UPD_SET_ALPHA, LVar0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_Bootler, FOLD_UPD_SET_ALPHA, LVar0, 0, 0, 0) EVT_WAIT(1) EVT_END_LOOP EVT_WAIT(40 * DT) diff --git a/src/world/area_obk/obk_09/obk_09_4_npc.c b/src/world/area_obk/obk_09/obk_09_4_npc.c index e7a950cc0a..2a40b52874 100644 --- a/src/world/area_obk/obk_09/obk_09_4_npc.c +++ b/src/world/area_obk/obk_09/obk_09_4_npc.c @@ -108,7 +108,7 @@ EvtScript N(EVS_NpcInit_Skolar) = { EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_WorldSkolar_IdleSad) EVT_CALL(SetNpcPos, NPC_SELF, 0, NPC_DISPOSE_POS_Y, -100) EVT_CALL(EnableNpcShadow, NPC_SELF, FALSE) - EVT_CALL(func_802CFD30, NPC_SELF, FOLD_TYPE_7, 170, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_SELF, FOLD_UPD_SET_ALPHA, 170, 0, 0, 0) EVT_IF_GE(GB_StoryProgress, STORY_CH3_BOW_JOINED_PARTY) EVT_CALL(RemoveNpc, NPC_SELF) EVT_END_IF diff --git a/src/world/area_pra/common/Reflection.inc.c b/src/world/area_pra/common/Reflection.inc.c index cb1c295787..dfdb504248 100644 --- a/src/world/area_pra/common/Reflection.inc.c +++ b/src/world/area_pra/common/Reflection.inc.c @@ -97,10 +97,10 @@ void N(worker_reflect_player_wall)(void) { if (playerStatus->alpha1 != D_802D9D70) { if (playerStatus->alpha1 < 254) { renderMode = RENDER_MODE_SURFACE_XLU_LAYER1; - func_802DDEE4(PLAYER_SPRITE_AUX2, -1, FOLD_TYPE_7, 0, 0, 0, playerStatus->alpha1, 0); + func_802DDEE4(PLAYER_SPRITE_AUX2, -1, FOLD_UPD_SET_ALPHA, 0, 0, 0, playerStatus->alpha1, 0); } else { renderMode = RENDER_MODE_ALPHATEST; - func_802DDEE4(PLAYER_SPRITE_AUX2, -1, FOLD_TYPE_NONE, 0, 0, 0, 0, 0); + func_802DDEE4(PLAYER_SPRITE_AUX2, -1, FOLD_UPD_CLEAR, 0, 0, 0, 0, 0); } } D_802D9D70 = playerStatus->alpha1; @@ -172,10 +172,10 @@ void N(worker_reflect_player_floor)(void) { if (playerStatus->alpha1 != D_802D9D71) { if (playerStatus->alpha1 < 254) { renderMode = RENDER_MODE_SURFACE_XLU_LAYER1; - func_802DDEE4(PLAYER_SPRITE_AUX1, -1, FOLD_TYPE_7, 0, 0, 0, playerStatus->alpha1, 0); + func_802DDEE4(PLAYER_SPRITE_AUX1, -1, FOLD_UPD_SET_ALPHA, 0, 0, 0, playerStatus->alpha1, 0); } else { renderMode = RENDER_MODE_ALPHATEST; - func_802DDEE4(PLAYER_SPRITE_AUX1, -1, FOLD_TYPE_NONE, 0, 0, 0, 0, 0); + func_802DDEE4(PLAYER_SPRITE_AUX1, -1, FOLD_UPD_CLEAR, 0, 0, 0, 0, 0); } } D_802D9D71 = playerStatus->alpha1; diff --git a/src/world/area_pra/pra_32/pra_32_3_npc.c b/src/world/area_pra/pra_32/pra_32_3_npc.c index 23838f34d2..51dbac0487 100644 --- a/src/world/area_pra/pra_32/pra_32_3_npc.c +++ b/src/world/area_pra/pra_32/pra_32_3_npc.c @@ -51,7 +51,7 @@ EvtScript N(EVS_Scene_CrystalKingAppears) = { EVT_CALL(SetMusicTrack, 0, SONG_CRYSTAL_KING_THEME, 0, 8) EVT_CALL(ShowMessageAtScreenPos, MSG_CH7_016A, 160, 40) EVT_CALL(SetNpcPos, NPC_CrystalKing_01, 588, 200, 116) - EVT_CALL(func_802CFD30, NPC_CrystalKing_01, FOLD_TYPE_7, 0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_CrystalKing_01, FOLD_UPD_SET_ALPHA, 0, 0, 0, 0) EVT_CALL(GetNpcPos, NPC_CrystalKing_01, LVar0, LVar1, LVar2) EVT_CALL(UseSettingsFrom, CAM_DEFAULT, LVar0, LVar1, LVar2) EVT_ADD(LVar1, -30) @@ -95,7 +95,7 @@ EvtScript N(EVS_Scene_CrystalKingAppears) = { EVT_CALL(MakeLerp, 0, 255, 120 * DT, EASING_LINEAR) EVT_LABEL(5) EVT_CALL(UpdateLerp) - EVT_CALL(func_802CFD30, NPC_CrystalKing_01, FOLD_TYPE_7, LVar0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_CrystalKing_01, FOLD_UPD_SET_ALPHA, LVar0, 0, 0, 0) EVT_WAIT(1) EVT_IF_EQ(LVar1, 1) EVT_GOTO(5) @@ -171,7 +171,7 @@ EvtScript N(EVS_Scene_BossDefeated) = { EVT_CALL(MakeLerp, 255, 122, 30 * DT, EASING_COS_IN_OUT) EVT_LOOP(0) EVT_CALL(UpdateLerp) - EVT_CALL(func_802CFD30, NPC_CrystalKing_01, FOLD_TYPE_7, LVar0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_CrystalKing_01, FOLD_UPD_SET_ALPHA, LVar0, 0, 0, 0) EVT_IF_EQ(LVar1, 0) EVT_BREAK_LOOP EVT_END_IF @@ -186,13 +186,13 @@ EvtScript N(EVS_Scene_BossDefeated) = { EVT_CALL(MakeLerp, 120, 0, 30 * DT, EASING_COS_IN_OUT) EVT_LOOP(0) EVT_CALL(UpdateLerp) - EVT_CALL(func_802CFD30, NPC_CrystalKing_01, FOLD_TYPE_7, LVar0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_CrystalKing_01, FOLD_UPD_SET_ALPHA, LVar0, 0, 0, 0) EVT_IF_EQ(LVar1, 0) EVT_BREAK_LOOP EVT_END_IF EVT_WAIT(1) EVT_END_LOOP - EVT_CALL(func_802CFD30, NPC_CrystalKing_01, FOLD_TYPE_7, 0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_CrystalKing_01, FOLD_UPD_SET_ALPHA, 0, 0, 0, 0) EVT_CALL(GetNpcPos, NPC_CrystalKing_01, LVar0, LVar1, LVar2) EVT_ADD(LVar1, 20) EVT_PLAY_EFFECT(EFFECT_SPARKLES, 1, LVar0, LVar1, LVar2, 40) diff --git a/src/world/area_sam/sam_02/sam_02_4_npc.c b/src/world/area_sam/sam_02/sam_02_4_npc.c index 58a458b34f..cae7b45b90 100644 --- a/src/world/area_sam/sam_02/sam_02_4_npc.c +++ b/src/world/area_sam/sam_02/sam_02_4_npc.c @@ -73,8 +73,8 @@ EvtScript N(EVS_ToadHouse_GetInBed) = { EVT_CALL(InterpPlayerYaw, 229, 1) EVT_CALL(HidePlayerShadow, TRUE) EVT_CALL(SetPlayerAnimation, ANIM_Mario1_Idle) - EVT_CALL(func_802D286C, 0x800) - EVT_CALL(func_802D2520, ANIM_Mario1_Idle, 5, FOLD_TYPE_7, 1, 1, 0) + EVT_CALL(SetPlayerFoldFlags, FOLD_STATE_FLAG_800) + EVT_CALL(UpdatePlayerFold, ANIM_Mario1_Idle, FOLD_UPD_SET_ANIM, FOLD_ANIM_GET_IN_BED, 1, 1, 0) EVT_THREAD EVT_WAIT(60) EVT_CALL(SetPlayerAnimation, ANIM_MarioW2_SleepStanding) @@ -110,7 +110,7 @@ EvtScript N(EVS_ToadHouse_ReturnFromRest) = { EVT_END_IF EVT_END_IF EVT_CALL(HidePlayerShadow, FALSE) - EVT_CALL(func_802D2520, ANIM_Mario1_Idle, 0, 0, 0, 0, 0) + EVT_CALL(UpdatePlayerFold, ANIM_Mario1_Idle, FOLD_UPD_CLEAR, 0, 0, 0, 0) EVT_CALL(SetPlayerPos, 277, 0, -256) EVT_CALL(SetPlayerSpeed, EVT_FLOAT(3.0)) EVT_CALL(PlayerMoveTo, 336, -199, 0) diff --git a/src/world/area_sam/sam_05/sam_05_4_npc.c b/src/world/area_sam/sam_05/sam_05_4_npc.c index c47e2c1dfa..323162b090 100644 --- a/src/world/area_sam/sam_05/sam_05_4_npc.c +++ b/src/world/area_sam/sam_05/sam_05_4_npc.c @@ -84,11 +84,11 @@ API_CALLABLE(N(UpdateMonstarSpriteEffects)) { } if (enemy->varTable[3] == 0) { - func_802DE780(npc->spriteInstanceID, 1, FOLD_TYPE_7, 255, 255, 255, 0, 0); + func_802DE780(npc->spriteInstanceID, 1, FOLD_UPD_SET_ALPHA, 255, 255, 255, 0, 0); return ApiStatus_BLOCK; } - func_802DE780(npc->spriteInstanceID, 0, FOLD_TYPE_11, 20, 0, 0, 255, 0); + func_802DE780(npc->spriteInstanceID, 0, FOLD_UPD_ALLOC_COLOR_BUF, 20, 0, 0, 255, 0); script->functionTemp[0] += 10; if (script->functionTemp[0] >= 360) { script->functionTemp[0] %= 360; @@ -100,7 +100,7 @@ API_CALLABLE(N(UpdateMonstarSpriteEffects)) { sp50[i] = (cosine(script->functionTemp[0] + (i * 25) + 90) + 1.0) * 56.0; sp68[i] = enemy->varTable[3]; - func_802DE780(npc->spriteInstanceID, 0, FOLD_TYPE_C, i, (sp20[i] << 24) | (sp38[i] << 16) | (sp50[i] << 8) | sp68[i], 0, 255, 0); + func_802DE780(npc->spriteInstanceID, 0, FOLD_UPD_COLOR_BUF_SET_C, i, (sp20[i] << 24) | (sp38[i] << 16) | (sp50[i] << 8) | sp68[i], 0, 255, 0); } if (enemy->varTable[3] == 255) { diff --git a/src/world/area_sam/sam_05/sam_05_5_scenes.c b/src/world/area_sam/sam_05/sam_05_5_scenes.c index 6040cc036b..5c3976b2ad 100644 --- a/src/world/area_sam/sam_05/sam_05_5_scenes.c +++ b/src/world/area_sam/sam_05/sam_05_5_scenes.c @@ -217,7 +217,7 @@ EvtScript N(EVS_StarKidsFlee) = { EVT_IF_EQ(LVarA, -1) EVT_BREAK_LOOP EVT_END_IF - EVT_CALL(func_802CFD30, LVarA, FOLD_TYPE_7, LVar2, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, LVarA, FOLD_UPD_SET_ALPHA, LVar2, 0, 0, 0) EVT_END_LOOP EVT_WAIT(1) EVT_IF_EQ(LVar1, 1) diff --git a/src/world/area_sam/sam_06/sam_06_4_npc.c b/src/world/area_sam/sam_06/sam_06_4_npc.c index e80ceb6511..b69356615d 100644 --- a/src/world/area_sam/sam_06/sam_06_4_npc.c +++ b/src/world/area_sam/sam_06/sam_06_4_npc.c @@ -762,8 +762,8 @@ EvtScript N(EVS_ToadHouse_GetInBed) = { EVT_CALL(InterpPlayerYaw, 229, 1) EVT_CALL(HidePlayerShadow, TRUE) EVT_CALL(SetPlayerAnimation, ANIM_Mario1_Idle) - EVT_CALL(func_802D286C, 0x800) - EVT_CALL(func_802D2520, ANIM_Mario1_Idle, 5, 7, 1, 1, 0) + EVT_CALL(SetPlayerFoldFlags, FOLD_STATE_FLAG_800) + EVT_CALL(UpdatePlayerFold, ANIM_Mario1_Idle, FOLD_UPD_SET_ANIM, FOLD_ANIM_GET_IN_BED, 1, 1, 0) EVT_THREAD EVT_WAIT(60) EVT_CALL(SetPlayerAnimation, ANIM_MarioW2_SleepStanding) @@ -784,7 +784,7 @@ EvtScript N(EVS_ToadHouse_GetInBed) = { EvtScript N(EVS_ToadHouse_ReturnFromRest) = { EVT_EXEC(N(EVS_SetupMusic)) EVT_CALL(HidePlayerShadow, FALSE) - EVT_CALL(func_802D2520, ANIM_Mario1_Idle, 0, 0, 0, 0, 0) + EVT_CALL(UpdatePlayerFold, ANIM_Mario1_Idle, FOLD_UPD_CLEAR, 0, 0, 0, 0) EVT_CALL(PlayerMoveTo, -347, -114, 0) EVT_CALL(SetPlayerSpeed, EVT_FLOAT(3.0)) EVT_CALL(PlayerMoveTo, -309, -16, 0) diff --git a/src/world/area_sam/sam_11/sam_11_3_rooms.c b/src/world/area_sam/sam_11/sam_11_3_rooms.c index 9202957337..614cde5ecd 100644 --- a/src/world/area_sam/sam_11/sam_11_3_rooms.c +++ b/src/world/area_sam/sam_11/sam_11_3_rooms.c @@ -48,7 +48,7 @@ EvtScript N(EVS_RoomListener_LeftHouse) = { EVT_CALL(MakeLerp, 0, 255, 20, EASING_LINEAR) EVT_LOOP(0) EVT_CALL(UpdateLerp) - EVT_CALL(func_802CFD30, NPC_Herringway, FOLD_TYPE_7, LVar0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_Herringway, FOLD_UPD_SET_ALPHA, LVar0, 0, 0, 0) EVT_WAIT(1) EVT_IF_EQ(LVar1, 0) EVT_BREAK_LOOP diff --git a/src/world/area_sam/sam_11/sam_11_5_npc.c b/src/world/area_sam/sam_11/sam_11_5_npc.c index 5bca054aff..9e49e309e1 100644 --- a/src/world/area_sam/sam_11/sam_11_5_npc.c +++ b/src/world/area_sam/sam_11/sam_11_5_npc.c @@ -206,7 +206,7 @@ EvtScript N(EVS_NpcInteract_Herringway) = { EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_Herringway_Idle) EVT_CALL(SetNpcPos, NPC_SELF, -217, 0, -38) EVT_END_THREAD - EVT_CALL(func_802CFD30, NPC_SELF, FOLD_TYPE_7, 0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_SELF, FOLD_UPD_SET_ALPHA, 0, 0, 0, 0) EVT_SET(GB_StoryProgress, STORY_CH7_SPOKE_WITH_HERRINGWAY) EVT_CASE_LT(STORY_CH7_MAYOR_MURDER_SOLVED) EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Herringway_Talk, ANIM_Herringway_Idle, 0, MSG_CH7_00D3) diff --git a/src/world/area_sam/sam_12/sam_12_4_scenes.c b/src/world/area_sam/sam_12/sam_12_4_scenes.c index bc158a23f1..074595c4c7 100644 --- a/src/world/area_sam/sam_12/sam_12_4_scenes.c +++ b/src/world/area_sam/sam_12/sam_12_4_scenes.c @@ -70,10 +70,10 @@ EvtScript N(EVS_MerlarFlickering) = { EVT_USE_BUF(EVT_PTR(N(FlickeringStaticAmts))) EVT_LOOP(5) EVT_BUF_READ1(LVar0) - EVT_CALL(func_802CFD30, NPC_Merlar, FOLD_TYPE_D, EVT_FLOAT(0.0), LVar0, EVT_FLOAT(200.0), EVT_FLOAT(100.0)) + EVT_CALL(SetNpcFoldParams, NPC_Merlar, FOLD_UPD_HOLOGRAM, EVT_FLOAT(0.0), LVar0, EVT_FLOAT(200.0), EVT_FLOAT(100.0)) EVT_WAIT(1) EVT_END_LOOP - EVT_CALL(func_802CFD30, NPC_Merlar, FOLD_TYPE_D, EVT_FLOAT(0.0), EVT_FLOAT(0.0), EVT_FLOAT(0.0), EVT_FLOAT(100.0)) + EVT_CALL(SetNpcFoldParams, NPC_Merlar, FOLD_UPD_HOLOGRAM, EVT_FLOAT(0.0), EVT_FLOAT(0.0), EVT_FLOAT(0.0), EVT_FLOAT(100.0)) EVT_WAIT(1) EVT_END_LOOP EVT_GOTO(0) @@ -144,7 +144,7 @@ EvtScript N(EVS_Scene_MeetMerlar) = { EVT_SETF(LVar0, EVT_FLOAT(0.0)) EVT_LOOP(LOOPCOUNT_2) EVT_ADDF(LVar0, EVT_FLOAT(1.0)) - EVT_CALL(func_802CFD30, NPC_Merlar, FOLD_TYPE_7, LVar0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_Merlar, FOLD_UPD_SET_ALPHA, LVar0, 0, 0, 0) EVT_WAIT(1) EVT_END_LOOP EVT_EXEC_GET_TID(N(EVS_MerlarFlickering), LVar8) @@ -248,7 +248,7 @@ EvtScript N(EVS_Scene_MeetMerlar) = { EVT_SETF(LVar0, EVT_FLOAT(100.0)) EVT_LOOP(LOOPCOUNT_2) EVT_ADDF(LVar0, EVT_FLOAT(-100.0 / LOOPCOUNT_2)) - EVT_CALL(func_802CFD30, NPC_Merlar, FOLD_TYPE_7, LVar0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_Merlar, FOLD_UPD_SET_ALPHA, LVar0, 0, 0, 0) EVT_WAIT(1) EVT_END_LOOP EVT_CALL(SetNpcPos, NPC_Merlar, NPC_DISPOSE_LOCATION) diff --git a/src/world/area_trd/trd_00/trd_00_3_npc.c b/src/world/area_trd/trd_00/trd_00_3_npc.c index 4b305fb372..581d879804 100644 --- a/src/world/area_trd/trd_00/trd_00_3_npc.c +++ b/src/world/area_trd/trd_00/trd_00_3_npc.c @@ -53,10 +53,10 @@ EvtScript N(EVS_NpcIdle_KoopaBros) = { EVT_CALL(SetNpcSpeed, NPC_SELF, EVT_FLOAT(4.5 / DT)) EVT_CALL(NpcMoveTo, NPC_SELF, -556, 180, 0) EVT_CALL(WaitForCam, CAM_DEFAULT, EVT_FLOAT(1.0)) - EVT_CALL(func_802CFD30, NPC_SELF, FOLD_TYPE_5, 4, 2, 1, 0) + EVT_CALL(SetNpcFoldParams, NPC_SELF, FOLD_UPD_SET_ANIM, FOLD_ANIM_STARTLE, 2, 1, 0) EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_KoopaBros_Black_Anim1E) EVT_WAIT(12 * DT) - EVT_CALL(func_802CFD30, NPC_SELF, FOLD_TYPE_NONE, 0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_SELF, FOLD_UPD_CLEAR, 0, 0, 0, 0) EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_KoopaBros_Black_Anim04) EVT_WAIT(10 * DT) EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_KoopaBros_Black_Anim14, ANIM_KoopaBros_Black_Anim04, 0, MSG_CH1_00D2) diff --git a/src/world/area_trd/trd_03/trd_03_3_npc.c b/src/world/area_trd/trd_03/trd_03_3_npc.c index 3ce71f1196..aea8e5e42a 100644 --- a/src/world/area_trd/trd_03/trd_03_3_npc.c +++ b/src/world/area_trd/trd_03/trd_03_3_npc.c @@ -89,10 +89,10 @@ EvtScript N(EVS_Scene_GreenKoopaBros) = { EVT_CALL(SetPlayerPos, -647, 0, 80) EVT_EXEC_WAIT(N(EVS_EnterMap)) EVT_CALL(InterpNpcYaw, NPC_KoopaBros, 270, 5) - EVT_CALL(func_802CFD30, NPC_KoopaBros, FOLD_TYPE_5, 4, 2, 1, 0) + EVT_CALL(SetNpcFoldParams, NPC_KoopaBros, FOLD_UPD_SET_ANIM, FOLD_ANIM_STARTLE, 2, 1, 0) EVT_CALL(SetNpcAnimation, NPC_KoopaBros, ANIM_KoopaBros_Green_Anim1E) EVT_WAIT(12 * DT) - EVT_CALL(func_802CFD30, NPC_KoopaBros, FOLD_TYPE_NONE, 0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_KoopaBros, FOLD_UPD_CLEAR, 0, 0, 0, 0) EVT_CALL(SetNpcAnimation, NPC_KoopaBros, ANIM_KoopaBros_Green_Anim04) EVT_WAIT(10 * DT) EVT_CALL(SpeakToPlayer, NPC_KoopaBros, ANIM_KoopaBros_Green_Anim14, ANIM_KoopaBros_Green_Anim04, 0, MSG_CH1_00D4) diff --git a/src/world/area_trd/trd_05/trd_05_4_npc.c b/src/world/area_trd/trd_05/trd_05_4_npc.c index 5f38b48ea4..340ece7a1b 100644 --- a/src/world/area_trd/trd_05/trd_05_4_npc.c +++ b/src/world/area_trd/trd_05/trd_05_4_npc.c @@ -31,11 +31,11 @@ EvtScript N(EVS_KoopaBros_SetTrap) = { EVT_CALL(SetNpcAnimation, NPC_KoopaBros_01, ANIM_KoopaBros_Yellow_Anim04) EVT_THREAD EVT_LOOP(8) - EVT_CALL(func_802CFD30, NPC_KoopaBros_01, FOLD_TYPE_7, 0, 0, 0, 0) - EVT_CALL(func_802CFD30, NPC_KoopaBros_02, FOLD_TYPE_7, 255, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_KoopaBros_01, FOLD_UPD_SET_ALPHA, 0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_KoopaBros_02, FOLD_UPD_SET_ALPHA, 255, 0, 0, 0) EVT_WAIT(6 * DT) - EVT_CALL(func_802CFD30, NPC_KoopaBros_01, FOLD_TYPE_7, 255, 0, 0, 0) - EVT_CALL(func_802CFD30, NPC_KoopaBros_02, FOLD_TYPE_7, 0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_KoopaBros_01, FOLD_UPD_SET_ALPHA, 255, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_KoopaBros_02, FOLD_UPD_SET_ALPHA, 0, 0, 0, 0) EVT_WAIT(6 * DT) EVT_END_LOOP EVT_END_THREAD diff --git a/src/world/area_trd/trd_10/trd_10_2_npc.c b/src/world/area_trd/trd_10/trd_10_2_npc.c index 7d64143544..4f781ff8dc 100644 --- a/src/world/area_trd/trd_10/trd_10_2_npc.c +++ b/src/world/area_trd/trd_10/trd_10_2_npc.c @@ -66,10 +66,10 @@ EvtScript N(EVS_NpcAI_KoopaBros_01) = { EVT_CALL(SetNpcPos, NPC_KoopaBros_01, -32, 0, 0) EVT_CALL(NpcMoveTo, NPC_KoopaBros_01, -88, 0, 15 * DT) EVT_WAIT(10 * DT) - EVT_CALL(func_802CFD30, NPC_KoopaBros_01, FOLD_TYPE_5, 4, 2, 1, 0) + EVT_CALL(SetNpcFoldParams, NPC_KoopaBros_01, FOLD_UPD_SET_ANIM, FOLD_ANIM_STARTLE, 2, 1, 0) EVT_CALL(SetNpcAnimation, NPC_KoopaBros_01, ANIM_KoopaBros_Black_Anim1E) EVT_WAIT(12 * DT) - EVT_CALL(func_802CFD30, NPC_KoopaBros_01, FOLD_TYPE_NONE, 0, 0, 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_KoopaBros_01, FOLD_UPD_CLEAR, 0, 0, 0, 0) EVT_CALL(SetNpcAnimation, NPC_KoopaBros_01, ANIM_KoopaBros_Black_Anim04) EVT_WAIT(10 * DT) EVT_CALL(SpeakToPlayer, NPC_KoopaBros_01, ANIM_KoopaBros_Black_Anim02, ANIM_KoopaBros_Black_Anim04, 0, MSG_CH1_00F4) diff --git a/src/world/area_tst/tst_11/tst_11_2_extra.c b/src/world/area_tst/tst_11/tst_11_2_extra.c index ab5c172801..ea12f07a4a 100644 --- a/src/world/area_tst/tst_11/tst_11_2_extra.c +++ b/src/world/area_tst/tst_11/tst_11_2_extra.c @@ -120,9 +120,9 @@ void N(appendGfx_test_reflection_floor)(void* data) { guTranslateF(sp60, playerStatus->position.x, playerStatus->position.y, 0.0f); guMtxCatF(sp20, sp60, sp20); trueAnimation = playerStatus->trueAnimation; - func_802DDFF8(trueAnimation, 7, 255, 255, 255, 20, 0); + func_802DDFF8(trueAnimation, FOLD_UPD_SET_ALPHA, 255, 255, 255, 20, 0); spr_draw_player_sprite(PLAYER_SPRITE_AUX1, 0, 0, 0, sp20); - func_802DDFF8(trueAnimation, 0, 0, 0, 0, 0, 0); + func_802DDFF8(trueAnimation, FOLD_UPD_CLEAR, 0, 0, 0, 0, 0); } API_CALLABLE(N(PartnerReflectTest)) { diff --git a/src/world/common/complete/KnockDownPlayer.inc.c b/src/world/common/complete/KnockDownPlayer.inc.c index c937e6889e..4808ce286c 100644 --- a/src/world/common/complete/KnockDownPlayer.inc.c +++ b/src/world/common/complete/KnockDownPlayer.inc.c @@ -50,7 +50,7 @@ void N(gfx_build_knocked_down_player)(void) { part.yOffset = rasterInfo.height; part.opacity = 255; - fold_appendGfx_component(temp_v0->foldID, &part, 0.0f, sp40); + fold_appendGfx_component(temp_v0->foldID, &part, 0, sp40); gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW); } diff --git a/src/world/common/enemy/ai/MagikoopaAI.inc.c b/src/world/common/enemy/ai/MagikoopaAI.inc.c index d6206b2943..794f71f0e4 100644 --- a/src/world/common/enemy/ai/MagikoopaAI.inc.c +++ b/src/world/common/enemy/ai/MagikoopaAI.inc.c @@ -128,7 +128,7 @@ void N(MagikoopaAI_11)(Evt* script, MobileAISettings* aiSettings, EnemyDetectVol } if (enemy->varTable[0] == 0) { if (npc->duration >= 20) { - func_802DE894(npc->spriteInstanceID, FOLD_TYPE_NONE, 0, 0, 0, 0, 0); + func_802DE894(npc->spriteInstanceID, FOLD_UPD_CLEAR, 0, 0, 0, 0, 0); npc->alpha = 255; npc->scale.x = 1.0f; npc->scale.y = 1.0f; @@ -311,7 +311,7 @@ API_CALLABLE(N(MagikoopaAI_OnPlayerWon)) { Npc* npc = get_npc_unsafe(enemy->npcID); npc->alpha = 255; - func_802DE894(npc->spriteInstanceID, FOLD_TYPE_NONE, 0, 0, 0, 0, 0); + func_802DE894(npc->spriteInstanceID, FOLD_UPD_CLEAR, 0, 0, 0, 0, 0); return ApiStatus_DONE2; } diff --git a/src/world/common/enemy/ai/SentinelAI.inc.c b/src/world/common/enemy/ai/SentinelAI.inc.c index abdd642693..5676add07e 100644 --- a/src/world/common/enemy/ai/SentinelAI.inc.c +++ b/src/world/common/enemy/ai/SentinelAI.inc.c @@ -131,7 +131,7 @@ void N(SentinelAI_Descend)(Evt* script, MobileAISettings* aiSettings, EnemyDetec npc->rotation.y -= 360.0; } color = 255.0f - (cosine((s32)npc->rotation.y % 180) * 56.0f); - func_802DE894(npc->spriteInstanceID, FOLD_TYPE_6, color, color, color, 255, 0); + func_802DE894(npc->spriteInstanceID, FOLD_UPD_SET_COLOR, color, color, color, 255, 0); posX = gPlayerStatusPtr->position.x; posY = gPlayerStatusPtr->position.y; @@ -160,7 +160,7 @@ void N(SentinelAI_LosePlayerInit)(Evt* script, MobileAISettings* aiSettings, Ene Npc* npc = get_npc_unsafe(enemy->npcID); enemy->varTable[0] &= ~SENTINEL_AI_FLAG_CHASING; - func_802DE894(npc->spriteInstanceID, FOLD_TYPE_NONE, 0, 0, 0, 0, 0); + func_802DE894(npc->spriteInstanceID, FOLD_UPD_CLEAR, 0, 0, 0, 0, 0); if (enemy->varTable[0] & SENTINEL_AI_FLAG_PLAYING_SOUND) { sfx_stop_sound(SOUND_80000011); enemy->varTable[0] &= ~SENTINEL_AI_FLAG_PLAYING_SOUND; @@ -299,7 +299,7 @@ API_CALLABLE(N(SentinelAI_Main)) { switch (script->AI_TEMP_STATE) { case AI_STATE_SENTINEL_WANDER_INIT: N(FlyingAI_WanderInit)(script, aiSettings, territoryPtr); - func_802DE894(npc->spriteInstanceID, FOLD_TYPE_NONE, 0, 0, 0, 0, 0); + func_802DE894(npc->spriteInstanceID, FOLD_UPD_CLEAR, 0, 0, 0, 0, 0); // fallthrough case AI_STATE_SENTINEL_WANDER: N(FlyingAI_Wander)(script, aiSettings, territoryPtr); diff --git a/src/world/common/entity/Pipe.inc.c b/src/world/common/entity/Pipe.inc.c index d32e4a6b34..d2667f2a3d 100644 --- a/src/world/common/entity/Pipe.inc.c +++ b/src/world/common/entity/Pipe.inc.c @@ -128,8 +128,8 @@ EvtScript N(EVS_Pipe_EnterVertical) = { EVT_CALL(SetPlayerPos, LVar1, LVar2, LVar3) EVT_CALL(InterpPlayerYaw, LVar4, 0) EVT_CALL(PlaySound, SOUND_ENTER_PIPE) - EVT_CALL(func_802D286C, 0x100) - EVT_CALL(func_802D2520, ANIM_Mario1_Still, FOLD_TYPE_5, 2, 1, 1, 0) + EVT_CALL(SetPlayerFoldFlags, FOLD_STATE_FLAG_REVERSE_ANIM) + EVT_CALL(UpdatePlayerFold, ANIM_Mario1_Still, FOLD_UPD_SET_ANIM, FOLD_ANIM_VERTICAL_PIPE_CURL, 1, 1, 0) EVT_CALL(GetPlayerPos, LVar0, LVar1, LVar2) EVT_LOOP(40) EVT_ADD(LVar1, 1) @@ -150,7 +150,7 @@ EvtScript N(EVS_Pipe_EnterVertical) = { EVT_END_THREAD EVT_END_IF EVT_WAIT(2) - EVT_CALL(func_802D2520, ANIM_Mario1_Still, FOLD_TYPE_NONE, 0, 0, 0, 0) + EVT_CALL(UpdatePlayerFold, ANIM_Mario1_Still, FOLD_UPD_CLEAR, 0, 0, 0, 0) EVT_WAIT(1) EVT_CALL(SetPlayerAnimation, ANIM_Mario1_Idle) EVT_CALL(DisablePlayerPhysics, FALSE) @@ -202,8 +202,8 @@ EvtScript N(EVS_Pipe_EnterHorizontal) = { EVT_WAIT(25) EVT_CALL(HidePlayerShadow, FALSE) EVT_END_THREAD - EVT_CALL(func_802D286C, 0x100 | 0x800) - EVT_CALL(func_802D2520, ANIM_Mario1_Idle, FOLD_TYPE_5, 3, 1, 1, 0) + EVT_CALL(SetPlayerFoldFlags, FOLD_STATE_FLAG_REVERSE_ANIM | FOLD_STATE_FLAG_800) + EVT_CALL(UpdatePlayerFold, ANIM_Mario1_Idle, FOLD_UPD_SET_ANIM, FOLD_ANIM_HORIZONTAL_PIPE_CURL, 1, 1, 0) EVT_LOOP(40) EVT_CALL(N(Pipe_GetPointAheadOfPlayer), EVT_FLOAT(1.0)) EVT_CALL(SetPlayerPos, LVar0, LVar1, LVar2) @@ -220,7 +220,7 @@ EvtScript N(EVS_Pipe_EnterHorizontal) = { EVT_END_THREAD EVT_END_IF EVT_WAIT(5) - EVT_CALL(func_802D2520, ANIM_Mario1_Idle, FOLD_TYPE_NONE, 0, 0, 0, 0) + EVT_CALL(UpdatePlayerFold, ANIM_Mario1_Idle, FOLD_UPD_CLEAR, 0, 0, 0, 0) EVT_CALL(ModifyColliderFlags, 1, LVarB, COLLIDER_FLAGS_UPPER_MASK) EVT_CALL(DisablePlayerInput, FALSE) EVT_CALL(DisablePlayerPhysics, FALSE) @@ -278,8 +278,8 @@ EvtScript N(EVS_Pipe_ExitVertical_Impl) = { EVT_WAIT(1) EVT_END_LOOP EVT_END_THREAD - EVT_CALL(func_802D286C, 0x800) - EVT_CALL(func_802D2520, ANIM_Mario1_Idle, FOLD_TYPE_5, 2, 1, 1, 0) + EVT_CALL(SetPlayerFoldFlags, FOLD_STATE_FLAG_800) + EVT_CALL(UpdatePlayerFold, ANIM_Mario1_Idle, FOLD_UPD_SET_ANIM, FOLD_ANIM_VERTICAL_PIPE_CURL, 1, 1, 0) EVT_WAIT(25) EVT_EXEC_WAIT(LVarC) EVT_RETURN @@ -328,8 +328,8 @@ EvtScript N(EVS_Pipe_ExitHorizontal) = { EVT_CALL(GetPlayerPos, LVar0, LVar1, LVar2) EVT_CALL(SetPlayerPos, LVar0, LVar6, LVar7) EVT_CALL(SetPlayerAnimation, ANIM_Mario1_Still) - EVT_CALL(func_802D286C, 0x800) - EVT_CALL(func_802D2520, ANIM_Mario1_Still, FOLD_TYPE_5, 3, 1, 1, 0) + EVT_CALL(SetPlayerFoldFlags, FOLD_STATE_FLAG_800) + EVT_CALL(UpdatePlayerFold, ANIM_Mario1_Still, FOLD_UPD_SET_ANIM, FOLD_ANIM_HORIZONTAL_PIPE_CURL, 1, 1, 0) EVT_THREAD EVT_WAIT(8) EVT_CALL(HidePlayerShadow, TRUE) diff --git a/src/world/dead/area_kzn/kzn_17/kzn_17_3_npc.c b/src/world/dead/area_kzn/kzn_17/kzn_17_3_npc.c index e57f29841b..fb8c126be4 100644 --- a/src/world/dead/area_kzn/kzn_17/kzn_17_3_npc.c +++ b/src/world/dead/area_kzn/kzn_17/kzn_17_3_npc.c @@ -45,7 +45,7 @@ EvtScript N(EVS_Kolorado_TrompImpact) = { EVT_CALL(SetNpcRotationPivot, NPC_Kolorado, 13) EVT_CALL(SetNpcRotation, NPC_Kolorado, 0, 0, 250) EVT_CALL(SetNpcAnimation, NPC_Kolorado, ANIM_Kolorado_HurtStill) - EVT_CALL(func_802CFD30, NPC_Kolorado, FOLD_TYPE_4, EVT_FLOAT(3.0), EVT_FLOAT(3.0), 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_Kolorado, FOLD_UPD_WAVY, EVT_FLOAT(3.0), EVT_FLOAT(3.0), 0, 0) EVT_CALL(PlaySoundAtNpc, NPC_Kolorado, SOUND_HIT_PLAYER_NORMAL, SOUND_SPACE_MODE_0) EVT_THREAD EVT_CALL(SetNpcCollisionSize, NPC_Kolorado, 20, 24) @@ -70,7 +70,7 @@ EvtScript N(EVS_Kolorado_HurtInit) = { EVT_CALL(SetNpcRotationPivot, NPC_Kolorado, 13) EVT_CALL(SetNpcRotation, NPC_Kolorado, 0, 0, 250) EVT_CALL(SetNpcAnimation, NPC_Kolorado, ANIM_Kolorado_HurtStill) - EVT_CALL(func_802CFD30, NPC_Kolorado, FOLD_TYPE_4, EVT_FLOAT(3.0), EVT_FLOAT(3.0), 0, 0) + EVT_CALL(SetNpcFoldParams, NPC_Kolorado, FOLD_UPD_WAVY, EVT_FLOAT(3.0), EVT_FLOAT(3.0), 0, 0) EVT_RETURN EVT_END }; diff --git a/src/world/partner/bow.c b/src/world/partner/bow.c index 9e81f50a8c..3f7850078d 100644 --- a/src/world/partner/bow.c +++ b/src/world/partner/bow.c @@ -281,7 +281,7 @@ API_CALLABLE(N(UseAbility)) { bow->duration--; if (bow->duration == 0) { bow->yaw = playerStatus->targetYaw; - func_8003D624(bow, FOLD_TYPE_7, playerStatus->alpha1, 0, 0, 0, 0); + npc_set_fold_params(bow, FOLD_UPD_SET_ALPHA, playerStatus->alpha1, 0, 0, 0, 0); suggest_player_anim_always_forward(ANIM_Mario1_Crouch); sfx_play_sound_at_npc(SOUND_BOW_VANISH, SOUND_SPACE_MODE_0, NPC_PARTNER); script->USE_STATE = OUTTA_SIGHT_VANISH; @@ -303,7 +303,7 @@ API_CALLABLE(N(UseAbility)) { } get_shadow_by_index(bow->shadowIndex)->alpha = playerStatus->alpha1 >> 1; - func_8003D624(bow, FOLD_TYPE_7, playerStatus->alpha1, 0, 0, 0, 0); + npc_set_fold_params(bow, FOLD_UPD_SET_ALPHA, playerStatus->alpha1, 0, 0, 0, 0); bow->pos.x = playerStatus->position.x - N(OuttaSightPosX); bow->pos.y = playerStatus->position.y - N(OuttaSightPosY); bow->pos.z = playerStatus->position.z - N(OuttaSightPosZ); @@ -367,7 +367,7 @@ void N(end_outta_sight_cleanup)(Npc* bow) { s32 actionState; playerStatus->alpha1 = 255; - func_8003D624(bow, FOLD_TYPE_NONE, 0, 0, 0, 0, 0); + npc_set_fold_params(bow, FOLD_UPD_CLEAR, 0, 0, 0, 0, 0); bow->renderMode = RENDER_MODE_SURFACE_XLU_LAYER1; get_shadow_by_index(bow->shadowIndex)->alpha = playerStatus->alpha1 / 2; diff --git a/src/world/partner/sushie.c b/src/world/partner/sushie.c index e1579aa559..8a20729485 100644 --- a/src/world/partner/sushie.c +++ b/src/world/partner/sushie.c @@ -281,8 +281,8 @@ void N(update_riding_physics)(Npc* sushie) { if (!N(IsUnderwater) && (playerStatus->position.y + (playerStatus->colliderHeight * 0.5f) < N(WaterSurfaceY))) { N(IsUnderwater) = TRUE; playerStatus->renderMode = RENDER_MODE_ALPHATEST; - func_802DDFF8(playerStatus->trueAnimation, 4, 2, 0, 0, 0, 0); - func_8003D624(sushie, FOLD_TYPE_4, 2, 0, 0, 0, 0); + func_802DDFF8(playerStatus->trueAnimation, FOLD_UPD_WAVY, 2, 0, 0, 0, 0); + npc_set_fold_params(sushie, FOLD_UPD_WAVY, 2, 0, 0, 0, 0); } if (N(DiveTime) >= 10) { if (!(partnerStatus->currentButtons & BUTTON_C_DOWN) || N(DiveTime) >= 30) { @@ -316,8 +316,8 @@ void N(update_riding_physics)(Npc* sushie) { if ((N(WaterSurfaceY) - sushie->moveToPos.y) - (sushie->collisionHeight * 0.5f) <= 0.0f) { if (N(IsUnderwater)) { N(IsUnderwater) = FALSE; - func_802DDFF8(ANIM_Mario1_Idle, 0, 0, 0, 0, 0, 0); - func_8003D624(sushie, FOLD_TYPE_NONE, 0, 0, 0, 0, 0); + func_802DDFF8(ANIM_Mario1_Idle, FOLD_UPD_CLEAR, 0, 0, 0, 0, 0); + npc_set_fold_params(sushie, FOLD_UPD_CLEAR, 0, 0, 0, 0, 0); } N(DiveState) = DIVE_STATE_NONE; sushie->currentAnim = ANIM_WorldSushie_Ride; @@ -411,7 +411,7 @@ API_CALLABLE(N(UseAbility)) { suggest_player_anim_always_forward(ANIM_MarioW2_RideSushie); disable_player_shadow(); disable_npc_shadow(sushie); - func_8003D624(sushie, FOLD_TYPE_4, 2, 0, 0, 0, 0); + npc_set_fold_params(sushie, FOLD_UPD_WAVY, 2, 0, 0, 0, 0); sushie->currentAnim = ANIM_WorldSushie_Ride; sushie->moveSpeed = playerStatus->runSpeed; sushie->jumpScale = 0.0f; @@ -487,7 +487,7 @@ API_CALLABLE(N(UseAbility)) { sushie->flags |= NPC_FLAG_8; sushie->flags &= ~(NPC_FLAG_GRAVITY | NPC_FLAG_IGNORE_WORLD_COLLISION); disable_npc_shadow(sushie); - func_8003D624(sushie, FOLD_TYPE_4, 2, 0, 0, 0, 0); + npc_set_fold_params(sushie, FOLD_UPD_WAVY, 2, 0, 0, 0, 0); sushie->currentAnim = ANIM_WorldSushie_Ride; playerStatus->flags |= PS_FLAG_MOVEMENT_LOCKED; dist = dist2D(playerStatus->position.x, playerStatus->position.z, sushie->moveToPos.x, sushie->moveToPos.z); @@ -722,8 +722,8 @@ API_CALLABLE(N(UseAbility)) { gGameStatusPtr->keepUsingPartnerOnMapChange = FALSE; partnerStatus->partnerActionState = PARTNER_ACTION_NONE; partnerStatus->actingPartner = 0; - func_802DDFF8(ANIM_Mario1_Idle, 0, 0, 0, 0, 0, 0); - func_8003D624(sushie, FOLD_TYPE_NONE, 0, 0, 0, 0, 0); + func_802DDFF8(ANIM_Mario1_Idle, FOLD_UPD_CLEAR, 0, 0, 0, 0, 0); + npc_set_fold_params(sushie, FOLD_UPD_CLEAR, 0, 0, 0, 0, 0); return ApiStatus_DONE1; } sushie->duration--; diff --git a/tools/disasm_script.py b/tools/disasm_script.py index aece959b08..4533e68fcb 100755 --- a/tools/disasm_script.py +++ b/tools/disasm_script.py @@ -406,9 +406,9 @@ replace_funcs = { "func_8027D434" :{0:"ActorIDs"}, "SetProjectileTargetOffset" :{0:"ActorIDs"}, "GetInstigatorValue" :{0:"ActorIDs"}, - "func_802CFD30" :{0:"NpcIDs"}, - "func_802CFE2C" :{0:"NpcIDs"}, - "func_802D2520" :{0:"PlayerAnims"}, + "SetNpcFoldParams" :{0:"NpcIDs"}, + "SetNpcFoldFlags" :{0:"NpcIDs"}, + "UpdatePlayerFold" :{0:"PlayerAnims"}, "GetAnimation" :{0:"ActorIDs", 2:"CustomAnim"}, "GetActorFlags" :{0:"ActorIDs", 1:"ActorFlags"}, diff --git a/tools/ignored_funcs.txt b/tools/ignored_funcs.txt index 27b7534911..c2ff5a5bb5 100644 --- a/tools/ignored_funcs.txt +++ b/tools/ignored_funcs.txt @@ -155,7 +155,7 @@ dead_CreatePushBlockGrid = 0x80283420; dead_SetPushBlock = 0x8028364C; dead_GetSelfAnimationFromTable = 0x800497E4; dead_SelfEnemyOverrideSyncPos = 0x80049630; -dead_func_802CFD30 = 0x802DD290; +dead_SetNpcFoldParams = 0x802DD290; dead_SetGroupVisibility = 0x802D6788; dead_GetCamDistance = 0x802D9578; dead_GetCamPitch = 0x802D94E8; @@ -209,8 +209,8 @@ dead_SetSelfVar = 0x8004930C; dead_GetSelfVar = 0x80049370; dead_GetPlayerTargetYaw = 0x802DF348; dead_HidePlayerShadow = 0x802DE3C0; -dead_func_802D286C = 0x802DFEB8; -dead_func_802D2520 = 0x802DFB40; +dead_SetPlayerFoldFlags = 0x802DFEB8; +dead_UpdatePlayerFold = 0x802DFB40; dead_SetPlayerFlagBits = 0x802DF380; dead_func_80044238 = 0x800482D8; dead_SetCamType = 0x802D8FA8; diff --git a/ver/ique/asm/bss3.s b/ver/ique/asm/bss3.s index f37d1ad68e..5bb60f351f 100644 --- a/ver/ique/asm/bss3.s +++ b/ver/ique/asm/bss3.s @@ -579,7 +579,7 @@ dlabel D_80156968 dlabel D_80156970 .space 0x00000010 -dlabel fold_groupDescriptors +dlabel FoldAnimHeaders .space 0x000005a0 dlabel fold_gfxDataCache diff --git a/ver/ique/undefined_syms.txt b/ver/ique/undefined_syms.txt index cc18b34dd4..713fade632 100644 --- a/ver/ique/undefined_syms.txt +++ b/ver/ique/undefined_syms.txt @@ -813,7 +813,7 @@ is_ability_active = 0x800e8128; SetNpcFlagBits = 0x802cf060; SetNpcRotation = 0x802cddb0; -func_802CFD30 = 0x802cfd30; +SetNpcFoldParams = 0x802cfd30; npc_raycast_down_sides = 0x800daf5c; @@ -1036,7 +1036,7 @@ TranslateGroup = 0x802c97b4; SetMotionBlurParams = 0x802d7cf8; ClearAmbientSounds = 0x802d60e8; SetMusicTrack = 0x802d5d4c; -func_802D2520 = 0x802d2520; +UpdatePlayerFold = 0x802d2520; SetPlayerAnimation = 0x802d1084; EnableNpcShadow = 0x802cf268; DisablePlayerPhysics = 0x802d0de4; @@ -1045,7 +1045,7 @@ SetPlayerPos = 0x802d0ef0; InterpPlayerYaw = 0x802d193c; UseSettingsFrom = 0x802cb860; GetCurrentPartnerID = 0x802cfc74; -func_802D286C = 0x802d286c; +SetPlayerFoldFlags = 0x802d286c; EnablePartnerAI = 0x802cf52c; GetPartnerInUse = 0x802d2b0c; InterruptUsePartner = 0x802d2b6c; diff --git a/ver/jp/undefined_syms.txt b/ver/jp/undefined_syms.txt index c85fadb430..a5de2b7a82 100644 --- a/ver/jp/undefined_syms.txt +++ b/ver/jp/undefined_syms.txt @@ -346,7 +346,7 @@ SetNpcAnimation = 0x802CE0F4; SetNpcYaw = 0x802CEA84; SetNpcFlagBits = 0x802CF060; GetNpcPos = 0x802CF0F4; -func_802CFD30 = 0x802CFD30; +SetNpcFoldParams = 0x802CFD30; GetPlayerPos = 0x802D1DFC; PlaySound = 0x802D6150; D_802D9D70 = 0x802D9D70; diff --git a/ver/pal/undefined_syms.txt b/ver/pal/undefined_syms.txt index 03093aacb8..01f5b667ba 100644 --- a/ver/pal/undefined_syms.txt +++ b/ver/pal/undefined_syms.txt @@ -64,7 +64,7 @@ set_npc_yaw = 0x8003B830; npc_set_palswap_mode_A = 0x8003B8C0; npc_set_palswap_1 = 0x8003B93C; npc_set_palswap_2 = 0x8003B954; -func_8003D624 = 0x8003DB14; +npc_set_fold_params = 0x8003DB14; spawn_surface_effects = 0x8003DB50; init_encounter_status = 0x8003E828; kill_enemy = 0x8003EC9C; @@ -1037,8 +1037,8 @@ PutPartnerAway = 0x802D2988; GetCurrentPartnerID = 0x802D2C74; PartnerCanUseAbility = 0x802D2CA0; PartnerIsFlying = 0x802D2CE8; -func_802CFD30 = 0x802D2D30; -func_802CFE2C = 0x802D2E2C; +SetNpcFoldParams = 0x802D2D30; +SetNpcFoldFlags = 0x802D2E2C; SetNpcPaletteSwapMode = 0x802D2E80; SetNpcPaletteSwapLower = 0x802D2EEC; SetNpcPaletteSwapping = 0x802D2FC0; @@ -1089,8 +1089,8 @@ func_802D2484 = 0x802D5484; IsPlayerOnValidFloor = 0x802D549C; WaitForPlayerMoveToComplete = 0x802D54F4; WaitForPlayerInputEnabled = 0x802D5508; -func_802D2520 = 0x802D5520; -func_802D286C = 0x802D586C; +UpdatePlayerFold = 0x802D5520; +SetPlayerFoldFlags = 0x802D586C; FacePlayerTowardPoint = 0x802D5884; DisablePulseStone = 0x802D5AA8; GetPartnerInUse = 0x802D5B0C; diff --git a/ver/us/asm/bss3.s b/ver/us/asm/bss3.s index 5833a5ba45..bc03a6b182 100644 --- a/ver/us/asm/bss3.s +++ b/ver/us/asm/bss3.s @@ -574,7 +574,7 @@ dlabel D_80156968 dlabel D_80156970 .space 0x00000010 -dlabel fold_groupDescriptors +dlabel FoldAnimHeaders .space 0x000005a0 dlabel fold_gfxDataCache diff --git a/ver/us/symbol_addrs.txt b/ver/us/symbol_addrs.txt index 67154d42c8..31fb190b6d 100644 --- a/ver/us/symbol_addrs.txt +++ b/ver/us/symbol_addrs.txt @@ -310,7 +310,7 @@ npc_find_closest_simple = 0x8003D0C4; // type:func rom:0x184C4 npc_find_standing_on_entity = 0x8003D1D4; // type:func rom:0x185D4 npc_get_collider_below = 0x8003D2F8; // type:func rom:0x186F8 func_8003D3BC = 0x8003D3BC; // type:func rom:0x187BC -func_8003D624 = 0x8003D624; // type:func rom:0x18A24 +npc_set_fold_params = 0x8003D624; // type:func rom:0x18A24 spawn_surface_effects = 0x8003D660; // type:func rom:0x18A60 spawn_default_surface_effects = 0x8003D788; // type:func rom:0x18B88 spawn_flower_surface_effects = 0x8003DA38; // type:func rom:0x18E38 @@ -4312,7 +4312,7 @@ func_80138740 = 0x80138740; // type:func rom:0xCEE40 func_80138D88 = 0x80138D88; // type:func rom:0xCF488 func_80138E54 = 0x80138E54; // type:func rom:0xCF554 func_80139F10 = 0x80139F10; // type:func rom:0xD0610 -func_8013A370 = 0x8013A370; // type:func rom:0xD0A70 +fold_set_vtx_buf_capacity = 0x8013A370; // type:func rom:0xD0A70 fold_init = 0x8013A37C; // type:func rom:0xD0A7C func_8013A4D0 = 0x8013A4D0; // type:func rom:0xD0BD0 fold_add_to_gfx_cache = 0x8013A610; // type:func rom:0xD0D10 @@ -4331,17 +4331,17 @@ fold_set_state_flags = 0x8013AF20; // type:func rom:0xD1620 fold_appendGfx_component = 0x8013AF70; // type:func rom:0xD1670 func_8013B0EC = 0x8013B0EC; // type:func rom:0xD17EC func_8013B1B0 = 0x8013B1B0; // type:func rom:0xD18B0 -func_8013BC88 = 0x8013BC88; // type:func rom:0xD2388 -func_8013C048 = 0x8013C048; // type:func rom:0xD2748 -fold_load_gfx = 0x8013C220; // type:func rom:0xD2920 -func_8013C3F0 = 0x8013C3F0; // type:func rom:0xD2AF0 +fold_mesh_make_strip = 0x8013BC88; // type:func rom:0xD2388 +fold_mesh_make_grid = 0x8013C048; // type:func rom:0xD2748 +fold_load_anim = 0x8013C220; // type:func rom:0xD2920 +fold_mesh_anim_update = 0x8013C3F0; // type:func rom:0xD2AF0 func_8013CFA8 = 0x8013CFA8; // type:func rom:0xD36A8 func_8013DAB4 = 0x8013DAB4; // type:func rom:0xD41B4 func_8013E2F0 = 0x8013E2F0; // type:func rom:0xD49F0 func_8013E904 = 0x8013E904; // type:func rom:0xD5004 -func_8013EE48 = 0x8013EE48; // type:func rom:0xD5548 -func_8013EE68 = 0x8013EE68; // type:func rom:0xD5568 -func_8013F1F8 = 0x8013F1F8; // type:func rom:0xD58F8 +fold_wavy_init = 0x8013EE48; // type:func rom:0xD5548 +fold_mesh_wavy_update = 0x8013EE68; // type:func rom:0xD5568 +fold_mesh_load_colors = 0x8013F1F8; // type:func rom:0xD58F8 hud_element_load_script = 0x8013F350; // type:func rom:0xD5A50 hud_element_draw_rect = 0x8013F704; // type:func rom:0xD5E04 hud_element_clear_cache = 0x80141100; // type:func rom:0xD7800 @@ -4628,13 +4628,13 @@ D_8014E9A8 = 0x8014E9A8; // type:data rom:0xE50A8 D_8014EA48 = 0x8014EA48; // type:data rom:0xE5148 fold_currentImage = 0x8014EE10; // type:data rom:0xE5510 fold_vtxCount = 0x8014EE14; // type:data rom:0xE5514 -D_8014EE18 = 0x8014EE18; // type:data rom:0xE5518 +FoldLights = 0x8014EE18; // type:data rom:0xE5518 D_8014EE40 = 0x8014EE40; // type:data rom:0xE5540 D_8014EE50 = 0x8014EE50; // type:data rom:0xE5550 -D_8014EE60 = 0x8014EE60; // type:data rom:0xE5560 +FoldVtxBufferCapacity = 0x8014EE60; // type:data rom:0xE5560 D_8014EE68 = 0x8014EE68; // type:data rom:0xE5568 D_8014EE98 = 0x8014EE98; // type:data rom:0xE5598 -fold_groupOffsets = 0x8014EF64; // type:data rom:0xE5664 +FoldAnimOffsets = 0x8014EF64; // type:data rom:0xE5664 gHudElementAuxCache = 0x8014EFC0; // type:data rom:0xE56C0 gHudElementCacheCapacity = 0x8014EFC4; // type:data rom:0xE56C4 HES_Empty = 0x8014EFC8; // type:data rom:0xE56C8 @@ -5138,7 +5138,7 @@ D_80156958 = 0x80156958; // type:data rom:0xED058 D_80156960 = 0x80156960; // type:data rom:0xED060 D_80156968 = 0x80156968; // type:data rom:0xED068 D_80156970 = 0x80156970; // type:data rom:0xED070 -fold_groupDescriptors = 0x80156980; // type:data rom:0xED080 +FoldAnimHeaders = 0x80156980; // type:data rom:0xED080 evt_find_label = 0x802C8890; // type:func rom:0xED240 evt_skip_if = 0x802C88FC; // type:func rom:0xED2AC evt_skip_else = 0x802C8978; // type:func rom:0xED328 @@ -5368,8 +5368,8 @@ PutPartnerAway = 0x802CF988; // type:func rom:0xF4338 GetCurrentPartnerID = 0x802CFC74; // type:func rom:0xF4624 PartnerCanUseAbility = 0x802CFCA0; // type:func rom:0xF4650 PartnerIsFlying = 0x802CFCE8; // type:func rom:0xF4698 -func_802CFD30 = 0x802CFD30; // type:func rom:0xF46E0 -func_802CFE2C = 0x802CFE2C; // type:func rom:0xF47DC +SetNpcFoldParams = 0x802CFD30; // type:func rom:0xF46E0 +SetNpcFoldFlags = 0x802CFE2C; // type:func rom:0xF47DC SetNpcPaletteSwapMode = 0x802CFE80; // type:func rom:0xF4830 SetNpcPaletteSwapLower = 0x802CFEEC; // type:func rom:0xF489C SetNpcPaletteSwapping = 0x802CFFC0; // type:func rom:0xF4970 @@ -5430,8 +5430,8 @@ func_802D2484 = 0x802D2484; // type:func rom:0xF6E34 IsPlayerOnValidFloor = 0x802D249C; // type:func rom:0xF6E4C WaitForPlayerMoveToComplete = 0x802D24F4; // type:func rom:0xF6EA4 WaitForPlayerInputEnabled = 0x802D2508; // type:func rom:0xF6EB8 -func_802D2520 = 0x802D2520; // type:func rom:0xF6ED0 -func_802D286C = 0x802D286C; // type:func rom:0xF721C +UpdatePlayerFold = 0x802D2520; // type:func rom:0xF6ED0 +SetPlayerFoldFlags = 0x802D286C; // type:func rom:0xF721C FacePlayerTowardPoint = 0x802D2884; // type:func rom:0xF7234 DisablePulseStone = 0x802D2AA8; // type:func rom:0xF7458 GetPartnerInUse = 0x802D2B0C; // type:func rom:0xF74BC @@ -27159,7 +27159,7 @@ D_802DAE54 = 0x802DAE54; // type:data gCurrentPrintContext = 0x802DB260; // D_802DB264 = 0x802DB264; // type:data D_802DB268 = 0x802DB268; // type:data -D_802DB5B0 = 0x802DB5B0; // type:data +PlayerFoldFlags = 0x802DB5B0; // type:data bBattleVirtualEntityList = 0x802DB5C0; // type:data wWorldVirtualEntityList = 0x802DB6C0; // type:data gCurrentVirtualEntityListPtr = 0x802DB7C0; // type:data diff --git a/ver/us/undefined_syms.txt b/ver/us/undefined_syms.txt index 11e777c77a..53e382b289 100644 --- a/ver/us/undefined_syms.txt +++ b/ver/us/undefined_syms.txt @@ -364,7 +364,7 @@ dead_func_802CF56C = func_802CF56C + 0xD560; dead_BringPartnerOut = BringPartnerOut + 0xD560; dead_PutPartnerAway = PutPartnerAway + 0xD560; dead_GetCurrentPartnerID = GetCurrentPartnerID + 0xD560; -dead_func_802CFD30 = func_802CFD30 + 0xD560; +dead_SetNpcFoldParams = SetNpcFoldParams + 0xD560; dead_SetNpcPaletteSwapMode = SetNpcPaletteSwapMode + 0xD560; dead_SetNpcPaletteSwapping = SetNpcPaletteSwapping + 0xD560; dead_PlaySoundAtNpc = PlaySoundAtNpc + 0xD560; @@ -398,8 +398,8 @@ dead_GetPlayerAnimation = GetPlayerAnimation + 0xD620; dead_UseExitHeading = UseExitHeading + 0xD620; dead_IsPlayerOnValidFloor = IsPlayerOnValidFloor + 0xD620; dead_WaitForPlayerInputEnabled = WaitForPlayerInputEnabled + 0xD620; -dead_func_802D2520 = func_802D2520 + 0xD620; -dead_func_802D286C = func_802D286C + 0xD64C; +dead_UpdatePlayerFold = UpdatePlayerFold + 0xD620; +dead_SetPlayerFoldFlags = SetPlayerFoldFlags + 0xD64C; dead_FacePlayerTowardPoint = FacePlayerTowardPoint + 0xD64C; dead_GetPartnerInUse = GetPartnerInUse + 0xD64C; dead_InterruptUsePartner = InterruptUsePartner + 0xD64C;