Prev: CF39 Up: Map Next: CF5F
CF3C: Compare the boxes along X
Used by the routine at compare_along_y.
Part of compare_next_obj. Along X (centre +$01, half-size +$04) the code adds 0 if the candidate's low-X edge is at or beyond IY's high-X edge -- IY lies wholly further back -- 18 if the candidate lies wholly further back, and 9 if they overlap.
compare_along_x CF3C LD A,(IY+$01) L = IY's high-X edge
CF3F ADD A,(IY+$04)
CF42 LD L,A candidate's low-X edge at or beyond it: add 0
CF43 LD A,(IX+$01)
CF46 SUB (IX+$04)
CF49 SUB L
CF4A JR NC,act_on_comparison
CF4C LD A,(IX+$01) L = the candidate's high-X edge
CF4F ADD A,(IX+$04)
CF52 LD L,A IY's low-X edge at or beyond it: add 18, otherwise 9
CF53 LD A,(IY+$01)
CF56 SUB (IY+$04)
CF59 SUB L
CF5A LD A,C
CF5B JR C,add_x_code
CF5D ADD A,$09
Prev: CF39 Up: Map Next: CF5F