Prev: B520 Up: Map Next: B55A
B531: List the objects to be drawn
Used by the routine at OBJECT_DONE.
Called by the main loop (OBJECT_DONE) once every object has been updated. Writes into DRAW_LIST the number (0-53) of every record in use whose draw flag, bit 4 of +$07, is set, in record order, and an $FF after the last. RENDER_DYNAMIC_OBJECTS wipes the objects' old places from this list and SORT_AND_DRAW draws from it.
LIST_DRAWN B531 PUSH IX 54 records from OBJECTS; HL = the list; C = the number
B533 LD B,$36
B535 LD DE,$0020
B538 LD IX,OBJECTS
B53C LD HL,DRAW_LIST
B53F LD C,$00
LIST_DRAWN_0 B541 LD A,(IX+$00) an empty record: not listed
B544 AND A
B545 JR Z,LIST_DRAWN_1
B547 BIT 4,(IX+$07) not to be drawn this turn
B54B JR Z,LIST_DRAWN_1
B54D LD (HL),C list its number
B54E INC HL
LIST_DRAWN_1 B54F INC C the next record
B550 ADD IX,DE
B552 DJNZ LIST_DRAWN_0
B554 LD A,$FF end the list
B556 LD (HL),A
B557 POP IX
B559 RET
Prev: B520 Up: Map Next: B55A