Prev: 51140 Up: Map Next: 51198
51163: Flag Objects Near Arch
Used by the routine at HandleNearArch.
Flags the player and the special objects that are close to an arch, and are flagged to be adjusted near arches, as being near an arch.
Input
H Distance in Y that counts as near
L Distance in X that counts as near
IX Address of the arch object
Flag each nearby object as being near an arch.
FlagObjectsNearArch 51163 LD IY,23560 Point IY at the player, ObjectsTable.
51167 LD DE,32 Set DE to the size of an object.
51170 LD B,4 Set the number of objects to 4, which is the player and the special objects.
FlagObjectsNearArch_Next 51172 LD A,(IY+0) Fetch the graphic number of the object.
51175 AND A Test whether there is an object.
51176 JR Z,FlagObjectsNearArch_Advance Jump to FlagObjectsNearArch_Advance if there is not.
51178 BIT 3,(IY+7) Jump to FlagObjectsNearArch_Advance if the object is not flagged to be adjusted near arches.
51182 JR Z,FlagObjectsNearArch_Advance
51184 CALL TestNearTo Test whether the object is near the arch.
51187 JR NC,FlagObjectsNearArch_Advance Jump to FlagObjectsNearArch_Advance if it is not.
51189 SET 0,(IY+7) Flag the object as being near an arch.
FlagObjectsNearArch_Advance 51193 ADD IY,DE Point IY at the next object.
51195 DJNZ FlagObjectsNearArch_Next Jump to FlagObjectsNearArch_Next until all of the objects have been done.
51197 RET Return.
Prev: 51140 Up: Map Next: 51198