Static recompilation of Super Mario Bros. using doppelganger's disassembly
- D-Pad: WASD
- B: K
- A: L
- start: Enter
- select: Space
- z: Save state
- x: Load state
- Static translation of the disassembly to low-level C
- PPU & APU emulation layers
- Convert subroutines to C functions
- Convert most gotos to if statements
- Remove unused flag updates
- Replace PPU with direct draw calls
- Manually rewrite portions of the code to higher level C
In the root folder:
- Clone and build raylib using raylib-quickstart
- Run
make build - Place a legally obtained dump/ROM of SMB called
smb.nesin the root folder to extract graphics data from - You can now run
./smb
- Install a recent version of
clangwith support for thewasm32target - Run
make wasm - Run an HTTP server in the
web/folder and openindex.htmlin your browser - Select a legally obtained dump/ROM of SMB to extract graphics data from
The output of the code generator is in the codegen/ folder. To regenerate it:
- Install Moonbit:
$ curl -fsSL https://cli.moonbitlang.com/install/unix.sh | bash -s '0.6.26+4cdee97dd'- Run
make codegen
