Prev: 27842 Up: Map Next: 27927
27898: Identify a tile in front of a sprite
Used by the routine at 27842.
Input
E Previous tile indicator
HL Attribute file address for the tile
Output
E Updated tile indicator
27898 LD A,E Copy the previous tile indicator to A.
27899 CP 255 Have we already found a wall tile?
27901 RET Z Return if so.
27902 LD A,(HL) Pick up the tile's attribute byte.
27903 CP 61 Is it a wall tile?
27905 JR NZ,27910 Jump if not.
27907 LD E,255 Signal: wall tile found.
27909 RET
27910 CP 63 Is it a tunnel entrance?
27912 JR NZ,27919 Jump if not.
27914 LD A,1 Record the number of tunnel entrance tiles found so far in bits 0 and 1 of E.
27916 ADD A,E
27917 LD E,A
27918 RET
27919 CP 56 Is it an arrow tile (maze entrance/exit)?
27921 RET NZ Return if not.
27922 LD A,4 Record the number of arrow tiles found so far in bits 2 and 3 of E.
27924 ADD A,E
27925 LD E,A
27926 RET
Prev: 27842 Up: Map Next: 27927