← 9610 Draw a corner block Map 9667 → Draw a top/bottom border strip
9635: Draw or color the mirror side wall on the bat's side
Draws the mirror side wall, the safety net barrier down the bat's own losing edge.
The permanent border wall holds the far edge.
It both lays the tiles down and steps the color fade.
Input
A 0 to redraw the mirror wall's tiles at base appearance, or the attribute byte to flood across its 36 cells
The wall opposite the bat is composed by draw_side_wall from the real bat side. This routine targets the other edge, the bat's own.
draw_mirror_wall 9635 OR A Redraw the wall's tiles, or flood its band with one attribute?
9636 JR NZ,color_mirror_wall
9638 LD A,(bat_side) Tile-redraw mode: flip the bat side, redraw the mirror wall via draw_side_wall on the flipped side, then restore the bat side.
963B PUSH AF
963C XOR $01
963E LD (bat_side),A
9641 CALL draw_side_wall
9644 POP AF
9645 LD (bat_side),A
9648 RET
color_mirror_wall 9649 EX AF,AF' Attribute mode: stash the fill byte in A', then pick the band column from the bat side – the mirror edge on the bat's side.
964A LD A,(bat_side)
964D OR A
964E JR NZ,band_left
9650 LD HL,ATTR_BASE+$9E Bat on the right: anchor the 2-wide band at the right edge, column 30 of attribute row 4.
9653 JR fill_band
band_left 9655 LD HL,ATTR_BASE+$80 Bat on the left: anchor the band at the left edge, column 0 of attribute row 4.
fill_band 9658 EX AF,AF' Recover the fill byte into C.
9659 LD C,A
965A LD B,$12 Walk the band's full height.
965C LD DE,$0020 Row stride: 32 cells to the next attribute row
fill_band_row 965F LD (HL),C Write the fill byte to both columns of the row, then step down one 32-column row.
9660 INC HL
9661 LD (HL),C
9662 DEC HL
9663 ADD HL,DE
9664 DJNZ fill_band_row
9666 RET
← 9610 Draw a corner block Map 9667 → Draw a top/bottom border strip
Fork me on GitHub