Prev: AA38 Up: Map Next: AB33
AAC6: Routine at AAC6
Used by the routine at main_loop.
move_helicopter AAC6 LD A,($A224) Return if helicopter_control is zero
AAC9 AND A
AACA RET Z
AACB LD A,$00 A = <self modified> -- Self modified by AAD3 below
AACD CP $61 Jump to move_helicopter_0 if A == 97
AACF JR Z,move_helicopter_0
AAD1 SUB $02 A -= 2
AAD3 LD ($AACC),A Self modify AACB above
move_helicopter_0 AAD6 LD C,A C = A
AAD7 LD A,$00 A = <self modified> -- Self modified below
AAD9 INC A A = (A + 1) & 3
AADA AND $03
AADC LD ($AAD8),A Self modify AAD7 above
AADF LD A,$01 A = <self modified> -- Self modified by AAE5 below
AAE1 JR NZ,move_helicopter_1 what are we testing here?
AAE3 NEG A = -A
AAE5 LD ($AAE0),A Self modify AADF above
move_helicopter_1 AAE8 ADD A,$00 A += <self modified> -- Increment by old amount -- Self modified below
AAEA LD ($AAE9),A Self modify above with new value of A
AAED ADD A,C A += C
AAEE LD ($AA5B),A Self modify 'LD A' @ AA5A
AAF1 LD HL,($A26C) HL = road_pos
AAF4 LD D,H DE = HL
AAF5 LD E,L
AAF6 LD BC,$0000 BC = <self modified> -- Self modified by AAFC below, AB60 -- prev road pos?
AAF9 AND A Set flags
AAFA SBC HL,BC HL -= BC
AAFC LD ($AAF7),DE Self modify 'LD BC' above to load DE
AB00 LD DE,($AA95) Load DE from 'LD BC' @ sub_AA94
AB04 ADD HL,DE HL += DE
AB05 PUSH HL Preserve HL
AB06 LD DE,$0070 DE = $0070
AB09 LD B,$00 B = 0
AB0B AND A Set flags
AB0C SBC HL,DE HL -= DE
AB0E POP HL Restore HL
AB0F JR Z,move_helicopter_5
AB11 LD A,$08 A = 8
AB13 PUSH AF Preserve AF
AB14 JP M,move_helicopter_2
AB17 DEC B B--
AB18 NEG A = -A
move_helicopter_2 AB1A LD C,A C = A
AB1B ADD HL,BC HL += BC
AB1C PUSH HL Preserve HL
AB1D AND A Set flags
AB1E SBC HL,DE HL -= DE
AB20 POP HL Restore HL
AB21 JP M,move_helicopter_3
AB24 POP AF Restore AF
AB25 JP P,move_helicopter_5
AB28 JR move_helicopter_4
move_helicopter_3 AB2A POP AF Restore AF
AB2B JP M,move_helicopter_5
move_helicopter_4 AB2E EX DE,HL
move_helicopter_5 AB2F LD ($AA95),HL Self modify 'LD BC' @ sub_AA94
AB32 RET Return
Prev: AA38 Up: Map Next: AB33