Patches Pokémon FRLG save blobs and ROM images via non destructive IO
Find a file
2026-05-25 19:38:48 +00:00
src Introduce idempotent shiny rate transitions across vanilla rate and forced modes 2026-05-25 19:38:48 +00:00
.gitignore Inital commit 2026-05-25 16:48:11 +00:00
Cargo.lock Inital commit 2026-05-25 16:48:11 +00:00
Cargo.toml Inital commit 2026-05-25 16:48:11 +00:00
README.md Introduce idempotent shiny rate transitions across vanilla rate and forced modes 2026-05-25 19:38:48 +00:00

frce

Patches Pokémon FRLG save blobs and ROM images via non destructive IO. Emits RAM script installers alongside Thumb ACE payload builders + warp stubs and canonical save mutation passes while preserving the source artefact

Materialised save images and patched ROM binaries are serialised to the selected output path

Build

cargo build --release

Commands

./target/release/frce inspect save.sav

Install a RAM script

./target/release/frce install save.sav patched.sav --payload-hex '02'

Build a RAM script ACE payload from Thumb bytes

./target/release/frce ace save.sav ace.sav \
  --dest 0x0203f000 \
  --thumb-hex '7047'

7047 encodes bx lr to give a return only smoke test payload for validating the Thumb ACE trampoline and script install path. The RAM script slot exposes 995 field script bytes while inline Thumb ACE payloads cap at 164 bytes

Warp state is patched by mutating map id, layout id, player coords, continue warp metadata and flag state as a single coherent save transaction

./target/release/frce warp save.sav warped.sav \
  --map-group 5 --map-num 4 --layout-id 8 --x 12 --y 6

Use a preset:

./target/release/frce preset viridian-old-man save.sav viridian.sav
./target/release/frce preset pallet-room save.sav out.sav
./target/release/frce preset viridian-pc save.sav out.sav
./target/release/frce preset pewter-pc save.sav out.sav
./target/release/frce preset cerulean-pc save.sav out.sav

Saves

These mutate the output save and fix the affected checksum

./target/release/frce edit money save.sav rich.sav --amount 999999
./target/release/frce edit item save.sav balls.sav --item master-ball --count 99
./target/release/frce edit badges save.sav badges.sav --all

Item names

`master-ball`, `ultra-ball`, `great-ball`, `poke-ball`,
`potion`, `rare-candy`, `tm-case`, and `berry-pouch`. Numeric item ids also
work when paired with `--pocket`.

Visible payloads

These install nurse triggered payloads for the Viridian PC. Interact with the nurse to dispatch the payload

Add --warp-to-nurse only when you want the tool to relocate the avatar to the counter tile

./target/release/frce payload money save.sav nurse-money.sav --amount 999999
./target/release/frce payload item save.sav nurse-balls.sav --item master-ball --count 99
./target/release/frce payload badges save.sav nurse-badges.sav
./target/release/frce payload kit save.sav nurse-kit.sav
./target/release/frce payload wild save.sav nurse-mewtwo.sav --species mewtwo --level 70
./target/release/frce payload shiny-wild save.sav nurse-shiny-mew.sav --species mew --level 30

payload wild starts a scripted wild encounter

payload shiny-wild makes that generated opponent shiny before the battle starts. it doesnt change global shiny odds

Shiny patch

Patch a ROM copy for normal grass/cave/and surf encounters

./target/release/frce rom shiny fire-red.gba fire-red-shiny.gba --always
./target/release/frce rom shiny fire-red.gba fire-red-rate.gba --rate 0xfe
./target/release/frce rom shiny fire-red.gba fire-red-rate.gba --odds 1/257
./target/release/frce rom shiny fire-red-rate.gba fire-red-vanilla.gba --vanilla
./target/release/frce rom inspect-shiny fire-red.gba

--always forces shiny checks to pass, --rate 0xfe raises odds to about 1/257, --odds 1/N converts readable odds into the closest engine threshold, and --vanilla restores known shiny patches from this tool back to stock bytes

ROM shiny patching is validated against the FireRed US/English game code before offset patches are applied

Thumb assembly

With clang and llvm-objcopy you can also use Thumb source directly

./target/release/frce ace-asm save.sav ace.sav \
  --dest 0x0203f000 \
  --asm payload.s

See all arguments with:

./target/release/frce --help