#patch #ips #rom #flip #ups #bps

sys no-std flips-sys

Raw FFI bindings to Flips, the Floating IPS patcher

3 unstable releases

0.2.1 May 14, 2020
0.2.0 Apr 5, 2020
0.1.0 Mar 22, 2020

#386 in No standard library

36 downloads per month
Used in flips

GPL-3.0 license

235KB
6.5K SLoC

C++ 4.5K SLoC // 0.1% comments C 1.5K SLoC // 0.1% comments Rust 327 SLoC // 0.0% comments

flips.rs Star me

Rust bindings to Flips, the Floating IPS patcher.

TravisCI Codecov License Source Crate Documentation Changelog GitHub issues

🗺️ Overview

Flips is a popular patcher for the IPS, BPS and UPS formats, typically used to patch ROMs of video game cartridges. It is known to create the smallest BPS and IPS files among all widely used patchers. This library provides a safe API to create and apply patches to arbitrary sources.

Format Apply Create Metadata Study
UPS ✔️
IPS ✔️ ✔️ ✔️
BPS ✔️ ✔️ ✔️

🔌 Usage

Load a ROM and a patch from two files, apply the patch to the ROM, and then write it back to a file:

extern crate flips;

// get the input ROM and patch
let patch = std::fs::read("FE_LonelyMirror_v3_3.ups").unwrap();
let rom = std::fs::read("Fire Emblem 8.rom").unwrap();

// apply the patch and write the output
let output = flips::UpsPatch::new(patch).apply(rom)
  .expect("could not apply patch");
std::fs::write("FE_LonelyMirror.rom", output).unwrap();

Check the online documentation for more examples about how to use this library.

📝 Features

📦 no_std support

no_std support for this crate can be opted-in by disabling the std feature. It will disable support of std::error::Error and Vec<u8>. It will also disable dynamic dispatch of hardware-accelerated CRC32 implementation.

🧩 CRC32

Flips is patched to use the crc32fast crate instead of the naive algorithm it used, which greatly improves performances when creating or applying BPS and UPS patches, since both of this formats will compute the checksum for their inputs and outputs every time.

📋 Changelog

This project adheres to Semantic Versioning and provides a changelog in the Keep a Changelog format.

📜 License

This library is provided under the GNU General Public License v3.0, since Flips itself is GPLv3 software.

Dependencies

~67–400KB