Finally, one I can answer.

Sim Earth needs proper vertical mosaic support to work.

Here's how you do it: take two variables, mosaicY and mosaicCounter. At Vcounter=1, reset mosaicY to 1, and mosaicCounter to the size value in MOSAIC ($4106.d7-d4). At each scanline, if mosaicCounter == 0, set mosaicY to the current Vcounter position. Now decrement mosaicCounter. If it's <= 0, reload the counter from MOSAIC's size value again.

Do that for each background independently. Simply writing to MOSAIC again won't reload the internal decrement counter, it'll have to reach zero to fetch in the new value.

Lastly, use mosaicY instead of the Vcounter for all purposes when rendering.

Obviously, you special case when $2106.d3-d0 has mosaic disabled for that BG by using the actual scanline instead.