Prev: 50916 Up: Map Next: 51013
50972: 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 table of objects (PlayerBottomObject), and the list ends with 255. An object is in the list if it is present and flagged to be drawn.
Point at the first object and the start of the list.
ListObjectsToDraw 50972 PUSH IX Stash IX on the stack.
50974 LD B,56 Set a counter of 56 objects.
50976 LD DE,32 Set DE to 0032.
50979 LD IX,23432 Point IX at PlayerBottomObject.
50983 LD HL,51013 Point HL at ObjectsToDrawList.
50986 LD C,0 Set the index to 0.
Add the object if it is present and flagged to be drawn.
ListObjectsToDraw_Next 50988 LD A,(IX+0) Fetch the sprite number and test whether the slot is used.
50991 AND A
50992 JR Z,ListObjectsToDraw_Advance Jump to ListObjectsToDraw_Advance if it is not.
50994 BIT 4,(IX+7) Jump to ListObjectsToDraw_Advance if the object is not flagged to be drawn.
50998 JR Z,ListObjectsToDraw_Advance
51000 LD (HL),C Add the index of the object to the list.
51001 INC HL Move on to the next place in the list.
Move on to the next object.
ListObjectsToDraw_Advance 51002 INC C Go to the next index.
51003 ADD IX,DE Point IX at the next object.
51005 DJNZ ListObjectsToDraw_Next Jump to ListObjectsToDraw_Next until all of the objects have been tested.
Mark the end of the list.
51007 LD A,255 Store the end marker.
51009 LD (HL),A
51010 POP IX Restore IX from the stack.
51012 RET Return.
View the equivalent code in;
Prev: 50916 Up: Map Next: 51013