Prev: 8179 Up: Map Next: 81A4
8180: Mark one height's blocks in PLANES
Used by the routine at BUILD_PLANES.
For each of the 512 places in PLANES, write the height's bit there if the gathered cell at the same offset from DE has a block at that height. Called for the heights in order, lowest first, so a higher block overwrites a lower one.
Input
C The height's bit ($01 for the ground layer up to $20)
DE Where in VIEW_CELLS that height's cells start
MARK_PLANE 8180 LD B,$80 128 times four places.
8182 LD HL,PLANES
MARK_PLANE_0 8185 LD A,(DE) A block at this height in the cell: mark the place.
8186 AND C
8187 JR Z,MARK_PLANE_1
8189 LD (HL),C
MARK_PLANE_1 818A INC L
818B INC E
818C LD A,(DE)
818D AND C
818E JR Z,MARK_PLANE_2
8190 LD (HL),C
MARK_PLANE_2 8191 INC L
8192 INC E
8193 LD A,(DE)
8194 AND C
8195 JR Z,MARK_PLANE_3
8197 LD (HL),C
MARK_PLANE_3 8198 INC L
8199 INC E
819A LD A,(DE)
819B AND C
819C JR Z,MARK_PLANE_4
819E LD (HL),C
MARK_PLANE_4 819F INC HL
81A0 INC DE
81A1 DJNZ MARK_PLANE_0
81A3 RET
Prev: 8179 Up: Map Next: 81A4