Prev: CE49 Up: Map Next: CE8B
CE62: List Objects To Draw
Used by the routine at RunGame.
Makes the list at ObjectsToDrawList of the objects that have to be drawn again. Each entry is the index of an object in the objects table, and the list ends with FF. An object is in the list if it is present and flagged to be drawn.
Add each object that is present and flagged to be drawn.
ListObjectsToDraw CE62 PUSH IX Stash IX on the stack.
CE64 LD B,$28 Set the number of objects to 28.
CE66 LD DE,$0020 Set DE to the size of an object.
CE69 LD IX,$5C08 Point IX at ObjectsTable.
CE6D LD HL,$CE8B Point HL at ObjectsToDrawList.
CE70 LD C,$00 Set the index of the object to zero.
ListObjectsToDraw_Next CE72 LD A,(IX+$00) Fetch the graphic number of the object and test whether it is null.
CE75 AND A
CE76 JR Z,ListObjectsToDraw_Advance Jump to ListObjectsToDraw_Advance if it is.
CE78 BIT 4,(IX+$07) Jump to ListObjectsToDraw_Advance if the object is not flagged to be drawn.
CE7C JR Z,ListObjectsToDraw_Advance
CE7E LD (HL),C Add the index of the object to the list.
CE7F INC HL Move on to the next place in the list.
ListObjectsToDraw_Advance CE80 INC C Go to the next index.
CE81 ADD IX,DE Point IX at the next object.
CE83 DJNZ ListObjectsToDraw_Next Jump to ListObjectsToDraw_Next until all of the objects have been tested.
CE85 LD A,$FF Fetch the end marker.
CE87 LD (HL),A Store it at the end of the list.
CE88 POP IX Restore IX from the stack.
CE8A RET Return.
View the equivalent code in;
Prev: CE49 Up: Map Next: CE8B