stephaneseng / gameboy-tiles-extractor

Extract tiles data contained in a GameBoy (Color) ROM

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

gameboy-tiles-extractor

The main goal of this tool is to programmatically extract tiles data contained in a GameBoy (Color) ROM.

Installation

0. Requirements

1. Install

(venv) make install

Usage

(venv) python ./src/extractor/extractor.py $CONFIGURATION_FILE_PATH $ROM_FILE_PATH $OUTPUT_DIRECTORY_PATH

Development

Run the tests

(venv) make test

Configuration file reference

Palettes

palettes:
- &palette-id
  colors: [0x1, 0x2, 0x3, 0x4]
  is_obj: true
  • Palette.anchor:
    • Type: String
    • Palette unique identifier
  • Palette.colors:
    • Type: List of Integers
    • List of 4 colors, encoded in BGR15
  • Palette.is_obj:
    • Type: Boolean
    • If true the first color in the palette will be considered as transparent

Tiles

tiles:
- &tile-id
  address: 0x1
  palette: *palette-id
  • Tile.anchor:
    • Type: String
    • Tile unique identifier, used to generate the tile file name
  • Tile.address:
    • Type: Integer
    • Tile byte offset in the ROM file
  • Tile.palette:
    • Type: Palette
    • The palette to apply on the tile

Sprites

sprites:
- &sprite-id
  sprite_tiles:
  - tile: *tile-id-1
    x_flip: true
    y_flip: true
  - tile: *tile-id-2
    x_flip: true
    y_flip: true
  - tile: *tile-id-3
    x_flip: true
    y_flip: true
  - tile: *tile-id-4
    x_flip: true
    y_flip: true
  • Sprite.anchor:
    • Type: String
    • Sprite unique identifier, used to generate the sprite file name
  • Sprite.sprite_tiles:
    • Type: List of SpriteTiles
  • Sprite.sprite_tiles.tile
    • Type: Tile
    • Tile composing a 4-tiles sprite
    • Tile order is: top-left, bottom-left, top-right, bottom-right
  • Sprite.sprite_tiles.x_flip, Sprite.sprite_tiles.y_flip:
    • Type: Boolean, default: false
    • If true the tile will be flipped horizontally or vertically

Spritesheets

spritesheets:
- &spritesheet-id
  spritesheet_sprites:
  - sprite: *sprite-id-1
  - sprite: *sprite-id-2
  • Spritesheet.anchor:
    • Type: String
    • Spritesheet unique identifier, used to generate the spritesheet file name
  • Spritesheet.spritesheet_sprites:
    • Type: List of SpritesheetSprites
  • Spritesheet.spritesheet_sprites.sprite:
    • Type: Sprite
    • Sprite composing a spritesheet
    • Sprites are added from left to right on the spritesheet, without limitation on the number of sprites to use

About

Extract tiles data contained in a GameBoy (Color) ROM

License:MIT License


Languages

Language:Python 99.4%Language:Makefile 0.6%