![]() |
Routines |
| Prev: CD99 | Up: Map | Next: CDB3 |
|
Used by the routine at next_overlap_obj.
IY is the object under test. An empty record (type 0) is skipped, and so is one already marked for redrawing. Otherwise its current rectangle is compared with the union: in each direction, if the object starts inside the union its offset from the union's start must be less than the union's size, and if it starts before the union the distance back must be less than the object's own size. Both directions overlapping means the object must be redrawn.
|
||||||||||||
| test_overlap_obj | CD9B | LD A,(IY+$00) | skip empty records | |||||||||
| CD9E | AND A | |||||||||||
| CD9F | JR Z,next_overlap_obj | |||||||||||
| CDA1 | BIT 4,(IY+$07) | skip objects already marked for redrawing | ||||||||||
| CDA5 | JR NZ,next_overlap_obj | |||||||||||
| CDA7 | LD A,(IY+$1A) | A = the object's first column | ||||||||||
| CDAA | RRCA | |||||||||||
| CDAB | RRCA | |||||||||||
| CDAC | RRCA | |||||||||||
| CDAD | AND $1F | |||||||||||
| CDAF | SUB E | columns from the union's left edge; negative if it starts to the left | ||||||||||
| CDB0 | JR C,obj_starts_left | |||||||||||
| CDB2 | CP D | does it start beyond the union's right edge? | ||||||||||
| Prev: CD99 | Up: Map | Next: CDB3 |