After yesterday's successes, I decided to continue plucking tasks from my To-Do list. First on the agenda was a keypress to prevent tile zero being plotted when the user draws with a brush. Essentially, tile zero is transparent in every tileset, and usually shows up as black (because the background is black).
Whenever a Brush is drawn, if there are any instances of tile zero, these get plotted too, overwriting anything that might be underneath. However, there may be instances where you need to draw a non-rectangular shape onto an existing map without plotting tile 0 - and thanks to a tiny bit of fiddling, the user can now hold Control when plotting a Brush to do just that (essentially this gives you a genuine transparency on tile 0).
This idea may be expanded to apply the current mask to the plotting procedure (currently the mask prevents certain tiles being drawn over - this could be tweaked to prevent masked tiles actually being plotted), but this will be logged on the Wish-List for now.
The next task of the day saw me implementing the Merge Visible routine, which takes all of the currently visible layers and merges them to the layer currently being edited (tile zero is not plotted, allowing the maps at the back to show through the gaps in the maps at the front). This routine took a while due to an interesting problem with Bank sizes (i.e. I was using the actual Bank size in bytes as opposed to the relative Bank size in doublewords).
That done, I finished up by adding a Swap Visible routine, which will - surprisingly - swap the two layers which are currently visible. This again took a little bit of thought, as I needed to add error handling should the user have too few/too many layers selected.
