3.1.2 • Published 1 year ago

rommage v3.1.2

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

RomMage

RomMage gives you the ability to manipulate ROM files. It supports:

  • ROM Type detection
  • Patching (using IPS, UPS, and BPS formats)
  • Header Modification (for NES, SNES, GB, GBC, and GBA ROMs)

Node.js and the browser are supported. Written in Typescript.

Installation

$ npm install --save rommage

Examples

ROM type detection

import { readFile } from "fs/promises";
import { Rom, RomType } from "rommage";

// Alternatively, require syntax may be used:
// const { Rom, RomType } = require("rommage");

const romBuffer = await readFile("./someFile.gbc");
const rom = Rom.fromBuffer(romBuffer);
console.log(rom.type === RomType.Gb);

Rom patching

import { Patch, PatchType } from "rommage";
const patchBuffer = await readFile("./someFileMod.ups");
const patch = Patch.fromBuffer(patchBuffer);
console.log(patch.type === PatchType.Ups);

patch.applyTo(romBuffer);

Header modification

console.log(rom.validity);

console.log(rom.header.logo.isValid);
rom.header.logo.togglePixel(1, 5);
console.log(rom.header.logo.isValid);

console.log(rom.header.version);
console.log(rom.header.title);

Accessing specific rom type

import { GbRom } from "rommage/GbRom";

const gbRom = GbRom.fromBuffer(romBuffer);
console.log(rom.validity); // -> 4
3.1.2

1 year ago

3.1.1

1 year ago

3.1.0

1 year ago

3.0.0

1 year ago

2.0.1

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago