Friday, 18 July 2025

Pretty fly for a transcode

Still plugging away at Frogger as time allows.

I've been working through the high-level foreground/background (depending on your nomenclature preference) and NMI code, ensuring I've transcoded everything that is not in a subroutine. Along the way I've managed to name a few more variables, mostly simple flags, but also decided others have multiple purposes (the classic 'temp' variable). Ugh. Work that had to be done, but resulted in no tangible difference on the screen.

My next thought was to implement the code that handles when your frog gets 'home' - that's quite brain-dead and clearly identified in my RE. Alas, it's not actually possible to get home without scrolling logs to position you in the center of each home. So back to the drawing board.

Next idea was to handle the (seemingly) random appearance of the fly in the frog's homes. There wasn't a great deal of code, and the timers involved were all ticking over already, so it didn't take a great deal of effort to see it working.

A fly appears briefly!

Now it's crunch time; no choice but to tackle the scrolling cars and logs, turtles, alligators etc. This involves diving into code that I haven't fully RE'd. Some of it I have a high level understanding of what it is doing, but don't understand any of the detail. For example there are tables of bytes that are copied into RAM that comprise logic & data for the scrolling entities, and calculations that are done on some of that data which escape my understanding atm.

But at the same time, there are aspects of the code that do offer good hints, like it seems there's a routine to construct/update each of the scrolling rows explicitly. So for example, I believe that I can transcode the routines to update, say, just the bottom row of vehicles on the road.

For now though, I'm in the middle of wrapping my head around a routine that I guess calculates where to start drawing the log on one of the rows. It works backwards from the VRAM address and a few bytes that would indicate some sort of scroll position maybe? Not the sort of routine that translates well from Z80 to 68K either, so understanding what it's doing is definitely going to be more beneficial than a brute-force transcode.

By my crude calculation, the transcode is now 39% done.

No comments:

Post a Comment