Tuesday 4 October 2022

Those pesky Sol Towers!

 More eye candy, and another mystery!

First something I mentioned in a few entries back; namely not understanding how two (2) banks of background tiles were selected. Turns out that bit 0 of the attribute byte (in bg_colorram) selects the tile bank. Easy explanation in the end.

And although I haven't exactly wrapped my head around it, it would appear that the two ROMs that handle the address mapping for the 3rd map ROM do indeed implement some sort of meta/macro tile mechanism. Now that I say that out aloud, it's not that surprising. Given that it provides both a tile code and colour/attribute byte for 32K tiles (ie. 64KB) in just 16kB of ROM, it's not a bad compression ratio.

Onto the eye candy and the mystery then.

I've done a little more decoding of the object table, and identified a few more ground-based objects, some of which aren't stationary. It's worth mentioning that this encoding also differentiates between the Grobda (tanks) with different behaviours; those that are stationary, those that stop when fired upon, and those that dart forward, for example.

As well as decoding more of the table, I've updated the map tool to indicate the location of the Sol Towers using the actual sprites. As well as producing a BMP file for each area, it also merges them onto a single BMP for easier reference. It's rather large, but looks very pretty. Here is the PNG version:

All 16 areas showing the Sol Tower locations

And it's pretty obvious now that towers don't appear in the same locations of the global map in areas that have overlapping global map space. At some point I'll update the tool to indicate locations of all the objects. And probably produce the iconic global map as well.

And finally, the mystery. Last entry I mentioned a 46th Sol Tower that hadn't been documented yet. There's a good reason for that; it doesn't actually appear in the game! Why not? I have no definite answer - I can step through the code and see the tower being read from the object table and handled just like every other tower. But the end result is, well, nothing!?!

It could be a bug related to the fact that there is a Logram (Sphere Station) on the same row - I've yet to determine if any other towers have other non-tower objects on the same row. As an experiment I patched the object table to move the tower one row later - and it appears - which suggests I could be right!?!

The missing Sol Tower in-game in Area 6 - one row above where it should appear

So now that I have finally done what I've wanted to do for a very, very long time, I will return to RE'ing the rest of the code. I am intending the next task be working out how the objects are handled once they're copied from the object table; that'll be very interesting, and will open up a lot of the code I'm thinking (and as a result be very time consuming).

No comments:

Post a Comment