Prev: B6DB Up: Map Next: B6EF
B6DE: Shuttling block: step towards the target
The first instruction's displacement is patched by shuttle_block to read X or Y. Adding 8 is because a block built on a cell's centre line sits at 8 past a multiple of 16, so this is its distance along its span.
shuttle_block_step B6DE LD A,(IX+$01) the position: IX+1 or IX+2, patched
B6E1 ADD A,$08 where in its span it is now; is that the target?
B6E3 AND $0F
B6E5 CP C
B6E6 JP Z,set_wipe_and_draw_flags yes: stand still this frame, but redraw
B6E9 LD A,$01 no: +1 if short of it, -1 if past it
B6EB JR C,shuttle_block_move
B6ED NEG
Prev: B6DB Up: Map Next: B6EF