Prev: 54156 Up: Map Next: 54214
54197: Find Object Address
Used by the routines at DrawObjectsInOrder and DrawChangedObjects.
Finds the address of an object in the objects table from its index.
Input
A Index of the object (bit 7 is ignored)
Output
HL Address of the object
Multiply the index by 32 and add it to ObjectsTable.
FindObjectAddress 54197 PUSH BC Stash BC on the stack.
54198 AND %01111111 Keep bits 0 to 6.
54200 LD L,A Copy it to L.
54201 LD H,0 Set H to 0.
54203 ADD HL,HL Multiply HL by 32.
54204 ADD HL,HL
54205 ADD HL,HL
54206 ADD HL,HL
54207 ADD HL,HL
54208 LD BC,23560 Point BC at ObjectsTable.
54211 ADD HL,BC Add BC to HL.
54212 POP BC Restore BC from the stack.
54213 RET Return.
View the equivalent code in;
Prev: 54156 Up: Map Next: 54214