Code Monkey home page Code Monkey logo

rommage's Introduction

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

rommage's People

Contributors

kinetikeith avatar

Stargazers

James Hernandez avatar Leo Melo avatar Sara Vieira avatar

Watchers

 avatar

Forkers

lazerwalker

rommage's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.