An open API service indexing awesome lists of open source software.

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

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.