Tuesday, 1 March 2016

Some background information

This time 'round I've wasted no time getting into the project whilst on business travel. I even had the monster laptop out at the airport during what turned out to be a 5hr lay-over to do some porting. And this afternoon, in my room whilst trying to fight off sleep so I can get myself synced to the time zone, I've done some more.

The days tick over and after 40 days the Game Over screen is displayed, albeit incomplete. Pressing any key will then return you to the main menu. That was low hanging fruit because the text display routines were already done.

Boring, but everyone wants to see screen shots

From here I can go two ways. I can start with the sprite rendering routines and display the menu border and the panel. Or I can press ahead and start parsing the location data so that the sprite routines can be used to render a room. At least for this port I know exactly which routines are key to the rendering process, and which are more cosmetic and can be left for later.

For reasons even I'm not completely clear on, I've chosen to go the latter route. The start location is randomised and chosen, and the location data is parsed to build the graphical object table from the background objects. Next step is to extend that routine to include the foreground objects.

Either way, it won't be long before I can add sprite rendering and the blit routines and have them show something interesting. I'll start with a relatively brain-dead, quick 'n' dirty routine (eg.no flip, byte-aligned only) and build on it from there. The beauty is that the sprite rendering can be enhanced and optimised at any time without affecting other parts of the code.

I have to admit that I haven't found the process as painful as I first feared - at least not yet. Whilst I'm using the Z80 code as a rough guide, I'm striving to do things the 6809 way and as a result haven't actually run into too many instances where I've run out of registers trying to mimic the behaviour of the Z80 code! Plenty of flicking through Rodney Zak's Programming the 6809 book though... As expected, some things are a little easier in Z80, and some easier in 6809. On the balance, I'm finding I (still) prefer the 6809 - something I discovered unexpectedly when I was attempting to port Lode Runner to both Z80 and 6809 simultaneously.

I'm sufficiently buoyed by my success thus far that I don't believe the task is quite as daunting as I imagined, and I may well have it finished long before I initially predicted. It's certainly encouraging to be able to page up/down the file and see the finite number of routine stubs that I need to flesh out.

No comments:

Post a Comment