Pointers in the Right Direction
Now that movement works I’d like to have a bit more convenience when navigating the map. So I want to add a minimap to the square area next to the character portraits.
I would like to have it slowly reveal when walking through the dungeon as well as a pointer indicating the player orientation.
First of all the process of getting the minimap data is pretty similar to the one for the view. I take the player x and y position as origin and decrease that by three (the minimap size is seven chars so the center minus three would be the starting point) in both directions to get the top left char of the minimap.
That done I simply traverse through all the maptiles until I reach the minimap width or height to fill it.
The whole affair is pretty straightforward. I get the data from the map address and store it at the corresponding address for the minimap.
Drawing the map
To draw the map on screen I simply traverse through all the stored minimap tiles. First I rotate the bits for every tile to the left to check if it has been allready explored. If not I break out of the code and simply draw the symbol for unexplored space.
If it is explored I load the original tile data again and this time rotate to the left until the carry is set to find out what type of tile is stored here.
Once that is done I load the starting address of the selected char and using my previously written routines draw it on screen.