Prev: D319 Up: Map Next: D481
D464: Decide how a sloped step near the right edge is clipped
Entered from the patched JR at the end of landscape_step_loop with A = the step's run in pixels (negated here for a piece running left) and B its screen x. If the step's far side stays left of $E9 it goes on to slope_step_at_left_edge. Otherwise it crosses the play area's right edge and one of the right-clipping blitters is chosen: for a step starting left of $E0 only its rightmost column is lost (slope_lose_last_column); for one starting at $E0 or later only its first column or two are drawn, the count patched into the blitter's JR (blit_right_clip by set_right_clip_columns, or blit_mirrored_right_clip by mirrored_slope_far_right).
Input
A Run of the step in pixels
B Screen x of the step
slope_step_at_right_edge D464 NEG Far side left of $E9: no right clipping.
D466 ADD A,B
D467 CP $E9
D469 JP C,slope_step_at_left_edge
D46C LD A,B Starts left of $E0: slope_lose_last_column.
D46D CP $E0
D46F JR C,slope_lose_last_column
D471 LD A,(direction_flag) A piece running left uses the mirrored blitter (mirrored_slope_far_right).
D474 CP $01
D476 JR Z,mirrored_slope_far_right
D478 LD A,(piece_dcolumn) Displacement for the JR in blit_right_clip: $21 less the byte advance.
D47B LD B,A
D47C LD A,$21
D47E SUB B
slope_step_at_right_edge_0 D47F JR slope_step_at_right_edge_0 Patched by landscape_step_loop (displacement 1 on a byte boundary): into set_right_clip_columns (one less) or past its DEC A.
Prev: D319 Up: Map Next: D481