Prev: D59F Up: Map Next: D5DB
D5B2: Wipe the next object that moved
Used by the routines at wipe_height and wipe_rect.
Bytes $18 and $19 of a record are the width in bytes and height in rows of its sprite as last drawn, and $1A and $1B its pixel x and y; save_2d_info copies all four to bytes $1C to $1F before the object's handler runs, so they hold last frame's picture while $18 to $1B are about to get this frame's. The rectangle wiped is the smallest one that covers both.
wipe_next_object D5B2 LD HL,($5BCB) the next index from the list
D5B5 LD A,(HL)
D5B6 INC HL
D5B7 LD ($5BCB),HL
D5BA CP $FF $FF ends it
D5BC JP Z,draw_and_copy_rects
D5BF CALL get_ptr_object bit 5 of byte 7 means it needs wiping; the others in the list are only being drawn again
D5C2 PUSH HL
D5C3 POP IX
D5C5 BIT 5,(IX+$07)
D5C9 JR Z,wipe_next_object
D5CB RES 5,(IX+$07) only once
D5CF LD A,(IX+$1A) C = whichever of the new (byte $1A) and old (byte $1E) pixel x is further left
D5D2 SUB (IX+$1E)
D5D5 JP C,wipe_left_is_new
D5D8 LD C,(IX+$1E)
Prev: D59F Up: Map Next: D5DB