Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
8924 lines (7509 sloc) 461 KB
; Disassembly of "game.gbc"
; This file was created with mgbdis v1.0.1 - Game Boy ROM disassembler by Matt Currie.
; https://github.com/mattcurrie/mgbdis
include "code/audio/music.asm"
label_002_41D0::
push bc ; $41D0: $C5
ld a, $07 ; $41D1: $3E $07
call label_3B86 ; $41D3: $CD $86 $3B
jr c, jr_002_41FA ; $41D6: $38 $22
ld hl, wEntitiesTypeTable ; $41D8: $21 $80 $C2
add hl, de ; $41DB: $19
dec [hl] ; $41DC: $35
ldh a, [hSwordIntersectedAreaX] ; $41DD: $F0 $CE
and $F0 ; $41DF: $E6 $F0
add $08 ; $41E1: $C6 $08
ld hl, wEntity0PosX ; $41E3: $21 $00 $C2
add hl, de ; $41E6: $19
ld [hl], a ; $41E7: $77
ldh a, [hSwordIntersectedAreaY] ; $41E8: $F0 $CD
and $F0 ; $41EA: $E6 $F0
add $10 ; $41EC: $C6 $10
ld hl, wEntitiesPosYTable ; $41EE: $21 $10 $C2
add hl, de ; $41F1: $19
ld [hl], a ; $41F2: $77
ld hl, $C3B0 ; $41F3: $21 $B0 $C3
add hl, de ; $41F6: $19
ldh a, [hRoomPaletteBank] ; $41F7: $F0 $DF
ld [hl], a ; $41F9: $77
jr_002_41FA:
pop bc ; $41FA: $C1
ret ; $41FB: $C9
ld hl, $C146 ; $41FC: $21 $46 $C1
ld a, [wC166] ; $41FF: $FA $66 $C1
or [hl] ; $4202: $B6
ld hl, $C1A4 ; $4203: $21 $A4 $C1
or [hl] ; $4206: $B6
ret nz ; $4207: $C0
ld [$C5A4], a ; $4208: $EA $A4 $C5
ld [$C5A5], a ; $420B: $EA $A5 $C5
call CopyLinkFinalPositionToPosition ; $420E: $CD $BE $0C
ld a, [$DB49] ; $4211: $FA $49 $DB
and $07 ; $4214: $E6 $07
jr z, jr_002_4241 ; $4216: $28 $29
ld a, [$DB4A] ; $4218: $FA $4A $DB
cp $01 ; $421B: $FE $01
jr z, jr_002_422D ; $421D: $28 $0E
cp $02 ; $421F: $FE $02
jr z, jr_002_4237 ; $4221: $28 $14
ld a, $DC ; $4223: $3E $DC
ld [wC166], a ; $4225: $EA $66 $C1
ld a, $09 ; $4228: $3E $09
ldh [hSFX], a ; $422A: $E0 $F3
ret ; $422C: $C9
jr_002_422D:
ld a, $D0 ; $422D: $3E $D0
ld [wC166], a ; $422F: $EA $66 $C1
ld a, $0B ; $4232: $3E $0B
ldh [hSFX], a ; $4234: $E0 $F3
ret ; $4236: $C9
jr_002_4237:
ld a, $BB ; $4237: $3E $BB
ld [wC166], a ; $4239: $EA $66 $C1
ld a, $0A ; $423C: $3E $0A
ldh [hSFX], a ; $423E: $E0 $F3
ret ; $4240: $C9
jr_002_4241:
ld a, $D0 ; $4241: $3E $D0
ld [wC166], a ; $4243: $EA $66 $C1
ld a, $15 ; $4246: $3E $15
ldh [hSFX], a ; $4248: $E0 $F3
ret ; $424A: $C9
ret ; $424B: $C9
jr nc, @-$2E ; $424C: $30 $D0
nop ; $424E: $00
jr_002_424F:
nop ; $424F: $00
nop ; $4250: $00
nop ; $4251: $00
ret nc ; $4252: $D0
jr nc, jr_002_424F ; $4253: $30 $FA
ld b, [hl] ; $4255: $46
pop bc ; $4256: $C1
and a ; $4257: $A7
jr nz, jr_002_4286 ; $4258: $20 $2C
ld a, $03 ; $425A: $3E $03
call label_142F ; $425C: $CD $2F $14
jr c, jr_002_4286 ; $425F: $38 $25
ld hl, wEntitiesFrameCounterTable ; $4261: $21 $E0 $C2
add hl, de ; $4264: $19
ld [hl], $2A ; $4265: $36 $2A
ld hl, $C3B0 ; $4267: $21 $B0 $C3
add hl, de ; $426A: $19
xor a ; $426B: $AF
ld [hl], a ; $426C: $77
ldh a, [hLinkDirection] ; $426D: $F0 $9E
ld c, a ; $426F: $4F
ld b, $00 ; $4270: $06 $00
ld hl, $424C ; $4272: $21 $4C $42
add hl, bc ; $4275: $09
ld a, [hl] ; $4276: $7E
ld hl, $C240 ; $4277: $21 $40 $C2
add hl, de ; $427A: $19
ld [hl], a ; $427B: $77
ld hl, $4250 ; $427C: $21 $50 $42
add hl, bc ; $427F: $09
ld a, [hl] ; $4280: $7E
ld hl, $C250 ; $4281: $21 $50 $C2
add hl, de ; $4284: $19
ld [hl], a ; $4285: $77
jr_002_4286:
ret ; $4286: $C9
label_002_4287::
ld a, [wIsShootingArrow] ; $4287: $FA $4C $C1
and a ; $428A: $A7
jr z, jr_002_4291 ; $428B: $28 $04
dec a ; $428D: $3D
ld [wIsShootingArrow], a ; $428E: $EA $4C $C1
jr_002_4291:
ld a, [$C1C4] ; $4291: $FA $C4 $C1
and a ; $4294: $A7
jr z, jr_002_429B ; $4295: $28 $04
dec a ; $4297: $3D
ld [$C1C4], a ; $4298: $EA $C4 $C1
jr_002_429B:
ld a, [$C1C0] ; $429B: $FA $C0 $C1
and a ; $429E: $A7
jr z, jr_002_42A5 ; $429F: $28 $04
dec a ; $42A1: $3D
ld [$C1C0], a ; $42A2: $EA $C0 $C1
jr_002_42A5:
call func_002_436C ; $42A5: $CD $6C $43
ld a, [wC16E] ; $42A8: $FA $6E $C1
and a ; $42AB: $A7
jr z, jr_002_42B2 ; $42AC: $28 $04
dec a ; $42AE: $3D
ld [wC16E], a ; $42AF: $EA $6E $C1
jr_002_42B2:
ldh a, [$FFA1] ; $42B2: $F0 $A1
cp $02 ; $42B4: $FE $02
jr nz, jr_002_42C7 ; $42B6: $20 $0F
xor a ; $42B8: $AF
ldh [$FFA1], a ; $42B9: $E0 $A1
ldh [hLinkPositionXIncrement], a ; $42BB: $E0 $9A
ldh [hLinkPositionYIncrement], a ; $42BD: $E0 $9B
ldh [$FFA3], a ; $42BF: $E0 $A3
call func_002_4A16 ; $42C1: $CD $16 $4A
jp func_002_753A ; $42C4: $C3 $3A $75
jr_002_42C7:
call label_1A50 ; $42C7: $CD $50 $1A
xor a ; $42CA: $AF
ldh [$FFA1], a ; $42CB: $E0 $A1
call label_1F61 ; $42CD: $CD $61 $1F
call $1177 ; $42D0: $CD $77 $11
call $44ED ; $42D3: $CD $ED $44
call $434A ; $42D6: $CD $4A $43
call func_002_478C ; $42D9: $CD $8C $47
call func_002_4B49 ; $42DC: $CD $49 $4B
call ApplyLinkMotionState ; $42DF: $CD $94 $17
call func_002_4338 ; $42E2: $CD $38 $43
call func_002_4A16 ; $42E5: $CD $16 $4A
ld a, [wRoomTransitionState] ; $42E8: $FA $24 $C1
and a ; $42EB: $A7
jr nz, jr_002_4315 ; $42EC: $20 $27
ld a, [wSwordAnimationState] ; $42EE: $FA $37 $C1
ld [wC16A], a ; $42F1: $EA $6A $C1
cp $05 ; $42F4: $FE $05
jr nz, jr_002_4316 ; $42F6: $20 $1E
ld a, [$C14A] ; $42F8: $FA $4A $C1
and a ; $42FB: $A7
jr nz, jr_002_4333 ; $42FC: $20 $35
xor a ; $42FE: $AF
ld [wSwordAnimationState], a ; $42FF: $EA $37 $C1
ld a, [$C122] ; $4302: $FA $22 $C1
cp $28 ; $4305: $FE $28
jr z, jr_002_4315 ; $4307: $28 $0C
inc a ; $4309: $3C
ld [$C122], a ; $430A: $EA $22 $C1
cp $28 ; $430D: $FE $28
jr nz, jr_002_4315 ; $430F: $20 $04
ld a, JINGLE_CHARGING_SWORD ; $4311: $3E $04
ldh [hJingle], a ; $4313: $E0 $F2
jr_002_4315:
ret ; $4315: $C9
jr_002_4316:
ld a, [$C1AD] ; $4316: $FA $AD $C1
cp $01 ; $4319: $FE $01
jr z, jr_002_4333 ; $431B: $28 $16
ld a, [$C122] ; $431D: $FA $22 $C1
cp $28 ; $4320: $FE $28
jr nz, jr_002_4333 ; $4322: $20 $0F
ld a, [wC16E] ; $4324: $FA $6E $C1
and a ; $4327: $A7
jr nz, jr_002_4337 ; $4328: $20 $0D
ld a, $20 ; $432A: $3E $20
ld [wIsUsingSpinAttack], a ; $432C: $EA $21 $C1
ld a, $03 ; $432F: $3E $03
ldh [hFFF4], a ; $4331: $E0 $F4
jr_002_4333:
xor a ; $4333: $AF
ld [$C122], a ; $4334: $EA $22 $C1
jr_002_4337:
ret ; $4337: $C9
func_002_4338::
ld a, [wC15C] ; $4338: $FA $5C $C1
cp $02 ; $433B: $FE $02
jr c, jr_002_4345 ; $433D: $38 $06
ldh [hLinkAnimationState], a ; $433F: $E0 $9D
ld a, $01 ; $4341: $3E $01
ldh [$FFA1], a ; $4343: $E0 $A1
jr_002_4345:
ret ; $4345: $C9
ld de, $0F10 ; $4346: $11 $10 $0F
ld c, $FA ; $4349: $0E $FA
sbc e ; $434B: $9B
pop bc ; $434C: $C1
and $7F ; $434D: $E6 $7F
jr z, jr_002_4367 ; $434F: $28 $16
ld a, [$C19B] ; $4351: $FA $9B $C1
dec a ; $4354: $3D
ld [$C19B], a ; $4355: $EA $9B $C1
and $7F ; $4358: $E6 $7F
ldh a, [hLinkDirection] ; $435A: $F0 $9E
ld e, a ; $435C: $5F
ld d, $00 ; $435D: $16 $00
ld hl, $4346 ; $435F: $21 $46 $43
add hl, de ; $4362: $19
ld a, [hl] ; $4363: $7E
ldh [hLinkAnimationState], a ; $4364: $E0 $9D
ret ; $4366: $C9
jr_002_4367:
xor a ; $4367: $AF
ld [$C19B], a ; $4368: $EA $9B $C1
ret ; $436B: $C9
func_002_436C::
ldh a, [hIsSideScrolling] ; $436C: $F0 $F9
and a ; $436E: $A7
jr z, jr_002_43BA ; $436F: $28 $49
ld a, [wFreeMovementMode] ; $4371: $FA $7B $C1
and a ; $4374: $A7
jr nz, jr_002_43BA ; $4375: $20 $43
jp $68B7 ; $4377: $C3 $B7 $68
func_002_437A::
ldh a, [hPressedButtonsMask] ; $437A: $F0 $CB
and $0F ; $437C: $E6 $0F
or e ; $437E: $B3
ld e, a ; $437F: $5F
ld hl, Data_002_48C5 ; $4380: $21 $C5 $48
add hl, de ; $4383: $19
ld a, [hl] ; $4384: $7E
ldh [hLinkPositionXIncrement], a ; $4385: $E0 $9A
ld hl, $48E5 ; $4387: $21 $E5 $48
add hl, de ; $438A: $19
ld a, [hl] ; $438B: $7E
ldh [hLinkPositionYIncrement], a ; $438C: $E0 $9B
ret ; $438E: $C9
func_002_438F::
ldh a, [hPressedButtonsMask] ; $438F: $F0 $CB
and $0F ; $4391: $E6 $0F
or e ; $4393: $B3
ld e, a ; $4394: $5F
ld hl, Data_002_48C5 ; $4395: $21 $C5 $48
add hl, de ; $4398: $19
ld a, [hl] ; $4399: $7E
ld hl, hLinkPositionXIncrement ; $439A: $21 $9A $FF
sub [hl] ; $439D: $96
jr z, jr_002_43A7 ; $439E: $28 $07
inc [hl] ; $43A0: $34
bit 7, a ; $43A1: $CB $7F
jr z, jr_002_43A7 ; $43A3: $28 $02
dec [hl] ; $43A5: $35
dec [hl] ; $43A6: $35
jr_002_43A7:
ld hl, $48E5 ; $43A7: $21 $E5 $48
add hl, de ; $43AA: $19
ld a, [hl] ; $43AB: $7E
ld hl, hLinkPositionYIncrement ; $43AC: $21 $9B $FF
sub [hl] ; $43AF: $96
jr z, jr_002_43B9 ; $43B0: $28 $07
inc [hl] ; $43B2: $34
bit 7, a ; $43B3: $CB $7F
jr z, jr_002_43B9 ; $43B5: $28 $02
dec [hl] ; $43B7: $35
dec [hl] ; $43B8: $35
jr_002_43B9:
ret ; $43B9: $C9
jr_002_43BA:
ld a, [wIndoorRoom] ; $43BA: $FA $AE $DB
ld [$D46B], a ; $43BD: $EA $6B $D4
call func_002_44C2 ; $43C0: $CD $C2 $44
ldh a, [$FFA2] ; $43C3: $F0 $A2
and a ; $43C5: $A7
jr nz, jr_002_43CE ; $43C6: $20 $06
ldh a, [$FFA1] ; $43C8: $F0 $A1
and a ; $43CA: $A7
jp nz, label_002_44B5 ; $43CB: $C2 $B5 $44
jr_002_43CE:
ld a, [$C14A] ; $43CE: $FA $4A $C1
and a ; $43D1: $A7
jr z, jr_002_4402 ; $43D2: $28 $2E
ldh a, [hFFCC] ; $43D4: $F0 $CC
and $0F ; $43D6: $E6 $0F
jr z, jr_002_43E6 ; $43D8: $28 $0C
ld e, a ; $43DA: $5F
ld d, $00 ; $43DB: $16 $00
ld hl, $4905 ; $43DD: $21 $05 $49
add hl, de ; $43E0: $19
ldh a, [hLinkDirection] ; $43E1: $F0 $9E
cp [hl] ; $43E3: $BE
jr nz, jr_002_43F4 ; $43E4: $20 $0E
jr_002_43E6:
ld a, [wC120] ; $43E6: $FA $20 $C1
add $02 ; $43E9: $C6 $02
ld [wC120], a ; $43EB: $EA $20 $C1
call label_1756 ; $43EE: $CD $56 $17
jp label_002_4464 ; $43F1: $C3 $64 $44
jr_002_43F4:
ld [$C19A], a ; $43F4: $EA $9A $C1
ld a, [$C199] ; $43F7: $FA $99 $C1
add $0C ; $43FA: $C6 $0C
ld [$C199], a ; $43FC: $EA $99 $C1
call label_CAF ; $43FF: $CD $AF $0C
jr_002_4402:
ld a, [$C146] ; $4402: $FA $46 $C1
and a ; $4405: $A7
jp nz, label_002_4464 ; $4406: $C2 $64 $44
ld e, $00 ; $4409: $1E $00
ld d, $00 ; $440B: $16 $00
ld a, [wActivePowerUp] ; $440D: $FA $7C $D4
cp $01 ; $4410: $FE $01
jr nz, jr_002_4416 ; $4412: $20 $02
ld e, $10 ; $4414: $1E $10
jr_002_4416:
ld a, [wFreeMovementMode] ; $4416: $FA $7B $C1
and a ; $4419: $A7
jr jr_002_4427 ; $441A: $18 $0B
ldh a, [hMapId] ; $441C: $F0 $F7
cp MAP_COLOR_DUNGEON ; $441E: $FE $FF
jr nz, jr_002_4427 ; $4420: $20 $05
call func_002_438F ; $4422: $CD $8F $43
jr jr_002_442A ; $4425: $18 $03
jr_002_4427:
call func_002_437A ; $4427: $CD $7A $43
jr_002_442A:
ld a, [wFreeMovementMode] ; $442A: $FA $7B $C1
and a ; $442D: $A7
jr z, jr_002_443A ; $442E: $28 $0A
ld hl, hLinkPositionXIncrement ; $4430: $21 $9A $FF
sla [hl] ; $4433: $CB $26
ld hl, hLinkPositionYIncrement ; $4435: $21 $9B $FF
sla [hl] ; $4438: $CB $26
jr_002_443A:
ld a, e ; $443A: $7B
and $0F ; $443B: $E6 $0F
ld e, a ; $443D: $5F
jr z, jr_002_4459 ; $443E: $28 $19
ld hl, wC120 ; $4440: $21 $20 $C1
inc [hl] ; $4443: $34
ld hl, $4905 ; $4444: $21 $05 $49
add hl, de ; $4447: $19
ld a, [hl] ; $4448: $7E
cp $0F ; $4449: $FE $0F
jr z, label_002_4464 ; $444B: $28 $17
ld e, a ; $444D: $5F
ld a, [wC16E] ; $444E: $FA $6E $C1
and a ; $4451: $A7
ld a, e ; $4452: $7B
jr nz, jr_002_4457 ; $4453: $20 $02
ldh [hLinkDirection], a ; $4455: $E0 $9E
jr_002_4457:
jr label_002_4464 ; $4457: $18 $0B
jr_002_4459:
ld a, [$C14B] ; $4459: $FA $4B $C1
and a ; $445C: $A7
jr nz, label_002_4464 ; $445D: $20 $05
ld a, $07 ; $445F: $3E $07
ld [wC120], a ; $4461: $EA $20 $C1
label_002_4464::
ld e, $03 ; $4464: $1E $03
ld a, [wC117] ; $4466: $FA $17 $C1
and a ; $4469: $A7
jr nz, jr_002_44A2 ; $446A: $20 $36
ld e, $01 ; $446C: $1E $01
ld a, [wC15C] ; $446E: $FA $5C $C1
and a ; $4471: $A7
jr z, jr_002_4481 ; $4472: $28 $0D
ld a, [$C5A8] ; $4474: $FA $A8 $C5
cp $D5 ; $4477: $FE $D5
jr nz, jr_002_4481 ; $4479: $20 $06
ld a, [$C146] ; $447B: $FA $46 $C1
and a ; $447E: $A7
jr nz, jr_002_44A2 ; $447F: $20 $21
jr_002_4481:
ldh a, [$FFB2] ; $4481: $F0 $B2
and a ; $4483: $A7
jr nz, jr_002_44A2 ; $4484: $20 $1C
ld hl, wC11F ; $4486: $21 $1F $C1
ld a, [hl] ; $4489: $7E
and a ; $448A: $A7
jr z, func_002_44AD ; $448B: $28 $20
cp $07 ; $448D: $FE $07
jr nz, jr_002_44A9 ; $448F: $20 $18
ld a, [wFreeMovementMode] ; $4491: $FA $7B $C1
and a ; $4494: $A7
jr nz, func_002_44AD ; $4495: $20 $16
ld e, $01 ; $4497: $1E $01
ld a, [$C1BB] ; $4499: $FA $BB $C1
cp $18 ; $449C: $FE $18
jr c, jr_002_44A2 ; $449E: $38 $02
ld e, $07 ; $44A0: $1E $07
jr_002_44A2:
ldh a, [hFrameCounter] ; $44A2: $F0 $E7
and e ; $44A4: $A3
jr nz, label_002_44B5 ; $44A5: $20 $0E
jr func_002_44AD ; $44A7: $18 $04
jr_002_44A9:
ldh a, [hFrameCounter] ; $44A9: $F0 $E7
and [hl] ; $44AB: $A6
ret z ; $44AC: $C8
func_002_44AD::
ld a, [wInventoryAppearing] ; $44AD: $FA $4F $C1
and a ; $44B0: $A7
ret nz ; $44B1: $C0
call label_21A8 ; $44B2: $CD $A8 $21
label_002_44B5::
ld a, [wC11F] ; $44B5: $FA $1F $C1
ld [$C130], a ; $44B8: $EA $30 $C1
xor a ; $44BB: $AF
ld [wC11F], a ; $44BC: $EA $1F $C1
jp CheckPositionForMapTransition ; $44BF: $C3 $75 $6C
func_002_44C2::
ld a, [$C13E] ; $44C2: $FA $3E $C1
and a ; $44C5: $A7
ret z ; $44C6: $C8
dec a ; $44C7: $3D
ld [$C13E], a ; $44C8: $EA $3E $C1
call label_21A8 ; $44CB: $CD $A8 $21
call CheckPositionForMapTransition ; $44CE: $CD $75 $6C
ld a, [wCollisionType] ; $44D1: $FA $33 $C1
and a ; $44D4: $A7
jr z, jr_002_44E3 ; $44D5: $28 $0C
and $03 ; $44D7: $E6 $03
jr z, jr_002_44E0 ; $44D9: $28 $05
xor a ; $44DB: $AF
ldh [hLinkPositionYIncrement], a ; $44DC: $E0 $9B
jr jr_002_44E3 ; $44DE: $18 $03
jr_002_44E0:
xor a ; $44E0: $AF
ldh [hLinkPositionXIncrement], a ; $44E1: $E0 $9A
jr_002_44E3:
pop af ; $44E3: $F1
jp ApplyLinkMotionState ; $44E4: $C3 $94 $17
nop ; $44E7: $00
ld a, [rNR10] ; $44E8: $F0 $10
nop ; $44EA: $00
rst $38 ; $44EB: $FF
ld bc, $46FA ; $44EC: $01 $FA $46
pop bc ; $44EF: $C1
and a ; $44F0: $A7
jp z, label_002_45AC ; $44F1: $CA $AC $45
ldh a, [hIsSideScrolling] ; $44F4: $F0 $F9
and a ; $44F6: $A7
jp nz, label_002_45AC ; $44F7: $C2 $AC $45
func_002_44FA::
call $21E1 ; $44FA: $CD $E1 $21
ldh a, [$FFA3] ; $44FD: $F0 $A3
sub $02 ; $44FF: $D6 $02
ldh [$FFA3], a ; $4501: $E0 $A3
ld a, $FF ; $4503: $3E $FF
ld [wC120], a ; $4505: $EA $20 $C1
ld a, [wC10A] ; $4508: $FA $0A $C1
ld hl, $C14A ; $450B: $21 $4A $C1
or [hl] ; $450E: $B6
jr nz, jr_002_4563 ; $450F: $20 $52
ld a, [$D475] ; $4511: $FA $75 $D4
and a ; $4514: $A7
jr nz, jr_002_451E ; $4515: $20 $07
ld a, [$C1AD] ; $4517: $FA $AD $C1
cp $80 ; $451A: $FE $80
jr nz, jr_002_4523 ; $451C: $20 $05
jr_002_451E:
call ClearLinkPositionIncrement ; $451E: $CD $8E $17
jr jr_002_4563 ; $4521: $18 $40
jr_002_4523:
ldh a, [hPressedButtonsMask] ; $4523: $F0 $CB
and $03 ; $4525: $E6 $03
jr z, jr_002_4542 ; $4527: $28 $19
ld e, a ; $4529: $5F
ld d, $00 ; $452A: $16 $00
ld hl, $68B1 ; $452C: $21 $B1 $68
add hl, de ; $452F: $19
ldh a, [hLinkPositionXIncrement] ; $4530: $F0 $9A
sub [hl] ; $4532: $96
jr z, jr_002_4542 ; $4533: $28 $0D
ld e, $01 ; $4535: $1E $01
bit 7, a ; $4537: $CB $7F
jr nz, jr_002_453D ; $4539: $20 $02
ld e, $FF ; $453B: $1E $FF
jr_002_453D:
ldh a, [hLinkPositionXIncrement] ; $453D: $F0 $9A
add e ; $453F: $83
ldh [hLinkPositionXIncrement], a ; $4540: $E0 $9A
jr_002_4542:
ldh a, [hPressedButtonsMask] ; $4542: $F0 $CB
rra ; $4544: $1F
rra ; $4545: $1F
and $03 ; $4546: $E6 $03
jr z, jr_002_4563 ; $4548: $28 $19
ld e, a ; $454A: $5F
ld d, $00 ; $454B: $16 $00
ld hl, $44E7 ; $454D: $21 $E7 $44
add hl, de ; $4550: $19
ldh a, [hLinkPositionYIncrement] ; $4551: $F0 $9B
sub [hl] ; $4553: $96
jr z, jr_002_4563 ; $4554: $28 $0D
ld e, $01 ; $4556: $1E $01
bit 7, a ; $4558: $CB $7F
jr nz, jr_002_455E ; $455A: $20 $02
ld e, $FF ; $455C: $1E $FF
jr_002_455E:
ldh a, [hLinkPositionYIncrement] ; $455E: $F0 $9B
add e ; $4560: $83
ldh [hLinkPositionYIncrement], a ; $4561: $E0 $9B
jr_002_4563:
ldh a, [$FFA2] ; $4563: $F0 $A2
and a ; $4565: $A7
jr z, jr_002_456C ; $4566: $28 $04
and $80 ; $4568: $E6 $80
jr z, label_002_45AC ; $456A: $28 $40
jr_002_456C:
call label_CB6 ; $456C: $CD $B6 $0C
ldh [$FFA2], a ; $456F: $E0 $A2
ld [$C149], a ; $4571: $EA $49 $C1
ldh [$FFA3], a ; $4574: $E0 $A3
ld [$C146], a ; $4576: $EA $46 $C1
ld [$C152], a ; $4579: $EA $52 $C1
ld [$C153], a ; $457C: $EA $53 $C1
ld [wC10A], a ; $457F: $EA $0A $C1
ldh a, [hLinkPositionY] ; $4582: $F0 $99
cp $88 ; $4584: $FE $88
jr nc, label_002_45AC ; $4586: $30 $24
call func_002_75BD ; $4588: $CD $BD $75
ldh a, [$FFB8] ; $458B: $F0 $B8
cp $61 ; $458D: $FE $61
jr z, label_002_45AC ; $458F: $28 $1B
ld a, [$C181] ; $4591: $FA $81 $C1
cp $05 ; $4594: $FE $05
jr z, jr_002_45AD ; $4596: $28 $15
cp $07 ; $4598: $FE $07
jr z, label_002_45AC ; $459A: $28 $10
cp $0B ; $459C: $FE $0B
jr z, label_002_45AC ; $459E: $28 $0C
cp $50 ; $45A0: $FE $50
jr z, label_002_45AC ; $45A2: $28 $08
cp $51 ; $45A4: $FE $51
jr z, label_002_45AC ; $45A6: $28 $04
ld a, $07 ; $45A8: $3E $07
ldh [hFFF4], a ; $45AA: $E0 $F4
label_002_45AC::
ret ; $45AC: $C9
jr_002_45AD:
ldh a, [hLinkPositionY] ; $45AD: $F0 $99
ldh [$FFD8], a ; $45AF: $E0 $D8
ldh a, [hLinkPositionX] ; $45B1: $F0 $98
ldh [hScratchA], a ; $45B3: $E0 $D7
ld a, JINGLE_WATER_DIVE ; $45B5: $3E $0E
ldh [hJingle], a ; $45B7: $E0 $F2
ld a, $0C ; $45B9: $3E $0C
jp label_CC7 ; $45BB: $C3 $C7 $0C
Data_002_45BE::
db $00, $00, $08, $06, $00, $06, $00, $00, $08, $0A, $00, $0A, $00, $00, $08, $10
db $00, $10, $00, $00, $08, $08, $00, $08, $00, $00, $05, $0A, $00, $0A, $00, $00
db $05, $0A, $00, $0A, $00, $00, $05, $08, $00, $08, $00, $00, $05, $08, $00, $08
db $00, $00, $08, $08, $00, $08, $00, $00, $08, $08, $00, $08, $00, $00, $08, $08
db $00, $08, $00, $00, $08, $08, $00, $08, $00, $00, $05, $08, $00, $08, $00, $00
db $05, $08, $00, $08, $00, $00, $05, $08, $00, $08, $00, $00, $05, $08, $00, $08
db $00, $06, $07, $00, $01, $00, $00, $06, $05, $04, $03, $04, $00, $00, $07, $06
db $05, $06, $00, $04, $03, $02, $01, $02, $00, $18, $19, $11, $11, $FF, $00, $16
db $17, $10, $10, $FF, $00, $14, $15, $0F, $0F, $FF, $00, $12, $13, $0E, $0E, $FF
db $00, $00, $0D, $13, $10, $0B, $00, $F8, $F3, $ED, $F0, $F5, $00, $10, $0D, $F8
db $F5, $F8, $00, $F0, $F3, $00, $0C, $00, $00, $F0, $F3, $00, $0C, $00, $00, $F0
db $F3, $00, $0C, $00, $00, $F8, $F3, $F0, $F3, $F5, $00, $00, $0D, $10, $0D, $0D
db $00, $00, $00, $03, $03, $00, $00, $00, $00, $FD, $FD, $00, $00, $00, $00, $00
db $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
db $00, $00, $00, $00, $00, $00, $00, $FD, $FD, $00, $00, $00, $00, $03, $03, $00
db $03, $03, $08, $01, $01, $01, $01, $61, $62, $63, $00, $5E, $5F, $60, $00, $67
db $68, $69, $00, $64, $65, $66, $00, $00, $03, $01, $02, $03, $02, $03, $02, $03
db $02, $03, $04, $03, $04, $03, $02, $03, $04, $03, $04, $03, $02, $03, $04, $03
db $04, $03, $04, $03, $04, $03, $04, $03, $02, $03, $04, $00, $02, $02, $01, $01
db $03, $03, $00, $01, $02, $02, $00, $00, $03, $03, $01, $02, $00, $00, $03, $03
db $01, $01, $02, $03, $01, $01, $02, $02, $00, $00, $03
label_002_4709::
dec a ; $4709: $3D
ld [wIsUsingSpinAttack], a ; $470A: $EA $21 $C1
ld hl, $FFA1 ; $470D: $21 $A1 $FF
ld [hl], $01 ; $4710: $36 $01
srl a ; $4712: $CB $3F
srl a ; $4714: $CB $3F
ld e, a ; $4716: $5F
ld d, $00 ; $4717: $16 $00
ldh a, [hLinkDirection] ; $4719: $F0 $9E
sla a ; $471B: $CB $27
sla a ; $471D: $CB $27
sla a ; $471F: $CB $27
add e ; $4721: $83
ld e, a ; $4722: $5F
ld hl, $46C9 ; $4723: $21 $C9 $46
add hl, de ; $4726: $19
ld a, [hl] ; $4727: $7E
ld [wSwordAnimationState], a ; $4728: $EA $37 $C1
ld hl, $46E9 ; $472B: $21 $E9 $46
add hl, de ; $472E: $19
ldh a, [hLinkDirection] ; $472F: $F0 $9E
push af ; $4731: $F5
ld a, [hl] ; $4732: $7E
ldh [hLinkDirection], a ; $4733: $E0 $9E
call label_002_4827 ; $4735: $CD $27 $48
pop af ; $4738: $F1
ldh [hLinkDirection], a ; $4739: $E0 $9E
ldh a, [hFrameCounter] ; $473B: $F0 $E7
and $03 ; $473D: $E6 $03
jr nz, jr_002_4745 ; $473F: $20 $04
ld hl, wIsUsingSpinAttack ; $4741: $21 $21 $C1
dec [hl] ; $4744: $35
jr_002_4745:
ld a, [wIsUsingSpinAttack] ; $4745: $FA $21 $C1
and a ; $4748: $A7
jp z, label_002_48B0 ; $4749: $CA $B0 $48
rla ; $474C: $17
jp c, label_002_48B0 ; $474D: $DA $B0 $48
ldh a, [hLinkPositionX] ; $4750: $F0 $98
add $08 ; $4752: $C6 $08
ld [$C140], a ; $4754: $EA $40 $C1
ld a, $18 ; $4757: $3E $18
ld [$C141], a ; $4759: $EA $41 $C1
ld [$C143], a ; $475C: $EA $43 $C1
ld a, [$C145] ; $475F: $FA $45 $C1
add $08 ; $4762: $C6 $08
ld [$C142], a ; $4764: $EA $42 $C1
ld [$C5B0], a ; $4767: $EA $B0 $C5
ret ; $476A: $C9
label_002_476B::
dec a ; $476B: $3D
ld [wC16D], a ; $476C: $EA $6D $C1
jp z, label_002_48B0 ; $476F: $CA $B0 $48
ld hl, wC16E ; $4772: $21 $6E $C1
ld [hl], $04 ; $4775: $36 $04
ld a, [$C14A] ; $4777: $FA $4A $C1
and a ; $477A: $A7
jr nz, jr_002_4781 ; $477B: $20 $04
ld a, $01 ; $477D: $3E $01
ldh [$FFA1], a ; $477F: $E0 $A1
jr_002_4781:
ld a, $03 ; $4781: $3E $03
ld [wSwordAnimationState], a ; $4783: $EA $37 $C1
jp label_002_4827 ; $4786: $C3 $27 $48
jr_002_4789:
jp label_002_4827 ; $4789: $C3 $27 $48
func_002_478C::
ld a, [$D475] ; $478C: $FA $75 $D4
and a ; $478F: $A7
jr z, jr_002_47A3 ; $4790: $28 $11
ldh a, [hFrameCounter] ; $4792: $F0 $E7
rra ; $4794: $1F
rra ; $4795: $1F
and $03 ; $4796: $E6 $03
ld e, a ; $4798: $5F
ld d, $00 ; $4799: $16 $00
ld hl, $46C5 ; $479B: $21 $C5 $46
add hl, de ; $479E: $19
ld a, [hl] ; $479F: $7E
ldh [hLinkDirection], a ; $47A0: $E0 $9E
ret ; $47A2: $C9
jr_002_47A3:
ld a, [$C146] ; $47A3: $FA $46 $C1
cp $01 ; $47A6: $FE $01
jr nz, jr_002_47E0 ; $47A8: $20 $36
ld a, [$C3CF] ; $47AA: $FA $CF $C3
ld hl, wSwordAnimationState ; $47AD: $21 $37 $C1
or [hl] ; $47B0: $B6
jr nz, jr_002_47E0 ; $47B1: $20 $2D
ldh a, [hLinkDirection] ; $47B3: $F0 $9E
rla ; $47B5: $17
rla ; $47B6: $17
and $0C ; $47B7: $E6 $0C
ld c, a ; $47B9: $4F
ld b, $00 ; $47BA: $06 $00
ld a, [$C152] ; $47BC: $FA $52 $C1
cp $03 ; $47BF: $FE $03
jr nc, jr_002_47E0 ; $47C1: $30 $1D
ld e, a ; $47C3: $5F
ld d, $00 ; $47C4: $16 $00
ld hl, $46B5 ; $47C6: $21 $B5 $46
add hl, de ; $47C9: $19
add hl, bc ; $47CA: $09
ld a, [hl] ; $47CB: $7E
ldh [hLinkAnimationState], a ; $47CC: $E0 $9D
ld a, [$C153] ; $47CE: $FA $53 $C1
inc a ; $47D1: $3C
ld [$C153], a ; $47D2: $EA $53 $C1
and $07 ; $47D5: $E6 $07
jr nz, jr_002_47E0 ; $47D7: $20 $07
ld a, [$C152] ; $47D9: $FA $52 $C1
inc a ; $47DC: $3C
ld [$C152], a ; $47DD: $EA $52 $C1
jr_002_47E0:
ld a, [wIsUsingSpinAttack] ; $47E0: $FA $21 $C1
and a ; $47E3: $A7
jp nz, label_002_4709 ; $47E4: $C2 $09 $47
ld a, [wC16D] ; $47E7: $FA $6D $C1
and a ; $47EA: $A7
jp nz, label_002_476B ; $47EB: $C2 $6B $47
ld a, [wSwordAnimationState] ; $47EE: $FA $37 $C1
and a ; $47F1: $A7
ret z ; $47F2: $C8
ld hl, wC16E ; $47F3: $21 $6E $C1
ld [hl], $04 ; $47F6: $36 $04
ld a, [wSwordAnimationState] ; $47F8: $FA $37 $C1
cp $05 ; $47FB: $FE $05
jr nc, jr_002_4789 ; $47FD: $30 $8A
ld a, [$C14A] ; $47FF: $FA $4A $C1
and a ; $4802: $A7
jr nz, jr_002_4809 ; $4803: $20 $04
ld a, $01 ; $4805: $3E $01
ldh [$FFA1], a ; $4807: $E0 $A1
jr_002_4809:
ld a, [$C138] ; $4809: $FA $38 $C1
and a ; $480C: $A7
jr nz, jr_002_4823 ; $480D: $20 $14
ld a, [wSwordAnimationState] ; $480F: $FA $37 $C1
inc a ; $4812: $3C
ld [wSwordAnimationState], a ; $4813: $EA $37 $C1
cp $04 ; $4816: $FE $04
jp z, label_002_48B0 ; $4818: $CA $B0 $48
ld c, a ; $481B: $4F
ld b, $00 ; $481C: $06 $00
ld hl, $46AD ; $481E: $21 $AD $46
add hl, bc ; $4821: $09
ld a, [hl] ; $4822: $7E
jr_002_4823:
dec a ; $4823: $3D
ld [$C138], a ; $4824: $EA $38 $C1
label_002_4827::
ld hl, wSwordAnimationState ; $4827: $21 $37 $C1
ldh a, [hLinkDirection] ; $482A: $F0 $9E
ld e, a ; $482C: $5F
sla a ; $482D: $CB $27
sla a ; $482F: $CB $27
add e ; $4831: $83
add e ; $4832: $83
add [hl] ; $4833: $86
ld c, a ; $4834: $4F
ld b, $00 ; $4835: $06 $00
ld hl, $461E ; $4837: $21 $1E $46
add hl, bc ; $483A: $09
ld a, [hl] ; $483B: $7E
ld [wSwordDirection], a ; $483C: $EA $36 $C1
ld hl, $4636 ; $483F: $21 $36 $46
add hl, bc ; $4842: $09
ld a, [hl] ; $4843: $7E
cp $FF ; $4844: $FE $FF
jr z, jr_002_484A ; $4846: $28 $02
ldh [hLinkAnimationState], a ; $4848: $E0 $9D
jr_002_484A:
ld hl, $464E ; $484A: $21 $4E $46
add hl, bc ; $484D: $09
ld a, [hl] ; $484E: $7E
ld [$C13A], a ; $484F: $EA $3A $C1
ld hl, $4666 ; $4852: $21 $66 $46
add hl, bc ; $4855: $09
ld a, [hl] ; $4856: $7E
ld [$C139], a ; $4857: $EA $39 $C1
ld hl, $467E ; $485A: $21 $7E $46
add hl, bc ; $485D: $09
ld a, [hl] ; $485E: $7E
ld [$C13C], a ; $485F: $EA $3C $C1
ld hl, $4696 ; $4862: $21 $96 $46
add hl, bc ; $4865: $09
ld a, [hl] ; $4866: $7E
ld [$C13B], a ; $4867: $EA $3B $C1
ld hl, Data_002_45BE ; $486A: $21 $BE $45
add hl, bc ; $486D: $09
ld a, [hl] ; $486E: $7E
and a ; $486F: $A7
jr z, jr_002_48AD ; $4870: $28 $3B
ld a, [wIsUsingShield] ; $4872: $FA $5B $C1
and a ; $4875: $A7
jr z, jr_002_487E ; $4876: $28 $06
ldh a, [hFrameCounter] ; $4878: $F0 $E7
and $01 ; $487A: $E6 $01
jr nz, jr_002_48AD ; $487C: $20 $2F
jr_002_487E:
ld a, [$C13A] ; $487E: $FA $3A $C1
add [hl] ; $4881: $86
ld hl, hLinkPositionX ; $4882: $21 $98 $FF
add [hl] ; $4885: $86
ld [$C140], a ; $4886: $EA $40 $C1
ld hl, $45D6 ; $4889: $21 $D6 $45
add hl, bc ; $488C: $09
ld a, [hl] ; $488D: $7E
ld [$C141], a ; $488E: $EA $41 $C1
ld a, [$C139] ; $4891: $FA $39 $C1
ld hl, $45EE ; $4894: $21 $EE $45
add hl, bc ; $4897: $09
add [hl] ; $4898: $86
ld hl, $C145 ; $4899: $21 $45 $C1
add [hl] ; $489C: $86
ld [$C142], a ; $489D: $EA $42 $C1
ld hl, $4606 ; $48A0: $21 $06 $46
add hl, bc ; $48A3: $09
ld a, [hl] ; $48A4: $7E
ld [$C143], a ; $48A5: $EA $43 $C1
ld a, $01 ; $48A8: $3E $01
ld [$C5B0], a ; $48AA: $EA $B0 $C5
jr_002_48AD:
jp CheckStaticSwordCollision_trampoline ; $48AD: $C3 $A7 $15
label_002_48B0::
xor a ; $48B0: $AF
ld [$C1AC], a ; $48B1: $EA $AC $C1
ld a, [$C14A] ; $48B4: $FA $4A $C1
and a ; $48B7: $A7
jr nz, jr_002_48C4 ; $48B8: $20 $0A
xor a ; $48BA: $AF
ld [wSwordAnimationState], a ; $48BB: $EA $37 $C1
ld [wC16A], a ; $48BE: $EA $6A $C1
ld [wIsUsingSpinAttack], a ; $48C1: $EA $21 $C1
jr_002_48C4:
ret ; $48C4: $C9
Data_002_48C5::
db $00, $10, $F0, $00, $00, $0C, $F4, $00, $00, $0C, $F4, $00, $00, $00, $00, $00
db $00, $14, $EC, $00, $00, $0F, $F1, $00, $00, $0F, $F1, $00, $00, $00, $00, $00
db $00, $00, $00, $00, $F0, $F4, $F4, $00, $10, $0C, $0C, $00, $00, $00, $00, $00
db $00, $00, $00, $00, $EC, $F1, $F1, $00, $14, $0F, $0F, $00, $00, $00, $00, $00
db $0F, $00, $01, $0F, $02, $0F, $0F, $0F, $03, $0F, $0F, $0A, $0B, $06, $07, $04
db $05, $00, $01, $2C, $2D, $06, $07, $34, $35, $22, $23, $2A, $2B, $28, $29, $30
db $31, $24, $25, $2E, $2F, $06, $07, $34, $35, $22, $23, $2A, $2B, $28, $29, $32
db $33, $26, $27, $20, $21, $1E, $1F, $1C, $1D, $1A, $1B, $3E, $3F, $40, $41, $42
db $43, $44, $45, $46, $47, $48, $49, $4A, $4B, $4C, $4D, $4E, $4F, $4E, $4F, $4E
db $4F, $4E, $4F, $5B, $5C, $58, $59, $5B, $5C, $58, $59
ld a, $02 ; $4960: $3E $02
ld [$C1C4], a ; $4962: $EA $C4 $C1
ldh a, [$FF9C] ; $4965: $F0 $9C
and a ; $4967: $A7
jr nz, jr_002_49AA ; $4968: $20 $40
ldh a, [hLinkPositionY] ; $496A: $F0 $99
add $10 ; $496C: $C6 $10
ldh [hLinkPositionY], a ; $496E: $E0 $99
ldh [hLinkFinalPositionY], a ; $4970: $E0 $A0
ldh a, [$FFA2] ; $4972: $F0 $A2
add $10 ; $4974: $C6 $10
ldh [$FFA2], a ; $4976: $E0 $A2
jr_002_4978:
ld a, $FF ; $4978: $3E $FF
ldh [hLinkPositionYIncrement], a ; $497A: $E0 $9B
xor a ; $497C: $AF
ldh [hLinkPositionXIncrement], a ; $497D: $E0 $9A
ldh a, [hLinkPositionY] ; $497F: $F0 $99
add $08 ; $4981: $C6 $08
ldh [hLinkPositionY], a ; $4983: $E0 $99
ldh [hLinkFinalPositionY], a ; $4985: $E0 $A0
ldh a, [$FFA2] ; $4987: $F0 $A2
add $08 ; $4989: $C6 $08
ldh [$FFA2], a ; $498B: $E0 $A2
call CheckForLedgeJump ; $498D: $CD $45 $6E
ldh a, [$FFAF] ; $4990: $F0 $AF
cp $E1 ; $4992: $FE $E1
jr z, jr_002_4978 ; $4994: $28 $E2
cp $61 ; $4996: $FE $61
jr z, jr_002_49A0 ; $4998: $28 $06
ld a, [wCollisionType] ; $499A: $FA $33 $C1
and a ; $499D: $A7
jr nz, jr_002_4978 ; $499E: $20 $D8
jr_002_49A0:
ld a, $01 ; $49A0: $3E $01
ldh [$FF9C], a ; $49A2: $E0 $9C
ldh a, [hLinkPositionY] ; $49A4: $F0 $99
sub $03 ; $49A6: $D6 $03
ldh [hLinkPositionY], a ; $49A8: $E0 $99
jr_002_49AA:
call func_002_44FA ; $49AA: $CD $FA $44
ldh a, [$FFA2] ; $49AD: $F0 $A2
and a ; $49AF: $A7
jr nz, jr_002_49B6 ; $49B0: $20 $04
xor a ; $49B2: $AF
ld [wLinkMotionState], a ; $49B3: $EA $1C $C1
jr_002_49B6:
ld a, $01 ; $49B6: $3E $01
ld [$C146], a ; $49B8: $EA $46 $C1
call $1177 ; $49BB: $CD $77 $11
call func_002_478C ; $49BE: $CD $8C $47
ld a, [wSwordAnimationState] ; $49C1: $FA $37 $C1
ld [wC16A], a ; $49C4: $EA $6A $C1
jp ApplyLinkMotionState ; $49C7: $C3 $94 $17
ld bc, $0100 ; $49CA: $01 $00 $01
nop ; $49CD: $00
nop ; $49CE: $00
ld bc, $0100 ; $49CF: $01 $00 $01
ld bc, $0001 ; $49D2: $01 $01 $00
nop ; $49D5: $00
nop ; $49D6: $00
nop ; $49D7: $00
ld bc, $0101 ; $49D8: $01 $01 $01
nop ; $49DB: $00
ld bc, $0000 ; $49DC: $01 $00 $00
ld bc, $0100 ; $49DF: $01 $00 $01
ld bc, $0001 ; $49E2: $01 $01 $00
nop ; $49E5: $00
nop ; $49E6: $00
nop ; $49E7: $00
ld bc, $0001 ; $49E8: $01 $01 $00
ld bc, $0101 ; $49EB: $01 $01 $01
ld bc, $0100 ; $49EE: $01 $00 $01
ld bc, $0101 ; $49F1: $01 $01 $01
nop ; $49F4: $00
ld bc, $0101 ; $49F5: $01 $01 $01
ld bc, $0100 ; $49F8: $01 $00 $01
nop ; $49FB: $00
nop ; $49FC: $00
nop ; $49FD: $00
nop ; $49FE: $00
ld bc, $0000 ; $49FF: $01 $00 $00
nop ; $4A02: $00
nop ; $4A03: $00
ld bc, $0000 ; $4A04: $01 $00 $00
nop ; $4A07: $00
nop ; $4A08: $00
ld bc, $0100 ; $4A09: $01 $00 $01
ld bc, $0100 ; $4A0C: $01 $00 $01
nop ; $4A0F: $00
nop ; $4A10: $00
ld bc, $F808 ; $4A11: $01 $08 $F8
ld b, $01 ; $4A14: $06 $01
func_002_4A16::
ld a, [wC166] ; $4A16: $FA $66 $C1
and a ; $4A19: $A7
ret z ; $4A1A: $C8
ld hl, $FFA1 ; $4A1B: $21 $A1 $FF
ld [hl], $02 ; $4A1E: $36 $02
cp $FF ; $4A20: $FE $FF
jr nz, jr_002_4A7C ; $4A22: $20 $58
ld a, [$D210] ; $4A24: $FA $10 $D2
add $01 ; $4A27: $C6 $01
ld [$D210], a ; $4A29: $EA $10 $D2
ld a, [$D211] ; $4A2C: $FA $11 $D2
adc $00 ; $4A2F: $CE $00
ld [$D211], a ; $4A31: $EA $11 $D2
cp $08 ; $4A34: $FE $08
jr nz, jr_002_4A53 ; $4A36: $20 $1B
ld a, [$D210] ; $4A38: $FA $10 $D2
cp $D0 ; $4A3B: $FE $D0
jr nz, jr_002_4A53 ; $4A3D: $20 $14
xor a ; $4A3F: $AF
ld [wC166], a ; $4A40: $EA $66 $C1
ld [wC167], a ; $4A43: $EA $67 $C1
ld a, $03 ; $4A46: $3E $03
ld [$C5A3], a ; $4A48: $EA $A3 $C5
ld a, [$D465] ; $4A4B: $FA $65 $D4
cp $47 ; $4A4E: $FE $47
ret z ; $4A50: $C8
jr jr_002_4A6C ; $4A51: $18 $19
jr_002_4A53:
ld a, [$D465] ; $4A53: $FA $65 $D4
cp $47 ; $4A56: $FE $47
jr z, jr_002_4A7A ; $4A58: $28 $20
ldh a, [hFFCC] ; $4A5A: $F0 $CC
and $30 ; $4A5C: $E6 $30
jr z, jr_002_4A7A ; $4A5E: $28 $1A
xor a ; $4A60: $AF
ld [wC166], a ; $4A61: $EA $66 $C1
ld [wC167], a ; $4A64: $EA $67 $C1
ld a, $03 ; $4A67: $3E $03
ld [$C5A3], a ; $4A69: $EA $A3 $C5
jr_002_4A6C:
ld a, [$D461] ; $4A6C: $FA $61 $D4
ld e, a ; $4A6F: $5F
ld d, b ; $4A70: $50
ld hl, wEntitiesWalkingTable ; $4A71: $21 $90 $C2
add hl, de ; $4A74: $19
ld [hl], $00 ; $4A75: $36 $00
jp label_27DD ; $4A77: $C3 $DD $27
jr_002_4A7A:
jr jr_002_4AD1 ; $4A7A: $18 $55
jr_002_4A7C:
call ClearLinkPositionIncrement ; $4A7C: $CD $8E $17
call label_CAF ; $4A7F: $CD $AF $0C
ld hl, wC166 ; $4A82: $21 $66 $C1
dec [hl] ; $4A85: $35
jr nz, jr_002_4AD1 ; $4A86: $20 $49
ld a, [wIsMarinFollowingLink] ; $4A88: $FA $73 $DB
and a ; $4A8B: $A7
jr z, jr_002_4AA2 ; $4A8C: $28 $14
ld a, [$DB4A] ; $4A8E: $FA $4A $DB
cp $01 ; $4A91: $FE $01
jr z, jr_002_4AB2 ; $4A93: $28 $1D
ld a, [wIsIndoor] ; $4A95: $FA $A5 $DB
and a ; $4A98: $A7
jr nz, jr_002_4AB2 ; $4A99: $20 $17
ld a, $77 ; $4A9B: $3E $77
call OpenDialogInTable2 ; $4A9D: $CD $7C $23
jr jr_002_4AB2 ; $4AA0: $18 $10
jr_002_4AA2:
ld a, [$DB49] ; $4AA2: $FA $49 $DB
and a ; $4AA5: $A7
jr nz, jr_002_4AB2 ; $4AA6: $20 $0A
ld a, $8E ; $4AA8: $3E $8E
call OpenDialog ; $4AAA: $CD $85 $23
xor a ; $4AAD: $AF
ld [wC167], a ; $4AAE: $EA $67 $C1
ret ; $4AB1: $C9
jr_002_4AB2:
xor a ; $4AB2: $AF
ld [wC167], a ; $4AB3: $EA $67 $C1
ld a, [$DB4A] ; $4AB6: $FA $4A $DB
cp $01 ; $4AB9: $FE $01
jr nz, jr_002_4AD0 ; $4ABB: $20 $13
ld a, TRANSITION_GFX_MANBO_IN ; $4ABD: $3E $02
ld [wTransitionGfx], a ; $4ABF: $EA $7F $C1
xor a ; $4AC2: $AF
ld [wTransitionGfxFrameCount], a ; $4AC3: $EA $80 $C1
ld [wTransitionSequenceCounter], a ; $4AC6: $EA $6B $C1
ld [wC16C], a ; $4AC9: $EA $6C $C1
ld a, JINGLE_MANBO_WARP ; $4ACC: $3E $2C
ldh [hJingle], a ; $4ACE: $E0 $F2
jr_002_4AD0:
ret ; $4AD0: $C9
jr_002_4AD1:
ld a, [$C5A4] ; $4AD1: $FA $A4 $C5
inc a ; $4AD4: $3C
ld [$C5A4], a ; $4AD5: $EA $A4 $C5
cp $38 ; $4AD8: $FE $38
jr c, jr_002_4AE8 ; $4ADA: $38 $0C
xor a ; $4ADC: $AF
ld [$C5A4], a ; $4ADD: $EA $A4 $C5
ld a, [$C5A5] ; $4AE0: $FA $A5 $C5
xor $01 ; $4AE3: $EE $01
ld [$C5A5], a ; $4AE5: $EA $A5 $C5
jr_002_4AE8:
ld a, [$C5A5] ; $4AE8: $FA $A5 $C5
ld e, $75 ; $4AEB: $1E $75
and a ; $4AED: $A7
jr nz, jr_002_4AF1 ; $4AEE: $20 $01
inc e ; $4AF0: $1C
jr_002_4AF1:
ld a, e ; $4AF1: $7B
ldh [hLinkAnimationState], a ; $4AF2: $E0 $9D
ld a, $02 ; $4AF4: $3E $02
ld [wC167], a ; $4AF6: $EA $67 $C1
ld [wC111], a ; $4AF9: $EA $11 $C1
ld a, [wC166] ; $4AFC: $FA $66 $C1
cp $10 ; $4AFF: $FE $10
ret c ; $4B01: $D8
ld a, [$C5A4] ; $4B02: $FA $A4 $C5
cp $14 ; $4B05: $FE $14
jr nz, jr_002_4B40 ; $4B07: $20 $37
ld a, $C9 ; $4B09: $3E $C9
call label_3B86 ; $4B0B: $CD $86 $3B
jr c, jr_002_4B40 ; $4B0E: $38 $30
ldh a, [hLinkPositionY] ; $4B10: $F0 $99
ld hl, wEntitiesPosYTable ; $4B12: $21 $10 $C2
add hl, de ; $4B15: $19
sub $08 ; $4B16: $D6 $08
ld [hl], a ; $4B18: $77
ld a, [$C5A5] ; $4B19: $FA $A5 $C5
ld c, a ; $4B1C: $4F
ld b, d ; $4B1D: $42
ld hl, $4A12 ; $4B1E: $21 $12 $4A
add hl, bc ; $4B21: $09
ldh a, [hLinkPositionX] ; $4B22: $F0 $98
add [hl] ; $4B24: $86
ld hl, wEntity0PosX ; $4B25: $21 $00 $C2
add hl, de ; $4B28: $19
ld [hl], a ; $4B29: $77
ld hl, $4A14 ; $4B2A: $21 $14 $4A
add hl, bc ; $4B2D: $09
ld a, [hl] ; $4B2E: $7E
ld hl, $C240 ; $4B2F: $21 $40 $C2
add hl, de ; $4B32: $19
ld [hl], a ; $4B33: $77
ld hl, $C250 ; $4B34: $21 $50 $C2
add hl, de ; $4B37: $19
ld [hl], $FC ; $4B38: $36 $FC
ld hl, $C3D0 ; $4B3A: $21 $D0 $C3
add hl, de ; $4B3D: $19
ld [hl], $40 ; $4B3E: $36 $40
jr_002_4B40:
ret ; $4B40: $C9
ld [hl], c ; $4B41: $71
ld [hl], d ; $4B42: $72
ld l, a ; $4B43: $6F
ld [hl], b ; $4B44: $70
ld [hl], e ; $4B45: $73
ld [hl], h ; $4B46: $74
ld l, l ; $4B47: $6D
ld l, [hl] ; $4B48: $6E
func_002_4B49::
ld a, [$C1C7] ; $4B49: $FA $C7 $C1
and a ; $4B4C: $A7
jr z, jr_002_4BBF ; $4B4D: $28 $70
ldh a, [hMapId] ; $4B4F: $F0 $F7
cp MAP_WINDFISHS_EGG ; $4B51: $FE $08
jr nz, jr_002_4B64 ; $4B53: $20 $0F
ld a, [$D219] ; $4B55: $FA $19 $D2
cp $02 ; $4B58: $FE $02
jr nz, jr_002_4B64 ; $4B5A: $20 $08
call $134B ; $4B5C: $CD $4B $13
ld a, $01 ; $4B5F: $3E $01
ld [$C5B0], a ; $4B61: $EA $B0 $C5
jr_002_4B64:
ld hl, $FFA1 ; $4B64: $21 $A1 $FF
ld [hl], $01 ; $4B67: $36 $01
call ClearLinkPositionIncrement ; $4B69: $CD $8E $17
ld [wSwordAnimationState], a ; $4B6C: $EA $37 $C1
ld [wIsUsingSpinAttack], a ; $4B6F: $EA $21 $C1
ld [$C122], a ; $4B72: $EA $22 $C1
ld a, [$C1C8] ; $4B75: $FA $C8 $C1
inc a ; $4B78: $3C
ld [$C1C8], a ; $4B79: $EA $C8 $C1
cp $10 ; $4B7C: $FE $10
jr nz, jr_002_4B85 ; $4B7E: $20 $05
push af ; $4B80: $F5
call func_002_4BC8 ; $4B81: $CD $C8 $4B
pop af ; $4B84: $F1
jr_002_4B85:
cp $18 ; $4B85: $FE $18
jr nz, jr_002_4BA9 ; $4B87: $20 $20
ld a, [$C1C7] ; $4B89: $FA $C7 $C1
cp $02 ; $4B8C: $FE $02
jr nz, jr_002_4BA1 ; $4B8E: $20 $11
ld a, [wIsMarinFollowingLink] ; $4B90: $FA $73 $DB
and a ; $4B93: $A7
jr z, jr_002_4BA1 ; $4B94: $28 $0B
ld a, [wDialogState] ; $4B96: $FA $9F $C1
and a ; $4B99: $A7
jr nz, jr_002_4BA1 ; $4B9A: $20 $05
ld a, $79 ; $4B9C: $3E $79
call OpenDialogInTable2 ; $4B9E: $CD $7C $23
jr_002_4BA1:
xor a ; $4BA1: $AF
ld [$C1C7], a ; $4BA2: $EA $C7 $C1
ld [$C1AC], a ; $4BA5: $EA $AC $C1
ret ; $4BA8: $C9
jr_002_4BA9:
rra ; $4BA9: $1F
rra ; $4BAA: $1F
rra ; $4BAB: $1F
rra ; $4BAC: $1F
and $01 ; $4BAD: $E6 $01
ld e, a ; $4BAF: $5F
ldh a, [hLinkDirection] ; $4BB0: $F0 $9E
sla a ; $4BB2: $CB $27
add e ; $4BB4: $83
ld e, a ; $4BB5: $5F
ld d, $00 ; $4BB6: $16 $00
ld hl, $4B41 ; $4BB8: $21 $41 $4B
add hl, de ; $4BBB: $19
ld a, [hl] ; $4BBC: $7E
ldh [hLinkAnimationState], a ; $4BBD: $E0 $9D
jr_002_4BBF:
ret ; $4BBF: $C9
inc d ; $4BC0: $14
db $fc ; $4BC1: $FC
ld [$0A08], sp ; $4BC2: $08 $08 $0A
ld a, [bc] ; $4BC5: $0A
db $fc ; $4BC6: $FC
inc d ; $4BC7: $14
func_002_4BC8::
call func_002_4D20 ; $4BC8: $CD $20 $4D
ret c ; $4BCB: $D8
ld a, $02 ; $4BCC: $3E $02
ld [$C1C7], a ; $4BCE: $EA $C7 $C1
jp label_002_4C92 ; $4BD1: $C3 $92 $4C
func_002_4BD4::
ldh a, [$FFCF] ; $4BD4: $F0 $CF
ld [hl+], a ; $4BD6: $22
ldh a, [$FFD0] ; $4BD7: $F0 $D0
ld [hl+], a ; $4BD9: $22
ld a, $81 ; $4BDA: $3E $81
ld [hl+], a ; $4BDC: $22
ld a, [wIsIndoor] ; $4BDD: $FA $A5 $DB
and a ; $4BE0: $A7
jr z, jr_002_4BFA ; $4BE1: $28 $17
ld a, $04 ; $4BE3: $3E $04
ld [hl+], a ; $4BE5: $22
ld a, $06 ; $4BE6: $3E $06
ld [hl+], a ; $4BE8: $22
ldh a, [$FFCF] ; $4BE9: $F0 $CF
ld [hl+], a ; $4BEB: $22
ldh a, [$FFD0] ; $4BEC: $F0 $D0
inc a ; $4BEE: $3C
ld [hl+], a ; $4BEF: $22
ld a, $81 ; $4BF0: $3E $81
ld [hl+], a ; $4BF2: $22
ld a, $05 ; $4BF3: $3E $05
ld [hl+], a ; $4BF5: $22
ld a, $07 ; $4BF6: $3E $07
jr jr_002_4C0F ; $4BF8: $18 $15
jr_002_4BFA:
ld a, $6A ; $4BFA: $3E $6A
ld [hl+], a ; $4BFC: $22
ld a, $7A ; $4BFD: $3E $7A
ld [hl+], a ; $4BFF: $22
ldh a, [$FFCF] ; $4C00: $F0 $CF
ld [hl+], a ; $4C02: $22
ldh a, [$FFD0] ; $4C03: $F0 $D0
inc a ; $4C05: $3C
ld [hl+], a ; $4C06: $22
ld a, $81 ; $4C07: $3E $81
ld [hl+], a ; $4C09: $22
ld a, $6B ; $4C0A: $3E $6B
ld [hl+], a ; $4C0C: $22
ld a, $7B ; $4C0D: $3E $7B
jr_002_4C0F:
ld [hl+], a ; $4C0F: $22
ld a, $00 ; $4C10: $3E $00
ld [hl+], a ; $4C12: $22
ret ; $4C13: $C9
func_002_4C14::
push de ; $4C14: $D5
push hl ; $4C15: $E5
ld hl, $DC91 ; $4C16: $21 $91 $DC
ld a, [$DC90] ; $4C19: $FA $90 $DC
ld e, a ; $4C1C: $5F
add $0A ; $4C1D: $C6 $0A
ld [$DC90], a ; $4C1F: $EA $90 $DC
add hl, de ; $4C22: $19
ld e, l ; $4C23: $5D
ld d, h ; $4C24: $54
pop hl ; $4C25: $E1
ldh a, [$FFCF] ; $4C26: $F0 $CF
ld [hl+], a ; $4C28: $22
ld [de], a ; $4C29: $12
inc de ; $4C2A: $13
ldh a, [$FFD0] ; $4C2B: $F0 $D0
ld [hl+], a ; $4C2D: $22
ld [de], a ; $4C2E: $12
inc de ; $4C2F: $13
ld a, $81 ; $4C30: $3E $81
ld [hl+], a ; $4C32: $22
ld [de], a ; $4C33: $12
inc de ; $4C34: $13
ld a, [wIsIndoor] ; $4C35: $FA $A5 $DB
and a ; $4C38: $A7
jr z, jr_002_4C64 ; $4C39: $28 $29
ld a, $04 ; $4C3B: $3E $04
ld [hl+], a ; $4C3D: $22
ld a, $06 ; $4C3E: $3E $06
ld [hl+], a ; $4C40: $22
ld a, $05 ; $4C41: $3E $05
ld [de], a ; $4C43: $12
inc de ; $4C44: $13
ld [de], a ; $4C45: $12
inc de ; $4C46: $13
ldh a, [$FFCF] ; $4C47: $F0 $CF
ld [hl+], a ; $4C49: $22
ld [de], a ; $4C4A: $12
inc de ; $4C4B: $13
ldh a, [$FFD0] ; $4C4C: $F0 $D0
inc a ; $4C4E: $3C
ld [hl+], a ; $4C4F: $22
ld [de], a ; $4C50: $12
inc de ; $4C51: $13
ld a, $81 ; $4C52: $3E $81
ld [hl+], a ; $4C54: $22
ld [de], a ; $4C55: $12
inc de ; $4C56: $13
ld a, $05 ; $4C57: $3E $05
ld [hl+], a ; $4C59: $22
ld a, $05 ; $4C5A: $3E $05
ld [de], a ; $4C5C: $12
inc de ; $4C5D: $13
ld [de], a ; $4C5E: $12
inc de ; $4C5F: $13
ld a, $07 ; $4C60: $3E $07
jr jr_002_4C8B ; $4C62: $18 $27
jr_002_4C64:
ld a, $6A ; $4C64: $3E $6A
ld [hl+], a ; $4C66: $22
ld a, $7A ; $4C67: $3E $7A
ld [hl+], a ; $4C69: $22
ld a, $03 ; $4C6A: $3E $03
ld [de], a ; $4C6C: $12
inc de ; $4C6D: $13
ld [de], a ; $4C6E: $12
inc de ; $4C6F: $13
ldh a, [$FFCF] ; $4C70: $F0 $CF
ld [hl+], a ; $4C72: $22
ld [de], a ; $4C73: $12
inc de ; $4C74: $13
ldh a, [$FFD0] ; $4C75: $F0 $D0
inc a ; $4C77: $3C
ld [hl+], a ; $4C78: $22
ld [de], a ; $4C79: $12
inc de ; $4C7A: $13
ld a, $81 ; $4C7B: $3E $81
ld [hl+], a ; $4C7D: $22
ld [de], a ; $4C7E: $12
inc de ; $4C7F: $13
ld a, $6B ; $4C80: $3E $6B
ld [hl+], a ; $4C82: $22
ld a, $03 ; $4C83: $3E $03
ld [de], a ; $4C85: $12
inc de ; $4C86: $13
ld [de], a ; $4C87: $12
inc de ; $4C88: $13
ld a, $7B ; $4C89: $3E $7B
jr_002_4C8B:
ld [hl+], a ; $4C8B: $22
ld a, $00 ; $4C8C: $3E $00
ld [hl+], a ; $4C8E: $22
ld [de], a ; $4C8F: $12
pop de ; $4C90: $D1
ret ; $4C91: $C9
label_002_4C92::
ldh a, [$FFD8] ; $4C92: $F0 $D8
ld e, a ; $4C94: $5F
ld d, $00 ; $4C95: $16 $00
ld hl, wRoomObjects ; $4C97: $21 $11 $D7
add hl, de ; $4C9A: $19
ld [hl], $CC ; $4C9B: $36 $CC
ld a, $82 ; $4C9D: $3E $82
call label_B2F ; $4C9F: $CD $2F $0B
call label_2887 ; $4CA2: $CD $87 $28
ld hl, wRequestDestinationHigh ; $4CA5: $21 $01 $D6
ld a, [wRequests] ; $4CA8: $FA $00 $D6
ld e, a ; $4CAB: $5F
add $0A ; $4CAC: $C6 $0A
ld [wRequests], a ; $4CAE: $EA $00 $D6
ld d, $00 ; $4CB1: $16 $00
add hl, de ; $4CB3: $19
ldh a, [hIsGBC] ; $4CB4: $F0 $FE
and a ; $4CB6: $A7
jr nz, jr_002_4CBE ; $4CB7: $20 $05
call func_002_4BD4 ; $4CB9: $CD $D4 $4B
jr jr_002_4CC1 ; $4CBC: $18 $03
jr_002_4CBE:
call func_002_4C14 ; $4CBE: $CD $14 $4C
jr_002_4CC1:
call GetRandomByte ; $4CC1: $CD $0D $28
and $07 ; $4CC4: $E6 $07
jr nz, jr_002_4D1F ; $4CC6: $20 $57
ld a, [wIsIndoor] ; $4CC8: $FA $A5 $DB
and a ; $4CCB: $A7
jr nz, jr_002_4CD3 ; $4CCC: $20 $05
ldh a, [hMapRoom] ; $4CCE: $F0 $F6
cp $0E ; $4CD0: $FE $0E
ret z ; $4CD2: $C8
jr_002_4CD3:
call GetRandomByte ; $4CD3: $CD $0D $28
rra ; $4CD6: $1F
ld a, $2E ; $4CD7: $3E $2E
jr nc, jr_002_4CDD ; $4CD9: $30 $02
ld a, $2D ; $4CDB: $3E $2D
jr_002_4CDD:
call label_3B86 ; $4CDD: $CD $86 $3B
jr c, jr_002_4D1F ; $4CE0: $38 $3D
ld hl, wEntity0PosX ; $4CE2: $21 $00 $C2
add hl, de ; $4CE5: $19
ldh a, [hSwordIntersectedAreaX] ; $4CE6: $F0 $CE
add $08 ; $4CE8: $C6 $08
ld [hl], a ; $4CEA: $77
ld hl, wEntitiesPosYTable ; $4CEB: $21 $10 $C2
add hl, de ; $4CEE: $19
ldh a, [hSwordIntersectedAreaY] ; $4CEF: $F0 $CD
add $10 ; $4CF1: $C6 $10
ld [hl], a ; $4CF3: $77
ld hl, $C450 ; $4CF4: $21 $50 $C4
add hl, de ; $4CF7: $19
ld [hl], $80 ; $4CF8: $36 $80
ld hl, wEntitiesUnknowTableF ; $4CFA: $21 $F0 $C2
add hl, de ; $4CFD: $19
ld [hl], $18 ; $4CFE: $36 $18
ld hl, $C320 ; $4D00: $21 $20 $C3
add hl, de ; $4D03: $19
ld [hl], $20 ; $4D04: $36 $20
ld c, e ; $4D06: $4B
ld b, d ; $4D07: $42
ld a, $0C ; $4D08: $3E $0C
call label_3BAA ; $4D0A: $CD $AA $3B
ldh a, [hScratchA] ; $4D0D: $F0 $D7
cpl ; $4D0F: $2F
inc a ; $4D10: $3C
ld hl, $C250 ; $4D11: $21 $50 $C2
add hl, bc ; $4D14: $09
ld [hl], a ; $4D15: $77
ldh a, [$FFD8] ; $4D16: $F0 $D8
cpl ; $4D18: $2F
inc a ; $4D19: $3C
ld hl, $C240 ; $4D1A: $21 $40 $C2
add hl, bc ; $4D1D: $09
ld [hl], a ; $4D1E: $77
jr_002_4D1F:
ret ; $4D1F: $C9
func_002_4D20::
ld a, [wC15C] ; $4D20: $FA $5C $C1
ld hl, $FFA2 ; $4D23: $21 $A2 $FF
or [hl] ; $4D26: $B6
ld hl, wLinkMotionState ; $4D27: $21 $1C $C1
or [hl] ; $4D2A: $B6
ld hl, hIsSideScrolling ; $4D2B: $21 $F9 $FF
or [hl] ; $4D2E: $B6
jp nz, label_002_4D95 ; $4D2F: $C2 $95 $4D
ldh a, [hLinkDirection] ; $4D32: $F0 $9E
ld e, a ; $4D34: $5F
ld d, $00 ; $4D35: $16 $00
ld hl, $4BC0 ; $4D37: $21 $C0 $4B
add hl, de ; $4D3A: $19
ldh a, [hLinkPositionX] ; $4D3B: $F0 $98
add [hl] ; $4D3D: $86
sub $08 ; $4D3E: $D6 $08
and $F0 ; $4D40: $E6 $F0
ldh [hSwordIntersectedAreaX], a ; $4D42: $E0 $CE
swap a ; $4D44: $CB $37
ld c, a ; $4D46: $4F
ld hl, $4BC4 ; $4D47: $21 $C4 $4B
add hl, de ; $4D4A: $19
ldh a, [hLinkPositionY] ; $4D4B: $F0 $99
add [hl] ; $4D4D: $86
sub $10 ; $4D4E: $D6 $10
and $F0 ; $4D50: $E6 $F0
ldh [hSwordIntersectedAreaY], a ; $4D52: $E0 $CD
or c ; $4D54: $B1
ld e, a ; $4D55: $5F
ldh [$FFD8], a ; $4D56: $E0 $D8
ld hl, wRoomObjects ; $4D58: $21 $11 $D7
add hl, de ; $4D5B: $19
ld a, h ; $4D5C: $7C
cp $D7 ; $4D5D: $FE $D7
jp nz, label_002_4D95 ; $4D5F: $C2 $95 $4D
ld a, [hl] ; $4D62: $7E
ldh [hScratchA], a ; $4D63: $E0 $D7
ld e, a ; $4D65: $5F
ld a, [wIsIndoor] ; $4D66: $FA $A5 $DB
ld d, a ; $4D69: $57
call label_2A26 ; $4D6A: $CD $26 $2A
cp $00 ; $4D6D: $FE $00
jr nz, label_002_4D95 ; $4D6F: $20 $24
ld a, d ; $4D71: $7A
and a ; $4D72: $A7
jr nz, jr_002_4D8D ; $4D73: $20 $18
ldh a, [hScratchA] ; $4D75: $F0 $D7
cp $0C ; $4D77: $FE $0C
jr z, label_002_4D95 ; $4D79: $28 $1A
cp $0D ; $4D7B: $FE $0D
jr z, label_002_4D95 ; $4D7D: $28 $16
cp $0C ; $4D7F: $FE $0C
jr z, label_002_4D95 ; $4D81: $28 $12
cp $0D ; $4D83: $FE $0D
jr z, label_002_4D95 ; $4D85: $28 $0E
cp $B9 ; $4D87: $FE $B9
jr z, label_002_4D95 ; $4D89: $28 $0A
jr jr_002_4D93 ; $4D8B: $18 $06
jr_002_4D8D:
ldh a, [hScratchA] ; $4D8D: $F0 $D7
cp $05 ; $4D8F: $FE $05
jr nz, label_002_4D95 ; $4D91: $20 $02
jr_002_4D93:
and a ; $4D93: $A7
ret ; $4D94: $C9
label_002_4D95::
scf ; $4D95: $37
ret ; $4D96: $C9
label_002_4D97::
ldh a, [hScratchA] ; $4D97: $F0 $D7
ldh [hSwordIntersectedAreaX], a ; $4D99: $E0 $CE
swap a ; $4D9B: $CB $37
and $0F ; $4D9D: $E6 $0F
ld e, a ; $4D9F: $5F
ldh a, [$FFD8] ; $4DA0: $F0 $D8
ldh [hSwordIntersectedAreaY], a ; $4DA2: $E0 $CD
and $F0 ; $4DA4: $E6 $F0
or e ; $4DA6: $B3
ld e, a ; $4DA7: $5F
ld d, $00 ; $4DA8: $16 $00
ld hl, wRoomObjects ; $4DAA: $21 $11 $D7
add hl, de ; $4DAD: $19
ld [hl], $AE ; $4DAE: $36 $AE
call label_2887 ; $4DB0: $CD $87 $28
ldh a, [hIsGBC] ; $4DB3: $F0 $FE
and a ; $4DB5: $A7
jr z, jr_002_4DCB ; $4DB6: $28 $13
push bc ; $4DB8: $C5
ld c, $AE ; $4DB9: $0E $AE
ld b, $00 ; $4DBB: $06 $00
sla c ; $4DBD: $CB $21
rl b ; $4DBF: $CB $10
sla c ; $4DC1: $CB $21
rl b ; $4DC3: $CB $10
ld a, $02 ; $4DC5: $3E $02
call $092E ; $4DC7: $CD $2E $09
pop bc ; $4DCA: $C1
jr_002_4DCB:
ld hl, wRequestDestinationHigh ; $4DCB: $21 $01 $D6
ld a, [wRequests] ; $4DCE: $FA $00 $D6
ld e, a ; $4DD1: $5F
add $0A ; $4DD2: $C6 $0A
ld [wRequests], a ; $4DD4: $EA $00 $D6
ld d, $00 ; $4DD7: $16 $00
add hl, de ; $4DD9: $19
ldh a, [$FFCF] ; $4DDA: $F0 $CF
ld [hl+], a ; $4DDC: $22
ldh a, [$FFD0] ; $4DDD: $F0 $D0
ld [hl+], a ; $4DDF: $22
ld a, $81 ; $4DE0: $3E $81
ld [hl+], a ; $4DE2: $22
ld a, $76 ; $4DE3: $3E $76
ld [hl+], a ; $4DE5: $22
ld a, $77 ; $4DE6: $3E $77
ld [hl+], a ; $4DE8: $22
ldh a, [$FFCF] ; $4DE9: $F0 $CF
ld [hl+], a ; $4DEB: $22
ldh a, [$FFD0] ; $4DEC: $F0 $D0
inc a ; $4DEE: $3C
ld [hl+], a ; $4DEF: $22
ld a, $81 ; $4DF0: $3E $81
ld [hl+], a ; $4DF2: $22
ld a, $76 ; $4DF3: $3E $76
ld [hl+], a ; $4DF5: $22
ld a, $77 ; $4DF6: $3E $77
ld [hl+], a ; $4DF8: $22
ld [hl], $00 ; $4DF9: $36 $00
ret ; $4DFB: $C9
func_002_4DFC::
push bc ; $4DFC: $C5
push de ; $4DFD: $D5
ld hl, $DC50 ; $4DFE: $21 $50 $DC
ld c, $00 ; $4E01: $0E $00
di ; $4E03: $F3
jr_002_4E04:
xor a ; $4E04: $AF
ld [rSVBK], a ; $4E05: $E0 $70
ld b, [hl] ; $4E07: $46
ld a, $02 ; $4E08: $3E $02
ld [rSVBK], a ; $4E0A: $E0 $70
ld a, b ; $4E0C: $78
ld [hl], a ; $4E0D: $77
inc hl ; $4E0E: $23
inc c ; $4E0F: $0C
ld a, c ; $4E10: $79
cp $08 ; $4E11: $FE $08
jr c, jr_002_4E04 ; $4E13: $38 $EF
xor a ; $4E15: $AF
ld [rSVBK], a ; $4E16: $E0 $70
ei ; $4E18: $FB
pop de ; $4E19: $D1
pop bc ; $4E1A: $C1
ret ; $4E1B: $C9
rst $38 ; $4E1C: $FF
ld b, a ; $4E1D: $47
nop ; $4E1E: $00
nop ; $4E1F: $00
inc c ; $4E20: $0C
add hl, sp ; $4E21: $39
db $76 ; $4E22: $76
ld e, [hl] ; $4E23: $5E
rst $38 ; $4E24: $FF
ld b, a ; $4E25: $47
nop ; $4E26: $00
nop ; $4E27: $00
ld h, a ; $4E28: $67
jr z, jr_002_4EA1 ; $4E29: $28 $76
ld e, [hl] ; $4E2B: $5E
func_002_4E2C::
push bc ; $4E2C: $C5
di ; $4E2D: $F3
ld hl, $4E1C ; $4E2E: $21 $1C $4E
add hl, de ; $4E31: $19
ld de, $DC88 ; $4E32: $11 $88 $DC
ld c, $00 ; $4E35: $0E $00
jr_002_4E37:
ld a, [hl+] ; $4E37: $2A
ld [de], a ; $4E38: $12
inc de ; $4E39: $13
inc c ; $4E3A: $0C
ld a, c ; $4E3B: $79
cp $08 ; $4E3C: $FE $08
jr c, jr_002_4E37 ; $4E3E: $38 $F7
ei ; $4E40: $FB
ld a, $02 ; $4E41: $3E $02
ld [$DDD1], a ; $4E43: $EA $D1 $DD
pop bc ; $4E46: $C1
ret ; $4E47: $C9
; Copy data from RAM bank 2 to RAM bank 0
func_002_4E48::
di ; $4E48: $F3
ld hl, $DC88 ; $4E49: $21 $88 $DC
ld e, $00 ; $4E4C: $1E $00
.loop
ld a, $02 ; $4E4E: $3E $02
ld [rSVBK], a ; $4E50: $E0 $70
ld b, [hl] ; $4E52: $46
xor a ; $4E53: $AF
ld [rSVBK], a ; $4E54: $E0 $70
ld a, b ; $4E56: $78
ld [hl], a ; $4E57: $77
inc hl ; $4E58: $23
inc e ; $4E59: $1C
ld a, e ; $4E5A: $7B
cp $08 ; $4E5B: $FE $08
jr c, .loop ; $4E5D: $38 $EF
ei ; $4E5F: $FB
ld a, $02 ; $4E60: $3E $02
ld [$DDD1], a ; $4E62: $EA $D1 $DD
ret ; $4E65: $C9
ld d, b ; $4E66: $50
ld d, c ; $4E67: $51
ld d, d ; $4E68: $52
ld d, e ; $4E69: $53
ld d, e ; $4E6A: $53
ld d, h ; $4E6B: $54
ld d, d ; $4E6C: $52
ld a, $10 ; $4E6D: $3E $10
ldh [hLinkPositionY], a ; $4E6F: $E0 $99
ld a, $50 ; $4E71: $3E $50
ldh [hLinkPositionX], a ; $4E73: $E0 $98
ld [wC167], a ; $4E75: $EA $67 $C1
ld a, [$C198] ; $4E78: $FA $98 $C1
push af ; $4E7B: $F5
ld d, $00 ; $4E7C: $16 $00
ld e, $08 ; $4E7E: $1E $08
cp $18 ; $4E80: $FE $18
jr z, jr_002_4E95 ; $4E82: $28 $11
ld e, $00 ; $4E84: $1E $00
cp $28 ; $4E86: $FE $28
jr z, jr_002_4E95 ; $4E88: $28 $0B
and a ; $4E8A: $A7
jr nz, jr_002_4E9D ; $4E8B: $20 $10
ldh a, [hIsGBC] ; $4E8D: $F0 $FE
and a ; $4E8F: $A7
jr z, jr_002_4E9D ; $4E90: $28 $0B
call func_002_4DFC ; $4E92: $CD $FC $4D
jr_002_4E95:
ldh a, [hIsGBC] ; $4E95: $F0 $FE
and a ; $4E97: $A7
jr z, jr_002_4E9D ; $4E98: $28 $03
call func_002_4E2C ; $4E9A: $CD $2C $4E
jr_002_4E9D:
pop af ; $4E9D: $F1
rra ; $4E9E: $1F
rra ; $4E9F: $1F
rra ; $4EA0: $1F
jr_002_4EA1:
and $07 ; $4EA1: $E6 $07
ld e, a ; $4EA3: $5F
ld d, $00 ; $4EA4: $16 $00
ld hl, $4E66 ; $4EA6: $21 $66 $4E
add hl, de ; $4EA9: $19
ld a, [hl] ; $4EAA: $7E
ldh [hLinkAnimationState], a ; $4EAB: $E0 $9D
ld a, [$C198] ; $4EAD: $FA $98 $C1
inc a ; $4EB0: $3C
ld [$C198], a ; $4EB1: $EA $98 $C1
cp $38 ; $4EB4: $FE $38
jr c, jr_002_4EC4 ; $4EB6: $38 $0C
ld a, $FB ; $4EB8: $3E $FB
ldh [hLinkPositionY], a ; $4EBA: $E0 $99
ld a, $02 ; $4EBC: $3E $02
ldh [hLinkDirection], a ; $4EBE: $E0 $9E
ld a, $04 ; $4EC0: $3E $04
ldh [hLinkAnimationState], a ; $4EC2: $E0 $9D
jr_002_4EC4:
ld a, [$C198] ; $4EC4: $FA $98 $C1
cp $48 ; $4EC7: $FE $48
jr nz, jr_002_4EEF ; $4EC9: $20 $24
ldh a, [hIsGBC] ; $4ECB: $F0 $FE
and a ; $4ECD: $A7
jr z, jr_002_4ED3 ; $4ECE: $28 $03
call func_002_4E48 ; $4ED0: $CD $48 $4E
jr_002_4ED3:
ld a, $02 ; $4ED3: $3E $02
ld [wRoomTransitionDirection], a ; $4ED5: $EA $25 $C1
ld a, $01 ; $4ED8: $3E $01
ld [wRoomTransitionState], a ; $4EDA: $EA $24 $C1
func_002_4EDD::
xor a ; $4EDD: $AF
ld [$C198], a ; $4EDE: $EA $98 $C1
ld [wC167], a ; $4EE1: $EA $67 $C1
ld [$DDD6], a ; $4EE4: $EA $D6 $DD
ld [$DDD7], a ; $4EE7: $EA $D7 $DD
ld a, $00 ; $4EEA: $3E $00
ld [wLinkMotionState], a ; $4EEC: $EA $1C $C1
jr_002_4EEF:
ret ; $4EEF: $C9
nop ; $4EF0: $00
ld [$00F8], sp ; $4EF1: $08 $F8 $00
nop ; $4EF4: $00
ld b, $FA ; $4EF5: $06 $FA
nop ; $4EF7: $00
nop ; $4EF8: $00
ld b, $FA ; $4EF9: $06 $FA
nop ; $4EFB: $00
nop ; $4EFC: $00
nop ; $4EFD: $00
nop ; $4EFE: $00
nop ; $4EFF: $00
nop ; $4F00: $00
db $10 ; $4F01: $10
ld a, [rP1] ; $4F02: $F0 $00
nop ; $4F04: $00
inc c ; $4F05: $0C
db $f4 ; $4F06: $F4
nop ; $4F07: $00
nop ; $4F08: $00
inc c ; $4F09: $0C
db $f4 ; $4F0A: $F4
nop ; $4F0B: $00
nop ; $4F0C: $00
nop ; $4F0D: $00
nop ; $4F0E: $00
nop ; $4F0F: $00
nop ; $4F10: $00
nop ; $4F11: $00
nop ; $4F12: $00
nop ; $4F13: $00
ld hl, sp-$06 ; $4F14: $F8 $FA
ld a, [label_800] ; $4F16: $FA $00 $08
ld b, $06 ; $4F19: $06 $06
nop ; $4F1B: $00
nop ; $4F1C: $00
nop ; $4F1D: $00
nop ; $4F1E: $00
nop ; $4F1F: $00
nop ; $4F20: $00
nop ; $4F21: $00
nop ; $4F22: $00
nop ; $4F23: $00
ldh a, [hFFF4] ; $4F24: $F0 $F4
db $f4 ; $4F26: $F4
nop ; $4F27: $00
db $10 ; $4F28: $10
inc c ; $4F29: $0C
inc c ; $4F2A: $0C
nop ; $4F2B: $00
nop ; $4F2C: $00
nop ; $4F2D: $00
nop ; $4F2E: $00
nop ; $4F2F: $00
ld a, [wFreeMovementMode] ; $4F30: $FA $7B $C1
and a ; $4F33: $A7
jr z, jr_002_4F3C ; $4F34: $28 $06
ld a, $00 ; $4F36: $3E $00
ld [wLinkMotionState], a ; $4F38: $EA $1C $C1
ret ; $4F3B: $C9
jr_002_4F3C:
call label_CAF ; $4F3C: $CD $AF $0C
ldh [$FFA2], a ; $4F3F: $E0 $A2
ld [$C146], a ; $4F41: $EA $46 $C1
ld [$C19B], a ; $4F44: $EA $9B $C1
ld [wSwordAnimationState], a ; $4F47: $EA $37 $C1
ld [wC16A], a ; $4F4A: $EA $6A $C1
ld [wC16D], a ; $4F4D: $EA $6D $C1
ld a, [wIndoorRoom] ; $4F50: $FA $AE $DB
ld [$D46B], a ; $4F53: $EA $6B $D4
ld hl, wDialogState ; $4F56: $21 $9F $C1
ldh a, [$FFA1] ; $4F59: $F0 $A1
or [hl] ; $4F5B: $B6
jp z, label_002_4F6D ; $4F5C: $CA $6D $4F
call ClearLinkPositionIncrement ; $4F5F: $CD $8E $17
ldh a, [$FFA1] ; $4F62: $F0 $A1
and a ; $4F64: $A7
jr z, jr_002_4F6A ; $4F65: $28 $03
xor a ; $4F67: $AF
ldh [$FFA1], a ; $4F68: $E0 $A1
jr_002_4F6A:
jp label_1A50 ; $4F6A: $C3 $50 $1A
label_002_4F6D::
ldh a, [hFFCC] ; $4F6D: $F0 $CC
and $20 ; $4F6F: $E6 $20
jr z, jr_002_4F86 ; $4F71: $28 $13
ldh a, [$FF9C] ; $4F73: $F0 $9C
xor $01 ; $4F75: $EE $01
ldh [$FF9C], a ; $4F77: $E0 $9C
jr z, jr_002_4F86 ; $4F79: $28 $0B
ld a, $A0 ; $4F7B: $3E $A0
ldh [$FFB7], a ; $4F7D: $E0 $B7
ldh a, [hLinkPositionY] ; $4F7F: $F0 $99
sub $03 ; $4F81: $D6 $03
call func_002_5928 ; $4F83: $CD $28 $59
jr_002_4F86:
ld a, [$C183] ; $4F86: $FA $83 $C1
and a ; $4F89: $A7
jr z, jr_002_4F92 ; $4F8A: $28 $06
dec a ; $4F8C: $3D
ld [$C183], a ; $4F8D: $EA $83 $C1
jr jr_002_4FA1 ; $4F90: $18 $0F
jr_002_4F92:
ldh a, [hFFCC] ; $4F92: $F0 $CC
and $10 ; $4F94: $E6 $10
jr z, jr_002_4FA1 ; $4F96: $28 $09
ld a, $0F ; $4F98: $3E $0F
ldh [hJingle], a ; $4F9A: $E0 $F2
ld a, $20 ; $4F9C: $3E $20
ld [$C183], a ; $4F9E: $EA $83 $C1
jr_002_4FA1:
ldh a, [hFrameCounter] ; $4FA1: $F0 $E7
and $01 ; $4FA3: $E6 $01
jr nz, jr_002_5005 ; $4FA5: $20 $5E
ldh a, [hPressedButtonsMask] ; $4FA7: $F0 $CB
and $0F ; $4FA9: $E6 $0F
ld e, a ; $4FAB: $5F
ld d, $00 ; $4FAC: $16 $00
ld hl, $4EF0 ; $4FAE: $21 $F0 $4E
ld a, [$C183] ; $4FB1: $FA $83 $C1
cp $10 ; $4FB4: $FE $10
jr c, jr_002_4FBB ; $4FB6: $38 $03
ld hl, $4F00 ; $4FB8: $21 $00 $4F
jr_002_4FBB:
add hl, de ; $4FBB: $19
ld a, [hl] ; $4FBC: $7E
ld hl, hLinkPositionXIncrement ; $4FBD: $21 $9A $FF
sub [hl] ; $4FC0: $96
jr z, jr_002_4FCA ; $4FC1: $28 $07
inc [hl] ; $4FC3: $34
bit 7, a ; $4FC4: $CB $7F
jr z, jr_002_4FCA ; $4FC6: $28 $02
dec [hl] ; $4FC8: $35
dec [hl] ; $4FC9: $35
jr_002_4FCA:
ld hl, $4F10 ; $4FCA: $21 $10 $4F
ld a, [$C183] ; $4FCD: $FA $83 $C1
cp $10 ; $4FD0: $FE $10
jr c, jr_002_4FD7 ; $4FD2: $38 $03
ld hl, $4F20 ; $4FD4: $21 $20 $4F
jr_002_4FD7:
add hl, de ; $4FD7: $19
ld a, [hl] ; $4FD8: $7E
ld hl, hLinkPositionYIncrement ; $4FD9: $21 $9B $FF
sub [hl] ; $4FDC: $96
jr z, jr_002_4FE6 ; $4FDD: $28 $07
inc [hl] ; $4FDF: $34
bit 7, a ; $4FE0: $CB $7F
jr z, jr_002_4FE6 ; $4FE2: $28 $02
dec [hl] ; $4FE4: $35
dec [hl] ; $4FE5: $35
jr_002_4FE6:
ldh a, [hLinkPositionXIncrement] ; $4FE6: $F0 $9A
or [hl] ; $4FE8: $B6
ld hl, $FF9C ; $4FE9: $21 $9C $FF
or [hl] ; $4FEC: $B6
jr z, jr_002_4FF5 ; $4FED: $28 $06
ld hl, wC120 ; $4FEF: $21 $20 $C1
inc [hl] ; $4FF2: $34
jr jr_002_4FFA ; $4FF3: $18 $05
jr_002_4FF5:
ld a, $03 ; $4FF5: $3E $03
ld [wC120], a ; $4FF7: $EA $20 $C1
jr_002_4FFA:
ld hl, $4905 ; $4FFA: $21 $05 $49
add hl, de ; $4FFD: $19
ld a, [hl] ; $4FFE: $7E
cp $0F ; $4FFF: $FE $0F
jr z, jr_002_5005 ; $5001: $28 $02
ldh [hLinkDirection], a ; $5003: $E0 $9E
jr_002_5005:
call label_1A50 ; $5005: $CD $50 $1A
ldh a, [$FFA1] ; $5008: $F0 $A1
and a ; $500A: $A7
jr z, jr_002_5012 ; $500B: $28 $05
xor a ; $500D: $AF
ldh [$FFA1], a ; $500E: $E0 $A1
jr jr_002_5015 ; $5010: $18 $03
jr_002_5012:
call func_002_44AD ; $5012: $CD $AD $44
jr_002_5015:
call func_002_753A ; $5015: $CD $3A $75
ldh a, [$FF9C] ; $5018: $F0 $9C
and a ; $501A: $A7
jr z, jr_002_5079 ; $501B: $28 $5C
ldh a, [$FFB7] ; $501D: $F0 $B7
and a ; $501F: $A7
jr nz, jr_002_5024 ; $5020: $20 $02
ldh [$FF9C], a ; $5022: $E0 $9C
jr_002_5024:
ldh a, [hMapId] ; $5024: $F0 $F7
and a ; $5026: $A7
jr z, jr_002_5035 ; $5027: $28 $0C
cp $1F ; $5029: $FE $1F
jr nz, jr_002_507A ; $502B: $20 $4D
ldh a, [hMapRoom] ; $502D: $F0 $F6
cp $F2 ; $502F: $FE $F2
jr nz, jr_002_5079 ; $5031: $20 $46
jr jr_002_503B ; $5033: $18 $06
jr_002_5035:
ldh a, [hMapRoom] ; $5035: $F0 $F6
cp $78 ; $5037: $FE $78
jr nz, jr_002_5079 ; $5039: $20 $3E
jr_002_503B:
ldh a, [hLinkPositionY] ; $503B: $F0 $99
sub $50 ; $503D: $D6 $50
add $08 ; $503F: $C6 $08
cp $10 ; $5041: $FE $10
jr nc, jr_002_50A2 ; $5043: $30 $5D
ldh a, [hLinkPositionX] ; $5045: $F0 $98
sub $58 ; $5047: $D6 $58
add $08 ; $5049: $C6 $08
cp $10 ; $504B: $FE $10
jr nc, jr_002_50A2 ; $504D: $30 $53
ld hl, hRoomStatus ; $504F: $21 $F8 $FF
bit 5, [hl] ; $5052: $CB $6E
jr nz, jr_002_5079 ; $5054: $20 $23
set 5, [hl] ; $5056: $CB $EE
ld a, $35 ; $5058: $3E $35
call label_3B86 ; $505A: $CD $86 $3B
jr c, jr_002_5079 ; $505D: $38 $1A
ldh a, [hLinkPositionX] ; $505F: $F0 $98
ld hl, wEntity0PosX ; $5061: $21 $00 $C2
add hl, de ; $5064: $19
ld [hl], a ; $5065: $77
ldh a, [hLinkPositionY] ; $5066: $F0 $99
ld hl, wEntitiesPosYTable ; $5068: $21 $10 $C2
add hl, de ; $506B: $19
ld [hl], a ; $506C: $77
ld hl, $C310 ; $506D: $21 $10 $C3
add hl, de ; $5070: $19
ld [hl], $03 ; $5071: $36 $03
ld hl, $C340 ; $5073: $21 $40 $C3
add hl, de ; $5076: $19
res 4, [hl] ; $5077: $CB $A6
jr_002_5079:
ret ; $5079: $C9
jr_002_507A:
ldh a, [hMapRoom] ; $507A: $F0 $F6
cp $8D ; $507C: $FE $8D
jr nz, jr_002_50A2 ; $507E: $20 $22
ldh a, [hLinkPositionY] ; $5080: $F0 $99
sub $50 ; $5082: $D6 $50
add $08 ; $5084: $C6 $08
cp $10 ; $5086: $FE $10
jr nc, jr_002_50A2 ; $5088: $30 $18
ldh a, [hLinkPositionX] ; $508A: $F0 $98
sub $58 ; $508C: $D6 $58
add $08 ; $508E: $C6 $08
cp $10 ; $5090: $FE $10
jr nc, jr_002_50A2 ; $5092: $30 $0E
ldh a, [hLinkPositionX] ; $5094: $F0 $98
ld [$D404], a ; $5096: $EA $04 $D4
ld a, [wLinkMotionState] ; $5099: $FA $1C $C1
ld [$D463], a ; $509C: $EA $63 $D4
jp ApplyMapFadeOutTransition ; $509F: $C3 $7D $0C
jr_002_50A2:
ret ; $50A2: $C9
ld a, $01 ; $50A3: $3E $01
ldh [$FFA1], a ; $50A5: $E0 $A1
call label_21A8 ; $50A7: $CD $A8 $21
call $21E1 ; $50AA: $CD $E1 $21
ldh a, [hLinkPositionX] ; $50AD: $F0 $98
and $F0 ; $50AF: $E6 $F0
cp $E0 ; $50B1: $FE $E0
jr z, jr_002_50BA ; $50B3: $28 $05
ldh a, [$FFA2] ; $50B5: $F0 $A2
cp $78 ; $50B7: $FE $78
ret c ; $50B9: $D8
jr_002_50BA:
call $0C83 ; $50BA: $CD $83 $0C
call ClearLinkPositionIncrement ; $50BD: $CD $8E $17
ldh [$FFA2], a ; $50C0: $E0 $A2
ldh [$FFA3], a ; $50C2: $E0 $A3
ld a, $70 ; $50C4: $3E $70
ld [$DBC8], a ; $50C6: $EA $C8 $DB
ret ; $50C9: $C9
ld d, l ; $50CA: $55
ld d, [hl] ; $50CB: $56
ld d, a ; $50CC: $57
ld d, a ; $50CD: $57
rst $38 ; $50CE: $FF
rst $38 ; $50CF: $FF
rst $38 ; $50D0: $FF
rst $38 ; $50D1: $FF
rst $38 ; $50D2: $FF
rst $38 ; $50D3: $FF
ld a, $01 ; $50D4: $3E $01
ld [wC167], a ; $50D6: $EA $67 $C1
ld a, [$C198] ; $50D9: $FA $98 $C1
inc a ; $50DC: $3C
ld [$C198], a ; $50DD: $EA $98 $C1
rra ; $50E0: $1F
rra ; $50E1: $1F
rra ; $50E2: $1F
rra ; $50E3: $1F
nop ; $50E4: $00
and $0F ; $50E5: $E6 $0F
cp $06 ; $50E7: $FE $06
jr z, jr_002_50F6 ; $50E9: $28 $0B
ld e, a ; $50EB: $5F
ld d, $00 ; $50EC: $16 $00
ld hl, $50CA ; $50EE: $21 $CA $50
add hl, de ; $50F1: $19
ld a, [hl] ; $50F2: $7E
ldh [hLinkAnimationState], a ; $50F3: $E0 $9D
ret ; $50F5: $C9
jr_002_50F6:
xor a ; $50F6: $AF
ld [$C13E], a ; $50F7: $EA $3E $C1
ld [wIsUsingSpinAttack], a ; $50FA: $EA $21 $C1
ld [$C122], a ; $50FD: $EA $22 $C1
call func_002_52D6 ; $5100: $CD $D6 $52
ld a, [wIsIndoor] ; $5103: $FA $A5 $DB
and a ; $5106: $A7
jr nz, jr_002_512B ; $5107: $20 $22
ldh a, [hMapRoom] ; $5109: $F0 $F6
cp $01 ; $510B: $FE $01
jr z, jr_002_511B ; $510D: $28 $0C
cp $95 ; $510F: $FE $95
jr z, jr_002_511B ; $5111: $28 $08
cp $2C ; $5113: $FE $2C
jr z, jr_002_511B ; $5115: $28 $04
cp $EC ; $5117: $FE $EC
jr nz, jr_002_512B ; $5119: $20 $10
jr_002_511B:
ld a, $09 ; $511B: $3E $09
ld [wLinkMotionState], a ; $511D: $EA $1C $C1
ld a, $40 ; $5120: $3E $40
ldh [$FFB7], a ; $5122: $E0 $B7
xor a ; $5124: $AF
ldh [$FF9C], a ; $5125: $E0 $9C
dec a ; $5127: $3D
ldh [hLinkAnimationState], a ; $5128: $E0 $9D
ret ; $512A: $C9
jr_002_512B:
ld a, [$DBCB] ; $512B: $FA $CB $DB
cp $50 ; $512E: $FE $50
jr z, jr_002_516A ; $5130: $28 $38
cp $FF ; $5132: $FE $FF
jr z, jr_002_5155 ; $5134: $28 $1F
ld a, [$D401] ; $5136: $FA $01 $D4
cp $02 ; $5139: $FE $02
jr nz, jr_002_5145 ; $513B: $20 $08
ldh a, [hLinkPositionY] ; $513D: $F0 $99
ld [$D404], a ; $513F: $EA $04 $D4
xor a ; $5142: $AF
jr jr_002_515C ; $5143: $18 $17
jr_002_5145:
ldh a, [hLinkPositionX] ; $5145: $F0 $98
and $F0 ; $5147: $E6 $F0
add $08 ; $5149: $C6 $08
ld [$D404], a ; $514B: $EA $04 $D4
ldh a, [hLinkPositionY] ; $514E: $F0 $99
and $F0 ; $5150: $E6 $F0
ld [$D405], a ; $5152: $EA $05 $D4
jr_002_5155:
ld a, $01 ; $5155: $3E $01
ld [$D475], a ; $5157: $EA $75 $D4
ld a, $70 ; $515A: $3E $70
jr_002_515C:
ld [$DBC8], a ; $515C: $EA $C8 $DB
call ClearLinkPositionIncrement ; $515F: $CD $8E $17
ldh [$FFA3], a ; $5162: $E0 $A3
ld [$C146], a ; $5164: $EA $46 $C1
jp $0C83 ; $5167: $C3 $83 $0C
jr_002_516A:
ld a, [wIsIndoor] ; $516A: $FA $A5 $DB
and a ; $516D: $A7
jr nz, jr_002_5176 ; $516E: $20 $06
ldh a, [hMapRoom] ; $5170: $F0 $F6
cp $1E ; $5172: $FE $1E
jr z, jr_002_5155 ; $5174: $28 $DF
jr_002_5176:
ldh a, [hMapId] ; $5176: $F0 $F7
cp MAP_CAVE_B ; $5178: $FE $0A
jr nz, jr_002_51AC ; $517A: $20 $30
ldh a, [hMapRoom] ; $517C: $F0 $F6
cp $7A ; $517E: $FE $7A
jr z, jr_002_518E ; $5180: $28 $0C
cp $7B ; $5182: $FE $7B
jr z, jr_002_518E ; $5184: $28 $08
cp $7C ; $5186: $FE $7C
jr z, jr_002_518E ; $5188: $28 $04
cp $7D ; $518A: $FE $7D
jr nz, jr_002_51AC ; $518C: $20 $1E
jr_002_518E:
ld a, $00 ; $518E: $3E $00
ld hl, $D401 ; $5190: $21 $01 $D4
ld [hl+], a ; $5193: $22
ld a, $00 ; $5194: $3E $00
ld [hl+], a ; $5196: $22
ld a, $1A ; $5197: $3E $1A
ld [hl+], a ; $5199: $22
ld a, $68 ; $519A: $3E $68
ld [hl+], a ; $519C: $22
ld a, $56 ; $519D: $3E $56
ld [hl+], a ; $519F: $22
ld a, $24 ; $51A0: $3E $24
ld [$DBC8], a ; $51A2: $EA $C8 $DB
ld a, $03 ; $51A5: $3E $03
ldh [hLinkDirection], a ; $51A7: $E0 $9E
jp $0C83 ; $51A9: $C3 $83 $0C
jr_002_51AC:
call label_002_52B9 ; $51AC: $CD $B9 $52
ld a, [wDB94] ; $51AF: $FA $94 $DB
add $04 ; $51B2: $C6 $04
ld [wDB94], a ; $51B4: $EA $94 $DB
xor a ; $51B7: $AF
ld [wC167], a ; $51B8: $EA $67 $C1
ret ; $51BB: $C9
HandleGotItemA::
ld a, [wDialogGotItemCountdown] ; $51BC: $FA $AA $C1
cp $2E ; $51BF: $FE $2E
jr nz, HandleGotItemB ; $51C1: $20 $04
ld a, JINGLE_GOT_POWER_UP ; $51C3: $3E $17
ldh [hJingle], a ; $51C5: $E0 $F2
HandleGotItemB::
call label_CAF ; $51C7: $CD $AF $0C
ld [wC16A], a ; $51CA: $EA $6A $C1
ld [wSwordAnimationState], a ; $51CD: $EA $37 $C1
ld [$C13E], a ; $51D0: $EA $3E $C1
call ApplyLinkMotionState ; $51D3: $CD $94 $17
call $21E1 ; $51D6: $CD $E1 $21
ldh a, [$FFA3] ; $51D9: $F0 $A3
sub $02 ; $51DB: $D6 $02
ldh [$FFA3], a ; $51DD: $E0 $A3
ldh a, [$FFA2] ; $51DF: $F0 $A2
and $80 ; $51E1: $E6 $80
jr z, jr_002_51ED ; $51E3: $28 $08
xor a ; $51E5: $AF
ldh [$FFA2], a ; $51E6: $E0 $A2
ld [$C149], a ; $51E8: $EA $49 $C1
ldh [$FFA3], a ; $51EB: $E0 $A3
jr_002_51ED:
ld a, $6B ; $51ED: $3E $6B
ldh [hLinkAnimationState], a ; $51EF: $E0 $9D
ld bc, $C010 ; $51F1: $01 $10 $C0
ldh a, [hLinkPositionY] ; $51F4: $F0 $99
ld hl, $FFA2 ; $51F6: $21 $A2 $FF
sub [hl] ; $51F9: $96
ld hl, $C13B ; $51FA: $21 $3B $C1
add [hl] ; $51FD: $86
sub $10 ; $51FE: $D6 $10
ldh [hScratchA], a ; $5200: $E0 $D7
ld a, [wDialogGotItem] ; $5202: $FA $A9 $C1
cp $01 ; $5205: $FE $01
jr z, jr_002_524F ; $5207: $28 $46
ldh a, [hScratchA] ; $5209: $F0 $D7
add $02 ; $520B: $C6 $02
ld [bc], a ; $520D: $02
inc bc ; $520E: $03
ldh a, [hLinkPositionX] ; $520F: $F0 $98
add $00 ; $5211: $C6 $00
ld [bc], a ; $5213: $02
inc bc ; $5214: $03
ld a, [wDialogGotItem] ; $5215: $FA $A9 $C1
ld e, $AE ; $5218: $1E $AE
cp $05 ; $521A: $FE $05
jr z, jr_002_522F ; $521C: $28 $11
ld e, $8E ; $521E: $1E $8E
cp $03 ; $5220: $FE $03
jr z, jr_002_5244 ; $5222: $28 $20
cp $04 ; $5224: $FE $04
jr nz, jr_002_5234 ; $5226: $20 $0C
ld e, $8C ; $5228: $1E $8C
call func_002_524A ; $522A: $CD $4A $52
jr jr_002_5237 ; $522D: $18 $08
jr_002_522F:
call func_002_523A ; $522F: $CD $3A $52
jr jr_002_5237 ; $5232: $18 $03
jr_002_5234:
call func_002_523F ; $5234: $CD $3F $52
jr_002_5237:
inc bc ; $5237: $03
ld [bc], a ; $5238: $02
ret ; $5239: $C9
func_002_523A::
ld a, e ; $523A: $7B
ld [bc], a ; $523B: $02
ld a, $14 ; $523C: $3E $14
ret ; $523E: $C9
func_002_523F::
ld a, e ; $523F: $7B
ld [bc], a ; $5240: $02
ld a, $14 ; $5241: $3E $14
ret ; $5243: $C9
jr_002_5244:
ld a, e ; $5244: $7B
ld [bc], a ; $5245: $02
ld a, $16 ; $5246: $3E $16
jr jr_002_5237 ; $5248: $18 $ED
func_002_524A::
ld a, e ; $524A: $7B
ld [bc], a ; $524B: $02
ld a, $10 ; $524C: $3E $10
ret ; $524E: $C9
jr_002_524F:
ldh a, [hLinkPositionX] ; $524F: $F0 $98
sub $08 ; $5251: $D6 $08
ldh [$FFD8], a ; $5253: $E0 $D8
ldh a, [hFrameCounter] ; $5255: $F0 $E7
rla ; $5257: $17
rla ; $5258: $17
and $10 ; $5259: $E6 $10
ldh [$FFDA], a ; $525B: $E0 $DA
xor a ; $525D: $AF
ld h, a ; $525E: $67
ld l, a ; $525F: $6F
ld a, $06 ; $5260: $3E $06
ldh [$FFD9], a ; $5262: $E0 $D9
jp label_1819 ; $5264: $C3 $19 $18
call label_CAF ; $5267: $CD $AF $0C
call ClearLinkPositionIncrement ; $526A: $CD $8E $17
ldh a, [$FFB7] ; $526D: $F0 $B7
and a ; $526F: $A7
jr nz, jr_002_529F ; $5270: $20 $2D
ld [wC167], a ; $5272: $EA $67 $C1
ldh a, [$FF9C] ; $5275: $F0 $9C
cp $06 ; $5277: $FE $06
jr nz, jr_002_5283 ; $5279: $20 $08
ld a, [wDB94] ; $527B: $FA $94 $DB
add $04 ; $527E: $C6 $04
ld [wDB94], a ; $5280: $EA $94 $DB
jr_002_5283:
xor a ; $5283: $AF
ldh [$FF9C], a ; $5284: $E0 $9C
ld a, [wIsIndoor] ; $5286: $FA $A5 $DB
and a ; $5289: $A7
jr nz, jr_002_529C ; $528A: $20 $10
ldh a, [hMapRoom] ; $528C: $F0 $F6
cp $2B ; $528E: $FE $2B
jr nz, jr_002_529C ; $5290: $20 $0A
ld a, $48 ; $5292: $3E $48
ld [wLinkMapEntryPositionX], a ; $5294: $EA $B1 $DB
ld a, $30 ; $5297: $3E $30
ld [wLinkMapEntryPositionY], a ; $5299: $EA $B2 $DB
jr_002_529C:
jp label_002_52B9 ; $529C: $C3 $B9 $52
jr_002_529F:
ld e, $FF ; $529F: $1E $FF
ldh a, [$FFB7] ; $52A1: $F0 $B7
cp $30 ; $52A3: $FE $30
jr c, jr_002_52B5 ; $52A5: $38 $0E
ld e, $4E ; $52A7: $1E $4E
cp $40 ; $52A9: $FE $40
jr c, jr_002_52B5 ; $52AB: $38 $08
jr nz, jr_002_52B3 ; $52AD: $20 $04
ld a, $03 ; $52AF: $3E $03
ldh [hSFX], a ; $52B1: $E0 $F3
jr_002_52B3:
ld e, $4C ; $52B3: $1E $4C
jr_002_52B5:
ld a, e ; $52B5: $7B
ldh [hLinkAnimationState], a ; $52B6: $E0 $9D
ret ; $52B8: $C9
label_002_52B9::
ld a, $40 ; $52B9: $3E $40
ld [$DBC7], a ; $52BB: $EA $C7 $DB
ld a, [wLinkMapEntryPositionX] ; $52BE: $FA $B1 $DB
ldh [hLinkPositionX], a ; $52C1: $E0 $98
ldh [hLinkFinalPositionX], a ; $52C3: $E0 $9F
ld a, [wLinkMapEntryPositionY] ; $52C5: $FA $B2 $DB
ldh [hLinkPositionY], a ; $52C8: $E0 $99
ldh [hLinkFinalPositionY], a ; $52CA: $E0 $A0
ld hl, $FFA2 ; $52CC: $21 $A2 $FF
sub [hl] ; $52CF: $96
ld [$C145], a ; $52D0: $EA $45 $C1
call func_002_4EDD ; $52D3: $CD $DD $4E
func_002_52D6::
ldh a, [$FFAC] ; $52D6: $F0 $AC
and a ; $52D8: $A7
jr z, jr_002_52DF ; $52D9: $28 $04
ld a, $01 ; $52DB: $3E $01
ldh [$FFAC], a ; $52DD: $E0 $AC
jr_002_52DF:
ret ; $52DF: $C9
dec c ; $52E0: $0D
di ; $52E1: $F3
nop ; $52E2: $00
rst $38 ; $52E3: $FF
ld [$0CF8], sp ; $52E4: $08 $F8 $0C
push af ; $52E7: $F5
nop ; $52E8: $00
nop ; $52E9: $00
di ; $52EA: $F3
ld c, $F3 ; $52EB: $0E $F3
di ; $52ED: $F3
db $fc ; $52EE: $FC
nop ; $52EF: $00
ld b, $08 ; $52F0: $06 $08
ld [$0406], sp ; $52F2: $08 $06 $04
rst $38 ; $52F5: $FF
rst $38 ; $52F6: $FF
inc b ; $52F7: $04
inc b ; $52F8: $04
rst $38 ; $52F9: $FF
rst $38 ; $52FA: $FF
inc b ; $52FB: $04
ld b, $08 ; $52FC: $06 $08
ld [RenderLoop.RenderLoop_loadNewMap], sp ; $52FE: $08 $06 $02
ld [bc], a ; $5301: $02
ld [hl+], a ; $5302: $22
ld [hl+], a ; $5303: $22
ld [hl+], a ; $5304: $22
ld [bc], a ; $5305: $02
ld [bc], a ; $5306: $02
ld b, d ; $5307: $42
ld [hl+], a ; $5308: $22
ld [bc], a ; $5309: $02
ld [bc], a ; $530A: $02
ld [hl+], a ; $530B: $22
ld [bc], a ; $530C: $02
ld [bc], a ; $530D: $02
ld [hl+], a ; $530E: $22
ld [hl+], a ; $530F: $22
label_002_5310::
ld a, [$C19B] ; $5310: $FA $9B $C1
and $7F ; $5313: $E6 $7F
cp $08 ; $5315: $FE $08
ldh a, [hLinkDirection] ; $5317: $F0 $9E
jr c, jr_002_531D ; $5319: $38 $02
add $04 ; $531B: $C6 $04
jr_002_531D:
ld e, a ; $531D: $5F
ld d, $00 ; $531E: $16 $00
ld hl, $52E8 ; $5320: $21 $E8 $52
add hl, de ; $5323: $19
ld a, [hl] ; $5324: $7E
ldh [hScratchA], a ; $5325: $E0 $D7
ld hl, $52E0 ; $5327: $21 $E0 $52
add hl, de ; $532A: $19
ld a, [hl] ; $532B: $7E
ldh [$FFD8], a ; $532C: $E0 $D8
sla e ; $532E: $CB $23
ld hl, $52F0 ; $5330: $21 $F0 $52
add hl, de ; $5333: $19
ld a, [hl+] ; $5334: $2A
ldh [$FFD9], a ; $5335: $E0 $D9
ld a, [hl] ; $5337: $7E
ldh [$FFDA], a ; $5338: $E0 $DA
ld hl, $5300 ; $533A: $21 $00 $53
add hl, de ; $533D: $19
ld a, [hl+] ; $533E: $2A
ldh [$FFDB], a ; $533F: $E0 $DB
ld a, [hl] ; $5341: $7E
ldh [$FFDC], a ; $5342: $E0 $DC
ld de, $C010 ; $5344: $11 $10 $C0
ld bc, $C014 ; $5347: $01 $14 $C0
ld a, [$C145] ; $534A: $FA $45 $C1
ld hl, $C13B ; $534D: $21 $3B $C1
add [hl] ; $5350: $86
ld hl, hScratchA ; $5351: $21 $D7 $FF
add [hl] ; $5354: $86
ld [hl], a ; $5355: $77
ldh a, [$FFD9] ; $5356: $F0 $D9
cp $FF ; $5358: $FE $FF
jr z, jr_002_535E ; $535A: $28 $02
ld a, [hl] ; $535C: $7E
ld [de], a ; $535D: $12
jr_002_535E:
ldh a, [$FFDA] ; $535E: $F0 $DA
cp $FF ; $5360: $FE $FF
jr z, jr_002_5366 ; $5362: $28 $02
ld a, [hl] ; $5364: $7E
ld [bc], a ; $5365: $02
jr_002_5366:
inc de ; $5366: $13
inc bc ; $5367: $03
ldh a, [$FFD8] ; $5368: $F0 $D8
ld hl, hLinkPositionX ; $536A: $21 $98 $FF
add [hl] ; $536D: $86
ld [de], a ; $536E: $12
add $08 ; $536F: $C6 $08
ld [bc], a ; $5371: $02
inc de ; $5372: $13
inc bc ; $5373: $03
ldh a, [$FFD9] ; $5374: $F0 $D9
ld [de], a ; $5376: $12
ldh a, [$FFDA] ; $5377: $F0 $DA
ld [bc], a ; $5379: $02
inc de ; $537A: $13
inc bc ; $537B: $03
ldh a, [$FFDB] ; $537C: $F0 $DB
ld [de], a ; $537E: $12
ldh a, [$FFDC] ; $537F: $F0 $DC
ld [bc], a ; $5381: $02
ret ; $5382: $C9
inc b ; $5383: $04
db $fc ; $5384: $FC
db $fc ; $5385: $FC
inc b ; $5386: $04
inc b ; $5387: $04
inc b ; $5388: $04
db $fc ; $5389: $FC
inc b ; $538A: $04
label_002_538B::
ldh a, [hLinkDirection] ; $538B: $F0 $9E
ld c, a ; $538D: $4F
ld b, $00 ; $538E: $06 $00
ld hl, $5383 ; $5390: $21 $83 $53
add hl, bc ; $5393: $09
ldh a, [hLinkPositionX] ; $5394: $F0 $98
add [hl] ; $5396: $86
ld hl, wEntity0PosX ; $5397: $21 $00 $C2
add hl, de ; $539A: $19