Prev: 81A4 Up: Map Next: 81E4
81B0: Sort the gathered cells into PLANES, height by height
Used by the routine at DRAW_VIEW.
Each height reads VIEW_CELLS one row of 32 cells further on: a block one higher is drawn one row further up the screen, so it covers the place a row back. That is the whole of the 3D -- after this, PLANES says, for each place in the view, which height of block (if any) is the one to be seen there.
BUILD_PLANES 81B0 CALL CLEAR_PLANES Start from nothing.
81B3 LD C,$01 The ground layer...
81B5 LD DE,VIEW_CELLS
81B8 CALL MARK_PLANE
81BB LD C,$02
81BD LD DE,$B1A0
81C0 CALL MARK_PLANE
81C3 LD C,$04
81C5 LD DE,$B1C0
81C8 CALL MARK_PLANE
81CB LD C,$08
81CD LD DE,$B1E0
81D0 CALL MARK_PLANE
81D3 LD C,$10
81D5 LD DE,$B200
81D8 CALL MARK_PLANE
81DB LD C,$20 ...up to height 5, 32 cells further on each time.
81DD LD DE,$B220
81E0 CALL MARK_PLANE
81E3 RET
Prev: 81A4 Up: Map Next: 81E4