Prev: 6C0F Up: Map Next: 6C46
6C20: Check the attribute bytes at a sprite's location
Used by the routines at 65A1 and 66A4.
Input
HL Sprite location
Output
A 58 (cherry/strawberry), 59 (guard), 60 (flower), or 0 (none of these)
F Zero flag set if A is 0 (nothing found)
6C20 PUSH BC Save BC.
6C21 PUSH DE Save DE.
6C22 PUSH HL Save the sprite location.
6C23 LD BC,$4000 Convert the sprite location into a display file address.
6C26 ADD HL,BC
6C27 CALL $6C0F Set HL' to the corresponding attribute file address.
6C2A EXX Exchange registers.
6C2B LD E,$00 E' will hold the attribute of any interesting tile at this location; initialise it now.
6C2D CALL $6C46 Check the attribute of the top-left tile.
6C30 INC HL Point HL' at the top-right tile.
6C31 CALL $6C46 Check the attribute of the top-right tile.
6C34 LD BC,$001F Point HL' at the bottom-left tile.
6C37 ADD HL,BC
6C38 CALL $6C46 Check the attribute of the bottom-left tile.
6C3B INC HL Point HL' at the bottom-right tile.
6C3C CALL $6C46 Check the attribute of the bottom-right tile.
6C3F LD A,E Copy the tile attribute indicator to A.
6C40 EXX Exchange registers.
6C41 POP HL Restore the sprite location to HL.
6C42 POP DE Restore DE.
6C43 POP BC Restore BC.
6C44 AND A Set the zero flag if no interesting tile (guard, flower, cherry, strawberry) was found.
6C45 RET
Prev: 6C0F Up: Map Next: 6C46