Prev: DE0D Up: Map Next: DE6A
DE59: Test Move
Tests whether an object can move in the direction that it is facing, by testing the cells that its front edge touches (including the cells that the velocity takes it into) for walls. A wall changes the velocity so that the object stops at the wall, and sets the flag for a collision (bit 0 of the flags).
Input
IX Object
Clear bit 0 of the flags, then run the routine for the heading.
TestMove DE59 RES 0,(IX+$07) Clear the flag for a collision.
This entry point is used by the routines at UpdateShot, UpdateThrownItem and SetDirectionFromVelocity.
Run the routine for the heading, without clearing the flag.
TestMove_Keep DE5D LD A,(IX+$06) Fetch the direction that the object is facing.
DE60 RLCA Move the direction into the lowest two bits.
DE61 RLCA
DE62 AND %00000011 Keep only the direction.
Run the routine for the direction.
DE64 LD BC,$DE6A Point BC at TestMoveRoutines.
DE67 JP JumpToTableRoutine Jump to JumpToTableRoutine.
View the equivalent code in;
Prev: DE0D Up: Map Next: DE6A