Another significant milestone tonight - a ground-based object appearing on the map and scrolling with the screen. It means that a lot of the infrastructure code is in place now, and the bulk of the remaining transcode is filling out handlers for the various objects. That's not to say that I don't have an absolute crap-tonne of work ahead of me, just that it should be relatively straightforward.
|The first ground-based object to appear, a Barra|
The exact location of the sprites look like they require a bit of minor tweaking, but I was waiting until I could gauge them against the map. And any tweak will be universal for all sprites, so it should be trivial.
In the process of debugging this latest functionality, I verified that the main routines for the MAIN and SUB CPUs still have time to spin between VBLANK interrupts. This is particularly encouraging given that I still have some pretty brain-dead code in the video routines. It was left that way for 2 reasons; logically simpler code is always easier to debug, and of course I wanted to push ahead and implement more functionality.
As the transcode evolves I'm finding myself going back and refining some of my choices; primarily byte vs word variables, and register usage.
A lot of the time it's more efficient to use a 68K word in place of a Z80 byte, particularly if that byte is used as an offset from a base address/register, or in a 16-bit calculation of course. And in this instance memory is hardly scarce either.
Register usage is always something requiring consideration. My rule-of-thumb is that D0-D1 are used before any other data registers in a routine, D6 as an object table offset, and D7 for loop counters. I've reserved a few address registers for consistent usages as well; A5 for the object table, and A6 for the jump table routines. I haven't been in any danger of running out of registers just yet...
Next is a few more ground-based objects (low-hanging fruit) before I tweak the sprites and then I might look at bombing, so I can blow a few of them up and have a few object handlers transcoded for the full object lifecycle. That will enable me to code the scoring routines.