Prev: 48678 Up: Map Next: 48783
48707: Select Next Tile
Used by the routine at CheckTerrainCollision.
Chooses the next tile for CheckTerrainCollision to check the object against, from the tiles that the object overlaps and the count in TileNumber, then carries on at FindTilesOverlapped.
SelectNextTile 48707 LD A,(23581) The tiles still to test.
48710 CP 1 Jump to SelectNextTile_Column if A is not 1.
48712 JR NZ,SelectNextTile_Column
48714 LD A,(23594) The object reaches into the next column.
48717 AND A Jump to SelectNextTile_Column if A is zero.
48718 JR Z,SelectNextTile_Column
48720 LD A,(23595) The object reaches into the zone above.
48723 AND A Jump to SelectNextTile_Column if A is zero.
48724 JR Z,SelectNextTile_Column
48726 CALL SelectPreviousZone Call SelectPreviousZone.
48729 CALL SelectNextColumn Call SelectNextColumn.
48732 LD A,(23595) The object reaches into the zone above.
48735 LD (23597),A Update the segment screen row.
48738 JP FindTilesOverlapped Jump to FindTilesOverlapped.
SelectNextTile_Column 48741 LD A,(23594) The object reaches into the next column.
48744 AND A Jump to SelectNextTile_Current if A is zero.
48745 JR Z,SelectNextTile_Current
48747 LD A,(58395) The slope direction.
48750 AND A Jump to SelectNextTile_Current if A is zero.
48751 JR Z,SelectNextTile_Current
48753 XOR A Clear A.
48754 LD (58395),A Update the slope direction.
48757 CALL SelectNextColumn Call SelectNextColumn.
48760 LD HL,(23600) Fetch the word at BackToFrontFlag into HL.
48763 LD (49025),HL The vertical position of the next tile.
48766 JP FindTilesOverlapped Jump to FindTilesOverlapped.
SelectNextTile_Current 48769 CALL SelectPreviousZone Call SelectPreviousZone.
48772 LD HL,(23598) Fetch the word at PieceColumn into HL.
48775 LD (49023),HL Update the tile position.
48778 JP FindTilesOverlapped Jump to FindTilesOverlapped.
48781 NOP Do nothing.
48782 NOP Do nothing.
Prev: 48678 Up: Map Next: 48783