Friday 9 April 2021

Looking like a dump!

I've now got the Scramble code reading a memory dump from MAME and rendering the tiles and sprites to faithfully recreate the display, with the correct colours. The tiles and sprites are blitted from bitmap sheets in memory, so a single call to Allegro is all that is required. It's also cool that the sprite transparency also 'just works' using Allegro.

[Actually I've just realised I'm yet to implement column scrolling at the pixel level (only tile level) - I'll have to work that out at some point, but it's not important now.]


Rendered from a memory dump from MAME

To be honest, I've spent just as much time battling Allegro as I have coding logic for the game itself. At times I've stared at a blank window for half an hour before randomly stumbling on the issue, and fixing it whilst still not understanding why. But understanding the nuances of Allegro isn't the point of this exercise, so I'm not going to dwell on it for any longer than absolutely necessary. Hopefully from here-on in, I'll only be using routines I've already got working.

One last thing I will note about Allegro; it doesn't support the concept of indexed colour modes (palettes). Apparently you can simulate it with shaders, but that's another area I have zero experience with. Instead, I created an array of tile and sprite sheets, one for each palette entry. That'll do for a prototype.

One last thing I'll probably do before diving into the transcode proper is rearrange the code to (asynchronously) refresh the display every 60Hz. That way I don't have to worry about display output as updates will periodically occur whenever the game core updates the video and sprite RAM contents.

No comments:

Post a Comment