Prev: 6CC2 Up: Map Next: 6D17
6CFA: Identify a tile in front of a sprite
Used by the routine at 6CC2.
Input
E Previous tile indicator
HL Attribute file address for the tile
Output
E Updated tile indicator
6CFA LD A,E Copy the previous tile indicator to A.
6CFB CP $FF Have we already found a wall tile?
6CFD RET Z Return if so.
6CFE LD A,(HL) Pick up the tile's attribute byte.
6CFF CP $3D Is it a wall tile?
6D01 JR NZ,$6D06 Jump if not.
6D03 LD E,$FF Signal: wall tile found.
6D05 RET
6D06 CP $3F Is it a tunnel entrance?
6D08 JR NZ,$6D0F Jump if not.
6D0A LD A,$01 Record the number of tunnel entrance tiles found so far in bits 0 and 1 of E.
6D0C ADD A,E
6D0D LD E,A
6D0E RET
6D0F CP $38 Is it an arrow tile (maze entrance/exit)?
6D11 RET NZ Return if not.
6D12 LD A,$04 Record the number of arrow tiles found so far in bits 2 and 3 of E.
6D14 ADD A,E
6D15 LD E,A
6D16 RET
Prev: 6CC2 Up: Map Next: 6D17