GBTiles Ruby Gem released

GBTiles Ruby Gem released logo

Converts Game Boy maps and tiles into Z80 ASM format for memory management

Original development

The most highly recommended tools amongst homebrew Game Boy developers include the Game Boy Tile Designer (GBTD) and the Map Builder (GBMB) by Dutch developer Harry Mulder.

Originally developed in 1999 and written in the Delphi programming language, the tools provide a simply graphical interface to manipulate map data.

Output woes

Map and tile data can be output in many formats, but the most compatible with GBDK development is output the maps in GBDK-compatibile C language code.

Unfortunately, GBDK has known issues which causes arrays to bloat. On a platform which has limited memory (ROM: 8 MB, RAM: 32 kB, VRAM: 16 kB), space for data is a premium.

Output crunching

GBTiles takes .GBM and .GBR source files generated by these programs and converts them in to a compatible ASM format.

This results in reduced memory usage, allowing for more data to be included in the game ROM.

The command is outputs a source (.S) file containing the ASM source and a header (.H) file to include the references in the project GBDK source.

Installation

Operating systems with Ruby pre-installed (Mac OS X) can install the GBTiles gem by running:

gem install gbtiles

Alternatively, you can build the source from GitHub and contribute to the repository.

The project is publicly available under the MIT licence.

GBTD Example

Both the Game Boy Tile Design and Map Builder remain popular as the interfaces are simply to use.

Although originally created for use on the Windows operating system, the WINE Emulator can run the program on Mac OS X.

An example of the Game Boy Tile Designer

GBTD Sample Output

/*

 SNAKE.C

 Tile Source File.

 Info:
  Form                 : All tiles as one unit.
  Format               : Gameboy 4 color.
  Compression          : None.
  Counter              : None.
  Tile size            : 8 x 8
  Tiles                : 0 to 0

  Palette colors       : None.
  SGB Palette          : None.
  CGB Palette          : None.

  Convert to metatiles : No.

 This file was generated by GBTD v2.2

*/

/* Start of tile array. */
unsigned char Snake[] =
{
  0x00,0x01,0x00,0x7F,0x00,0x40,0x00,0x7C,
  0x00,0x04,0xA0,0xFC,0x00,0xE0,0x80,0x00
};

/* End of SNAKE.C */

GBTiles Sample Output

; .S created with
; GBTiles Ruby Gem (v0.0.3) - GBR
;
; .GBR created with
; Gameboy Tile Designer (v2.2)
; Home: www.casema.net/~hpmulder

.area _CODE_0

.globl _Snake
.dw _Snake

_Snake:
.db 0x00,0x01,0x00,0x7f,0x00,0x40,0x00,0x7c
.db 0x00,0x04,0xa0,0xfc,0x00,0xe0,0x80,0x00