Prev: F7E5 Up: Map Next: F856
F7EB: Build the landscape pieces' shifted copies
Used by the routine at sprite_buffer_two.
Called once, at the start (build_shift_tables), with the shift tables from shift_tables in place. Clears the work bytes from scratch_count, 38 of them, and makes, for each of the nine stored terrain-piece graphics, its copies shifted right by 2, 4 and 6 pixels, one after another at the address given: with shift_slope_piece for the slopes and the wall, with shift_flat_piece for the two flat pieces. The three ceiling slopes are made with piece_step_x set, which pads them with the checkerboard on the left instead of the right.
The tape holds the copies' places as zeros (the generator ORs into them), except that the flat pieces' copies are only partly made here; the rest of them came on the tape (see shift_flat_piece). Each graphic starts with a header (read_piece_header), which is why the source addresses here are two or three bytes before those in the tables at piece_blitters_shift2.
This routine and the ones after it to shift_slope_piece's end run once. Afterwards their bytes are reused: a sprite-compositing buffer of up to 256 bytes starts 21 bytes into this routine, inside the operand of a CALL, so it cannot have a label of its own (copy_box_in copies into it with LDI and dissolve_sprite reads it back; old_beam_frame builds a sprite there and new_beam_frame another from its 128th byte, sprite_buffer_two), over the end of this routine and the ones up to bit_reverse_table; and from bit_reverse_table the bit-reversed table build_bit_reverse makes, over the rest.
build_shifted_pieces F7EB LD HL,scratch_count Clear the work bytes scratch_count to basic_leftovers
F7EE LD B,$26
F7F0 CALL clear_bytes
F7F3 XOR A Floors: no padding on the left
F7F4 LD (piece_step_x),A
F7F7 LD HL,slope_2_shifted Direction 2 (one byte wide, 9 rows), shifted to slope_2_shifted
F7FA EXX
F7FB LD HL,slope_2_gfx
F7FE CALL shift_slope_piece
F801 LD HL,slope_1_shifted Direction 1 (two bytes wide, 9 rows), to slope_1_shifted
F804 EXX
F805 LD HL,slope_1_gfx
F808 CALL shift_slope_piece
F80B LD HL,slope_3_shifted Direction 3 (one byte wide, 17 rows), to slope_3_shifted
F80E EXX
F80F LD HL,slope_3_gfx
F812 CALL shift_slope_piece
F815 LD HL,wall_shifted Direction 14 (the wall), to wall_shifted
F818 EXX
F819 LD HL,wall_gfx
F81C CALL shift_slope_piece
F81F LD HL,flat_piece_shifted Direction 0 (flat), to flat_piece_shifted
F822 EXX
F823 LD HL,flat_piece_gfx
F826 CALL shift_flat_piece
F829 LD HL,flat_piece_two_shifted Direction 7 (the flat ceiling), to flat_piece_two_shifted
F82C EXX
F82D LD HL,flat_piece_two_gfx
F830 CALL shift_flat_piece
F833 OR $FF Ceilings: checkerboard on the left
F835 LD (piece_step_x),A
F838 LD HL,slope_9_shifted Direction 9, to slope_9_shifted
F83B EXX
F83C LD HL,slope_9_gfx
F83F CALL shift_slope_piece
F842 LD HL,slope_8_shifted Direction 8, to slope_8_shifted
F845 EXX
F846 LD HL,slope_8_gfx
F849 CALL shift_slope_piece
F84C LD HL,slope_10_shifted Direction 10, to slope_10_shifted
F84F EXX
F850 LD HL,slope_10_gfx
F853 JP shift_slope_piece
Prev: F7E5 Up: Map Next: F856