top of page

Slow Tile Movement Behavior

2.22

Description Loading...

HMA Discord Link 2.png

Credits

Defa


How To

Add this routine to free space and note the offset:

    push  {lr}
    lsl   r0, r0, #24
    lsr   r0, r0, #24
    cmp   r0, #10
    beq   true
    cmp   r0, #6
    beq   true
    mov   r0, #0
    b     end
true:
    mov   r0, #1
end:
    pop   {r1}
    bx    r1

Change 05A234 from 00 B5 00 06 00 0E 0A 28 to 00 49 08 47 <offset+1>

Add this routine to free space and note the offset:

    mov   r0, r4
    ldr   r3, =(0x0805BAAD) @PlayerIsMovingOnRockStairs
    bl    linker
    cmp   r0, #1
    beq   back
    ldr   r0, =(0x02037078) @gPlayerAvatar
    ldrb  r1, [r0, #5] @.objectEventId
    lsl   r0, r1, #3
    add   r0, r0, r1
    lsl   r0, r0, #2
    ldr   r1, =(0x02036E38) @gObjectEvents
    add   r2, r0, r1
    ldrh  r0, [r2, #16] @->currentCoords.x
    ldrh  r1, [r2, #18] @->currentCoords.y
    lsl   r0, r0, #16
    asr   r0, r0, #16
    lsl   r1, r1, #16
    asr   r1, r1, #16
    ldr   r3, =(0x08058F79) @MapGridGetMetatileBehaviorAt    
    bl    linker
    lsl   r0, r0, #24
    lsr   r0, r0, #24
    cmp   r0, #6 @metatile behavior Unused_06
    beq   back
    ldr   r3, =(0x0805BA9F) @back after hook, PlayerWalkNormal
    bx    r3
back:
    ldr   r3, =(0x0805BA97) @back after hook, PlayerWalkSlow
linker:
    bx    r3

Change 05BA8C from 20 1C 00 F0 0D F8 00 28 to 00 48 00 47 <offset+1>

To use this function apply behavior Unused_06 to the block


NOTE: All <offset+1> is the offset+1 in little endian


Video from Pokemon Ocean Blue by DontJoelMe


Happy Hacking!

 


bottom of page