Supercon 2023: Bringing Arcade Classics To New Hardware

The processing power of modern game consoles is absolutely staggering when compared to the coin-op arcade machines of the early 1980s. Packed with terabytes of internal storage and gigabytes of RAM, there’s hardly a comparison to make with the Z80 cabinets that ran classics like Pac-Man. But despite being designed to pump out lifelike 4K imagery without breaking a virtual sweat, occasionally even these cutting-edge consoles are tasked with running one of those iconic early games like Dig Dug or Pole Position. Nostalgia is a hell of a drug…

As long as there are still demand for these genre-defining games, developers will have to keep figuring out ways to bring them to newer — and vastly more complex — systems. Which is precisely the topic of Bob Hickman’s 2023 Supercon talk, The Bits and Bytes of Bringing Arcade Classics to Game Consoles. Having spent decades as a professional game developer, he’s got plenty of experience with the unique constraints presented by both consoles and handhelds, and what it takes to get old code running on new silicon.

Why Not Emulate?

For any reasonably tech-savvy person, the first thing that will come to mind when talking about bringing old games to new hardware is naturally going to be emulation. At first glance, it would seem to be the ideal solution: you don’t have to recreate the game from scratch, the gameplay should be exactly as players remember it, and there’s probably an open source emulator core out there already that you can port over to whatever your target system is.

Depending on the hardware, emulation isn’t always viable.

But as Bob explains early on in his talk, it’s not quite that simple in the real world. Sure, emulation should provide a perfect recreation of the game, but in practice, there are always differences that will manifest themselves in unexpected ways. Plus modern audiences are often going to expect enhancements (upgraded graphics, online play, etc) that are likely going to require some modification to the original game anyway.

There is also the issue of performance to consider. While this is going to be less of a problem on a modern console, you might be trying to bring the game over to something like a smartphone which may or may not have enough processing power to emulate the original system at the the speeds necessary to deliver the experience you’re aiming for.

To illustrate the point, most of Bob’s talk covers a particular project he was involved in back in 2001: bringing Namco Museum to Nintendo’s Game Boy Advance (GBA).

The Fine Art of Porting

Powered by an ARM7 CPU running at a little over 16 MHz, the GBA wasn’t exactly the ideal platform for emulation. At the same time, simply recreating the games included in Namco Museum from scratch wasn’t really an option either. Not only would it have been a considerable undertaking, but the final result would have been different enough from the originals that you’d lose that nostalgic charm.

The solution? Porting the games over to portable C code that could be compiled for the GBA. But even here, things wouldn’t exactly be smooth sailing. For one thing, Bob points out that you won’t necessarily have access to the original source code. So the first step is likely going to be extracting the binary and graphical assets from a ROM of the game — this could be pulled literally from an arcade cabinet and read into the computer, or if you’re pressed for time, perhaps downloaded from one of the seedier corners of the Internet.

After decompiling the game’s binary into Z80 assembly, Bob says the next step would be to convert that over to C. The results aren’t going to be perfect, but they’ll be better than nothing. The resulting C code certainly isn’t going to compile on the first go, but you’ll get plenty of error messages in the attempt, and that will tell you where you need to focus your attention on. Fixing these issues one-by-one is going to be time consuming, but will be worth the effort in the end. Eventually, you’ll get a binary that compiles and actually runs on your target system…but you aren’t done yet.

Up to this point you’ve just been worried about getting the code compiled and running. Whether or not it actually does what it’s supposed to do has been only a vague concern. So when you get this far, the binary you run likely won’t look or play anything like it’s supposed to. For one thing, the graphics are sure to be busted. You’ll need to go in there and rewrite the graphics functions so they’ll work on your target system while still taking the same inputs as the original versions. That’s going to include figuring out how to scale everything to fit your new target resolution.

You’ll need to do something similar for handling user input, as well. The original arcade cabinet probably had some memory mapped scheme where reading from an address in memory would tell it which physical buttons were being pressed, so that’s going to need to be modified to fit the game’s new home.

Keep knocking these issues out as they come up, and eventually you’ll have a working game. Sort of.

Getting Up to Speed

The final part of the process is optimization. Bob recalls that, after porting over the original Z80 code and getting it running  properly on the GBA, some of the games would only run at a fraction of their original speed. It wasn’t because the GBA didn’t have the computational power to do the games justice, it’s just that the code wasn’t working to the system’s strengths.

Pole Position running on the GBA.

One trick that Bob details is adding some code that will record each function called by the code, and have somebody play the game for a bit. After you’ve collected enough data, you’ll be able to identify the most commonly used functions and properly direct your optimization efforts.

Unfortunately, there’s no magic bullet for code optimization. But Bob does mention some commonly used tricks, such as using pre-computed lookup tables instead of trying to do sine and cosine math in real-time. There’s also things the new hardware will be capable of that you might be able to put to use, even with an older game that wasn’t designed with it in mind.

Bob gives an excellent example of this in discussing the optimizations for Pole Position. Originally the background objects on the horizon were rendered in the same way the rest of the game was, but this proved to be slower on the GBA than anticipated. So the solution was to take the entire skyline, save it as a pre-rendered image, and use the GBA’s hardware scrolling capabilities to move it. Along with a few other tricks, this got the 1982 racer running at the proper 60 frames per second.

Not All Fun and Games

While Bob’s talk was focused on a very specific niche, many of the tricks and techniques he describes could be applied to other aspects of software development. Whether it’s taking old assembly code and turning it into C that your modern computer can run, or tracking down which functions are worth your time to refactor, there’s plenty in this presentation that you can use in whatever software project you might have going on.

Now whether or not your project is as much fun to bug-test as Galaga — well, that’s another topic entirely.

8 thoughts on “Supercon 2023: Bringing Arcade Classics To New Hardware

  1. I’m not an action gamer (card games are more my style), but it was an interesting video.
    Before reading this article and watching the video, I thought emulation was going to be a cake walk.

  2. New hardware
    Newer I guess, but the GBA is still old enough to drink. It is probably closer in time to some of those arcade games than it is to the present day. 2001 is equidistant to 2024 and 1979…
    If you were going to run it on actual new hardware, you would probably just want to save yourself the work and emulate. All of those games have had the bugs worked out of emulation long long ago. I have all of them sitting on a pi.

    1. “Newer I guess, but the GBA is still old enough to drink.”

      The talk is about work that was done 20 years ago. It was actually done *before the GBA actually came out*.

    2. Ah, this is a real gem of a Hackaday comment. Not only did you not bother to read the article, you’re now going to explain to us why the professional game developer is wrong.

  3. All due respect to Bob, I’ve been in the game industry for about 20 years, and have been an emulator developer for about 25.

    I sometimes wonder why it is that game developers like him, and that Modern Vintage Gamer YouTuber, comport themselves as if they’re in any way qualified to speak on the topic of emulation. I’ve tended to find that they have a habit of omitting important contextual details on the emulation side of things, or even making outright incorrect statements.

    Giving a talk about the ups and downs of porting a vintage game to modern hardware would certainly be compelling enough as it is, while also staying in his lane. I just don’t get it.

    1. I agree. The article starts off discussing emulation, then suddenly dismisses it before going on to suggest that porting the code is a more satisfactory solution. The main part of the article then describes how seemingly porting the code has more difficulties than emulation.
      Nowhere is the option of using custom FGPA chips even mentioned. Weird

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.