The landscape is drawn every pass from pieces: straight runs of identical steps in one of 16 directions (draw_landscape). Each step is drawn by a POP blitter with SP on its graphic, two rows a POP, climbing the screen; its graphic is stored exactly as the blitter writes it -- the bottom row left to right, the row above right to left, and so on up. For each of the four fine-scroll positions, 0, 2, 4 and 6 pixels, a table gives every direction a blitter and a graphic: piece_blitters_shift0 for shift 0, piece_blitters_shift2 for shift 2, piece_blitters_shift4 for shift 4, piece_blitters_shift6 for shift 6, chosen each pass by the scroll (shift_table).

Only nine graphics are stored. A ceiling (directions 7 to 13) has graphics of its own, but a step climbing left is its partner's graphic started one row later and drawn by a blitter that turns every byte round through the bit-reversal table (bit_reverse_table): with the zig-zag order, starting a row later makes every row's bytes arrive the other way round, and reversing each byte finishes the mirror. Each graphic holds three variants of its step, one above the other, and column_varieties walks a fixed jumble of 0, 1 and 2 along a run so that a long flat stretch is not one pattern repeated; the offset of each variant comes from graphic_offsets. The two flat graphics carry four end caps after their variants, drawn at the ends of a run instead of a variant (flat_step_clip).

The shifted copies are made at start-up, by build_shifted_pieces, over bytes that are zeros on the tape: a slope one byte wider than its graphic, its open side filled with the ground's checker (shift_slope_piece); a flat piece rotated rather than shifted, since the ground under it repeats every 24 pixels (shift_flat_piece). So the pictures here are of a game run to its menu in SkoolKit's simulator, after the start-up: each step is drawn by the blitter its table names, with SP on the graphic at the variant's offset and A its pairs of rows, and run to the jump back into after_step_drawn (after_step_drawn) -- one call of what draw_step does for every step. White is a pixel set; the strips are the three variants left to right, then, for the flat pieces, the four end caps.

The nine stored graphics

GraphicDirections at shift 0Shifted copiesMade by
flat_piece_gfx0flat_piece_shiftedshift_flat_piece
flat_piece_two_gfx7flat_piece_two_shiftedshift_flat_piece
slope_9_gfx9, 12slope_9_shiftedshift_slope_piece
slope_2_gfx2, 5slope_2_shiftedshift_slope_piece
slope_8_gfx8, 11slope_8_shiftedshift_slope_piece
slope_1_gfx1, 4slope_1_shiftedshift_slope_piece
slope_10_gfx10, 13slope_10_shiftedshift_slope_piece
slope_3_gfx3, 6slope_3_shiftedshift_slope_piece
wall_gfx14, 15wall_shiftedshift_slope_piece

flat_piece_gfx's copies at flat_piece_shifted, 28 rows of 3 bytes each: the rows the start-up writes, compared with the tape's bytes in the simulator -- shift 2: rows 0 to 11; shift 4: rows 0 to 11; shift 6: rows 0 to 11. Those are the three variants (4 rows each); the 16 rows after them, the four end caps, came on the tape already shifted.

flat_piece_two_gfx's copies at flat_piece_two_shifted, 28 rows of 3 bytes each: the rows the start-up writes, compared with the tape's bytes in the simulator -- shift 2: rows 0 to 11; shift 4: rows 0 to 11; shift 6: rows 0 to 11. Those are the three variants (4 rows each); the 16 rows after them, the four end caps, came on the tape already shifted.

The flat pieces

