Prev: 6DE8 Up: Map Next: 6F14
6EC5: Rect Intersection Test. Returns carry set if not.
Used by the routines at Vector_Main and Screen_DrawColumn.
Input
A Size of object. (Map units?)
IX Pointer to object data.
RectIntersection 6EC5 LD C,A See if a scenery item intersects a store rectangle.
6EC6 LD B,$00
6EC8 LD L,(IX+$00)
6ECB LD H,$00
6ECD RRCA
6ECE ADC HL,HL
6ED0 LD A,C
6ED1 SBC HL,BC
6ED3 LD E,L
6ED4 LD D,H
6ED5 ADD HL,BC
6ED6 ADD HL,BC
6ED7 LD C,L
6ED8 LD B,H
6ED9 LD HL,(Rectangle_x1)
6EDC SBC HL,BC
6EDE JR NC,Exit
6EE0 LD HL,(Rectangle_x2)
6EE3 SCF
6EE4 SBC HL,DE
6EE6 RET C
6EE7 LD C,A
6EE8 LD B,$00
6EEA LD L,(IX+$01)
6EED LD H,$00
6EEF RRCA
6EF0 ADC HL,HL
6EF2 SBC HL,BC
6EF4 LD E,L
6EF5 LD D,H
6EF6 ADD HL,BC
6EF7 ADD HL,BC
6EF8 LD C,L
6EF9 LD B,H
6EFA LD HL,(Rectangle_y1)
6EFD SBC HL,BC
6EFF JR NC,Exit
6F01 LD HL,(Rectangle_y2)
6F04 SCF
6F05 SBC HL,DE
6F07 RET C
6F08 AND A
6F09 RET
Exit 6F0A SCF
6F0B RET
Rectangle_x1 6F0C DEFW $0160
Rectangle_y1 6F0E DEFW $01F6
Rectangle_x2 6F10 DEFW $016B
Rectangle_y2 6F12 DEFW $01F8
Prev: 6DE8 Up: Map Next: 6F14