Prev: C6E4 Up: Map Next: C745
C71C: 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 FF. 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 C71C PUSH IX Stash IX on the stack.
C71E LD B,$38 Set a counter of 38 objects.
C720 LD DE,$0020 Set DE to 0020.
C723 LD IX,$5B88 Point IX at PlayerBottomObject.
C727 LD HL,$C745 Point HL at ObjectsToDrawList.
C72A LD C,$00 Set the index to 00.
Add the object if it is present and flagged to be drawn.
ListObjectsToDraw_Next C72C LD A,(IX+$00) Fetch the sprite number and test whether the slot is used.
C72F AND A
C730 JR Z,ListObjectsToDraw_Advance Jump to ListObjectsToDraw_Advance if it is not.
C732 BIT 4,(IX+$07) Jump to ListObjectsToDraw_Advance if the object is not flagged to be drawn.
C736 JR Z,ListObjectsToDraw_Advance
C738 LD (HL),C Add the index of the object to the list.
C739 INC HL Move on to the next place in the list.
Move on to the next object.
ListObjectsToDraw_Advance C73A INC C Go to the next index.
C73B ADD IX,DE Point IX at the next object.
C73D DJNZ ListObjectsToDraw_Next Jump to ListObjectsToDraw_Next until all of the objects have been tested.
Mark the end of the list.
C73F LD A,$FF Store the end marker.
C741 LD (HL),A
C742 POP IX Restore IX from the stack.
C744 RET Return.
View the equivalent code in;
Prev: C6E4 Up: Map Next: C745