Prev: D2B2 Up: Map Next: D372
D356: Colour a column of wall up to the top of the play area
Used by the routine at DRAW_WALL_COLUMN.
A wall hides everything above it on the screen, so its colour runs from the attribute row holding its bottom line to the top of the play area: two attribute bytes a row, filled by COLOUR_STRIP in the attribute buffer (ATTR_BUFFER, 24 bytes a row, the bottom row first). The ink is bright green, cyan, yellow or white by the two low bits of the cell's type (CELL_TYPE); the paper is this turn's, LAST_FLASH, which a dying villain flashes. Nothing for a wall standing at or above line $B8.
The pair of bytes runs one past the end of a row when the column's x is in the last byte of the row: into the first byte of the next row, part of the two-byte margin at the left of the buffer that is never copied to the screen (COPY_ATTR_BUFFER shows 22 of each row's 24 bytes), and on the top row one past the attribute buffer altogether, into ATTR_SPILL. Measured: 28 of 752 fills in a random tour reached it, each at the right-hand edge; and over 877 calls the lowest wall bottom was line 126, so a fill never starts below the attribute buffer.
Input
D the y of the wall's bottom line
E its x
COLOUR_WALL D356 LD A,D At or above line $BF: nothing
D357 SUB $BF
D359 RET NC
D35A NEG The attribute rows from its own up to the top: (191 - y) / 8; none, nothing
D35C SRL A
D35E SRL A
D360 SRL A
D362 RET Z
D363 LD B,A B = the rows; HL = the attribute byte (ATTR_ADDRESS)
D364 EX DE,HL
D365 CALL ATTR_ADDRESS
D368 LD A,(CELL_TYPE) Bright, with the ink from the cell type
D36B AND $03
D36D OR $44
D36F JP COLOUR_STRIP Fill the rows, with this turn's paper (COLOUR_STRIP)
Prev: D2B2 Up: Map Next: D372