Prev: 9179 Up: Map Next: 919D
917A: Make Monty climb a ladder
Used by the routine at 89D4.
917A LD A,($849B) Put the last input data from climbing or falling (849B) in B.
917D LD B,A
917E LD A,($832E) Compare this against the actual last input data.
9181 CP B
9182 JP NZ,$8A5B Jump back if there isn't a match.
9185 LD HL,$5C7C Point HL at the current Y co-ordinate (5C7C).
9188 LD A,($832E) Was the direction up?
918B OR A
918C JR NZ,$9193 Jump back if not.
Monty is moving up the ladder.
918E INC (HL) Increase the Y co-ordinate by 2.
918F INC (HL)
9190 JP $8A27 Jump back to update Monty's position.
Monty is not moving up the ladder, is he moving down?
9193 CP $01 Was the direction down?
9195 JP NZ,$8A0A Jump back if not.
9198 DEC (HL) Decrease the Y co-ordinate by 2.
9199 DEC (HL)
919A JP $8A27 Jump back to update Monty's position.
Prev: 9179 Up: Map Next: 919D