Case study · Static recompilation

Hotel Mario PC and 3DS Port

A 1994 Philips CD-i game, running on PC and 3DS with no emulator.

  • downloads of the first release127
  • StatusReleased, v0.1.1
  • Built withC · 68000 assembly · Static recompilation
  • My partDesign, research, build, testing
Hotel Mario title screen

The problem

Hotel Mario only runs on a Philips CD-i, or in an emulator that needs the original BIOS. Very little work has been done on recompiling CD-i games, so there was no tool to start from.

What I built

  • A static recompiler that translates the game's 68000 machine code into C ahead of time
  • A runtime for the CD-i video chip, ADPCM audio and save data
  • Windows and Nintendo 3DS builds from the same code
  • A decompilation in progress: 52 of 208 functions in C, and the build matches the original byte for byte

The hard part

Getting every graphics and sound difference to match the real machine. Because the code is translated ahead of time, each bug is fixed once in the compiler instead of in thousands of places.

How the work was split

My part

I chose the static recompilation approach, compared the port against the original game screen by screen, and decided when it was right.

Where AI helped

AI-assisted programming wrote much of the translator and the runtime code.

Result

The whole game is playable on PC and 3DS. The first public release has 127 downloads.

Stack

C68000 assemblyStatic recompilationdevkitProNintendo 3DSWindows

What's next

Finish the decompilation: 52 of 208 functions are in C so far.

Next case studyTheme Park (EA 2011) Revival