Prev: D3A9 Up: Map Next: D3C6
D3B5: Object index to record address
Used by the routines at skip_drawn_entries, compare_next_obj and wipe_next_object.
Five doublings is a multiply by 32, and $5C08 is the base of the object table. The AND $7F is the counterpart of the flag bit that callers carry in the top of the index: render_obj sets bit 7 of an entry in the list at objects_to_draw once that object has been drawn, and the list is read again later in the same frame.
Input
A the object index; bit 7 is ignored
HL the address of its 32-byte record
get_ptr_object D3B5 PUSH BC
D3B6 AND $7F HL = index * 32
D3B8 LD L,A
D3B9 LD H,$00
D3BB ADD HL,HL
D3BC ADD HL,HL
D3BD ADD HL,HL
D3BE ADD HL,HL
D3BF ADD HL,HL
D3C0 LD BC,$5C08 plus the start of the object table
D3C3 ADD HL,BC
D3C4 POP BC
D3C5 RET
Prev: D3A9 Up: Map Next: D3C6