diff --git a/asm/field_player_avatar.s b/asm/field_player_avatar.s index 0abbf014f..c7b3a0486 100644 --- a/asm/field_player_avatar.s +++ b/asm/field_player_avatar.s @@ -1793,7 +1793,7 @@ InitPlayerAvatar: @ 808BFE0 movs r1, 0x1 orrs r0, r1 strb r0, [r4, 0x2] - bl sub_8154228 + bl CreateWarpArrowSprite strb r0, [r4, 0x1B] adds r0, r4, 0 mov r1, r9 @@ -2080,7 +2080,7 @@ _0808C2A2: movs r1, 0 ldrsh r3, [r7, r1] adds r1, r6, 0 - bl sub_8154298 + bl ShowWarpArrowSprite b _0808C302 .pool _0808C2E8: @@ -2095,7 +2095,7 @@ _0808C2E8: cmp r1, 0x3 ble _0808C2A2 ldrb r0, [r5, 0x1B] - bl objid_set_invisible + bl SetSpriteInvisible _0808C302: add sp, 0x4 pop {r3,r4} diff --git a/data/field_effect_scripts.s b/data/field_effect_scripts.s index c0c74496f..eab655877 100644 --- a/data/field_effect_scripts.s +++ b/data/field_effect_scripts.s @@ -86,15 +86,15 @@ gFieldEffectScript_UseCutOnTree:: @ 82DBAEC field_eff_end gFieldEffectScript_Shadow:: @ 82DBAF2 - field_eff_callnative oei_shadow + field_eff_callnative FldEff_Shadow field_eff_end gFieldEffectScript_TallGrass:: @ 82DBAF8 - field_eff_loadfadedpal_callnative gFieldEffectObjectPaletteInfo1, oei_grass_normal + field_eff_loadfadedpal_callnative gFieldEffectObjectPaletteInfo1, FldEff_TallGrass field_eff_end gFieldEffectScript_Ripple:: @ 82DBB02 - field_eff_loadfadedpal_callnative gFieldEffectObjectPaletteInfo1, oei_ripples + field_eff_loadfadedpal_callnative gFieldEffectObjectPaletteInfo1, FldEff_Ripple field_eff_end gFieldEffectScript_FieldMoveShowMon:: @ 82DBB0C @@ -102,11 +102,11 @@ gFieldEffectScript_FieldMoveShowMon:: @ 82DBB0C field_eff_end gFieldEffectScript_Ash:: @ 82DBB12 - field_eff_loadfadedpal_callnative gFieldEffectObjectPaletteInfo1, oei_ash + field_eff_loadfadedpal_callnative gFieldEffectObjectPaletteInfo1, FldEff_Ash field_eff_end gFieldEffectScript_SurfBlob:: @ 82DBB1C - field_eff_callnative sub_8155534 + field_eff_callnative FldEff_SurfBlob field_eff_end gFieldEffectScript_UseSurf:: @ 82DBB22 @@ -114,7 +114,7 @@ gFieldEffectScript_UseSurf:: @ 82DBB22 field_eff_end gFieldEffectScript_GroundImpactDust:: @ 82DBB28 - field_eff_loadfadedpal_callnative gFieldEffectObjectPaletteInfo0, sub_8155890 + field_eff_loadfadedpal_callnative gFieldEffectObjectPaletteInfo0, FldEff_Dust field_eff_end gFieldEffectScript_Unknown11:: @ 82DBB32 @@ -122,55 +122,55 @@ gFieldEffectScript_Unknown11:: @ 82DBB32 field_eff_end gFieldEffectScript_BikeHopTallGrass:: @ 82DBB38 - field_eff_loadfadedpal_callnative gFieldEffectObjectPaletteInfo1, sub_8154658 + field_eff_loadfadedpal_callnative gFieldEffectObjectPaletteInfo1, FldEff_JumpTallGrass field_eff_end gFieldEffectScript_SandFootprints:: @ 82DBB42 - field_eff_loadfadedpal_callnative gFieldEffectObjectPaletteInfo0, sub_8154B04 + field_eff_loadfadedpal_callnative gFieldEffectObjectPaletteInfo0, FldEff_SandFootprints field_eff_end gFieldEffectScript_BikeHopBigSplash:: @ 82DBB4C - field_eff_loadfadedpal_callnative gFieldEffectObjectPaletteInfo0, oei_water_drop_tall + field_eff_loadfadedpal_callnative gFieldEffectObjectPaletteInfo0, FldEff_JumpBigSplash field_eff_end gFieldEffectScript_Splash:: @ 82DBB56 - field_eff_loadfadedpal_callnative gFieldEffectObjectPaletteInfo0, sub_8154CEC + field_eff_loadfadedpal_callnative gFieldEffectObjectPaletteInfo0, FldEff_Splash field_eff_end gFieldEffectScript_BikeHopSmallSplash:: @ 82DBB60 - field_eff_loadfadedpal_callnative gFieldEffectObjectPaletteInfo0, sub_8154E1C + field_eff_loadfadedpal_callnative gFieldEffectObjectPaletteInfo0, FldEff_JumpSmallSplash field_eff_end gFieldEffectScript_LongGrass:: @ 82DBB6A - field_eff_loadfadedpal_callnative gFieldEffectObjectPaletteInfo1, sub_8154758 + field_eff_loadfadedpal_callnative gFieldEffectObjectPaletteInfo1, FldEff_LongGrass field_eff_end gFieldEffectScript_Unknown18:: @ 82DBB74 - field_eff_loadfadedpal_callnative gFieldEffectObjectPaletteInfo1, sub_81548FC + field_eff_loadfadedpal_callnative gFieldEffectObjectPaletteInfo1, FldEff_JumpLongGrass field_eff_end gFieldEffectScript_Unknown19:: @ 82DBB7E - field_eff_loadfadedpal_callnative gFieldEffectObjectPaletteInfo1, sub_81551F0 + field_eff_loadfadedpal_callnative gFieldEffectObjectPaletteInfo1, FldEff_Unknown19 field_eff_end gFieldEffectScript_Unknown20:: @ 82DBB88 - field_eff_loadfadedpal_callnative gFieldEffectObjectPaletteInfo1, sub_815525C + field_eff_loadfadedpal_callnative gFieldEffectObjectPaletteInfo1, FldEff_Unknown20 field_eff_end gFieldEffectScript_Unknown21:: @ 82DBB92 - field_eff_loadfadedpal_callnative gFieldEffectObjectPaletteInfo0, sub_81552C8 + field_eff_loadfadedpal_callnative gFieldEffectObjectPaletteInfo0, FldEff_Unknown21 field_eff_end gFieldEffectScript_Unknown22:: @ 82DBB9C - field_eff_loadfadedpal_callnative gFieldEffectObjectPaletteInfo0, sub_8155334 + field_eff_loadfadedpal_callnative gFieldEffectObjectPaletteInfo0, FldEff_Unknown22 field_eff_end gFieldEffectScript_BerryTreeGrowthSparkle:: @ 82DBBA6 - field_eff_callnative sub_8155B2C + field_eff_callnative FldEff_BerryTreeGrowthSparkle field_eff_end gFieldEffectScript_DeepSandFootprints:: @ 82DBBAC - field_eff_loadfadedpal_callnative gFieldEffectObjectPaletteInfo0, sub_8154B78 + field_eff_loadfadedpal_callnative gFieldEffectObjectPaletteInfo0, FldEff_DeepSandFootprints field_eff_end gFieldEffectScript_Unknown25:: @ 82DBBB6 @@ -211,11 +211,11 @@ gFieldEffectScript_QuestionMarkIcon:: @ 82DBBEF field_eff_end gFieldEffectScript_FeetInFlowingWater:: @ 82DBBF5 - field_eff_loadfadedpal_callnative gFieldEffectObjectPaletteInfo0, sub_8154EFC + field_eff_loadfadedpal_callnative gFieldEffectObjectPaletteInfo0, FldEff_FeetInFlowingWater field_eff_end gFieldEffectScript_BikeTireTracks:: @ 82DBBFF - field_eff_loadfadedpal_callnative gFieldEffectObjectPaletteInfo0, sub_8154BEC + field_eff_loadfadedpal_callnative gFieldEffectObjectPaletteInfo0, FldEff_BikeTireTracks field_eff_end gFieldEffectScript_SandDisguisePlaceholder:: @ 82DBC09 @@ -235,15 +235,15 @@ gFieldEffectScript_Unknown38:: @ 82DBC1B field_eff_end gFieldEffectScript_Unknown39:: @ 82DBC21 - field_eff_loadfadedpal_callnative gFieldEffectObjectPaletteInfo0, sub_8155900 + field_eff_loadfadedpal_callnative gFieldEffectObjectPaletteInfo0, FldEff_SandPile field_eff_end gFieldEffectScript_ShortGrass:: @ 82DBC2B - field_eff_loadfadedpal_callnative gFieldEffectObjectPaletteInfo1, sub_815496C + field_eff_loadfadedpal_callnative gFieldEffectObjectPaletteInfo1, FldEff_ShortGrass field_eff_end gFieldEffectScript_HotSpringsWater:: @ 82DBC35 - field_eff_loadfadedpal_callnative gFieldEffectObjectPaletteInfo1, sub_81550B4 + field_eff_loadfadedpal_callnative gFieldEffectObjectPaletteInfo1, FldEff_HotSpringsWater field_eff_end gFieldEffectScript_Unknown43:: @ 82DBC3F @@ -288,11 +288,11 @@ gFieldEffectScript_Unknown52:: @ 82DBC86 field_eff_end gFieldEffectScript_Bubbles:: @ 82DBC90 - field_eff_loadfadedpal_callnative gFieldEffectObjectPaletteInfo0, sub_8155A88 + field_eff_loadfadedpal_callnative gFieldEffectObjectPaletteInfo0, FldEff_Bubbles field_eff_end gFieldEffectScript_Unknown54:: @ 82DBC9A - field_eff_loadfadedpal_callnative gFieldEffectObjectPaletteInfo3, sub_8155DDC + field_eff_loadfadedpal_callnative gFieldEffectObjectPaletteInfo3, FldEff_Sparkle field_eff_end gFieldEffectScript_Unknown55:: @ 82DBCA4 diff --git a/include/event_object_movement.h b/include/event_object_movement.h index 80b9f3fc0..ddccfe39b 100644 --- a/include/event_object_movement.h +++ b/include/event_object_movement.h @@ -102,17 +102,17 @@ void sub_80930E0(s16 *, s16 *, s16, s16); void EventObjectClearHeldMovement(struct EventObject *); void EventObjectClearHeldMovementIfActive(struct EventObject *); void TrySpawnEventObjects(s16, s16); -u8 sprite_new(u8, u8, s16, s16, u8, u8); -u8 AddPseudoEventObject(u16, void (*)(struct Sprite *), s16, s16, u8); +u8 sprite_new(u8 graphicsId, u8 a1, s16 x, s16 y, u8 z, u8 direction); +u8 AddPseudoEventObject(u16, void (*)(struct Sprite *), s16 x, s16 y, u8 subpriority); u8 show_sprite(u8, u8, u8); -u8 SpawnSpecialEventObjectParameterized(u8, u8, u8, s16, s16, u8); +u8 SpawnSpecialEventObjectParameterized(u8 graphicsId, u8 movementBehavior, u8 localId, s16 x, s16 y, u8 z); u8 SpawnSpecialEventObject(struct EventObjectTemplate *); void sub_8093038(s16, s16, s16 *, s16 *); void CameraObjectReset1(void); -void EventObjectSetGraphicsId(struct EventObject *, u8); +void EventObjectSetGraphicsId(struct EventObject *, u8 graphicsId); void EventObjectTurn(struct EventObject *, u8); void EventObjectTurnByLocalIdAndMap(u8, u8, u8, u8); -const struct EventObjectGraphicsInfo *GetEventObjectGraphicsInfo(u8); +const struct EventObjectGraphicsInfo *GetEventObjectGraphicsInfo(u8 graphicsId); void npc_by_local_id_and_map_set_field_1_bit_x20(u8, u8, u8, u8); void FreeAndReserveObjectSpritePalettes(void); void sub_808E82C(u8, u8, u8, s16, s16); diff --git a/include/field_effect_helpers.h b/include/field_effect_helpers.h index 547f515eb..9c354159b 100644 --- a/include/field_effect_helpers.h +++ b/include/field_effect_helpers.h @@ -1,7 +1,3 @@ -// -// Created by scott on 9/7/2017. -// - #ifndef GUARD_FIELD_EFFECT_HELPERS_H #define GUARD_FIELD_EFFECT_HELPERS_H @@ -10,29 +6,29 @@ // Exported RAM declarations // Exported ROM declarations -u8 sub_8154228(void); +u8 CreateWarpArrowSprite(void); bool8 sub_8155DA0(struct EventObject *); void sub_8155D78(struct EventObject *); void sub_81555AC(u8, u8); -void ash(s16, s16, u16, s16); +void StartAshFieldEffect(s16, s16, u16, s16); void SetUpReflection(struct EventObject*, struct Sprite*, u8); u32 StartFieldEffectForEventObject(u8, struct EventObject*); -u8 sub_81546C8(u8, u8, u8, s16, s16); +u8 FindTallGrassFieldEffectSpriteId(u8 localId, u8 mapNum, u8 mapGroup, s16 x, s16 y); void sub_8155F80(struct Sprite*); -void oamc_shadow(struct Sprite*); -void unc_grass_normal(struct Sprite*); +void UpdateShadowFieldEffect(struct Sprite*); +void UpdateTallGrassFieldEffect(struct Sprite*); void sub_81561D0(struct Sprite*); -void sub_8155460(struct Sprite*); -void sub_8155658(struct Sprite*); +void UpdateAshFieldEffect(struct Sprite*); +void UpdateSurfBlobFieldEffect(struct Sprite*); void sub_8156194(struct Sprite*); -void sub_8154C60(struct Sprite*); -void sub_8154D90(struct Sprite*); -void unc_grass_tall(struct Sprite*); -void sub_81559BC(struct Sprite*); -void sub_8155C88(struct Sprite*); -void sub_8154A10(struct Sprite*); -void sub_8155158(struct Sprite*); -void sub_8155AEC(struct Sprite*); -void sub_8155E50(struct Sprite*); +void UpdateFootprintsTireTracksFieldEffect(struct Sprite*); +void UpdateSplashFieldEffect(struct Sprite*); +void UpdateLongGrassFieldEffect(struct Sprite*); +void UpdateSandPileFieldEffect(struct Sprite*); +void UpdateDisguiseFieldEffect(struct Sprite*); +void UpdateShortGrassFieldEffect(struct Sprite*); +void UpdateHotSpringsWaterFieldEffect(struct Sprite*); +void UpdateBubblesFieldEffect(struct Sprite*); +void UpdateSparkleFieldEffect(struct Sprite*); #endif //GUARD_FIELD_EFFECT_HELPERS_H diff --git a/include/rom6.h b/include/rom6.h index 96c3b3ca2..8b133e56e 100644 --- a/include/rom6.h +++ b/include/rom6.h @@ -12,7 +12,7 @@ void UpdateFrontierManiac(u16 days); void UpdateFrontierGambler(u16 days); void SetShoalItemFlag(u16 days); -bool8 CheckObjectGraphicsInFrontOfPlayer(u8); +bool8 CheckObjectGraphicsInFrontOfPlayer(u8 graphicsId); u8 oei_task_add(void); #endif //GUARD_ROM6_H diff --git a/src/data/field_event_obj/field_effect_objects.h b/src/data/field_event_obj/field_effect_objects.h index 15fc73343..33fe66fe2 100755 --- a/src/data/field_event_obj/field_effect_objects.h +++ b/src/data/field_event_obj/field_effect_objects.h @@ -32,13 +32,13 @@ const struct SpriteFrameImage gFieldEffectObjectPicTable_ShadowExtraLarge[] = { obj_frame_tiles(gFieldEffectObjectPic_ShadowExtraLarge), }; -const struct SpriteTemplate gFieldEffectObjectTemplate_ShadowSmall = {0xFFFF, 0xFFFF, &gEventObjectBaseOam_8x8, gFieldEffectObjectImageAnimTable_Shadow, gFieldEffectObjectPicTable_ShadowSmall, gDummySpriteAffineAnimTable, oamc_shadow}; +const struct SpriteTemplate gFieldEffectObjectTemplate_ShadowSmall = {0xFFFF, 0xFFFF, &gEventObjectBaseOam_8x8, gFieldEffectObjectImageAnimTable_Shadow, gFieldEffectObjectPicTable_ShadowSmall, gDummySpriteAffineAnimTable, UpdateShadowFieldEffect}; -const struct SpriteTemplate gFieldEffectObjectTemplate_ShadowMedium = {0xFFFF, 0xFFFF, &gEventObjectBaseOam_16x8, gFieldEffectObjectImageAnimTable_Shadow, gFieldEffectObjectPicTable_ShadowMedium, gDummySpriteAffineAnimTable, oamc_shadow}; +const struct SpriteTemplate gFieldEffectObjectTemplate_ShadowMedium = {0xFFFF, 0xFFFF, &gEventObjectBaseOam_16x8, gFieldEffectObjectImageAnimTable_Shadow, gFieldEffectObjectPicTable_ShadowMedium, gDummySpriteAffineAnimTable, UpdateShadowFieldEffect}; -const struct SpriteTemplate gFieldEffectObjectTemplate_ShadowLarge = {0xFFFF, 0xFFFF, &gEventObjectBaseOam_32x8, gFieldEffectObjectImageAnimTable_Shadow, gFieldEffectObjectPicTable_ShadowLarge, gDummySpriteAffineAnimTable, oamc_shadow}; +const struct SpriteTemplate gFieldEffectObjectTemplate_ShadowLarge = {0xFFFF, 0xFFFF, &gEventObjectBaseOam_32x8, gFieldEffectObjectImageAnimTable_Shadow, gFieldEffectObjectPicTable_ShadowLarge, gDummySpriteAffineAnimTable, UpdateShadowFieldEffect}; -const struct SpriteTemplate gFieldEffectObjectTemplate_ShadowExtraLarge = {0xFFFF, 0xFFFF, &gEventObjectBaseOam_64x32, gFieldEffectObjectImageAnimTable_Shadow, gFieldEffectObjectPicTable_ShadowExtraLarge, gDummySpriteAffineAnimTable, oamc_shadow}; +const struct SpriteTemplate gFieldEffectObjectTemplate_ShadowExtraLarge = {0xFFFF, 0xFFFF, &gEventObjectBaseOam_64x32, gFieldEffectObjectImageAnimTable_Shadow, gFieldEffectObjectPicTable_ShadowExtraLarge, gDummySpriteAffineAnimTable, UpdateShadowFieldEffect}; const struct SpriteFrameImage gFieldEffectObjectPicTable_TallGrass[] = { overworld_frame(gFieldEffectObjectPic_TallGrass, 2, 2, 0), @@ -63,7 +63,7 @@ const union AnimCmd *const gFieldEffectObjectImageAnimTable_TallGrass[] = gFieldEffectObjectImageAnim_850CA84, }; -const struct SpriteTemplate gFieldEffectObjectTemplate_TallGrass = {0xFFFF, 0x1005, &gEventObjectBaseOam_16x16, gFieldEffectObjectImageAnimTable_TallGrass, gFieldEffectObjectPicTable_TallGrass, gDummySpriteAffineAnimTable, unc_grass_normal}; +const struct SpriteTemplate gFieldEffectObjectTemplate_TallGrass = {0xFFFF, 0x1005, &gEventObjectBaseOam_16x16, gFieldEffectObjectImageAnimTable_TallGrass, gFieldEffectObjectPicTable_TallGrass, gDummySpriteAffineAnimTable, UpdateTallGrassFieldEffect}; const struct SpriteFrameImage gFieldEffectObjectPicTable_Ripple[] = { overworld_frame(gFieldEffectObjectPic_Ripple, 2, 2, 0), @@ -116,7 +116,7 @@ const union AnimCmd *const gFieldEffectObjectImageAnimTable_Ash[] = gFieldEffectObjectImageAnim_850CB48, }; -const struct SpriteTemplate gFieldEffectObjectTemplate_Ash = {0xFFFF, 0x1005, &gEventObjectBaseOam_16x16, gFieldEffectObjectImageAnimTable_Ash, gFieldEffectObjectPicTable_Ash, gDummySpriteAffineAnimTable, sub_8155460}; +const struct SpriteTemplate gFieldEffectObjectTemplate_Ash = {0xFFFF, 0x1005, &gEventObjectBaseOam_16x16, gFieldEffectObjectImageAnimTable_Ash, gFieldEffectObjectPicTable_Ash, gDummySpriteAffineAnimTable, UpdateAshFieldEffect}; const struct SpriteFrameImage gFieldEffectObjectPicTable_SurfBlob[] = { overworld_frame(gFieldEffectObjectPic_SurfBlob, 4, 4, 0), @@ -156,7 +156,7 @@ const union AnimCmd *const gFieldEffectObjectImageAnimTable_SurfBlob[] = gFieldEffectObjectImageAnim_850CBAC, }; -const struct SpriteTemplate gFieldEffectObjectTemplate_SurfBlob = {0xFFFF, 0xFFFF, &gEventObjectBaseOam_32x32, gFieldEffectObjectImageAnimTable_SurfBlob, gFieldEffectObjectPicTable_SurfBlob, gDummySpriteAffineAnimTable, sub_8155658}; +const struct SpriteTemplate gFieldEffectObjectTemplate_SurfBlob = {0xFFFF, 0xFFFF, &gEventObjectBaseOam_32x32, gFieldEffectObjectImageAnimTable_SurfBlob, gFieldEffectObjectPicTable_SurfBlob, gDummySpriteAffineAnimTable, UpdateSurfBlobFieldEffect}; const struct SpriteFrameImage gFieldEffectObjectPicTable_Arrow[] = { overworld_frame(gFieldEffectObjectPic_Arrow, 2, 2, 0), @@ -289,7 +289,7 @@ const union AnimCmd *const gFieldEffectObjectImageAnimTable_SandFootprints[] = gFieldEffectObjectImageAnim_850CD30, }; -const struct SpriteTemplate gFieldEffectObjectTemplate_SandFootprints = {0xFFFF, 0x1004, &gEventObjectBaseOam_16x16, gFieldEffectObjectImageAnimTable_SandFootprints, gFieldEffectObjectPicTable_SandFootprints, gDummySpriteAffineAnimTable, sub_8154C60}; +const struct SpriteTemplate gFieldEffectObjectTemplate_SandFootprints = {0xFFFF, 0x1004, &gEventObjectBaseOam_16x16, gFieldEffectObjectImageAnimTable_SandFootprints, gFieldEffectObjectPicTable_SandFootprints, gDummySpriteAffineAnimTable, UpdateFootprintsTireTracksFieldEffect}; const struct SpriteFrameImage gFieldEffectObjectPicTable_DeepSandFootprints[] = { overworld_frame(gFieldEffectObjectPic_DeepSandFootprints, 2, 2, 0), @@ -329,7 +329,7 @@ const union AnimCmd *const gFieldEffectObjectImageAnimTable_DeepSandFootprints[] gFieldEffectObjectImageAnim_850CD8C, }; -const struct SpriteTemplate gFieldEffectObjectTemplate_DeepSandFootprints = {0xFFFF, 0x1004, &gEventObjectBaseOam_16x16, gFieldEffectObjectImageAnimTable_DeepSandFootprints, gFieldEffectObjectPicTable_DeepSandFootprints, gDummySpriteAffineAnimTable, sub_8154C60}; +const struct SpriteTemplate gFieldEffectObjectTemplate_DeepSandFootprints = {0xFFFF, 0x1004, &gEventObjectBaseOam_16x16, gFieldEffectObjectImageAnimTable_DeepSandFootprints, gFieldEffectObjectPicTable_DeepSandFootprints, gDummySpriteAffineAnimTable, UpdateFootprintsTireTracksFieldEffect}; const struct SpriteFrameImage gFieldEffectObjectPicTable_BikeTireTracks[] = { overworld_frame(gFieldEffectObjectPic_BikeTireTracks, 2, 2, 0), @@ -399,7 +399,7 @@ const union AnimCmd *const gFieldEffectObjectImageAnimTable_BikeTireTracks[] = gFieldEffectObjectImageAnim_850CE18, }; -const struct SpriteTemplate gFieldEffectObjectTemplate_BikeTireTracks = {0xFFFF, 0x1004, &gEventObjectBaseOam_16x16, gFieldEffectObjectImageAnimTable_BikeTireTracks, gFieldEffectObjectPicTable_BikeTireTracks, gDummySpriteAffineAnimTable, sub_8154C60}; +const struct SpriteTemplate gFieldEffectObjectTemplate_BikeTireTracks = {0xFFFF, 0x1004, &gEventObjectBaseOam_16x16, gFieldEffectObjectImageAnimTable_BikeTireTracks, gFieldEffectObjectPicTable_BikeTireTracks, gDummySpriteAffineAnimTable, UpdateFootprintsTireTracksFieldEffect}; const struct SpriteFrameImage gFieldEffectObjectPicTable_BikeHopBigSplash[] = { overworld_frame(gFieldEffectObjectPic_BikeHopBigSplash, 2, 2, 0), @@ -455,7 +455,7 @@ const union AnimCmd *const gFieldEffectObjectImageAnimTable_Splash[] = gFieldEffectObjectImageAnim_850CEC8, }; -const struct SpriteTemplate gFieldEffectObjectTemplate_Splash = {0xFFFF, 0x1004, &gEventObjectBaseOam_16x8, gFieldEffectObjectImageAnimTable_Splash, gFieldEffectObjectPicTable_Splash, gDummySpriteAffineAnimTable, sub_8154D90}; +const struct SpriteTemplate gFieldEffectObjectTemplate_Splash = {0xFFFF, 0x1004, &gEventObjectBaseOam_16x8, gFieldEffectObjectImageAnimTable_Splash, gFieldEffectObjectPicTable_Splash, gDummySpriteAffineAnimTable, UpdateSplashFieldEffect}; const struct SpriteFrameImage gFieldEffectObjectPicTable_BikeHopSmallSplash[] = { overworld_frame(gFieldEffectObjectPic_BikeHopSmallSplash, 2, 1, 0), @@ -502,7 +502,7 @@ const union AnimCmd *const gFieldEffectObjectImageAnimTable_LongGrass[] = gFieldEffectObjectImageAnim_850CF70, }; -const struct SpriteTemplate gFieldEffectObjectTemplate_LongGrass = {0xFFFF, 0x1005, &gEventObjectBaseOam_16x16, gFieldEffectObjectImageAnimTable_LongGrass, gFieldEffectObjectPicTable_LongGrass, gDummySpriteAffineAnimTable, unc_grass_tall}; +const struct SpriteTemplate gFieldEffectObjectTemplate_LongGrass = {0xFFFF, 0x1005, &gEventObjectBaseOam_16x16, gFieldEffectObjectImageAnimTable_LongGrass, gFieldEffectObjectPicTable_LongGrass, gDummySpriteAffineAnimTable, UpdateLongGrassFieldEffect}; const struct SpriteFrameImage gFieldEffectObjectPicTable_Unknown16[] = { overworld_frame(gFieldEffectObjectPic_Unknown16, 2, 2, 0), @@ -631,7 +631,7 @@ const union AnimCmd *const gFieldEffectObjectImageAnimTable_Unknown29[] = gFieldEffectObjectImageAnim_850D160, }; -const struct SpriteTemplate gFieldEffectObjectTemplate_Unknown29 = {0xFFFF, 0x1004, &gEventObjectBaseOam_16x8, gFieldEffectObjectImageAnimTable_Unknown29, gFieldEffectObjectPicTable_Unknown29, gDummySpriteAffineAnimTable, sub_81559BC}; +const struct SpriteTemplate gFieldEffectObjectTemplate_Unknown29 = {0xFFFF, 0x1004, &gEventObjectBaseOam_16x8, gFieldEffectObjectImageAnimTable_Unknown29, gFieldEffectObjectPicTable_Unknown29, gDummySpriteAffineAnimTable, UpdateSandPileFieldEffect}; const struct SpriteFrameImage gFieldEffectObjectPicTable_Unknown20[] = { overworld_frame(gFieldEffectObjectPic_Unknown20, 2, 2, 0), @@ -769,7 +769,7 @@ const union AnimCmd *const gFieldEffectObjectImageAnimTable_TreeDisguise[] = gFieldEffectObjectImageAnim_850D384, }; -const struct SpriteTemplate gFieldEffectObjectTemplate_TreeDisguise = {0xFFFF, 0xFFFF, &gEventObjectBaseOam_16x32, gFieldEffectObjectImageAnimTable_TreeDisguise, gFieldEffectObjectPicTable_TreeDisguise, gDummySpriteAffineAnimTable, sub_8155C88}; +const struct SpriteTemplate gFieldEffectObjectTemplate_TreeDisguise = {0xFFFF, 0xFFFF, &gEventObjectBaseOam_16x32, gFieldEffectObjectImageAnimTable_TreeDisguise, gFieldEffectObjectPicTable_TreeDisguise, gDummySpriteAffineAnimTable, UpdateDisguiseFieldEffect}; const struct SpriteFrameImage gFieldEffectObjectPicTable_MountainDisguise[] = { overworld_frame(gFieldEffectObjectPic_MountainDisguise, 2, 4, 0), @@ -805,7 +805,7 @@ const union AnimCmd *const gFieldEffectObjectImageAnimTable_MountainDisguise[] = gFieldEffectObjectImageAnim_850D404, }; -const struct SpriteTemplate gFieldEffectObjectTemplate_MountainDisguise = {0xFFFF, 0xFFFF, &gEventObjectBaseOam_16x32, gFieldEffectObjectImageAnimTable_MountainDisguise, gFieldEffectObjectPicTable_MountainDisguise, gDummySpriteAffineAnimTable, sub_8155C88}; +const struct SpriteTemplate gFieldEffectObjectTemplate_MountainDisguise = {0xFFFF, 0xFFFF, &gEventObjectBaseOam_16x32, gFieldEffectObjectImageAnimTable_MountainDisguise, gFieldEffectObjectPicTable_MountainDisguise, gDummySpriteAffineAnimTable, UpdateDisguiseFieldEffect}; const struct SpriteFrameImage gFieldEffectObjectPicTable_SandDisguisePlaceholder[] = { overworld_frame(gFieldEffectObjectPic_SandDisguisePlaceholder, 2, 4, 0), @@ -817,7 +817,7 @@ const struct SpriteFrameImage gFieldEffectObjectPicTable_SandDisguisePlaceholder overworld_frame(gFieldEffectObjectPic_SandDisguisePlaceholder, 2, 4, 6), }; -const struct SpriteTemplate gFieldEffectObjectTemplate_SandDisguisePlaceholder = {0xFFFF, 0xFFFF, &gEventObjectBaseOam_16x32, gFieldEffectObjectImageAnimTable_TreeDisguise, gFieldEffectObjectPicTable_SandDisguisePlaceholder, gDummySpriteAffineAnimTable, sub_8155C88}; +const struct SpriteTemplate gFieldEffectObjectTemplate_SandDisguisePlaceholder = {0xFFFF, 0xFFFF, &gEventObjectBaseOam_16x32, gFieldEffectObjectImageAnimTable_TreeDisguise, gFieldEffectObjectPicTable_SandDisguisePlaceholder, gDummySpriteAffineAnimTable, UpdateDisguiseFieldEffect}; const struct SpriteFrameImage gFieldEffectObjectPicTable_Bird[] = { obj_frame_tiles(gFieldEffectObjectPic_Bird), @@ -853,7 +853,7 @@ const union AnimCmd *const gFieldEffectObjectImageAnimTable_ShortGrass[] = gFieldEffectObjectImageAnim_850D4D0, }; -const struct SpriteTemplate gFieldEffectObjectTemplate_ShortGrass = {0xFFFF, 0x1005, &gEventObjectBaseOam_16x16, gFieldEffectObjectImageAnimTable_ShortGrass, gFieldEffectObjectPicTable_ShortGrass, gDummySpriteAffineAnimTable, sub_8154A10}; +const struct SpriteTemplate gFieldEffectObjectTemplate_ShortGrass = {0xFFFF, 0x1005, &gEventObjectBaseOam_16x16, gFieldEffectObjectImageAnimTable_ShortGrass, gFieldEffectObjectPicTable_ShortGrass, gDummySpriteAffineAnimTable, UpdateShortGrassFieldEffect}; const struct SpriteFrameImage gFieldEffectObjectPicTable_HotSpringsWater[] = { obj_frame_tiles(gFieldEffectObjectPic_HotSpringsWater), @@ -870,7 +870,7 @@ const union AnimCmd *const gFieldEffectObjectImageAnimTable_HotSpringsWater[] = gFieldEffectObjectImageAnim_850D500, }; -const struct SpriteTemplate gFieldEffectObjectTemplate_HotSpringsWater = {0xFFFF, 0x1005, &gEventObjectBaseOam_16x16, gFieldEffectObjectImageAnimTable_HotSpringsWater, gFieldEffectObjectPicTable_HotSpringsWater, gDummySpriteAffineAnimTable, sub_8155158}; +const struct SpriteTemplate gFieldEffectObjectTemplate_HotSpringsWater = {0xFFFF, 0x1005, &gEventObjectBaseOam_16x16, gFieldEffectObjectImageAnimTable_HotSpringsWater, gFieldEffectObjectPicTable_HotSpringsWater, gDummySpriteAffineAnimTable, UpdateHotSpringsWaterFieldEffect}; const struct SpriteFrameImage gFieldEffectObjectPicTable_JumpOutOfAsh[] = { overworld_frame(gFieldEffectObjectPic_JumpOutOfAsh, 2, 2, 0), @@ -953,7 +953,7 @@ const union AnimCmd *const gFieldEffectObjectImageAnimTable_Bubbles[] = gFieldEffectObjectImageAnim_850D624, }; -const struct SpriteTemplate gFieldEffectObjectTemplate_Bubbles = {0xFFFF, 0x1004, &gEventObjectBaseOam_16x32, gFieldEffectObjectImageAnimTable_Bubbles, gFieldEffectObjectPicTable_Bubbles, gDummySpriteAffineAnimTable, sub_8155AEC}; +const struct SpriteTemplate gFieldEffectObjectTemplate_Bubbles = {0xFFFF, 0x1004, &gEventObjectBaseOam_16x32, gFieldEffectObjectImageAnimTable_Bubbles, gFieldEffectObjectPicTable_Bubbles, gDummySpriteAffineAnimTable, UpdateBubblesFieldEffect}; const struct SpriteFrameImage gFieldEffectObjectPicTable_Unknown35[] = { overworld_frame(gFieldEffectObjectPic_Unknown35, 2, 2, 0), @@ -973,7 +973,7 @@ const union AnimCmd *const gFieldEffectObjectImageAnimTable_Unknown35[] = gFieldEffectObjectImageAnim_850D674, }; -const struct SpriteTemplate gFieldEffectObjectTemplate_Unknown35 = {0xFFFF, 0x100F, &gEventObjectBaseOam_16x16, gFieldEffectObjectImageAnimTable_Unknown35, gFieldEffectObjectPicTable_Unknown35, gDummySpriteAffineAnimTable, sub_8155E50}; +const struct SpriteTemplate gFieldEffectObjectTemplate_Unknown35 = {0xFFFF, 0x100F, &gEventObjectBaseOam_16x16, gFieldEffectObjectImageAnimTable_Unknown35, gFieldEffectObjectPicTable_Unknown35, gDummySpriteAffineAnimTable, UpdateSparkleFieldEffect}; const struct SpritePalette gFieldEffectObjectPaletteInfo3 = {gFieldEffectObjectPalette3, 0x100F}; diff --git a/src/event_object_movement.c b/src/event_object_movement.c index 0714cf3b0..a11ee8111 100644 --- a/src/event_object_movement.c +++ b/src/event_object_movement.c @@ -1868,7 +1868,7 @@ static void sub_808E1B8(u8 eventObjectId, s16 x, s16 y) if (eventObject->movementType == 0x0b) { SetPlayerAvatarEventObjectIdAndObjectId(eventObjectId, spriteId); - eventObject->warpArrowSpriteId = sub_8154228(); + eventObject->warpArrowSpriteId = CreateWarpArrowSprite(); } if (subspriteTables != NULL) { @@ -8206,7 +8206,7 @@ void GroundEffect_JumpOnTallGrass(struct EventObject *eventObj, struct Sprite *s gFieldEffectArguments[3] = 2; FieldEffectStart(FLDEFF_JUMP_TALL_GRASS); - spriteId = sub_81546C8( + spriteId = FindTallGrassFieldEffectSpriteId( eventObj->localId, eventObj->mapNum, eventObj->mapGroup, eventObj->currentCoords.x, eventObj->currentCoords.y); if (spriteId == MAX_SPRITES) @@ -8843,14 +8843,14 @@ void sub_8097B78(u8 var1, u8 var2) StartSpriteAnim(&gSprites[spriteId], GetFaceDirectionAnimNum(var2)); } -void sub_8097BB4(u8 var1, u8 var2) +void sub_8097BB4(u8 var1, u8 graphicsId) { int spriteId = sub_8097B2C(var1); if(spriteId != MAX_SPRITES) { struct Sprite *sprite = &gSprites[spriteId]; - const struct EventObjectGraphicsInfo *gfxInfo = GetEventObjectGraphicsInfo(var2); + const struct EventObjectGraphicsInfo *gfxInfo = GetEventObjectGraphicsInfo(graphicsId); u16 tileNum = sprite->oam.tileNum; sprite->oam = *gfxInfo->oam; diff --git a/src/field_effect_helpers.c b/src/field_effect_helpers.c index 304f7a6f9..3534e0a71 100755 --- a/src/field_effect_helpers.c +++ b/src/field_effect_helpers.c @@ -1,28 +1,30 @@ #include "global.h" -#include "sprite.h" -#include "fieldmap.h" -#include "metatile_behavior.h" -#include "sound.h" #include "event_object_movement.h" #include "field_camera.h" -#include "field_weather.h" #include "field_effect.h" #include "field_effect_helpers.h" -#include "constants/songs.h" +#include "field_weather.h" +#include "fieldmap.h" #include "gpu_regs.h" +#include "metatile_behavior.h" +#include "sound.h" +#include "sprite.h" #include "trig.h" +#include "constants/songs.h" -void objc_reflection_maybe(struct Sprite *); -void npc_pal_op(struct EventObject *eventObject, struct Sprite *sprite); -void npc_pal_op_A(struct EventObject *, u8); -void npc_pal_op_B(struct EventObject *, u8); +#define EVENT_OBJ_PAL_TAG_NONE 0x11FF // duplicate of define in event_object_movement.c + +void UpdateObjectReflectionSprite(struct Sprite *); +void LoadObjectReflectionPalette(struct EventObject *eventObject, struct Sprite *sprite); +void LoadObjectHighBridgeReflectionPalette(struct EventObject *, u8); +void LoadObjectRegularReflectionPalette(struct EventObject *, u8); void sub_81561FC(struct Sprite *, u8, u8); -void sub_8154C7C(struct Sprite *); -void sub_8154CA0(struct Sprite *); -void sub_8154FB4(struct Sprite *); -void sub_815547C(struct Sprite *); -void sub_81554AC(struct Sprite *); -void sub_815550C(struct Sprite *); +void FadeFootprintsTireTracks_Step0(struct Sprite *); +void FadeFootprintsTireTracks_Step1(struct Sprite *); +void UpdateFeetInFlowingWaterFieldEffect(struct Sprite *); +void UpdateAshFieldEffect_Step0(struct Sprite *); +void UpdateAshFieldEffect_Step1(struct Sprite *); +void UpdateAshFieldEffect_Step2(struct Sprite *); void sub_81556B0(struct EventObject *, struct Sprite *); void sub_81556E8(struct EventObject *, struct Sprite *); void sub_815577C(struct EventObject *, struct Sprite *, struct Sprite *); @@ -34,7 +36,7 @@ void SetUpReflection(struct EventObject *eventObject, struct Sprite *sprite, boo struct Sprite *reflectionSprite; reflectionSprite = &gSprites[CreateCopySpriteAt(sprite, sprite->pos1.x, sprite->pos1.y, 0x98)]; - reflectionSprite->callback = objc_reflection_maybe; + reflectionSprite->callback = UpdateObjectReflectionSprite; reflectionSprite->oam.priority = 3; reflectionSprite->oam.paletteNum = gReflectionEffectPaletteMap[reflectionSprite->oam.paletteNum]; reflectionSprite->usingSheet = TRUE; @@ -46,18 +48,18 @@ void SetUpReflection(struct EventObject *eventObject, struct Sprite *sprite, boo reflectionSprite->data[0] = sprite->data[0]; reflectionSprite->data[1] = eventObject->localId; reflectionSprite->data[7] = stillReflection; - npc_pal_op(eventObject, reflectionSprite); + LoadObjectReflectionPalette(eventObject, reflectionSprite); if (!stillReflection) reflectionSprite->oam.affineMode = ST_OAM_AFFINE_NORMAL; } -s16 sub_8153F98(struct EventObject *eventObject) +static s16 GetReflectionVerticalOffset(struct EventObject *eventObject) { return GetEventObjectGraphicsInfo(eventObject->graphicsId)->height - 2; } -void npc_pal_op(struct EventObject *eventObject, struct Sprite *sprite) +void LoadObjectReflectionPalette(struct EventObject *eventObject, struct Sprite *sprite) { u8 bridgeType; u16 bridgeReflectionVerticalOffsets[] = { 12, 28, 44 }; @@ -65,20 +67,20 @@ void npc_pal_op(struct EventObject *eventObject, struct Sprite *sprite) if (!GetEventObjectGraphicsInfo(eventObject->graphicsId)->disableReflectionPaletteLoad && ((bridgeType = MetatileBehavior_GetBridgeSth(eventObject->previousMetatileBehavior)) || (bridgeType = MetatileBehavior_GetBridgeSth(eventObject->currentMetatileBehavior)))) { sprite->data[2] = bridgeReflectionVerticalOffsets[bridgeType - 1]; - npc_pal_op_A(eventObject, sprite->oam.paletteNum); + LoadObjectHighBridgeReflectionPalette(eventObject, sprite->oam.paletteNum); } else { - npc_pal_op_B(eventObject, sprite->oam.paletteNum); + LoadObjectRegularReflectionPalette(eventObject, sprite->oam.paletteNum); } } -void npc_pal_op_B(struct EventObject *eventObject, u8 paletteIndex) +void LoadObjectRegularReflectionPalette(struct EventObject *eventObject, u8 paletteIndex) { const struct EventObjectGraphicsInfo *graphicsInfo; graphicsInfo = GetEventObjectGraphicsInfo(eventObject->graphicsId); - if (graphicsInfo->paletteTag2 != 0x11ff) + if (graphicsInfo->paletteTag2 != EVENT_OBJ_PAL_TAG_NONE) { if (graphicsInfo->paletteSlot == 0) { @@ -98,19 +100,19 @@ void npc_pal_op_B(struct EventObject *eventObject, u8 paletteIndex) // When walking on a bridge high above water (Route 120), the reflection is a solid dark blue color. // This is so the sprite blends in with the dark water metatile underneath the bridge. -void npc_pal_op_A(struct EventObject *eventObject, u8 paletteNum) +void LoadObjectHighBridgeReflectionPalette(struct EventObject *eventObject, u8 paletteNum) { const struct EventObjectGraphicsInfo *graphicsInfo; graphicsInfo = GetEventObjectGraphicsInfo(eventObject->graphicsId); - if (graphicsInfo->paletteTag2 != 0x11ff) + if (graphicsInfo->paletteTag2 != EVENT_OBJ_PAL_TAG_NONE) { PatchObjectPalette(graphicsInfo->paletteTag2, paletteNum); UpdateSpritePaletteWithWeather(paletteNum); } } -void objc_reflection_maybe(struct Sprite *reflectionSprite) +void UpdateObjectReflectionSprite(struct Sprite *reflectionSprite) { struct EventObject *eventObject; struct Sprite *mainSprite; @@ -133,7 +135,7 @@ void objc_reflection_maybe(struct Sprite *reflectionSprite) reflectionSprite->invisible = mainSprite->invisible; reflectionSprite->pos1.x = mainSprite->pos1.x; // reflectionSprite->data[2] holds an additional vertical offset, used by the high bridges on Route 120 - reflectionSprite->pos1.y = mainSprite->pos1.y + sub_8153F98(eventObject) + reflectionSprite->data[2]; + reflectionSprite->pos1.y = mainSprite->pos1.y + GetReflectionVerticalOffset(eventObject) + reflectionSprite->data[2]; reflectionSprite->centerToCornerVecX = mainSprite->centerToCornerVecX; reflectionSprite->centerToCornerVecY = mainSprite->centerToCornerVecY; reflectionSprite->pos2.x = mainSprite->pos2.x; @@ -158,7 +160,7 @@ void objc_reflection_maybe(struct Sprite *reflectionSprite) extern const struct SpriteTemplate *const gFieldEffectObjectTemplatePointers[]; -u8 sub_8154228(void) +u8 CreateWarpArrowSprite(void) { u8 spriteId; struct Sprite *sprite; @@ -174,12 +176,12 @@ u8 sub_8154228(void) return spriteId; } -void objid_set_invisible(u8 spriteId) +void SetSpriteInvisible(u8 spriteId) { gSprites[spriteId].invisible = TRUE; } -void sub_8154298(u8 spriteId, u8 direction, s16 x, s16 y) +void ShowWarpArrowSprite(u8 spriteId, u8 direction, s16 x, s16 y) { s16 x2; s16 y2; @@ -213,7 +215,7 @@ const u16 gShadowVerticalOffsets[] = { 16 }; -u32 oei_shadow(void) +u32 FldEff_Shadow(void) { u8 eventObjectId; const struct EventObjectGraphicsInfo *graphicsInfo; @@ -233,7 +235,7 @@ u32 oei_shadow(void) return 0; } -void oamc_shadow(struct Sprite *sprite) +void UpdateShadowFieldEffect(struct Sprite *sprite) { u8 eventObjectId; struct EventObject *eventObject; @@ -262,7 +264,7 @@ void oamc_shadow(struct Sprite *sprite) } } -u32 oei_grass_normal(void) +u32 FldEff_TallGrass(void) { s16 x; s16 y; @@ -292,7 +294,7 @@ u32 oei_grass_normal(void) return 0; } -void unc_grass_normal(struct Sprite *sprite) +void UpdateTallGrassFieldEffect(struct Sprite *sprite) { u8 mapNum; u8 mapGroup; @@ -332,7 +334,7 @@ void unc_grass_normal(struct Sprite *sprite) } } -u32 sub_8154658(void) +u32 FldEff_JumpTallGrass(void) { u8 spriteId; struct Sprite *sprite; @@ -350,7 +352,7 @@ u32 sub_8154658(void) return 0; } -u8 sub_81546C8(u8 localId, u8 mapNum, u8 mapGroup, s16 x, s16 y) +u8 FindTallGrassFieldEffectSpriteId(u8 localId, u8 mapNum, u8 mapGroup, s16 x, s16 y) { struct Sprite *sprite; u8 i; @@ -360,7 +362,7 @@ u8 sub_81546C8(u8 localId, u8 mapNum, u8 mapGroup, s16 x, s16 y) if (gSprites[i].inUse) { sprite = &gSprites[i]; - if (sprite->callback == unc_grass_normal && (x == sprite->data[1] && y == sprite->data[2]) && (localId == (u8)(sprite->data[3] >> 8) && mapNum == (sprite->data[3] & 0xFF) && mapGroup == sprite->data[4])) + if (sprite->callback == UpdateTallGrassFieldEffect && (x == sprite->data[1] && y == sprite->data[2]) && (localId == (u8)(sprite->data[3] >> 8) && mapNum == (sprite->data[3] & 0xFF) && mapGroup == sprite->data[4])) return i; } } @@ -368,7 +370,7 @@ u8 sub_81546C8(u8 localId, u8 mapNum, u8 mapGroup, s16 x, s16 y) return MAX_SPRITES; } -u32 sub_8154758(void) +u32 FldEff_LongGrass(void) { s16 x; s16 y; @@ -398,7 +400,7 @@ u32 sub_8154758(void) return 0; } -void unc_grass_tall(struct Sprite *sprite) +void UpdateLongGrassFieldEffect(struct Sprite *sprite) { u8 mapNum; u8 mapGroup; @@ -435,7 +437,7 @@ void unc_grass_tall(struct Sprite *sprite) } } -u32 sub_81548FC(void) +u32 FldEff_JumpLongGrass(void) { u8 spriteId; struct Sprite *sprite; @@ -453,7 +455,7 @@ u32 sub_81548FC(void) return 0; } -u32 sub_815496C(void) +u32 FldEff_ShortGrass(void) { u8 eventObjectId; struct EventObject *eventObject; @@ -477,7 +479,7 @@ u32 sub_815496C(void) return 0; } -void sub_8154A10(struct Sprite *sprite) +void UpdateShortGrassFieldEffect(struct Sprite *sprite) { u8 eventObjectId; s16 x; @@ -513,7 +515,7 @@ void sub_8154A10(struct Sprite *sprite) } } -u32 sub_8154B04(void) +u32 FldEff_SandFootprints(void) { u8 spriteId; struct Sprite *sprite; @@ -531,7 +533,7 @@ u32 sub_8154B04(void) return 0; } -u32 sub_8154B78(void) +u32 FldEff_DeepSandFootprints(void) { u8 spriteId; struct Sprite *sprite; @@ -549,7 +551,7 @@ u32 sub_8154B78(void) return spriteId; } -u32 sub_8154BEC(void) +u32 FldEff_BikeTireTracks(void) { u8 spriteId; struct Sprite *sprite; @@ -568,16 +570,16 @@ u32 sub_8154BEC(void) } void (*const gFadeFootprintsTireTracksFuncs[])(struct Sprite *) = { - sub_8154C7C, - sub_8154CA0 + FadeFootprintsTireTracks_Step0, + FadeFootprintsTireTracks_Step1 }; -void sub_8154C60(struct Sprite *sprite) +void UpdateFootprintsTireTracksFieldEffect(struct Sprite *sprite) { gFadeFootprintsTireTracksFuncs[sprite->data[0]](sprite); } -void sub_8154C7C(struct Sprite *sprite) +void FadeFootprintsTireTracks_Step0(struct Sprite *sprite) { // Wait 40 frames before the flickering starts. if (++sprite->data[1] > 40) @@ -586,7 +588,7 @@ void sub_8154C7C(struct Sprite *sprite) UpdateEventObjectSpriteVisibility(sprite, FALSE); } -void sub_8154CA0(struct Sprite *sprite) +void FadeFootprintsTireTracks_Step1(struct Sprite *sprite) { sprite->invisible ^= 1; sprite->data[1]++; @@ -597,7 +599,7 @@ void sub_8154CA0(struct Sprite *sprite) } } -u32 sub_8154CEC(void) +u32 FldEff_Splash(void) { u8 eventObjectId; struct EventObject *eventObject; @@ -625,7 +627,7 @@ u32 sub_8154CEC(void) return 0; } -void sub_8154D90(struct Sprite *sprite) +void UpdateSplashFieldEffect(struct Sprite *sprite) { u8 eventObjectId; @@ -641,7 +643,7 @@ void sub_8154D90(struct Sprite *sprite) } } -u32 sub_8154E1C(void) +u32 FldEff_JumpSmallSplash(void) { u8 spriteId; struct Sprite *sprite; @@ -659,7 +661,7 @@ u32 sub_8154E1C(void) return 0; } -u32 oei_water_drop_tall(void) +u32 FldEff_JumpBigSplash(void) { u8 spriteId; struct Sprite *sprite; @@ -677,7 +679,7 @@ u32 oei_water_drop_tall(void) return 0; } -u32 sub_8154EFC(void) +u32 FldEff_FeetInFlowingWater(void) { u8 eventObjectId; struct EventObject *eventObject; @@ -692,7 +694,7 @@ u32 sub_8154EFC(void) { graphicsInfo = GetEventObjectGraphicsInfo(eventObject->graphicsId); sprite = &gSprites[spriteId]; - sprite->callback = sub_8154FB4; + sprite->callback = UpdateFeetInFlowingWaterFieldEffect; sprite->coordOffsetEnabled = TRUE; sprite->oam.priority = gSprites[eventObject->spriteId].oam.priority; sprite->data[0] = gFieldEffectArguments[0]; @@ -706,7 +708,7 @@ u32 sub_8154EFC(void) return 0; } -void sub_8154FB4(struct Sprite *sprite) +void UpdateFeetInFlowingWaterFieldEffect(struct Sprite *sprite) { u8 eventObjectId; struct Sprite *linkedSprite; @@ -736,7 +738,7 @@ void sub_8154FB4(struct Sprite *sprite) } } -u32 oei_ripples(void) +u32 FldEff_Ripple(void) { u8 spriteId; struct Sprite *sprite; @@ -752,7 +754,7 @@ u32 oei_ripples(void) return 0; } -u32 sub_81550B4(void) +u32 FldEff_HotSpringsWater(void) { u8 eventObjectId; struct EventObject *eventObject; @@ -776,7 +778,7 @@ u32 sub_81550B4(void) return 0; } -void sub_8155158(struct Sprite *sprite) +void UpdateHotSpringsWaterFieldEffect(struct Sprite *sprite) { u8 eventObjectId; const struct EventObjectGraphicsInfo *graphicsInfo; @@ -797,7 +799,7 @@ void sub_8155158(struct Sprite *sprite) } } -u32 sub_81551F0(void) +u32 FldEff_Unknown19(void) { u8 spriteId; struct Sprite *sprite; @@ -814,7 +816,7 @@ u32 sub_81551F0(void) return 0; } -u32 sub_815525C(void) +u32 FldEff_Unknown20(void) { u8 spriteId; struct Sprite *sprite; @@ -831,7 +833,7 @@ u32 sub_815525C(void) return 0; } -u32 sub_81552C8(void) +u32 FldEff_Unknown21(void) { u8 spriteId; struct Sprite *sprite; @@ -848,7 +850,7 @@ u32 sub_81552C8(void) return 0; } -u32 sub_8155334(void) +u32 FldEff_Unknown22(void) { u8 spriteId; struct Sprite *sprite; @@ -865,7 +867,7 @@ u32 sub_8155334(void) return 0; } -void ash(s16 x, s16 y, u16 c, s16 d) +void StartAshFieldEffect(s16 x, s16 y, u16 c, s16 d) { gFieldEffectArguments[0] = x; gFieldEffectArguments[1] = y; @@ -876,7 +878,7 @@ void ash(s16 x, s16 y, u16 c, s16 d) FieldEffectStart(FLDEFF_ASH); } -u32 oei_ash(void) +u32 FldEff_Ash(void) { s16 x; s16 y; @@ -901,17 +903,17 @@ u32 oei_ash(void) } void (*const gAshFieldEffectFuncs[])(struct Sprite *) = { - sub_815547C, - sub_81554AC, - sub_815550C + UpdateAshFieldEffect_Step0, + UpdateAshFieldEffect_Step1, + UpdateAshFieldEffect_Step2 }; -void sub_8155460(struct Sprite *sprite) +void UpdateAshFieldEffect(struct Sprite *sprite) { gAshFieldEffectFuncs[sprite->data[0]](sprite); } -void sub_815547C(struct Sprite *sprite) +void UpdateAshFieldEffect_Step0(struct Sprite *sprite) { sprite->invisible = TRUE; sprite->animPaused = TRUE; @@ -919,7 +921,7 @@ void sub_815547C(struct Sprite *sprite) sprite->data[0] = 1; } -void sub_81554AC(struct Sprite *sprite) +void UpdateAshFieldEffect_Step1(struct Sprite *sprite) { sprite->invisible = FALSE; sprite->animPaused = FALSE; @@ -929,14 +931,14 @@ void sub_81554AC(struct Sprite *sprite) sprite->data[0] = 2; } -void sub_815550C(struct Sprite *sprite) +void UpdateAshFieldEffect_Step2(struct Sprite *sprite) { UpdateEventObjectSpriteVisibility(sprite, FALSE); if (sprite->animEnded) FieldEffectStop(sprite, FLDEFF_ASH); } -u32 sub_8155534(void) +u32 FldEff_SurfBlob(void) { u8 spriteId; struct Sprite *sprite; @@ -988,7 +990,7 @@ u8 sub_815564C(struct Sprite *sprite) return (sprite->data[0] & 0xF00) >> 8; } -void sub_8155658(struct Sprite *sprite) +void UpdateSurfBlobFieldEffect(struct Sprite *sprite) { struct EventObject *eventObject; struct Sprite *linkedSprite; @@ -1179,7 +1181,7 @@ void sub_8155850(struct Sprite *sprite) } } -u32 sub_8155890(void) +u32 FldEff_Dust(void) { u8 spriteId; struct Sprite *sprite; @@ -1197,7 +1199,7 @@ u32 sub_8155890(void) return 0; } -u32 sub_8155900(void) +u32 FldEff_SandPile(void) { u8 eventObjectId; struct EventObject *eventObject; @@ -1225,7 +1227,7 @@ u32 sub_8155900(void) return 0; } -void sub_81559BC(struct Sprite *sprite) +void UpdateSandPileFieldEffect(struct Sprite *sprite) { u8 eventObjectId; s16 x; @@ -1255,7 +1257,7 @@ void sub_81559BC(struct Sprite *sprite) } } -u32 sub_8155A88(void) +u32 FldEff_Bubbles(void) { u8 spriteId; struct Sprite *sprite; @@ -1271,7 +1273,7 @@ u32 sub_8155A88(void) return 0; } -void sub_8155AEC(struct Sprite *sprite) +void UpdateBubblesFieldEffect(struct Sprite *sprite) { sprite->data[0] += 0x80; sprite->data[0] &= 0x100; @@ -1283,7 +1285,7 @@ void sub_8155AEC(struct Sprite *sprite) } } -u32 sub_8155B2C(void) +u32 FldEff_BerryTreeGrowthSparkle(void) { u8 spriteId; struct Sprite *sprite; @@ -1342,7 +1344,7 @@ u32 ShowDisguiseFieldEffect(u8 fldEff, u8 templateIdx, u8 paletteNum) return spriteId; } -void sub_8155C88(struct Sprite *sprite) +void UpdateDisguiseFieldEffect(struct Sprite *sprite) { u8 eventObjectId; const struct EventObjectGraphicsInfo *graphicsInfo; @@ -1404,7 +1406,7 @@ bool8 sub_8155DA0(struct EventObject *eventObject) return FALSE; } -u32 sub_8155DDC(void) +u32 FldEff_Sparkle(void) { u8 spriteId; @@ -1420,7 +1422,7 @@ u32 sub_8155DDC(void) return 0; } -void sub_8155E50(struct Sprite *sprite) +void UpdateSparkleFieldEffect(struct Sprite *sprite) { if (sprite->data[0] == 0) { diff --git a/src/field_tasks.c b/src/field_tasks.c index fc57585e5..5fb23f536 100644 --- a/src/field_tasks.c +++ b/src/field_tasks.c @@ -627,11 +627,11 @@ static void PerStepCallback_8069F64(u8 taskId) { if (MapGridGetMetatileIdAt(x, y) == 0x20a) { - ash(x, y, 0x212, 4); + StartAshFieldEffect(x, y, 0x212, 4); } else { - ash(x, y, 0x206, 4); + StartAshFieldEffect(x, y, 0x206, 4); } if (CheckBagHasItem(ITEM_SOOT_SACK, 1)) { diff --git a/src/fldeff_cut.c b/src/fldeff_cut.c index 9de954e80..5a9181789 100644 --- a/src/fldeff_cut.c +++ b/src/fldeff_cut.c @@ -1,26 +1,25 @@ #include "global.h" -#include "fldeff_cut.h" +#include "event_obj_lock.h" +#include "event_object_movement.h" #include "field_camera.h" #include "field_effect.h" -#include "event_object_movement.h" #include "field_player_avatar.h" #include "fieldmap.h" -#include "event_obj_lock.h" +#include "fldeff_cut.h" +#include "malloc.h" #include "metatile_behavior.h" -#include "party_menu.h" #include "overworld.h" +#include "party_menu.h" +#include "rom6.h" #include "script.h" #include "sound.h" #include "sprite.h" #include "task.h" #include "trig.h" -#include "malloc.h" +#include "constants/abilities.h" #include "constants/event_objects.h" #include "constants/songs.h" -#include "constants/abilities.h" -extern bool8 CheckObjectGraphicsInFrontOfPlayer(u8); -extern u8 oei_task_add(void); extern void ScriptUnfreezeEventObjects(void); extern bool8 IsMewPlayingHideAndSeek(void);