diff --git a/asm/macros/movement.inc b/asm/macros/movement.inc index 99b5c8f84..e26a00d76 100644 --- a/asm/macros/movement.inc +++ b/asm/macros/movement.inc @@ -102,8 +102,8 @@ create_movement_action clear_fixed_priority create_movement_action init_affine_anim create_movement_action clear_affine_anim - create_movement_action unknown_movement_1 - create_movement_action unknown_movement_2 + create_movement_action hide_reflection + create_movement_action show_reflection create_movement_action walk_down_start_affine create_movement_action walk_down_affine diff --git a/include/constants/event_object_movement_constants.h b/include/constants/event_object_movement_constants.h index b1f9b4cb5..ed6f6c7fb 100755 --- a/include/constants/event_object_movement_constants.h +++ b/include/constants/event_object_movement_constants.h @@ -179,8 +179,8 @@ #define MOVEMENT_ACTION_CLEAR_FIXED_PRIORITY 0x5D #define MOVEMENT_ACTION_INIT_AFFINE_ANIM 0x5E #define MOVEMENT_ACTION_CLEAR_AFFINE_ANIM 0x5F -#define MOVEMENT_ACTION_UNKNOWN1 0x60 -#define MOVEMENT_ACTION_UNKNOWN2 0x61 +#define MOVEMENT_ACTION_HIDE_REFLECTION 0x60 +#define MOVEMENT_ACTION_SHOW_REFLECTION 0x61 #define MOVEMENT_ACTION_WALK_DOWN_START_AFFINE 0x62 #define MOVEMENT_ACTION_WALK_DOWN_AFFINE 0x63 #define MOVEMENT_ACTION_ACRO_WHEELIE_FACE_DOWN 0x64 diff --git a/include/global.fieldmap.h b/include/global.fieldmap.h index a17180589..03e787266 100644 --- a/include/global.fieldmap.h +++ b/include/global.fieldmap.h @@ -65,7 +65,7 @@ struct EventObjectTemplate /*0x0E*/ u16 trainerRange_berryTreeId; /*0x10*/ const u8 *script; /*0x14*/ u16 flagId; -}; /*size = 0x18*/ +}; struct WarpEvent { @@ -82,7 +82,6 @@ struct CoordEvent u8 elevation; u16 trigger; u16 index; - u8 filler_A[0x2]; u8 *script; }; @@ -90,20 +89,14 @@ struct BgEvent { u16 x, y; u8 elevation; - u8 kind; - union { // carried over from diego's FR/LG work, seems to be the same struct - // in gen 3, "kind" (0x3 in BgEvent struct) determines the method to read the union. + u8 kind; // The "kind" field determines how to access bgUnion union below. + union { u8 *script; - - // hidden item type struct { u16 item; - u16 hiddenItemId; // flag offset to determine flag lookup + u16 hiddenItemId; } hiddenItem; - - // secret base type u32 secretBaseId; - } bgUnion; }; @@ -113,7 +106,6 @@ struct MapEvents u8 warpCount; u8 coordEventCount; u8 bgEventCount; - struct EventObjectTemplate *eventObjects; struct WarpEvent *warps; struct CoordEvent *coordEvents; @@ -122,10 +114,10 @@ struct MapEvents struct MapConnection { - /*0x00*/ u8 direction; - /*0x01*/ u32 offset; - /*0x05*/ u8 mapGroup; - /*0x06*/ u8 mapNum; + u8 direction; + u32 offset; + u8 mapGroup; + u8 mapNum; }; struct MapConnections @@ -180,7 +172,7 @@ struct EventObject /*0x03*/ u32 spriteAffineAnimPausedBackup:1; u32 disableJumpLandingGroundEffect:1; u32 fixedPriority:1; - u32 unk3_3:1; + u32 hideReflection:1; /*0x04*/ u8 spriteId; /*0x05*/ u8 graphicsId; /*0x06*/ u8 movementType; diff --git a/src/data/field_event_obj/movement_action_func_tables.h b/src/data/field_event_obj/movement_action_func_tables.h index 712988f5e..8e136b58b 100755 --- a/src/data/field_event_obj/movement_action_func_tables.h +++ b/src/data/field_event_obj/movement_action_func_tables.h @@ -170,8 +170,8 @@ u8 MovementAction_SetFixedPriority_Step0(struct EventObject *, struct Sprite *); u8 MovementAction_ClearFixedPriority_Step0(struct EventObject *, struct Sprite *); u8 MovementAction_InitAffineAnim_Step0(struct EventObject *, struct Sprite *); u8 MovementAction_ClearAffineAnim_Step0(struct EventObject *, struct Sprite *); -u8 MovementAction_Unknown1_Step0(struct EventObject *, struct Sprite *); -u8 MovementAction_Unknown2_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_HideReflection_Step0(struct EventObject *, struct Sprite *); +u8 MovementAction_ShowReflection_Step0(struct EventObject *, struct Sprite *); u8 MovementAction_WalkDownStartAffine_Step0(struct EventObject *, struct Sprite *); u8 MovementAction_WalkDownStartAffine_Step1(struct EventObject *, struct Sprite *); u8 MovementAction_WalkDownAffine_Step0(struct EventObject *, struct Sprite *); @@ -358,8 +358,8 @@ u8 (*const gMovementActionFuncs_SetFixedPriority[])(struct EventObject *, struct u8 (*const gMovementActionFuncs_ClearFixedPriority[])(struct EventObject *, struct Sprite *); u8 (*const gMovementActionFuncs_InitAffineAnim[])(struct EventObject *, struct Sprite *); u8 (*const gMovementActionFuncs_ClearAffineAnim[])(struct EventObject *, struct Sprite *); -u8 (*const gMovementActionFuncs_Unknown1[])(struct EventObject *, struct Sprite *); -u8 (*const gMovementActionFuncs_Unknown2[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_HideReflection[])(struct EventObject *, struct Sprite *); +u8 (*const gMovementActionFuncs_ShowReflection[])(struct EventObject *, struct Sprite *); u8 (*const gMovementActionFuncs_WalkDownStartAffine[])(struct EventObject *, struct Sprite *); u8 (*const gMovementActionFuncs_WalkDownAffine[])(struct EventObject *, struct Sprite *); u8 (*const gMovementActionFuncs_AcroWheelieFaceDown[])(struct EventObject *, struct Sprite *); @@ -518,8 +518,8 @@ u8 (*const *const gMovementActionFuncs[])(struct EventObject *, struct Sprite *) [MOVEMENT_ACTION_CLEAR_FIXED_PRIORITY] = gMovementActionFuncs_ClearFixedPriority, [MOVEMENT_ACTION_INIT_AFFINE_ANIM] = gMovementActionFuncs_InitAffineAnim, [MOVEMENT_ACTION_CLEAR_AFFINE_ANIM] = gMovementActionFuncs_ClearAffineAnim, - [MOVEMENT_ACTION_UNKNOWN1] = gMovementActionFuncs_Unknown1, - [MOVEMENT_ACTION_UNKNOWN2] = gMovementActionFuncs_Unknown2, + [MOVEMENT_ACTION_HIDE_REFLECTION] = gMovementActionFuncs_HideReflection, + [MOVEMENT_ACTION_SHOW_REFLECTION] = gMovementActionFuncs_ShowReflection, [MOVEMENT_ACTION_WALK_DOWN_START_AFFINE] = gMovementActionFuncs_WalkDownStartAffine, [MOVEMENT_ACTION_WALK_DOWN_AFFINE] = gMovementActionFuncs_WalkDownAffine, [MOVEMENT_ACTION_ACRO_WHEELIE_FACE_DOWN] = gMovementActionFuncs_AcroWheelieFaceDown, @@ -1197,13 +1197,13 @@ u8 (*const gMovementActionFuncs_ClearAffineAnim[])(struct EventObject *, struct MovementAction_Finish, }; -u8 (*const gMovementActionFuncs_Unknown1[])(struct EventObject *, struct Sprite *) = { - MovementAction_Unknown1_Step0, +u8 (*const gMovementActionFuncs_HideReflection[])(struct EventObject *, struct Sprite *) = { + MovementAction_HideReflection_Step0, MovementAction_Finish, }; -u8 (*const gMovementActionFuncs_Unknown2[])(struct EventObject *, struct Sprite *) = { - MovementAction_Unknown2_Step0, +u8 (*const gMovementActionFuncs_ShowReflection[])(struct EventObject *, struct Sprite *) = { + MovementAction_ShowReflection_Step0, MovementAction_Finish, }; diff --git a/src/event_object_movement.c b/src/event_object_movement.c index c493c6d87..994d76ca5 100644 --- a/src/event_object_movement.c +++ b/src/event_object_movement.c @@ -6831,15 +6831,15 @@ bool8 MovementAction_ClearAffineAnim_Step0(struct EventObject *eventObject, stru return TRUE; } -bool8 MovementAction_Unknown1_Step0(struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementAction_HideReflection_Step0(struct EventObject *eventObject, struct Sprite *sprite) { - eventObject->unk3_3 = TRUE; + eventObject->hideReflection = TRUE; return TRUE; } -bool8 MovementAction_Unknown2_Step0(struct EventObject *eventObject, struct Sprite *sprite) +bool8 MovementAction_ShowReflection_Step0(struct EventObject *eventObject, struct Sprite *sprite) { - eventObject->unk3_3 = FALSE; + eventObject->hideReflection = FALSE; return TRUE; } diff --git a/src/field_effect_helpers.c b/src/field_effect_helpers.c index fb883b105..8db58ad7a 100755 --- a/src/field_effect_helpers.c +++ b/src/field_effect_helpers.c @@ -143,7 +143,7 @@ static void UpdateObjectReflectionSprite(struct Sprite *reflectionSprite) reflectionSprite->pos2.y = -mainSprite->pos2.y; reflectionSprite->coordOffsetEnabled = mainSprite->coordOffsetEnabled; - if (eventObject->unk3_3 == TRUE) + if (eventObject->hideReflection == TRUE) reflectionSprite->invisible = TRUE; // Check if the reflection is not still.