This is my tile map helper. It uses several simple subroutines to help with tilemapping. Just put prgmMAP at the end of your code. There are 4 routines.
EDIT:More info
This uses only vars r1-6 for stuff, so it should be safe. Just have a list of numbers representing your tile values, and corresponding sprite data. The first sprite is displayed for a value of 1 and so on.
:sub(DSP,"pointer to tile data","pointer to sprite data"
This displays a tile map. For speed, it assumes a value of 0 means a blank tile.
:sub(ADD,"tile number to add",X,Y,"pointer to data"
Adds a tile to the data, using normal co'ords
:sub(ADT,"tile number to add",X,Y,"pointer to data"
Same, but uses tile co'ords ( 12*8 )
:sub(GET,"pointer to data",X,Y
Gets the value of the tile in the specified co'ords. Useful for checking if a tile is in the players way.
Example of a simple terrain generator.