Prev: 57405 Up: Map Next: 57487
57442: Free Distant Slots
Used by the routine at MakeTiles.
Frees any slots of objects that are not on one of the two columns and two rows that are on the screen.
Input
B Number of slots
IX Address of the first slot
FreeDistantSlots 57442 LD A,(56823) The next column.
57445 LD C,A C=A.
57446 LD DE,26 DE=26.
57449 LD HL,(52823) Fetch the word at MapPosition into HL.
57452 INC H Advance H.
FreeDistantSlots_Loop 57453 LD A,(IX+0) Read offset 0 of IX.
57456 INC A Advance A.
57457 JR Z,FreeDistantSlots_Next Jump to FreeDistantSlots_Next if the zero flag is set.
57459 LD A,(IX+1) Read offset 1 of IX.
57462 CP L Jump to FreeDistantSlots_Row if A is L.
57463 JR Z,FreeDistantSlots_Row
57465 CP C Jump to FreeDistantSlots_Free if A is not C.
57466 JR NZ,FreeDistantSlots_Free
FreeDistantSlots_Row 57468 LD A,(IX+4) Read offset 4 of IX.
57471 CP H Jump to FreeDistantSlots_Next if A is H.
57472 JR Z,FreeDistantSlots_Next
57474 INC A Advance A.
57475 CP H Jump to FreeDistantSlots_Next if A is H.
57476 JR Z,FreeDistantSlots_Next
FreeDistantSlots_Free 57478 LD (IX+0),255 Store 255 at offset 0 of IX.
FreeDistantSlots_Next 57482 ADD IX,DE IX gains DE.
57484 DJNZ FreeDistantSlots_Loop Decrease B and jump to FreeDistantSlots_Loop until none remain.
57486 RET Return.
Prev: 57405 Up: Map Next: 57487