https://github.com/56kyle/rom-patch-template
A project template meant to provide a modern dev workflow for patching ROM binaries
https://github.com/56kyle/rom-patch-template
Last synced: 8 months ago
JSON representation
A project template meant to provide a modern dev workflow for patching ROM binaries
- Host: GitHub
- URL: https://github.com/56kyle/rom-patch-template
- Owner: 56kyle
- License: mit
- Created: 2025-06-15T00:11:53.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2025-06-29T05:39:53.000Z (11 months ago)
- Last Synced: 2025-08-18T02:21:56.520Z (10 months ago)
- Language: Shell
- Size: 36.1 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ๐งฉ Generic ROM Patching Template
A modern, extensible template for developing ROM patches across cartridge-based systems like the Sega Genesis. Features clean tooling, snapshot testing, metadata tracking, and CI/CD.
---
## WIP
Just a heads up, this isn't currently working and was more of a spur of the moment thing.
This has some interesting ideas but needs a lot of tlc before it is useful.
## ๐ Features
- ๐งฑ Modular toolchain support (e.g., Sega Genesis w/ BPS)
- ๐ ๏ธ Devcontainer + Docker-based build environment
- ๐งช Snapshot testing and patch validation
- ๐ฆ GitHub Releases integration with patch metadata
- ๐ `patch.json` tracks hash-locked metadata
- ๐งฉ Uses [BPS patches](https://www.romhacking.net/utilities/893/) (via flips)
---
## ๐ Project Layout
```
โโโ .env # Environment config
โโโ Justfile # Task runner
โโโ scripts/ # Metadata + validation helpers
โโโ toolchains/ # Toolchain logic (per-console or method)
โ โโโ genesis-bps/ # Example: Sega Genesis BPS-based patching
โ โโโ pre.sh # Pre-build cleanup or setup
โ โโโ build.sh # ROM build (patching or compilation)
โ โโโ post.sh # Final validation
โโโ roms/ # Input/output ROMs (not committed)
โโโ patches/ # Output .bps and .json metadata
โโโ snapshots/ # Golden reference outputs
โโโ .github/workflows/ # GitHub Actions CI
```
---
## โ
Usage
### 1. ๐ณ Start Devcontainer
```bash
# Recommended: VSCode Devcontainer, or build manually
```
### 2. ๐งฑ Build ROM
```bash
just build
```
### 3. ๐ง Generate Patch
```bash
just patch
```
### 4. ๐งช Verify Patch
```bash
just check
```
---
## ๐งช Patch Metadata (`patch.json`)
For each `.bps`, a `.json` file will be generated containing:
- SHA1 hashes of input/output/patch
- Toolchain name
- Author + version + timestamp
- Rebuild safety + archival validation
---
## ๐ฆ GitHub Releases
When configured, a CI workflow:
- Builds ROM
- Validates snapshot
- Publishes patch + `.json` metadata
---
## ๐งฐ Toolchains
Each toolchain lives in `toolchains/` with:
- `pre.sh`, `build.sh`, `post.sh`
- Hooked into `just build`
- Swappable via `.env`:
```
TOOLCHAIN=genesis-bps
```
You can create new toolchains like `snes-bps` or `gbc-asm` for other consoles or workflows.
---
## ๐ง Philosophy
- Zero ROMs committed: all patches are derived
- Declarative patch tracking via JSON
- Extensible for any cartridge-style system
---
## ๐ License
MIT. Patches built using this template may have separate licensing requirements.