Prev: E028 Up: Map Next: E063
E051: Find Map Tile
Used by the routines at MarkCellVisited, SpawnItem, SpawnBall and SpawnBonus.
Finds the tile at a cell of the map, which is 32 cells wide and 32 cells high.
Input
L Column of the cell
H Row of the cell
Output
A The tile (zero for no tile)
F The zero flag is set if there is no tile
FindMapTile E051 LD A,L Save the column, and start with the row.
E052 LD L,H
E053 LD H,$00
E055 ADD HL,HL Multiply the row by thirty-two.
E056 ADD HL,HL
E057 ADD HL,HL
E058 ADD HL,HL
E059 ADD HL,HL
E05A OR L Add the column.
E05B LD L,A
E05C LD BC,$5E04 Add the address of the map.
E05F ADD HL,BC
E060 LD A,(HL) Fetch the tile and return.
E061 AND A
E062 RET
Prev: E028 Up: Map Next: E063