Prev: DB49 Up: Map Next: DB89
DB5B: Fill one row pair across a step's width
Used by the routines at fill_two_rows and fill_four_rows.
Writes D on the row at HL and E on the row above, for C bytes rightwards, skipping any byte outside columns 1-28, and only when the row (piece_page_y) is inside the play area. Then moves piece_page_y and HL two rows up and a byte advance on.
Input
HL Screen address
C Width in bytes
DE Fill pattern: $55AA (checker) or 0
fill_row_pair DB5B LD A,(piece_page_y) Row outside the play area: nothing.
DB5E CP $B8
DB60 JR NC,fill_row_pair_2
DB62 CP $18
DB64 JR C,fill_row_pair_2
DB66 LD B,C Across the width, inside columns 1-28 only.
DB67 PUSH HL
fill_row_pair_0 DB68 LD A,L
DB69 AND $1F
DB6B DEC A
DB6C CP $1C
DB6E JR NC,fill_row_pair_1
DB70 LD (HL),D
DB71 DEC H
DB72 LD (HL),E
DB73 INC H
fill_row_pair_1 DB74 INC L
DB75 DJNZ fill_row_pair_0
DB77 POP HL
fill_row_pair_2 DB78 LD A,(piece_page_y) Two rows up, a byte advance across.
DB7B DEC A
DB7C DEC A
DB7D LD (piece_page_y),A
DB80 LD A,(piece_dcolumn)
DB83 ADD A,L
DB84 LD L,A
DB85 DEC H
DB86 JP line_up_hl
Prev: DB49 Up: Map Next: DB89