Prev: 47414 Up: Map Next: 47482
47430: Find Tile Record
Used by the routine at FindTilesOverlapped.
Looks for the record of the tile at a position of the planet, in the four records that are kept at GameEntry and then every 37 bytes, which are for the tile at the map position in MapPosition and the ones next to it. If none of them match, the address of an empty record is returned.
Input
B Map zone
D Map column
Output
IX Address of the record of the tile
F The zero flag is set if the tile was found
FindTileRecord 47430 LD E,B E=B.
47431 LD IX,23424 The decryption routine.
47435 LD BC,(52823) Fetch the word at MapPosition into BC.
47439 CALL CompareTilePosition Call CompareTilePosition.
47442 RET Z Return if the zero flag is set.
47443 LD IX,23461 Use 23461.
47447 INC B Advance B.
47448 CALL CompareTilePosition Call CompareTilePosition.
47451 RET Z Return if the zero flag is set.
47452 LD IX,23535 Use 23535.
47456 INC C Advance C.
47457 LD A,C A=C.
47458 CP 96 Jump to FindTileRecord_Column if A is not 96.
47460 JR NZ,FindTileRecord_Column
47462 LD C,0 Clear C.
FindTileRecord_Column 47464 CALL CompareTilePosition Call CompareTilePosition.
47467 RET Z Return if the zero flag is set.
47468 DEC B Step B back.
47469 LD IX,23498 Use 23498.
47473 CALL CompareTilePosition Call CompareTilePosition.
47476 RET Z Return if the zero flag is set.
47477 LD IX,47428 The shot frame records.
47481 RET Return.
Prev: 47414 Up: Map Next: 47482