Prev: A15E Up: Map Next: A198
A179: Move Item To Sorted List
Used by the routines at SortDrawList and DrawOtherItemFirst.
Moves the item under consideration to the sorted list, marks it as moved in the draw list, and starts again with the first item that has not been moved.
MoveItemToSortedList A179 LD DE,$0000 Point DE at the next free place in the sorted list (the address is stored in the operand of this instruction, A17A).
A17C LD HL,($A1AE) Fetch the address of the entry after the item under consideration.
A17F DEC HL Move back to the start of the entry...
A180 DEC HL ...in the draw list...
A181 DEC HL ...which is three bytes.
A182 LD A,(HL) Fetch the flags of the item.
A183 SET 7,(HL) Mark it as moved in the draw list.
A185 LD (DE),A Store the flags in the sorted list.
A186 INC HL Move onto the address of the record.
A187 INC DE Move onto the next place in the sorted list.
A188 LDI Copy the first byte of the address of the record.
A18A LDI Copy the second byte.
A18C LD ($A17A),DE Store the address of the next free place in the sorted list.
A190 LD A,$FF Set the end marker of the list of items which have been tried.
A192 LD ($A19E),A Store it at the start of the list.
A195 JP SortDrawList_Next Jump to 9F9F to find the next item.
Prev: A15E Up: Map Next: A198