Monday 7 November 2022

Finally ready to tackle the Xevious sprites!

A bit more transcoding, scheduling the SUB CPU routines, and hooking up the Neo Geo dipswitches.

In my not-quite-complete RE, I never did find the code that was displaying the 1UP and 2UP text above the player scores. Today I found it - by accident - in the SUB CPU code. I didn't expect it to be in there, but it handles the display and flashing of the respective strings. Incidentally, it was the last and only unidentified main routine in the SUB CPU.


High Score Table, 1UP,2UP flashing

I had tacked a few of the SUB CPU routines onto the end of the MAIN BLANK IRQ handler as a quick hack to implement scrolling, but that started to cause issues when the SUB CPU code wanted to access video memory which disables interrupts. So I took a step backwards and looked at the timing and synchronisation of execution between the two CPUs. Both CPUs execute their main loop once, and then spin waiting for the next VBLANK.

It was a simple matter having the SUB CPU main routine called from the MAIN CPU main routine - I think that should do the trick. It's working for now at least. I also implemented the SUB CPU main routine round-robin function scheduler properly; not that it's doing much atm other than scrolling the display and displaying 1UP/2UP as above. But fleshing that out now should be trivial.

I've defined the Xevious dipswitches for the Neo Geo soft dips settings, and the lives setting has been coded and tested in the core. In order to avoid excessive bit-twiddlng each time the dips are read - once every VBLANK - I'm preserving the switch (bit) ordering in the Neo Geo even if the options aren't "nicely" ordered. Who cares, right?

And with that, it's time to start coding for the Xevious sprites. There's not a lot else that I can transcode that is meaningful without being able to at least play a game. The objects (sprites) in the game comprise the main data structures and the bulk of the code, so I'll need to optimise that for the 68K. It would be silly to attempt to preserve the exact structures used (and optimised for) the Z80. But it should end up more efficient than the Z80 code when all is done.

And sprites being sprites, technically it should be a lot easier on the Neo Geo than trying to emulate the tilemap layers. Just a lot of bit-twiddling to convert Xevious sprite register data to Neo Geo sprite register data.

No comments:

Post a Comment