Prev: CCC2 Up: Map Next: CD0C
CCE5: Move Object
Moves an object by the signed speeds at HorizontalSpeed and VerticalSpeed.
Input
IX The address of the object
Add HorizontalSpeed to the horizontal position.
MoveObject CCE5 LD A,($A214) Fetch HorizontalSpeed.
CCE8 CALL SignExtendAToHL Call SignExtendAToHL.
CCEB LD C,(IX+$01) Fetch the horizontal position.
CCEE LD B,(IX+$02)
CCF1 ADD HL,BC Add the speed to it.
CCF2 LD (IX+$01),L Set the horizontal position.
CCF5 LD (IX+$02),H
Add VerticalSpeed to the vertical position.
CCF8 LD A,($A215) Fetch VerticalSpeed.
CCFB CALL SignExtendAToHL Call SignExtendAToHL.
CCFE LD C,(IX+$03) Fetch the vertical position.
CD01 LD B,(IX+$04)
CD04 ADD HL,BC Add the speed to it.
CD05 LD (IX+$03),L Set the vertical position and return.
CD08 LD (IX+$04),H
CD0B RET
View the equivalent code in;
Prev: CCC2 Up: Map Next: CD0C