Wednesday 7 April 2021

Scrambled Priorities

I know I should be finishing off projects but I just can't get into them right now. I need something new to pique my interest before I return to that stuff. So for now, I've decided to look at Scott Tunstell's Scramble source code and see if I can transcode it to C.

First hurdle is to clone a project that allows me to prototype this on a Windows platform. Previously I've used a very old version of the Allegro graphics library under an equally old version of MinGW. But each time I return to these old projects I can't manage to get a working combination of a command environment, MinGW compiler and Allegro library - and tonight was no exception. Complicating matters is having three different Windows machines that I routinely build these projects on.

After struggling for a couple of hours with a few different combinations of issues I decided to bite the bullet and upgrade to the latest MinGW-gcc and Allegro library. That also required CMake but installation of the toolchains and building of Allegro was fairly straightforward.

Next step was to hack an existing project (makefile etc) and get it building under the new tools - in this case Lode Runner. It required some jiggery pokery with invoking an MSYS2 shell as the makefile was not designed for a Windows command shell but I got there in the end. Hopefully I'll remember how to invoke it all next time; I've made some notes in the makefile!

Last task tonight was to get something building and running. Allegro has changed quite radically from the old libraries I was using, so I had to change every single line of code that called Allegro routines. But finally I now have a running executable.


In the past I've simply created a new C source file for the transcode. That was nice and neat but the most annoying process was finding the correct place in the file to add new data, routines etc (I wanted them in the same order as the original code). This time I'm trialling a new process; I've copied the original ASM source file and commented-out every single line. I plan to add the C code in-place, probably deleting the ASM code as routines have been completed and tested.

Next task is to read up more on the new Allegro and work out how to interleave the Scramble C code with the Allegro framework. Then I'll rip some tiles and sprites and dump some video memory from MAME and see if I can render the display accurately.

No comments:

Post a Comment