Prev: 68A4 Up: Map Next: 6900
68E0: Is Object In The Current Room?
Input
A Object number
Output
F Zero flag set when the object is in the current room
IsObjectInCurrentRoom 68E0 PUSH HL Keep the caller's registers while the location is tested.
68E1 PUSH DE
68E2 LD E,A Index the location tables by this object.
68E3 LD D,$00
68E5 BIT 7,E Bit 7 selects a scenic slot rather than an ordinary object.
68E7 JR NZ,IsObjectInCurrentRoom_Step1
68E9 LD HL,$61AB Continue at IsObjectInCurrentRoom_Step2 to compare an ordinary object's location.
68EC JR IsObjectInCurrentRoom_Step2
IsObjectInCurrentRoom_Step1 68EE RES 7,E The scenic marker is not part of the object number.
68F0 LD HL,$6224 A scenic object is kept with the scenic rooms.
IsObjectInCurrentRoom_Step2 68F3 ADD HL,DE Index this object's byte in the location table.
68F4 LD A,($6223) Fetch the current room.
68F7 CP (HL) The object is here when its location is the current room.
68F8 JR Z,IsObjectInCurrentRoom_Step3
68FA LD A,$01 A carried object counts as present too.
68FC CP (HL)
IsObjectInCurrentRoom_Step3 68FD POP DE Restore the registers the caller needs from the stack.
68FE POP HL
68FF RET Return.
Prev: 68A4 Up: Map Next: 6900