Prev: DB5B Up: Map Next: DBB7
DB89: Draw a sloped step cut off by the right edge
Used by the routine at step_dispatch.
Reached through step_dispatch (dispatch 2) for a sloped step of a piece running right (directions 1-3 and their ceilings) that crosses the play area's right edge: only its left one or two byte columns are written. Like the full blitters it zig-zags up the screen two rows at a time, popping the graphic from SP. After the first column's byte, the JR whose displacement set_right_clip_columns or slope_lose_last_column set decides the rest:
  • 0: the second column, then the upper row's second and first columns, passing the third column's pair -- a three-byte step cut to two.
  • $1E: one column -- a three-byte step cut to one.
  • $1F: one column -- a two-byte step cut to one.
  • $20: one column -- a one-byte step, uncut.
This was code typed as text and data in the first code map.
Input
A Row pairs
HL Screen address, less the byte advance
SP The step's graphic
blit_right_clip DB89 LD B,A B = row pairs.
DB8A LD A,(piece_dcolumn) To the step's first column.
DB8D ADD A,L
DB8E LD L,A
blit_right_clip_0 DB8F POP DE Lower row, first column.
DB90 LD (HL),E
blit_right_clip_1 DB91 JR blit_right_clip_1 Patched: how much more of the row pair is drawn.
DB93 INC L Second column; up a row.
DB94 LD (HL),D
DB95 DEC H
DB96 POP DE Pass the third column's pair; take the upper row's.
DB97 POP DE
DB98 LD (HL),E Upper row: second column, first column.
DB99 DEC L
blit_right_clip_2 DB9A LD (HL),D
DB9B DEC H Up a pixel row, crossing a character row if need be.
DB9C LD A,H
DB9D INC A
DB9E AND $07
DBA0 JR NZ,blit_right_clip_3
DBA2 LD A,L
DBA3 SUB $20
DBA5 LD L,A
DBA6 JR C,blit_right_clip_3
DBA8 LD A,H
DBA9 ADD A,$08
DBAB LD H,A
blit_right_clip_3 DBAC DJNZ blit_right_clip_0 Next row pair.
DBAE JP after_step_drawn Done.
DBB1 POP DE One-column cuts: pass two pairs, one, or none; up a row; the upper row's first column.
DBB2 POP DE
DBB3 DEC H
DBB4 JP blit_right_clip_2
Prev: DB5B Up: Map Next: DBB7