Prev: 41310 Up: Map Next: 41368
41337: 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 41337 LD DE,0 Point DE at the next free place in the sorted list (the address is stored in the operand of this instruction, 41338).
41340 LD HL,(41390) Fetch the address of the entry after the item under consideration.
41343 DEC HL Move back to the start of the entry...
41344 DEC HL ...in the draw list...
41345 DEC HL ...which is three bytes.
41346 LD A,(HL) Fetch the flags of the item.
41347 SET 7,(HL) Mark it as moved in the draw list.
41349 LD (DE),A Store the flags in the sorted list.
41350 INC HL Move onto the address of the record.
41351 INC DE Move onto the next place in the sorted list.
41352 LDI Copy the first byte of the address of the record.
41354 LDI Copy the second byte.
41356 LD (41338),DE Store the address of the next free place in the sorted list.
41360 LD A,255 Set the end marker of the list of items which have been tried.
41362 LD (41374),A Store it at the start of the list.
41365 JP SortDrawList_Next Jump to 40863 to find the next item.
Prev: 41310 Up: Map Next: 41368