Prev: E289 Up: Map Next: E2A6
E28E: Start a flat piece that crosses the left-hand side of the play area
The first pass of the flat-piece blitter blit_flat_step comes here when flat_step_clip has patched the JR at the top of its loop to offset $33 (the piece's column is $1C or $1D, that is, it begins just left of the play area, whose columns are 1 to 28). It keeps the column saved for the next piece (column_address) in the right character row, moves L to column 1 of the row, and patches the loop's JR again (offset $4C) so that every later pair of rows goes straight to flat_blit_left_rows's second instruction. Then it skips the graphic's first byte, and through the JR flat_step_clip also patched (0 or 1) maybe a second one, so that only the bytes that lie on the play area are drawn.
Column $1D leaves two bytes of each row to draw (flat_blit_left_two_rows), column $1C one (flat_blit_left_one_row). The POPs that follow are one byte out of step with the graphic's pairs, which is why each row's last write and the drops in those two routines look lopsided.
Input
A the column kept for the next piece, low byte (column_address after the blitter added 3)
HL the screen address of the piece's first byte
flat_blit_left_edge E28E INC A Has the next piece's column come round to the start of a character row?
E28F AND $1F
E291 JR NZ,flat_blit_left_edge_0
E293 LD A,L If so, take it back into this one
E294 SUB $20
E296 LD (column_address),A
flat_blit_left_edge_0 E299 LD A,L L to column 1 of this pixel row
E29A AND $E0
E29C INC A
E29D LD L,A
This entry point is used by the routine at flat_blit_lose_first.
flat_blit_left_edge_1 E29E LD A,$4C From now on the loop's JR goes to flat_blit_left_rows + 1 (offset $4C)
E2A0 LD ($E25A),A
E2A3 INC SP Skip the graphic's first byte
flat_blit_left_edge_2 E2A4 JR flat_blit_left_edge_2 JR patched by flat_step_clip: 0 skips a second byte at flat_blit_left_rows, 1 does not
Prev: E289 Up: Map Next: E2A6