Prev: E03D Up: Map Next: E08F
E062: Free the object slots whose objects are outside the window
Used by the routine at load_map_window.
A slot ($1A bytes: +0 state, $FF when free; +1 map column; +4 map row) is freed if its column is neither the window's left (view_column) nor its right (right_map_column) column, or its row is neither of the window's two.
Input
IX First slot
B Number of slots
drop_far_objects E062 LD A,(right_map_column)
E065 LD C,A
E066 LD DE,$001A
E069 LD HL,(view_column)
E06C INC H
drop_far_objects_0 E06D LD A,(IX+$00)
E070 INC A
E071 JR Z,drop_far_objects_3
E073 LD A,(IX+$01)
E076 CP L
E077 JR Z,drop_far_objects_1
E079 CP C
E07A JR NZ,drop_far_objects_2
drop_far_objects_1 E07C LD A,(IX+$04)
E07F CP H
E080 JR Z,drop_far_objects_3
E082 INC A
E083 CP H
E084 JR Z,drop_far_objects_3
drop_far_objects_2 E086 LD (IX+$00),$FF
drop_far_objects_3 E08A ADD IX,DE
E08C DJNZ drop_far_objects_0
E08E RET
Prev: E03D Up: Map Next: E08F