Prev: 52333 Up: Map Next: 52391
52374: 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 52374 PUSH BC Stash BC on the stack.
52375 AND %01111111 Keep bits 0 to 6.
52377 LD L,A Copy it to L.
52378 LD H,0 Set H to 0.
52380 ADD HL,HL Multiply HL by 32.
52381 ADD HL,HL
52382 ADD HL,HL
52383 ADD HL,HL
52384 ADD HL,HL
52385 LD BC,23432 Point BC at PlayerBottomObject.
52388 ADD HL,BC Add BC to HL.
52389 POP BC Restore BC from the stack.
52390 RET Return.
View the equivalent code in;
Prev: 52333 Up: Map Next: 52391