Prev: AE25 Up: Map Next: AE67
AE2D: Update Packet Marker
Used by the routine at MainLoop.
Shows the position of the program packet on the map of the sectors. The marker is drawn with XOR, so the old marker is removed by drawing it again. Nothing is done if the packet has not moved.
UpdatePacketMarker AE2D LD A,($964C) Fetch the X cell where the marker was drawn last...
AE30 LD D,A ...and keep it in D.
AE31 LD A,($964D) Fetch the Y cell...
AE34 LD H,A ...and keep it in H.
AE35 LD A,($964E) Fetch the flag that says whether there was a marker.
AE38 AND A Jump if there was not.
AE39 JR Z,UpdatePacketMarker_Draw
AE3B LD A,($9770) Fetch the type of the packet.
AE3E AND A Jump to remove the old marker if there is no packet now.
AE3F JR Z,UpdatePacketMarker_Remove
AE41 LD A,($9772) Fetch the X cell of the packet.
AE44 CP D Jump to remove the old marker if the packet has moved in the X direction.
AE45 JR NZ,UpdatePacketMarker_Remove
AE47 LD A,($9774) Fetch the Y cell of the packet.
AE4A CP H Return if the packet has not moved.
AE4B RET Z
UpdatePacketMarker_Remove AE4C CALL ToggleMarker Remove the old marker using ToggleMarker.
UpdatePacketMarker_Draw AE4F LD A,($9772) Fetch the X cell of the packet...
AE52 LD ($964C),A ...and store it...
AE55 LD D,A ...and keep it in D.
AE56 LD A,($9774) Fetch the Y cell of the packet...
AE59 LD ($964D),A ...and store it...
AE5C LD H,A ...and keep it in H.
AE5D LD A,($9770) Fetch the type of the packet.
AE60 AND A Store the flag that says whether there is a marker...
AE61 LD ($964E),A
AE64 RET Z ...and return if there is not.
AE65 JR ToggleMarker Jump to ToggleMarker.
Prev: AE25 Up: Map Next: AE67