Skip to content

sopoforic/cgrr-gameboy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gameboy

This module parses Game Boy ROM headers.

Usage

To parse a ROM header:

>>> import gameboy
>>> gameboy.read_header("Super Mario Land (World).gb")
{
  'begin': b'\x00\xc3P\x01',
  'nintendo_logo': ..., # removed for space
  'title': 'SUPER MARIOLAND',
  'licensee': b'\x00\x00',
  'sgb_flag': 0,
  'cartridge_type': 1,
  'rom_size': <RomSize.ROM_64kbyte: 1>,
  'ram_size': <RamSize.RAM_None: 0>,
  'destination_code': <DestinationCode.JAPAN: 0>
  'old_licensee': 1,
  'mask_rom_version': 0,
  'header_checksum': 158,
  'global_checksum': 27457,
}

This dictionary can be modified and re-encoded using generate_header

import gameboy
header = gameboy.read_header("path/to/rom.gb")

header["title"] = "AWESOME HACK"

data = gameboy.generate_header(header)

The modified header can be re-inserted into a ROM file.

Requirements

  • pip install -r requirements.txt
  • If you're using python < 3.4, also do pip install enum34

More information

The Game Boy ROM header format is described in some detail on the wiki.

License

This module is available under the GPL v3 or later. See the file COPYING for details.

Build Status Code Health

About

Read and edit Game Boy ROM headers.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages