Prev: CC6D Up: Map Next: CCA7
CC96: Find Object Address
Used by the routines at DrawObjectsInOrder and DrawChangedObjects.
Works out the address of an object from its index in the table of objects.
Input
A Index of the object (bit 7 is ignored)
Output
HL Address of the object record
FindObjectAddress CC96 PUSH BC Stash BC on the stack.
CC97 AND %01111111 Keep bits 0 to 6.
CC99 LD L,A Copy it to L.
CC9A LD H,$00 Set H to 00.
CC9C ADD HL,HL Multiply HL by 20.
CC9D ADD HL,HL
CC9E ADD HL,HL
CC9F ADD HL,HL
CCA0 ADD HL,HL
CCA1 LD BC,$5B88 Point BC at PlayerBottomObject.
CCA4 ADD HL,BC Add BC to HL.
CCA5 POP BC Restore BC from the stack.
CCA6 RET Return.
View the equivalent code in;
Prev: CC6D Up: Map Next: CCA7