Tonight I started on the "audit" of the transcode. What I mean by this is a line-by-line review of the transcode, checking for:
- consistency between Z80 and 68K code
- consistency between Z80 and 68K annotations
- missing logic/code from 68K transcode
- micro-optmisations of 68K code
I'm only a very short way into the MAIN CPU program, but I've already been reminded of a few short-cuts I took in the transcode. Primarily, bulk initialisation (zeroing) of memory variables in a few places has not been transcoded. This is more likely to cause issues on subsequent games. And secondly, support for 2 players is completely untested, and possibly not completely implemented. For example, the code was not reading P2 inputs at all.
None of this is particularly problematic, but will take some time to implement and test in the process of completing the audit. Hopefully at the end of it I'll end up with less bugs than I have now rather than more!
Whilst I'm completing the audit, I'll probably set up the Amiga build toolchain and WinAUE and whatever else I need to be able to build and play the Amiga version - jotd is making good progress!
UPDATE: Session #2 - reorganised all the memory variables to be consistent with the original. This is necessary in order for the 'block' initialisation of memory areas to match up. A few isolated 'hack' initialisations I had made have now been removed. I also added (more) support for 2 player games - still WIP. Also fixed an erroneous annotation - makes more sense now.
UPDATE: Session #5 complete. Around 21% of the way through the MAIN CPU program, but there's a lot of data near the end so maybe actually ~25% of the way through the code? Most missing code has been for 2-player support, which I suspect is complete now (won't know for sure until the audit is done). I've also found & fixed a few subtle bugs along the way.
UPDATE: Session #6 complete. Verified pseudo random number routine (properly) - produces the same sequence as the Z80 routine. More annotations from Z80 RE and micro-optimisations.
Finished the first device (xvi_1.3p) of four (4) - so at least 25% of the way though the MAIN ROM.