It's a bit early for trixster to start drawing up new paperwork (but if you're at it, put me down for your Atari Falcon CT60e/060 ) but I've been hacking away at the original C64 disassembly for Stunt Car Racer for the last month and finally have something very early but promising to share with you all.
The first track of the game 'Little Ramp' is playable on a BBC Master in MODE 4 (SWRAM banks 4 & 5 must be available.) Try the ssd attached or check it out on jsbeeb: https://bitshifters.github.io/jsbeeb/?d ... del=Master
Keep hitting Return to step through the menu screens (you can't navigate them.) The in-game controls are S/D/Return/:/Space for left/right/boost/brake/reverse. The game is glitchy as heck (as you can see from the screenshots below) but is playable and surprisingly fast compared to the original C64 version. Oh, it'll almost certainly crash when you finish the track, either by completing three laps or damaging the car to destruction by crashing too much.
First step was to get the disassembly assembling to the C64's memory map under BeebAsm. Unfortunately pretty much every single byte of memory is used from $0000-$FFFF so there was quite a bit of work to rearrange everything. Firstly all of the data had to be moved to addresses that are always accessible, so below screen memory or in HAZEL. Secondly, most of the code had to be split into two SWRAM banks with a POP-style 'DLL' jump table interface added (by hand) so that function calls are intercepted and page in the necessary RAM bank and page the calling bank back in afterwards.
Of course I don't have the actual source, just the C64 disassembly (supplied thanks to Fandal, who ported the game to the Atari XE) so there were lots of memory addresses embedded either in the data blocks or as immediate values in the code itself. These were quite painful to track down and figure out so massive thanks to Tom Seddon who supplied me with his previous attempts to reverse engineer / document various SCR sources from a few years ago. These were immensely helpful and Tom continues to help me understand how the code works.
On C64 the game runs at a 160x200x4 resolution, so very close to MODE 5. Much to my delight, the C64 pixel bit pattern is more straight forward so the existing line drawing routines mapped very nicely to MODE 4 without any changes!
Obviously there is still a lot of work to do, not least tidy up all the glitchy crap, remove any writes to C64 VIC registers etc., get the front end working properly and think about sound. The biggest decision point is going to be around colour and attempting to recreate the pseudo 'solid fill' look of the original game. On C64 this is achieved by poking the VIC Color RAM, which is character mapped and therefore fairly cheap to update (you can see the vertical stripes around the horizon.) For Beeb this would have to be filled directly in screen memory, so 8x more writes and undoubtedly additional complexity. Alternatively it could be left in MODE 4 and do something similar to the ZX Spectrum version for hatching the ground vs sky. Any thoughts here folks?
Lastly, the way the game is structured gives a tantalising possibility of creating a Tube Enhanced version down the line that might run on a Model B at considerable speed, ala Elite. Because of the amount of sprite data, I'd imagine at least one bank of SWRAM would still be required but seems like most people would have such a set up. This is definitely a stretch goal for this project, and not something I'm going to be looking at any time soon, but certainly interesting. For now it'll be Master only due to the amount of available RAM needed at all times (56K.)
As ever, let me know what you think!