← B9C8 Update and draw all active objects Map B9FC → Draw one object's sprite into the back buffer
B9D2: Process every active on-screen object
Draws every active object whose Y lies on the visible playfield, via the sprite drawer. Inactive and off-screen entries are skipped.
draw_all_objects B9D2 LD IX,object_table Start at the first pool entry.
B9D6 LD A,(object_count) Count the entries.
B9D9 LD B,A
draw_all_objects_loop B9DA PUSH BC Save the loop state for this entry.
B9DB PUSH IX
B9DD BIT 0,(IX+$08) Active? Skip if not.
B9E1 JR Z,draw_all_objects_next
B9E3 LD A,(IX+$01) Y position off the bottom of the playfield? Skip.
B9E6 CP $A7
B9E8 JR NC,draw_all_objects_next
B9EA CP $18 Off the top? Skip.
B9EC JR C,draw_all_objects_next
B9EE CALL draw_object On-screen and active: draw it.
draw_all_objects_next B9F1 LD BC,$0009 Advance to the next pool entry – 9 bytes per slot – and loop.
B9F4 POP IX
B9F6 ADD IX,BC
B9F8 POP BC
B9F9 DJNZ draw_all_objects_loop
B9FB RET
← B9C8 Update and draw all active objects Map B9FC → Draw one object's sprite into the back buffer
Fork me on GitHub