Prev: 52809 Up: Map Next: 52875
52834: 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 255. 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 52834 PUSH IX Stash IX on the stack.
52836 LD B,40 Set the number of objects to 40.
52838 LD DE,32 Set DE to the size of an object.
52841 LD IX,23560 Point IX at ObjectsTable.
52845 LD HL,52875 Point HL at ObjectsToDrawList.
52848 LD C,0 Set the index of the object to zero.
ListObjectsToDraw_Next 52850 LD A,(IX+0) Fetch the graphic number of the object and test whether it is null.
52853 AND A
52854 JR Z,ListObjectsToDraw_Advance Jump to ListObjectsToDraw_Advance if it is.
52856 BIT 4,(IX+7) Jump to ListObjectsToDraw_Advance if the object is not flagged to be drawn.
52860 JR Z,ListObjectsToDraw_Advance
52862 LD (HL),C Add the index of the object to the list.
52863 INC HL Move on to the next place in the list.
ListObjectsToDraw_Advance 52864 INC C Go to the next index.
52865 ADD IX,DE Point IX at the next object.
52867 DJNZ ListObjectsToDraw_Next Jump to ListObjectsToDraw_Next until all of the objects have been tested.
52869 LD A,255 Fetch the end marker.
52871 LD (HL),A Store it at the end of the list.
52872 POP IX Restore IX from the stack.
52874 RET Return.
View the equivalent code in;
Prev: 52809 Up: Map Next: 52875