Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nathsou/smb
Super Mario Bros. static recompilation in C
https://github.com/nathsou/smb
Last synced: 28 days ago
JSON representation
Super Mario Bros. static recompilation in C
- Host: GitHub
- URL: https://github.com/nathsou/smb
- Owner: nathsou
- License: apache-2.0
- Created: 2024-10-22T18:09:18.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2024-11-20T22:24:38.000Z (about 1 month ago)
- Last Synced: 2024-11-20T23:26:13.860Z (about 1 month ago)
- Language: C
- Homepage: https://nathsou.github.io/smb/
- Size: 1.45 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SMB
[Play it online](https://nathsou.github.io/smb/)
Static recompilation of Super Mario Bros. using [doppelganger's disassembly](https://www.romhacking.net/documents/344/)
[![SMB C port running in the browser](res/smb-demo.png)](https://nathsou.github.io/smb)
## Controls
- D-Pad: WASD
- B: K
- A: L
- start: Enter
- select: Space
- z: Save state
- x: Load state## Checkpoints
- [x] Static translation of the disassembly to low-level C
- [x] PPU & APU emulation layers
- [x] Convert subroutines to C functions
- [x] 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## Building
### Linux & MacOS
In the root folder:
1. Clone and build raylib using [raylib-quickstart](https://github.com/raylib-extras/raylib-quickstart)
2. Run `make build`
3. Place a legally obtained dump/ROM of SMB called `smb.nes` in the root folder to extract graphics data from
4. You can now run `./smb`## WebAssembly
1. Install a recent version of `clang` with support for the `wasm32` target
2. Run `make wasm`
3. Run an HTTP server in the `web/` folder and open `index.html` in your browser
4. Select a legally obtained dump/ROM of SMB to extract graphics data from## References & Resources
- [doppelganger's disassembly](https://www.romhacking.net/documents/344/)
- [SuperMarioBros-C by MitchellSternke](https://github.com/MitchellSternke/SuperMarioBros-C)
- [Nesdev Wiki](https://www.nesdev.org/wiki/Nesdev_Wiki)
- [nessy](https://github.com/nathsou/nessy)
- [An Overview of NES Rendering by Austin Morlan](https://austinmorlan.com/posts/nes_rendering_overview/)