summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorPikalaxALT <PikalaxALT@users.noreply.github.com>2020-03-16 07:51:08 -0400
committerGitHub <noreply@github.com>2020-03-16 07:51:08 -0400
commitf44f89a463d7280a95094e8f37a56873a90da843 (patch)
tree194662b15b39fb223bd20b17ea696ff525ebab0d /include
parent4a7c1d888a9f90b9102f469aab12beeab89ffff6 (diff)
parente1f7efb8e67fb5587a8baf20f421c20e134e8b24 (diff)
Merge pull request #300 from ultima-soul/event_object_movement
Decompile/port event_object_movement
Diffstat (limited to 'include')
-rw-r--r--include/constants/event_objects.h38
-rw-r--r--include/constants/field_effects.h2
-rw-r--r--include/constants/global.h1
-rw-r--r--include/constants/metatile_behaviors.h8
-rw-r--r--include/event_object_movement.h133
-rw-r--r--include/field_camera.h3
-rw-r--r--include/field_control_avatar.h1
-rw-r--r--include/field_effect_helpers.h9
-rw-r--r--include/field_ground_effect.h24
-rw-r--r--include/field_player_avatar.h4
-rw-r--r--include/fieldmap.h2
-rw-r--r--include/global.fieldmap.h37
-rw-r--r--include/metatile_behavior.h22
-rw-r--r--include/overworld.h5
-rw-r--r--include/quest_log.h2
-rw-r--r--include/sprite.h3
16 files changed, 181 insertions, 113 deletions
diff --git a/include/constants/event_objects.h b/include/constants/event_objects.h
index c3862a7b1..2d51cd74d 100644
--- a/include/constants/event_objects.h
+++ b/include/constants/event_objects.h
@@ -154,22 +154,28 @@
#define OBJ_EVENT_GFX_DEOXYS_N 150
#define OBJ_EVENT_GFX_SS_ANNE 151
-#define OBJ_EVENT_GFX_VAR_0 240
-#define OBJ_EVENT_GFX_VAR_1 241
-#define OBJ_EVENT_GFX_VAR_2 242
-#define OBJ_EVENT_GFX_VAR_3 243
-#define OBJ_EVENT_GFX_VAR_4 244
-#define OBJ_EVENT_GFX_VAR_5 245
-#define OBJ_EVENT_GFX_VAR_6 246
-#define OBJ_EVENT_GFX_VAR_7 247
-#define OBJ_EVENT_GFX_VAR_8 248
-#define OBJ_EVENT_GFX_VAR_9 249
-#define OBJ_EVENT_GFX_VAR_A 250
-#define OBJ_EVENT_GFX_VAR_B 251
-#define OBJ_EVENT_GFX_VAR_C 252
-#define OBJ_EVENT_GFX_VAR_D 253
-#define OBJ_EVENT_GFX_VAR_E 254
-#define OBJ_EVENT_GFX_VAR_F 255
+#define NUM_OBJ_EVENT_GFX 239
+
+// These are dynamic object gfx ids.
+// They correspond with the values of the VAR_OBJ_GFX_ID_X vars.
+// More info about them in include/constants/vars.h
+#define OBJ_EVENT_GFX_VARS (NUM_OBJ_EVENT_GFX + 1)
+#define OBJ_EVENT_GFX_VAR_0 (OBJ_EVENT_GFX_VARS + 0x0) // 240
+#define OBJ_EVENT_GFX_VAR_1 (OBJ_EVENT_GFX_VARS + 0x1)
+#define OBJ_EVENT_GFX_VAR_2 (OBJ_EVENT_GFX_VARS + 0x2)
+#define OBJ_EVENT_GFX_VAR_3 (OBJ_EVENT_GFX_VARS + 0x3)
+#define OBJ_EVENT_GFX_VAR_4 (OBJ_EVENT_GFX_VARS + 0x4)
+#define OBJ_EVENT_GFX_VAR_5 (OBJ_EVENT_GFX_VARS + 0x5)
+#define OBJ_EVENT_GFX_VAR_6 (OBJ_EVENT_GFX_VARS + 0x6)
+#define OBJ_EVENT_GFX_VAR_7 (OBJ_EVENT_GFX_VARS + 0x7)
+#define OBJ_EVENT_GFX_VAR_8 (OBJ_EVENT_GFX_VARS + 0x8)
+#define OBJ_EVENT_GFX_VAR_9 (OBJ_EVENT_GFX_VARS + 0x9)
+#define OBJ_EVENT_GFX_VAR_A (OBJ_EVENT_GFX_VARS + 0xA)
+#define OBJ_EVENT_GFX_VAR_B (OBJ_EVENT_GFX_VARS + 0xB)
+#define OBJ_EVENT_GFX_VAR_C (OBJ_EVENT_GFX_VARS + 0xC)
+#define OBJ_EVENT_GFX_VAR_D (OBJ_EVENT_GFX_VARS + 0xD)
+#define OBJ_EVENT_GFX_VAR_E (OBJ_EVENT_GFX_VARS + 0xE)
+#define OBJ_EVENT_GFX_VAR_F (OBJ_EVENT_GFX_VARS + 0xF) // 255
#define SHADOW_SIZE_S 0
#define SHADOW_SIZE_M 1
diff --git a/include/constants/field_effects.h b/include/constants/field_effects.h
index 5aa885b37..a4ecd3e21 100644
--- a/include/constants/field_effects.h
+++ b/include/constants/field_effects.h
@@ -1,6 +1,6 @@
#ifndef GUARD_CONSTANTS_FIELD_EFFECTS_H
#define GUARD_CONSTANTS_FIELD_EFFECTS_H
-
+
#define FLDEFF_EXCLAMATION_MARK_ICON 0
#define FLDEFF_USE_CUT_ON_GRASS 1
#define FLDEFF_USE_CUT_ON_TREE 2
diff --git a/include/constants/global.h b/include/constants/global.h
index ae9a0da3b..28fe660e3 100644
--- a/include/constants/global.h
+++ b/include/constants/global.h
@@ -31,6 +31,7 @@
#define BAG_POKEBALLS_COUNT 13
#define BAG_TMHM_COUNT 58
#define BAG_BERRIES_COUNT 43
+#define OBJECT_EVENT_TEMPLATES_COUNT 64
#define QUEST_LOG_SCENE_COUNT 4
diff --git a/include/constants/metatile_behaviors.h b/include/constants/metatile_behaviors.h
index 0ceeda33f..da979084a 100644
--- a/include/constants/metatile_behaviors.h
+++ b/include/constants/metatile_behaviors.h
@@ -13,21 +13,21 @@
#define MB_SEMI_DEEP_WATER 0x11
#define MB_DEEP_WATER 0x12
#define MB_WATERFALL 0x13
-#define MB_SPLASHING_WATER 0x15
+#define MB_OCEAN_WATER 0x15
#define MB_PUDDLE 0x16
-#define MB_WATERFALL_BOTTOM 0x17
+#define MB_SHALLOW_WATER 0x17
#define MB_19 0x19
#define MB_1A 0x1A
#define MB_1B 0x1B
#define MB_STRENGTH_BUTTON 0x20
-#define MB_21 0x21
+#define MB_SAND 0x21
#define MB_22 0x22
#define MB_ICE 0x23
#define MB_THIN_ICE 0x26
#define MB_CRACKED_ICE 0x27
#define MB_HOT_SPRINGS 0x28
#define MB_ROCK_STAIRS 0x2A
-#define MB_SAND 0x2B
+#define MB_SAND_CAVE 0x2B
#define MB_IMPASSABLE_EAST 0x30
#define MB_IMPASSABLE_WEST 0x31
#define MB_IMPASSABLE_NORTH 0x32
diff --git a/include/event_object_movement.h b/include/event_object_movement.h
index 5c65db228..ac102d9a9 100644
--- a/include/event_object_movement.h
+++ b/include/event_object_movement.h
@@ -3,12 +3,10 @@
#include "global.h"
-#define NUM_OBJECT_GRAPHICS_INFO 239
-#define SPRITE_VAR 240
-
// Exported struct declarations
-enum SpinnerRunnerFollowPatterns {
+enum SpinnerRunnerFollowPatterns
+{
RUNFOLLOW_ANY,
RUNFOLLOW_NORTH_SOUTH,
RUNFOLLOW_EAST_WEST,
@@ -22,6 +20,39 @@ enum SpinnerRunnerFollowPatterns {
RUNFOLLOW_SOUTH_EAST_WEST
};
+struct UnkStruct_083A3698
+{
+ const union AnimCmd *const *anims;
+ u8 animPos[4];
+};
+
+#define GROUND_EFFECT_FLAG_TALL_GRASS_ON_SPAWN (1 << 0)
+#define GROUND_EFFECT_FLAG_TALL_GRASS_ON_MOVE (1 << 1)
+#define GROUND_EFFECT_FLAG_LONG_GRASS_ON_SPAWN (1 << 2)
+#define GROUND_EFFECT_FLAG_LONG_GRASS_ON_MOVE (1 << 3)
+#define GROUND_EFFECT_FLAG_ICE_REFLECTION (1 << 4)
+#define GROUND_EFFECT_FLAG_REFLECTION (1 << 5)
+#define GROUND_EFFECT_FLAG_SHALLOW_FLOWING_WATER (1 << 6)
+#define GROUND_EFFECT_FLAG_SAND (1 << 7)
+#define GROUND_EFFECT_FLAG_DEEP_SAND (1 << 8)
+#define GROUND_EFFECT_FLAG_RIPPLES (1 << 9)
+#define GROUND_EFFECT_FLAG_PUDDLE (1 << 10)
+#define GROUND_EFFECT_FLAG_SAND_PILE (1 << 11)
+#define GROUND_EFFECT_FLAG_LAND_IN_TALL_GRASS (1 << 12)
+#define GROUND_EFFECT_FLAG_LAND_IN_LONG_GRASS (1 << 13)
+#define GROUND_EFFECT_FLAG_LAND_IN_SHALLOW_WATER (1 << 14)
+#define GROUND_EFFECT_FLAG_LAND_IN_DEEP_WATER (1 << 15)
+#define GROUND_EFFECT_FLAG_LAND_ON_NORMAL_GROUND (1 << 16)
+#define GROUND_EFFECT_FLAG_SHORT_GRASS (1 << 17)
+#define GROUND_EFFECT_FLAG_HOT_SPRINGS (1 << 18)
+#define GROUND_EFFECT_FLAG_SEAWEED (1 << 19)
+
+struct PairedPalettes
+{
+ u16 tag;
+ const u16 *data;
+};
+
// Exported RAM declarations
// Exported ROM declarations
@@ -30,83 +61,91 @@ void sub_808D438(void);
u8 GetObjectEventIdByLocalIdAndMap(u8, u8, u8);
bool8 TryGetObjectEventIdByLocalIdAndMap(u8, u8, u8, u8 *);
u8 GetObjectEventIdByXY(s16, s16);
-void ObjectEventSetDirection(struct ObjectEvent *, u8);
+void SetObjectEventDirection(struct ObjectEvent *, u8);
u8 sub_808D4F4(void);
void RemoveObjectEventByLocalIdAndMap(u8, u8, u8);
void LoadPlayerObjectReflectionPalette(u16, u8);
void LoadSpecialObjectReflectionPalette(u16, u8);
-void sub_805F7C4(u8, u8, u8, s16, s16);
+void TryMoveObjectEventToMapCoords(u8, u8, u8, s16, s16);
void PatchObjectPalette(u16, u8);
void sub_808E16C(s16, s16);
void sub_808F28C(u8 localId, u8 mapNum, u8 mapGroup, u8 decorCat);
-void sub_8092FF0(s16, s16, s16 *, s16 *);
-u8 ObjectEventDirectionToImageAnimId(u8);
+void sub_8063AD4(s16, s16, s16 *, s16 *);
+u8 GetFaceDirectionAnimNum(u8);
void sub_8063BC4(s16 *, s16 *, s16, s16);
-void ObjectEventClearAnim(struct ObjectEvent *);
-void ObjectEventClearAnimIfSpecialAnimActive(struct ObjectEvent *);
+void ObjectEventClearHeldMovement(struct ObjectEvent *);
+void ObjectEventClearHeldMovementIfActive(struct ObjectEvent *);
void SpawnObjectEventsInView(s16, s16);
u8 sprite_new(u8, u8, s16, s16, u8, u8);
u8 AddPseudoObjectEvent(u16, SpriteCallback, s16, s16, u8);
u8 TrySpawnObjectEvent(u8 localId, u8 mapNum, u8 mapGroup);
int SpawnSpecialObjectEventParameterized(u8, u8, u8, s16, s16, u8);
u8 SpawnSpecialObjectEvent(struct ObjectEventTemplate *);
-void sub_8093038(s16, s16, s16 *, s16 *);
void CameraObjectReset1(void);
void CameraObjectReset2(void);
void ObjectEventSetGraphicsId(struct ObjectEvent *, u8);
void ObjectEventTurn(struct ObjectEvent *, u8);
void ObjectEventTurnByLocalIdAndMap(u8, u8, u8, u8);
-void ObjectEventForceSetSpecialAnim(struct ObjectEvent *, u8);
-u8 sub_8064270(u8 a0);
+void ObjectEventForceSetHeldMovement(struct ObjectEvent *, u8);
const struct ObjectEventGraphicsInfo *GetObjectEventGraphicsInfo(u8);
void npc_by_local_id_and_map_set_field_1_bit_x20(u8, u8, u8, u8);
-void gpu_pal_allocator_reset__manage_upper_four(void);
+void FreeAndReserveObjectSpritePalettes(void);
void sub_808E82C(u8, u8, u8, s16, s16);
void sub_805F400(u8, u8, u8);
void sub_805F3A8(u8, u8, u8, u8);
void sub_808E75C(s16, s16);
-void ObjectEventGetLocalIdAndMap(struct ObjectEvent * objectEvent, u8 *localId, u8 *mapNum, u8 *mapGroup);
-void npc_coords_shift(struct ObjectEvent *, s16, s16);
+void ObjectEventGetLocalIdAndMap(struct ObjectEvent *objectEvent, void *localId, void *mapNum, void *mapGroup);
+void ShiftObjectEventCoords(struct ObjectEvent *, s16, s16);
void sub_808EB08(struct ObjectEvent *, s16, s16);
-void sub_805FE94(u8, u8, u8);
-void ObjectEventStep(struct ObjectEvent *, struct Sprite *, bool8(struct ObjectEvent *, struct Sprite *));
+void TryOverrideObjectEventTemplateCoords(u8, u8, u8);
+void UpdateObjectEventCurrentMovement(struct ObjectEvent *, struct Sprite *, bool8(struct ObjectEvent *, struct Sprite *));
u8 ObjectEventFaceOppositeDirection(struct ObjectEvent *, u8);
u8 GetOppositeDirection(u8);
-u8 GetStepInPlaceDelay4AnimId(u32);
+u8 GetWalkInPlaceFastMovementAction(u32);
u8 GetStepInPlaceDelay8AnimId(u32);
-u8 GetStepInPlaceDelay16AnimId(u32);
+u8 GetWalkInPlaceNormalMovementAction(u32);
+u8 GetWalkInPlaceSlowMovementAction(u32);
u8 GetStepInPlaceDelay32AnimId(u32);
u8 GetCollisionAtCoords(struct ObjectEvent *, s16, s16, u32);
void MoveCoords(u8, s16 *, s16 *);
-bool8 ObjectEventIsSpecialAnimActive(struct ObjectEvent *);
+bool8 ObjectEventIsHeldMovementActive(struct ObjectEvent *);
u8 ObjectEventClearHeldMovementIfFinished(struct ObjectEvent *);
u8 GetObjectEventIdByXYZ(u16 x, u16 y, u8 z);
void sub_8063E28(struct ObjectEvent *, struct Sprite *);
bool8 ObjectEventSetHeldMovement(struct ObjectEvent *, u8);
-void npc_coords_shift_still(struct ObjectEvent *);
-void TryOverrideTemplateCoordsForObjectEvent(struct ObjectEvent *, u8);
+void ShiftStillObjectEventCoords(struct ObjectEvent *);
+void OverrideMovementTypeForObjectEvent(const struct ObjectEvent *, u8);
void SetTrainerMovementType(struct ObjectEvent *, u8);
-u8 sub_80634F0(u8 direction);
-u8 sub_8063500(u8 a0);
+u8 GetFishingNoCatchDirectionAnimNum(u8 direction);
+u8 GetFishingBiteDirectionAnimNum(u8 a0);
void ObjectEventSetGraphicsId(struct ObjectEvent *objectEvent, u8 a1);
u8 sub_805EB44(u8, u8, s16, s16);
-void npc_paltag_set_load(u8 mode);
+void InitObjectEventPalettes(u8 mode);
bool8 ObjectEventIsMovementOverridden(struct ObjectEvent *objectEvent);
u8 ObjectEventCheckHeldMovementStatus(struct ObjectEvent *objectEvent);
-u8 GetWalkNormalMovementAction(u8 direction);
+u8 GetWalkNormalMovementAction(u32);
+u8 GetWalkFastMovementAction(u32);
+u8 GetWalkFastestMovementAction(u32);
+u8 sub_8063F2C(u32 direction);
u8 GetTrainerFacingDirectionMovementType(u8 direction);
-void CameraObjectSetFollowedObjectId(u8 spriteId);
+u8 GetFaceDirectionMovementAction(u32);
+void CameraObjectSetFollowedObjectId(u8 objectId);
void UnfreezeObjectEvents(void);
+void sub_8069058(u8, u8);
+u8 GetSlideMovementAction(u32);
+u8 GetJumpInPlaceMovementAction(u32);
+u8 GetJumpMovementAction(u32);
+u8 GetJump2MovementAction(u32);
+bool8 sub_8068BCC(struct Sprite *sprite);
+void sub_8068D1C(struct Sprite *, u8, u8, u8);
+u8 sub_8068D3C(struct Sprite *);
+u8 sub_8068DC4(struct Sprite *);
void TurnObjectEvent(u8, u8);
const u8 *GetObjectEventScriptPointerByObjectEventId(u8 objectEventId);
-u8 GetIndexOfFirstInactiveObjectEvent(void);
+u8 GetFirstInactiveObjectEventId(void);
u8 GetCollisionFlagsAtCoords(struct ObjectEvent * objectEvent, s16 x, s16 y, u8 direction);
-u8 GetFaceDirectionMovementAction(u8 direction);
-u8 GetJumpInPlaceMovementAction(u8 direction);
u8 sub_8063FB0(u8 direction);
-void OverrideTemplateCoordsForObjectEvent(struct ObjectEvent *);
-void sub_805C774(void);
-
+void OverrideTemplateCoordsForObjectEvent(const struct ObjectEvent *objectEvent);void sub_805C774(void);
void FreezeObjectEvents(void);
bool8 FreezeObjectEvent(struct ObjectEvent *);
void UnfreezeObjectEvent(struct ObjectEvent *);
@@ -116,21 +155,36 @@ void RfuUnionObjectToggleInvisibility(u8 objectEventId, bool32 invisible);
bool32 RfuUnionObjectIsInvisible(u8 objectEventId);
void RfuUnionObjectStartWarp(u8 objectEventId, u8 animNo);
bool32 RfuUnionObjectIsWarping(u8 objectEventId);
-u8 sub_8063F2C(u8 direction);
-u8 sub_8064194(u8 direction);
-u8 sub_80641C0(u8 direction);
-
+u8 sub_80641C0(u32 direction);
void sub_805F378(s16 x, s16 y);
-void sub_805F724(struct ObjectEvent *, s16 x, s16 y);
+void MoveObjectEventToMapCoords(struct ObjectEvent *objectEvent, s16 x, s16 y);
u8 CreateCopySpriteAt(struct Sprite * sprite, s16 x, s16 y, u8 subpriority);
u16 GetObjectPaletteTag(u8 paletteIndex);
void SetSpritePosToMapCoords(s16 x, s16 y, s16 *x2, s16 *y2);
void UpdateObjectEventSpriteVisibility(struct Sprite *sprite, bool8 invisible);
+bool8 AreZCoordsCompatible(u8, u8);
u8 ZCoordToPriority(u8 z);
+void ObjectEventUpdateZCoord(struct ObjectEvent *pObject);
void SetObjectSubpriorityByZCoord(u8 z, struct Sprite * sprite, u8 offset);
+bool8 IsZCoordMismatchAt(u8, s16, s16);
void MakeObjectTemplateFromObjectEventGraphicsInfo(u16 graphicsId, void (*callback)(struct Sprite *), struct SpriteTemplate *spriteTemplate, const struct SubspriteTable **subspriteTables);
u8 AddCameraObject(u8 trackedSpriteId);
void UpdateObjectEventsForCameraUpdate(s16 x, s16 y);
+void UpdateObjectEventSpriteSubpriorityAndVisibility(struct Sprite *);
+void SetMovementDelay(struct Sprite *, s16);
+bool8 WaitForMovementDelay(struct Sprite *);
+void oamt_npc_ministep_reset(struct Sprite *, u8, u8);
+bool8 obj_npc_ministep(struct Sprite *sprite);
+void sub_8068BBC(struct Sprite *, u8);
+void sub_8068C58(struct Sprite *, u8);
+bool8 sub_8068C68(struct Sprite *sprite);
+void sub_8068C08(struct Sprite *, u8);
+bool8 sub_8068C18(struct Sprite *sprite);
+void DoShadowFieldEffect(struct ObjectEvent *);
+void sub_8068CA4(struct Sprite *, u8);
+bool8 sub_8068CB4(struct Sprite *sprite);
+void SetAndStartSpriteAnim(struct Sprite *, u8, u8);
+bool8 SpriteAnimEnded(struct Sprite *);
// Exported data declarations
@@ -138,7 +192,6 @@ extern const struct SpriteTemplate *const gFieldEffectObjectTemplatePointers[];
extern const struct SpritePalette gUnknown_83A5348;
extern const struct SpriteTemplate * const gFieldEffectObjectTemplatePointers[];
extern const struct OamData gObjectEventBaseOam_32x32;
-extern const struct UCoords16 gUnknown_83A64C8[];
extern const u16 gUnknown_8398648[];
extern const u16 gUnknown_8398688[];
extern const u8 gReflectionEffectPaletteMap[];
diff --git a/include/field_camera.h b/include/field_camera.h
index 65003bc6f..2d1ce2ce9 100644
--- a/include/field_camera.h
+++ b/include/field_camera.h
@@ -15,10 +15,9 @@ struct CameraObject
s32 y;
};
-extern struct CameraObject gFieldCamera;
-
// Exported RAM declarations
+extern struct CameraObject gFieldCamera;
extern u16 gTotalCameraPixelOffsetX;
extern u16 gTotalCameraPixelOffsetY;
diff --git a/include/field_control_avatar.h b/include/field_control_avatar.h
index a9ddd4b5c..4311a2b29 100644
--- a/include/field_control_avatar.h
+++ b/include/field_control_avatar.h
@@ -8,6 +8,7 @@ extern u32 gUnknown_3005078;
void RestartWildEncounterImmunitySteps(void);
void ClearPoisonStepCounter(void);
void SetCableClubWarp(void);
+void sub_806DE28(struct ObjectEvent *);
void dive_warp(struct MapPosition * pos, u16 behavior);
#endif //GUARD_FIELD_CONTROL_AVATAR_H
diff --git a/include/field_effect_helpers.h b/include/field_effect_helpers.h
index 831f83fd5..9472f0b94 100644
--- a/include/field_effect_helpers.h
+++ b/include/field_effect_helpers.h
@@ -12,10 +12,15 @@
// Exported RAM declarations
// Exported ROM declarations
-u8 sub_8154228(void);
-bool8 sub_80DCBE0(struct ObjectEvent *);
+
+u8 CreateWarpArrowSprite(void);
void sub_80DC44C(u8, u8);
void sub_80DC478(u8, u8);
void StartAshFieldEffect(s16, s16, u16, s16);
+void sub_80DCBB8(struct ObjectEvent *);
+bool8 sub_80DCBE0(struct ObjectEvent *);
+void SetUpReflection(struct ObjectEvent*, struct Sprite*, u8);
+u32 StartFieldEffectForObjectEvent(u8, struct ObjectEvent*);
+u8 FindTallGrassFieldEffectSpriteId(u8 localId, u8 mapNum, u8 mapGroup, s16 x, s16 y);
#endif //GUARD_FIELD_EFFECT_HELPERS_H
diff --git a/include/field_ground_effect.h b/include/field_ground_effect.h
deleted file mode 100644
index 1233dec69..000000000
--- a/include/field_ground_effect.h
+++ /dev/null
@@ -1,24 +0,0 @@
-//
-// Created by scott on 9/6/2017.
-//
-
-#ifndef GUARD_FIELD_GROUND_EFFECT_H
-#define GUARD_FIELD_GROUND_EFFECT_H
-
-#include "global.h"
-
-// Exported type declarations
-
-// Exported RAM declarations
-
-// Exported ROM declarations
-void SetObjectSubpriorityByZCoord(u8, struct Sprite *, u8);
-void InitObjectPriorityByZCoord(struct Sprite *, u8);
-bool8 IsZCoordMismatchAt(u8, s16, s16);
-bool8 AreZCoordsCompatible(u8, u8);
-void ObjectEventUpdateSubpriority(struct ObjectEvent *, struct Sprite *);
-void DoGroundEffects_OnSpawn(struct ObjectEvent *, struct Sprite *);
-void DoGroundEffects_OnBeginStep(struct ObjectEvent *, struct Sprite *);
-void DoGroundEffects_OnFinishStep(struct ObjectEvent *, struct Sprite *);
-
-#endif //GUARD_FIELD_GROUND_EFFECT_H
diff --git a/include/field_player_avatar.h b/include/field_player_avatar.h
index 3233c2d70..51ae9905f 100644
--- a/include/field_player_avatar.h
+++ b/include/field_player_avatar.h
@@ -9,8 +9,8 @@ u8 GetPlayerAvatarGenderByGraphicsId(u8);
bool8 TestPlayerAvatarFlags(u8);
void PlayerGetDestCoords(s16 *, s16 *);
u8 GetPlayerFacingDirection(void);
-u8 player_get_direction_upper_nybble(void);
-u8 player_get_x22(void);
+u8 GetPlayerMovementDirection(void);
+u8 PlayerGetCopyableMovement(void);
void sub_808D074(u8);
void sub_805C270(void);
diff --git a/include/fieldmap.h b/include/fieldmap.h
index 7cccbcc24..cc4a0f7ed 100644
--- a/include/fieldmap.h
+++ b/include/fieldmap.h
@@ -15,7 +15,7 @@ extern struct BackupMapLayout VMap;
extern const struct MapLayout Route1_Layout;
u32 MapGridGetMetatileIdAt(int, int);
-u32 MapGridGetMetatileBehaviorAt(int, int);
+u32 MapGridGetMetatileBehaviorAt(s16, s16);
u8 MapGridGetMetatileLayerTypeAt(s16 x, s16 y);
void MapGridSetMetatileIdAt(int, int, u16);
void MapGridSetMetatileEntryAt(int, int, u16);
diff --git a/include/global.fieldmap.h b/include/global.fieldmap.h
index 9c380d993..514bebb95 100644
--- a/include/global.fieldmap.h
+++ b/include/global.fieldmap.h
@@ -207,13 +207,13 @@ struct ObjectEvent
/*27*/ u32 hideReflection:1;
/*0x04*/ u8 spriteId;
/*0x05*/ u8 graphicsId;
- /*0x06*/ u8 animPattern;
+ /*0x06*/ u8 movementType;
/*0x07*/ u8 trainerType;
/*0x08*/ u8 localId;
/*0x09*/ u8 mapNum;
/*0x0A*/ u8 mapGroup;
- /*0x0B*/ u8 mapobj_unk_0B_0:4;
- u8 elevation:4;
+ /*0x0B*/ u8 currentElevation:4;
+ u8 previousElevation:4;
/*0x0C*/ struct Coords16 initialCoords;
/*0x10*/ struct Coords16 currentCoords;
/*0x14*/ struct Coords16 previousCoords;
@@ -221,14 +221,14 @@ struct ObjectEvent
/*0x18*/ u8 movementDirection:4;
/*0x19*/ union ObjectEventRange range;
/*0x1A*/ u8 fieldEffectSpriteId;
- /*0x1B*/ u8 mapobj_unk_1B;
- /*0x1C*/ u8 mapobj_unk_1C;
+ /*0x1B*/ u8 warpArrowSpriteId;
+ /*0x1C*/ u8 movementActionId;
/*0x1D*/ u8 trainerRange_berryTreeId;
/*0x1E*/ u8 currentMetatileBehavior;
/*0x1F*/ u8 previousMetatileBehavior;
- /*0x20*/ u8 mapobj_unk_20;
+ /*0x20*/ u8 previousMovementDirection;
/*0x21*/ u8 directionSequenceIndex;
- /*0x22*/ u8 animId;
+ /*0x22*/ u8 playerCopyableMovement;
/*size = 0x24*/
};
@@ -274,7 +274,28 @@ enum
enum
{
- COLLISION_LEDGE_JUMP = 6
+ COLLISION_NONE,
+ COLLISION_OUTSIDE_RANGE,
+ COLLISION_IMPASSABLE,
+ COLLISION_ELEVATION_MISMATCH,
+ COLLISION_OBJECT_EVENT,
+ COLLISION_STOP_SURFING,
+ COLLISION_LEDGE_JUMP,
+ COLLISION_PUSHED_BOULDER,
+ COLLISION_ROTATING_GATE,
+ COLLISION_WHEELIE_HOP,
+ COLLISION_ISOLATED_VERTICAL_RAIL,
+ COLLISION_ISOLATED_HORIZONTAL_RAIL,
+ COLLISION_VERTICAL_RAIL,
+ COLLISION_HORIZONTAL_RAIL,
+};
+
+// player tile transition states
+enum
+{
+ T_NOT_MOVING,
+ T_TILE_TRANSITION,
+ T_TILE_CENTER, // player is on a frame in which they are centered on a tile during which the player either stops or keeps their momentum and keeps going, changing direction if necessary.
};
struct PlayerAvatar /* 0x202E858 */
diff --git a/include/metatile_behavior.h b/include/metatile_behavior.h
index f3195e6c9..91a1824e5 100644
--- a/include/metatile_behavior.h
+++ b/include/metatile_behavior.h
@@ -3,15 +3,15 @@
#include "global.h"
-bool8 MetatileBehavior_UnusedReturnTrue(u8 metatileBehavior);
+bool8 MetatileBehavior_IsATile(u8 metatileBehavior);
bool8 MetatileBehavior_IsJumpEast(u8 metatileBehavior);
bool8 MetatileBehavior_IsJumpWest(u8 metatileBehavior);
bool8 MetatileBehavior_IsJumpNorth(u8 metatileBehavior);
bool8 MetatileBehavior_IsJumpSouth(u8 metatileBehavior);
-bool8 MetatileBehavior_IsTallGrass(u8 metatileBehavior);
-bool8 MetatileBehavior_IsMB21OrSand(u8 metatileBehavior);
-bool8 MetatileBehavior_IsSandOrDeepSand(u8 metatileBehavior);
-bool8 MetatileBehavior_ReturnFalse(u8 metatileBehavior);
+bool8 MetatileBehavior_IsPokeGrass(u8 metatileBehavior);
+bool8 MetatileBehavior_IsSand(u8 metatileBehavior);
+bool8 MetatileBehavior_IsSandOrShallowFlowingWater(u8 metatileBehavior);
+bool8 MetatileBehavior_IsDeepSand(u8 metatileBehavior);
bool8 MetatileBehavior_IsReflective(u8 metatileBehavior);
bool8 MetatileBehavior_IsIce(u8 metatileBehavior);
bool8 MetatileBehavior_IsWarpDoor(u8 metatileBehavior);
@@ -50,12 +50,12 @@ bool8 MetatileBehavior_IsSlideEast(u8 metatileBehavior);
bool8 MetatileBehavior_IsCounter(u8 metatileBehavior);
bool8 MetatileBehavior_IsPlayerFacingTVScreen(u8 tile, u8 playerDirection);
bool8 MetatileBehavior_IsPC(u8 metatileBehavior);
-bool8 MetatileBehavior_IsPondWaterOrPuddle(u8 metatileBehavior);
+bool8 MetatileBehavior_HasRipples(u8 metatileBehavior);
bool8 MetatileBehavior_IsPuddle(u8 metatileBehavior);
bool8 MetatileBehavior_IsTallGrass_2(u8 metatileBehavior);
bool8 MetatileBehavior_IsLongGrass(u8 metatileBehavior);
bool8 MetatileBehavior_ReturnFalse_4(u8 metatileBehavior);
-bool8 MetatileBehavior_ReturnFalse_5(u8 metatileBehavior);
+bool8 MetatileBehavior_IsFootprints(u8 metatileBehavior);
bool8 MetatileBehavior_IsBridge(u8 metatileBehavior);
bool8 MetatileBehavior_GetBridgeType(u8 metatileBehavior);
bool8 MetatileBehavior_UnusedIsMB_01(u8 metatileBehavior);
@@ -64,7 +64,7 @@ bool8 MetatileBehavior_IsIndoorEncounter(u8 metatileBehavior);
bool8 MetatileBehavior_IsMountain(u8 metatileBehavior);
bool8 MetatileBehavior_IsDeepOrSemiDeepWater(u8 metatileBehavior);
bool8 MetatileBehavior_IsMB19(u8 metatileBehavior);
-bool8 MetatileBehavior_IsWaterfallBottom(u8 metatileBehavior);
+bool8 MetatileBehavior_IsShallowFlowingWater(u8 metatileBehavior);
bool8 MetatileBehavior_IsThinIce(u8 metatileBehavior);
bool8 MetatileBehavior_IsCrackedIce(u8 metatileBehavior);
bool8 MetatileBehavior_IsDeepSemiDeepOrSplashingWater(u8 metatileBehavior);
@@ -74,7 +74,7 @@ bool8 MetatileBehavior_IsEastBlocked(u8 metatileBehavior);
bool8 MetatileBehavior_IsWestBlocked(u8 metatileBehavior);
bool8 MetatileBehavior_IsNorthBlocked(u8 metatileBehavior);
bool8 MetatileBehavior_IsSouthBlocked(u8 metatileBehavior);
-bool8 MetatileBehavior_ReturnFalse_8(u8 metatileBehavior);
+bool8 MetatileBehavior_IsShortGrass(u8 metatileBehavior);
bool8 MetatileBehavior_IsHotSprings(u8 metatileBehavior);
bool8 MetatileBehavior_IsWaterfall(u8 metatileBehavior);
bool8 MetatileBehavior_ReturnFalse_9(u8 metatileBehavior);
@@ -82,7 +82,7 @@ bool8 MetatileBehavior_UnusedReturnFalse(u8 metatileBehavior);
bool8 MetatileBehavior_UnusedReturnFalse_2(u8 metatileBehavior);
bool8 MetatileBehavior_UnusedReturnFalse_3(u8 metatileBehavior);
bool8 MetatileBehavior_UnusedReturnFalse_4(u8 metatileBehavior);
-bool8 MetatileBehavior_ReturnFalse_10(u8 metatileBehavior);
+bool8 MetatileBehavior_IsPacifidlogLog(u8 metatileBehavior);
bool8 MetatileBehavior_ReturnFalse_11(u8 metatileBehavior);
bool8 MetatileBehavior_IsRegionMap(u8 metatileBehavior);
bool8 MetatileBehavior_UnusedReturnFalse_5(u8 metatileBehavior);
@@ -103,7 +103,7 @@ bool8 MetatileBehavior_ReturnFalse_15(u8 metatileBehavior);
bool8 MetatileBehavior_ReturnFalse_16(u8 metatileBehavior);
bool8 MetatileBehavior_ReturnFalse_17(u8 metatileBehavior);
bool8 MetatileBehavior_ReturnFalse_18(u8 metatileBehavior);
-bool8 MetatileBehavior_IsMB22(u8 metatileBehavior);
+bool8 MetatileBehavior_IsSeaweed(u8 metatileBehavior);
bool8 MetatileBehavior_IsMB0A(u8 metatileBehavior);
bool8 MetatileBehavior_UnusedReturnFalse_9(u8 metatileBehavior);
bool8 MetatileBehavior_IsBookshelf(u8 metatileBehavior);
diff --git a/include/overworld.h b/include/overworld.h
index fecacf6de..37274dfb4 100644
--- a/include/overworld.h
+++ b/include/overworld.h
@@ -37,7 +37,7 @@ struct LinkPlayerObjectEvent
{
u8 active;
u8 linkPlayerId;
- u8 mapObjId;
+ u8 objEventId;
u8 mode;
};
@@ -99,7 +99,7 @@ void Overworld_ChangeMusicTo(u16);
bool32 IsUpdateLinkStateCBActive(void);
-void strange_npc_table_clear(void);
+void ClearLinkPlayerObjectEvents(void);
const struct MapHeader *Overworld_GetMapHeaderByGroupAndId(u16, u16);
void ObjectEventMoveDestCoords(struct ObjectEvent *, u32, s16 *, s16 *);
void sub_8086230(void);
@@ -145,6 +145,7 @@ void sub_8055864(u8 mapGroup, u8 mapNum);
void CB2_Overworld(void);
void CB2_OverworldBasic(void);
void CB2_NewGame(void);
+bool8 IsMapTypeOutdoors(u8 mapType);
bool8 Overworld_MapTypeAllowsTeleportAndFly(u8 mapType);
void Overworld_ResetStateAfterTeleport(void);
diff --git a/include/quest_log.h b/include/quest_log.h
index b2645954f..e2e652a81 100644
--- a/include/quest_log.h
+++ b/include/quest_log.h
@@ -49,6 +49,8 @@ void *QuestLogGetFlagOrVarPtr(bool8 isFlag, u16 idx);
void QuestLogSetFlagOrVar(bool8 isFlag, u16 idx, u16 value);
void sub_8110840(void *oldSave);
void sub_8112F18(u8 windowId);
+void sub_811246C(struct Sprite *sprite);
+void sub_81124EC(u8 a0, u8 a1, u8 a2, u8 a3);
bool8 sub_8111C2C(void);
void sub_81128BC(u8 a0);
void sub_811278C(u8, u8);
diff --git a/include/sprite.h b/include/sprite.h
index acf8f719c..c53919159 100644
--- a/include/sprite.h
+++ b/include/sprite.h
@@ -315,6 +315,9 @@ void CopyFromSprites(u8 *dest);
u8 SpriteTileAllocBitmapOp(u16 bit, u8 op);
void ClearSpriteCopyRequests(void);
void ResetAffineAnimData(void);
+void sub_8007FFC(struct Sprite* sprite, s16 a2, s16 a3);
+void sub_80075C0(struct Sprite *sprite);
+s16 AllocSpriteTiles(u16 tileCount);
void obj_pos2_update_enable(struct Sprite* sprite, s16 xmod, s16 ymod);
#endif //GUARD_SPRITE_H