decompile more code

1 non matching need help
This commit is contained in:
MCboy 2018-07-20 03:44:20 +04:30 committed by GitHub
parent 416db8e751
commit 43fa9da52a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -8,10 +8,13 @@ static u8 EventObjectCB2_NoMovement2();
void sub_808C280(struct EventObject *); //struct EventObject *playerEventObj
bool8 TryInterruptEventObjectSpecialAnim(struct EventObject *, u8);
void npc_clear_strange_bits(struct EventObject *);
u8 EventObjectGetHeldMovementActionId(struct EventObject *);
void DoPlayerAvatarTransition(void);
bool8 TryDoMetatileBehaviorForcedMovement();
void MovePlayerAvatarUsingKeypadInput(u8, u16, u16);
void PlayerAllowForcedMovementIfMovingSameDirection();
void MovePlayerNotOnBike(u8 a, u16 b);
u8 sub_808B028(u8);
void MovementType_Player(struct Sprite *sprite)
{
@ -44,3 +47,81 @@ void player_step(u8 direction, u16 newKeys, u16 heldKeys)
}
}
}
NAKED
bool8 TryInterruptEventObjectSpecialAnim(struct EventObject *eventObject, u8 direction)
{
asm_unified("push {r4-r6,lr}\n\
adds r4, r0, 0\n\
lsls r1, 24\n\
lsrs r5, r1, 24\n\
adds r6, r5, 0\n\
bl EventObjectIsMovementOverridden\n\
lsls r0, 24\n\
cmp r0, 0\n\
beq _0808AA92\n\
adds r0, r4, 0\n\
bl EventObjectClearHeldMovementIfFinished\n\
lsls r0, 24\n\
cmp r0, 0\n\
bne _0808AA92\n\
adds r0, r4, 0\n\
bl EventObjectGetHeldMovementActionId\n\
lsls r0, 24\n\
movs r1, 0xE7\n\
lsls r1, 24\n\
adds r0, r1\n\
lsrs r0, 24\n\
cmp r0, 0x3\n\
bhi _0808AA70\n\
cmp r5, 0\n\
bne _0808AA74\n\
_0808AA70:\n\
movs r0, 0x1\n\
b _0808AA94\n\
_0808AA74:\n\
ldrb r0, [r4, 0x18]\n\
lsrs r0, 4\n\
cmp r0, r5\n\
beq _0808AA84\n\
_0808AA7C:\n\
adds r0, r4, 0\n\
bl EventObjectClearHeldMovement\n\
b _0808AA92\n\
_0808AA84:\n\
adds r0, r6, 0\n\
bl sub_808B028\n\
lsls r0, 24\n\
cmp r0, 0\n\
beq _0808AA7C\n\
b _0808AA70\n\
_0808AA92:\n\
movs r0, 0\n\
_0808AA94:\n\
pop {r4-r6}\n\
pop {r1}\n\
bx r1");
}
void npc_clear_strange_bits(struct EventObject *eventObj)
{
eventObj->inanimate = 0;
eventObj->disableAnim = 0;
eventObj->facingDirectionLocked = 0;
gPlayerAvatar.flags &= ~PLAYER_AVATAR_FLAG_DASH;
}
void MovePlayerAvatarUsingKeypadInput(u8 direction, u16 newKeys, u16 heldKeys)
{
if ((gPlayerAvatar.flags & PLAYER_AVATAR_FLAG_MACH_BIKE)
|| (gPlayerAvatar.flags & PLAYER_AVATAR_FLAG_ACRO_BIKE))
MovePlayerOnBike(direction, newKeys, heldKeys);
else
MovePlayerNotOnBike(direction, heldKeys);
}
void PlayerAllowForcedMovementIfMovingSameDirection(void)
{
if (gPlayerAvatar.runningState == MOVING)
gPlayerAvatar.flags &= ~PLAYER_AVATAR_FLAG_5;
}