Prev: 57878 Up: Map Next: 57924
57909: Get Tile
Used by the routine at MakeTiles.
Gets the number of the tile at a column and a row of the map. It also stores the column, after it has wrapped, at NextColumn. If the row is zero there is no tile above the first row of the map, so the tile is blank and the address is moved up a row, ready for the next tile.
Input
DE 96
H Row
L Column
Output
A Tile number
HL Address in the map
GetTile 57909 CALL FindMapAddress Call FindMapAddress.
57912 LD A,C A=C.
57913 LD (56823),A Update the next column.
57916 LD A,(52824) The map row.
57919 AND A Jump to GetBlankTile if A is zero.
57920 JR Z,GetBlankTile
57922 LD A,(HL) Read HL.
57923 RET Return.
Prev: 57878 Up: Map Next: 57924