Prev: 44531 Up: Map Next: 44567
44547: Find Object
Used by the routine at HandleValve.
Searches the objects of the room for one whose sprite number is in a range.
Input
H Number of sprite numbers in the range
L First sprite number in the range
Output
IY The address of the object, if one was found
F Carry flag set if an object was found
Test each room object.
FindObject 44547 LD IY,23560 Point IY at RoomObjects.
44551 LD DE,32 Set DE to 0032.
44554 LD B,52 Set a counter of 52.
FindObject_TestObject 44556 LD A,(IY+0) Fetch the sprite number.
44559 SUB L Subtract the first sprite number in the range.
44560 CP H Compare it with the number of sprite numbers.
44561 RET C Return if the object is in the range.
44562 ADD IY,DE Move on to the next object.
44564 DJNZ FindObject_TestObject Jump to FindObject_TestObject until all of the objects have been tested.
44566 RET Return.
Prev: 44531 Up: Map Next: 44567