Prev: A19E Up: Map Next: A202
A19F: Move a character forward by one step.
Used by the routine at People_Main.
Input
Output
Person_MoveForward A19F LD IX,(Actor_CurrentPtr) Get address of character data node.
A1A3 BIT 6,(IX+$13) Is character enabled?
A1A7 RET NZ
This entry point is used by the routine at _a4ff_People.
Person_MoveForward_0 A1A8 LD A,(IX+$0A) Action count down.
A1AB AND A
A1AC JP Z,People_DecideAction
A1AF DEC (IX+$0A)
A1B2 JR NZ,Person_MoveForward_1
A1B4 LD A,(IX+$0D) See if character is standing still.
A1B7 AND A
A1B8 JR Z,Person_MoveForward_1
A1BA LD A,(IX+$04) If so then use the last frame, which is always the standing still frame.
A1BD JR Person_MoveForward_2
Person_MoveForward_1 A1BF LD A,(IX+$0B) Get current frame and increase it.
A1C2 INC A
A1C3 CP (IX+$04) See if the last frame has been hit and reset it if it has.
A1C6 JR C,Person_MoveForward_2
A1C8 LD A,(IX+$03)
Person_MoveForward_2 A1CB LD (IX+$0B),A
A1CE LD A,(IX+$02) Get direction.
A1D1 BIT 0,A
A1D3 JR Z,Person_MoveForward_3
A1D5 LD E,(IX+$07) Get E/W coords
A1D8 LD D,(IX+$08)
A1DB JR Person_MoveForward_4
Person_MoveForward_3 A1DD LD E,(IX+$05) Get N/S coords
A1E0 LD D,(IX+$06)
Person_MoveForward_4 A1E3 CP $00 Facing north?
A1E5 JR Z,Person_MoveForward_5
A1E7 CP $03 Facing west?
A1E9 JR Z,Person_MoveForward_5
A1EB INC DE Move south or east by one step.
A1EC JR Person_MoveForward_6
Person_MoveForward_5 A1EE DEC DE Move north or west by one step.
Person_MoveForward_6 A1EF BIT 0,A Put back in correct axis based on direction.
A1F1 JR Z,Person_MoveForward_7
A1F3 LD (IX+$07),E
A1F6 LD (IX+$08),D
A1F9 JR Person_MoveForward_8
Person_MoveForward_7 A1FB LD (IX+$05),E
A1FE LD (IX+$06),D
Person_MoveForward_8 A201 RET
Prev: A19E Up: Map Next: A202