Prev: CD40 Up: Map Next: CD9D
CD8C: Test Move
Checks whether an object can move in the direction of its heading without going into a wall. A wall changes the speeds so that the object stops, and sets bit 0 of the flags.
Input
IX The address of the object
Output
F The carry flag is set if the object hit a wall
Clear bit 0 of the flags, then run the routine for the heading.
TestMove CD8C RES 0,(IX+$07) Clear bit 0 of the flags of the object.
This entry point is used by the routines at HandleBullet and CheckWallsEachWay.
Run the routine for the heading, without clearing the flag.
CheckWalls CD90 LD A,(IX+$06) Fetch the heading.
CD93 RLCA Move the heading into the lowest two bits.
CD94 RLCA
CD95 AND %00000011 Keep only the heading.
CD97 LD BC,$CD9D Point BC at CheckWallsRoutines.
CD9A JP RunTableRoutine Jump to RunTableRoutine.
View the equivalent code in;
Prev: CD40 Up: Map Next: CD9D