Prev: 9DB1 Up: Map Next: 9DD8
9DBB: Test two boxes' x ranges
Used by the routine at boxes_overlap.
They overlap when the box's x is within D after L, or L is within the box's width after the box's x. scratch_count is 1 if so.
x_overlap 9DBB XOR A The box starts in the other's width
9DBC LD (scratch_count),A
9DBF LD A,(IX+$00)
9DC2 SUB L
9DC3 JR C,x_overlap_0
9DC5 CP D
9DC6 JR C,overlap_found
x_overlap_0 9DC8 LD A,(IX+$00) Or the other starts in the box's
9DCB CP L
9DCC RET NC
9DCD ADD A,(IX+$02)
9DD0 CP L
9DD1 RET C
This entry point is used by the routines at y_overlap, test_landscape_piece and test_slope_reversed.
overlap_found 9DD2 LD A,$01 Overlap
9DD4 LD (scratch_count),A
9DD7 RET
Prev: 9DB1 Up: Map Next: 9DD8