Prev: D86A Up: Map Next: D937
D8DA: Blank the byte column a flat piece's drop leaves behind when scrolling across
Used by the routine at after_step_drawn.
Called at the end of a flat piece when the fine horizontal position is on a byte boundary and the landscape is scrolling across (scroll_across). A byte column four rows tall beside a drop at one end of the run is cleared to black by fill_under_slope. Which step gives the place depends on the current-piece record's +1: if zero, the piece's first step (first_step_address), provided its cap on the side the scroll moves towards (piece_extra_b when scroll_across is negative, else piece_extra_a) is odd; otherwise the step kept by flat_step_clip (piece_kept set), two columns on.
fill_flat_end_column D8DA LD A,(scroll_across) No horizontal scroll: nothing to do.
D8DD AND A
D8DE JP Z,after_step_drawn_14
D8E1 LD A,(IX+$01) +1 zero: is that cap odd? Then the column left of the first step.
D8E4 AND A
D8E5 JR NZ,fill_flat_end_column_1
D8E7 LD A,(scroll_across)
D8EA BIT 7,A
D8EC LD A,(piece_extra_b)
D8EF JR NZ,fill_flat_end_column_0
D8F1 LD A,(piece_extra_a)
fill_flat_end_column_0 D8F4 BIT 0,A
D8F6 JP Z,after_step_drawn_14
D8F9 EXX
D8FA LD HL,(first_step_address)
D8FD DEC L
D8FE JR fill_flat_end_column_2
fill_flat_end_column_1 D900 LD A,(piece_kept) Otherwise the step kept by flat_step_clip, two columns on (a character row up if it hung off the left edge).
D903 AND A
D904 JP Z,after_step_drawn_14
D907 EXX
D908 LD HL,(first_step_address)
D90B INC L
D90C INC L
D90D LD A,(scratch_count)
D910 CP $F0
D912 JR C,fill_flat_end_column_2
D914 LD A,L
D915 SUB $20
D917 LD L,A
fill_flat_end_column_2 D918 LD A,(first_step_y) Its y; scrolling the other way, four columns further.
D91B LD (piece_page_y),A
D91E LD A,(scroll_across)
D921 BIT 7,A
D923 JR Z,fill_flat_end_column_3
D925 LD A,L
D926 ADD A,$04
D928 LD L,A
fill_flat_end_column_3 D929 LD DE,$0000 Black, two row pairs, one step: fill_under_slope.
D92C LD C,$02
D92E EXX
D92F LD B,$01
D931 CALL fill_under_slope
D934 JP after_step_drawn_14
Prev: D86A Up: Map Next: D937