Prev: EB54 Up: Map Next: EB79
EB55: See if the player is touching any collectable item
Used by the routine at 8184.
EB55 LD BC,$0000 Set B to 0 (first object) and C to 0 (no items).
EB58 CALL $AA8C Get the buffer for this object.
EB5B LD A,(HL) Get the first byte.
EB5C CP $FF Is it an end marker?
EB5E JR Z,$EB72 If so, there are no items here, so jump forward.
EB60 INC HL Point HL at the X co-ordinate.
EB61 LD A,(IY+$05) Get the X co-ordinate.
EB64 SUB (HL) Convert the player co-ordinate to an object co-ordinate.
EB65 INC HL
EB66 INC HL
EB67 INC HL
EB68 SUB $06
EB6A CP $F4 Are the two near enough?
EB6C JR C,$EB5B Jump back to look at other entries if not.
EB6E LD C,$01 Otherwise set that an object is found in C, then jump back.
EB70 JR $EB5B
At this point, all objects in the room have been checked, and C is set to 1 if the player is near any of them.
EB72 LD A,C Were any items found?
EB73 OR A
EB74 RET NZ Return if not.
EB75 LD ($EB54),A Otherwise mark that the player is near an object (EB54) and return.
EB78 RET
Prev: EB54 Up: Map Next: EB79