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
- Fetch the submodules:
$ git submodule update --init --recursive-
Build raylib, follow the instructions here
-
Run
make buildin the root folder:
$ 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.7.1+c0b22a8b0'- Run
make codegen
