| Routines

F986: Check for the presence of a plant pot

Used by the routines at 5D63 and FA4D. Returns with the zero flag set if either ERIC or the recently ejected contents of the water pistol are on top of a plant pot:
Location | Plant pot
--- | ---
91,2 | Near the top-floor window
93,9 | Near the middle-floor window
132,16 | To the left of the skool gate
135,16 | To the right of the skool gate
Input
H | 0xD2 (ERIC) or 0xD6 (water/sherry)
F986 | LD DE,$9FFC | Point DE at the plant-pot y-coordinate table at 9FFC
F989 | LD L,$02 | Point HL at byte 0x02 of the character's buffer
F98B | LD A,(DE) | A=y-coordinate of the plant pot
F98C | CP (HL) | Does this match the character's y-coordinate?
F98D | JR NZ,$F995 | Jump if not
F98F | DEC L | L=0x01
F990 | DEC D | Point DE at the plant-pot x-coordinate table at 9EFC
F991 | LD A,(DE) | A=x-coordinate of the plant pot
F992 | CP (HL) | Does this match the character's x-coordinate?
F993 | RET Z | Return with the zero flag set if so
F994 | INC D | Point DE back at the plant-pot y-coordinate table
F995 | INC E | Next plant pot
F996 | JR NZ,$F989 | Jump back until all four plant pots have been checked
F998 | INC E | Reset the zero flag to indicate the lack of any plant pot here
F999 | RET |