Directions 0 and 7, the flat floor and the flat ceiling: three bytes wide and four rows tall, drawn as two pairs of rows, all by the one blitter at every shift. Each strip is the three variants, then the four end caps, each drawn by the blitter at its offset (flat_step_clip picks a cap's: $24 plus 12 times its number).

Shift0: flat floor7: flat ceiling
0 (piece_blitters_shift0)Direction 0 at shift 0
blit_flat_step
graphic $E583, in flat_piece_gfx
Direction 7 at shift 0
blit_flat_step
graphic $E5D9, in flat_piece_two_gfx
2 (piece_blitters_shift2)Direction 0 at shift 2
blit_flat_step
graphic $EA68
Direction 7 at shift 2
blit_flat_step
graphic $EB64
4 (piece_blitters_shift4)Direction 0 at shift 4
blit_flat_step
graphic $EABC, in flat_piece_shifted
Direction 7 at shift 4
blit_flat_step
graphic $EBB8, in flat_piece_two_shifted
6 (piece_blitters_shift6)Direction 0 at shift 6
blit_flat_step
graphic $EB10, in flat_piece_shifted
Direction 7 at shift 6
blit_flat_step
graphic $EC0C, in flat_piece_two_shifted

The other 14 directions at the four shifts

A row a direction: what it is, then, at each shift, its step's three variants as its blitter draws them, the blitter, and where its graphic starts -- the variant's offset is added to that. The run and rise are from piece_shapes. Climbing-left directions at a shift use their partner's graphic at the opposite shift (2 for 6), started one row on.

DirectionShift 0 (piece_blitters_shift0)Shift 2 (piece_blitters_shift2)Shift 4 (piece_blitters_shift4)Shift 6 (piece_blitters_shift6)
1: a gentle slope climbing right
run 16, rise 8
Direction 1 at shift 0
blit_two
graphic $E6A5, in slope_1_gfx
Direction 1 at shift 2
$E4A8, in blit_three
graphic $E804
Direction 1 at shift 4
$E4A8, in blit_three
graphic $E861, in slope_1_shifted
Direction 1 at shift 6
$E4A8, in blit_three
graphic $E8BE, in slope_1_shifted
2: a 45-degree slope climbing right
run 8, rise 8
Direction 2 at shift 0
blit_one
graphic $E64E, in slope_2_gfx
Direction 2 at shift 2
$E4D0, in blit_two
graphic $E74A
Direction 2 at shift 4
$E4D0, in blit_two
graphic $E788, in slope_2_shifted
Direction 2 at shift 6
$E4D0, in blit_two
graphic $E7C6, in slope_2_shifted
3: a steep slope climbing right
run 8, rise 16
Direction 3 at shift 0
blit_one
graphic $E716, in slope_3_gfx
Direction 3 at shift 2
$E4D0, in blit_two
graphic $E91E
Direction 3 at shift 4
$E4D0, in blit_two
graphic $E98C, in slope_3_shifted
Direction 3 at shift 6
$E4D0, in blit_two
graphic $E9FA, in slope_3_shifted
4: a gentle slope climbing left
run -16, rise 8
Direction 4 at shift 0
$E52B, in blit_mirror_three
graphic $E6A7, in slope_1_gfx
Direction 4 at shift 2
$E4F2, in blit_mirror_three
graphic $E8C1, in slope_1_shifted
Direction 4 at shift 4
$E4F2, in blit_mirror_three
graphic $E864, in slope_1_shifted
Direction 4 at shift 6
$E4F2, in blit_mirror_three
graphic $E807, in slope_1_shifted
5: a 45-degree slope climbing left
run -8, rise 8
Direction 5 at shift 0
blit_mirror_one
graphic $E64F, in slope_2_gfx
Direction 5 at shift 2
blit_mirror_two
graphic $E7C8, in slope_2_shifted
Direction 5 at shift 4
blit_mirror_two
graphic $E78A, in slope_2_shifted
Direction 5 at shift 6
blit_mirror_two
graphic $E74C, in slope_2_shifted
6: a steep slope climbing left
run -8, rise 16
Direction 6 at shift 0
blit_mirror_one
graphic $E717, in slope_3_gfx
Direction 6 at shift 2
blit_mirror_two
graphic $E9FC, in slope_3_shifted
Direction 6 at shift 4
blit_mirror_two
graphic $E98E, in slope_3_shifted
Direction 6 at shift 6
blit_mirror_two
graphic $E920, in slope_3_shifted
8: a gentle slope climbing right, as a ceiling
run 16, rise 8
Direction 8 at shift 0
blit_two
graphic $E66C, in slope_8_gfx
Direction 8 at shift 2
$E4A8, in blit_three
graphic $EE9A
Direction 8 at shift 4
$E4A8, in blit_three
graphic $EEF7, in slope_8_shifted
Direction 8 at shift 6
$E4A8, in blit_three
graphic $EF54, in slope_8_shifted
9: a 45-degree slope climbing right, as a ceiling
run 8, rise 8
Direction 9 at shift 0
blit_one
graphic $E630, in slope_9_gfx
Direction 9 at shift 2
$E4D0, in blit_two
graphic $EDE0
Direction 9 at shift 4
$E4D0, in blit_two
graphic $EE1E, in slope_9_shifted
Direction 9 at shift 6
$E4D0, in blit_two
graphic $EE5C, in slope_9_shifted
10: a steep slope climbing right, as a ceiling
run 8, rise 16
Direction 10 at shift 0
blit_one
graphic $E6E0, in slope_10_gfx
Direction 10 at shift 2
$E4D0, in blit_two
graphic $EFB1
Direction 10 at shift 4
$E4D0, in blit_two
graphic $F01F, in slope_10_shifted
Direction 10 at shift 6
$E4D0, in blit_two
graphic $F08D, in slope_10_shifted
11: a gentle slope climbing left, as a ceiling
run -16, rise 8
Direction 11 at shift 0
$E52B, in blit_mirror_three
graphic $E66E, in slope_8_gfx
Direction 11 at shift 2
$E4F2, in blit_mirror_three
graphic $EF57, in slope_8_shifted
Direction 11 at shift 4
$E4F2, in blit_mirror_three
graphic $EEFA, in slope_8_shifted
Direction 11 at shift 6
$E4F2, in blit_mirror_three
graphic $EE9D, in slope_8_shifted
12: a 45-degree slope climbing left, as a ceiling
run -8, rise 8
Direction 12 at shift 0
blit_mirror_one
graphic $E631, in slope_9_gfx
Direction 12 at shift 2
blit_mirror_two
graphic $EE5E, in slope_9_shifted
Direction 12 at shift 4
blit_mirror_two
graphic $EE20, in slope_9_shifted
Direction 12 at shift 6
blit_mirror_two
graphic $EDE2, in slope_9_shifted
13: a steep slope climbing left, as a ceiling
run -8, rise 16
Direction 13 at shift 0
blit_mirror_one
graphic $E6E1, in slope_10_gfx
Direction 13 at shift 2
blit_mirror_two
graphic $F08F, in slope_10_shifted
Direction 13 at shift 4
blit_mirror_two
graphic $F021, in slope_10_shifted
Direction 13 at shift 6
blit_mirror_two
graphic $EFB3, in slope_10_shifted
14: a wall, stepping right
run 0, rise 16
Direction 14 at shift 0
$E48C, in blit_one
graphic $EC63, in wall_gfx
Direction 14 at shift 2
$E4D1, in blit_two
graphic $EC96
Direction 14 at shift 4
$E4D1, in blit_two
graphic $ED04, in wall_shifted
Direction 14 at shift 6
$E4D1, in blit_two
graphic $ED72, in wall_shifted
15: a wall, stepping left
run 0, rise 16
Direction 15 at shift 0
$E55C, in blit_mirror_one
graphic $EC64, in wall_gfx
Direction 15 at shift 2
$E52D, in blit_mirror_two
graphic $ED74, in wall_shifted
Direction 15 at shift 4
$E52D, in blit_mirror_two
graphic $ED06, in wall_shifted
Direction 15 at shift 6
$E52D, in blit_mirror_two
graphic $EC98, in wall_shifted