Prev: CF38 Up: Map Next: D063
D04F: Paint One Column
Paints one attribute cell in each of the rows going up the screen, but only the cells inside the area of the terrain.
Input
B Number of rows
C Attribute value
DE 20
HL Attribute address of the bottom cell
PaintOneColumn D04F CALL TestAttributeAddress Call TestAttributeAddress.
D052 JR Z,PaintOneColumn_Next Jump to PaintOneColumn_Next if the zero flag is set.
D054 LD A,L A=L.
D055 AND %00011111 Keep the bits of A that are set in 1F.
D057 DEC A Step A back.
D058 CP $1C Jump to PaintOneColumn_Next if A is 1C or more.
D05A JR NC,PaintOneColumn_Next
D05C LD (HL),C Write C where HL points.
PaintOneColumn_Next D05D AND A Is A zero?
D05E SBC HL,DE Subtract DE and the carry from HL.
D060 DJNZ PaintOneColumn Decrease B and jump to PaintOneColumn until none remain.
D062 RET Return.
Prev: CF38 Up: Map Next: D063