Prev: BF7E Up: Map Next: BF97
BF83: Fill a box of bytes, B wide and C rows high, with A
Fills B bytes along from HL, then moves 32 bytes on to the next row, C times: in the buffer that is up the screen, in the attribute file down. The row is eight unrolled stores (FILL_BOX_STORES), and the routine rewrites the displacement of the JR at FILL_BOX_ROW so that it lands on the last B of them -- on the tape the JR jumps to itself, and it is always rewritten before it runs. Used to clear the carried things' boxes and colour them (SHOW_CARRIED), for the panel (COLOUR_PANEL) and by RENDER_DYNAMIC_OBJECTS.
Input
HL the first byte: the box's bottom-left in the buffer, or its top-left in the attribute file
A the byte to fill with
B the width in bytes, 1 to 8
C how many rows
FILL_BOX BF83 PUSH AF the displacement: twice (8 - B) modulo 8, into the JR's second byte
BF84 LD A,B
BF85 NEG
BF87 AND $07
BF89 ADD A,A
BF8A LD ($BF96),A
BF8D LD A,$20 DE = 32 - B, from the end of one row to the start of the next
BF8F SUB B
BF90 LD E,A
BF91 LD D,$00
BF93 LD B,C B = the rows
BF94 POP AF
This entry point is used by the routine at FILL_BOX_STORES.
FILL_BOX_ROW BF95 JR FILL_BOX_ROW into the stores, B from the end (rewritten above)
Prev: BF7E Up: Map Next: BF97