This program interprets a ROM or VRAM dump as graphics data in the Game Boy's 2 bits-per-pixel color format and renders an output image. It was developed as part of my larger work in Game Boy emulation and development.
gbromviewer [-o rom.png] [-tw 16] [-pal dmg] rom.gb
-o
specifies the output image-tw
specifies the width of the output image in tiles (default 16)-pal
specifies the palette namedmg
for the original green Game Boymgb
for the grayscale Game Boy Pocket
(Arguments must be provided in this order, so if you want to specify the color palette you need to specify all the other arguments before it.)
That's the game code! Only some parts of a ROM are graphics data, but this program can't tell which, so it displays everything.
The graphics may be compressed, so they aren't stored in the ROM the same way they're loaded into VRAM at runtime for displaying on the Game Boy's screen. This program isn't sophisticated enough to deal with that, but if you dump the tile data from VRAM after it's loaded, you can load it that way.
The graphics may also not be "aligned" with the beginning of the ROM. This program assumes each 16 bytes of the ROM make up a tile, but if the graphics data is offset by some number of bytes and doesn't start at an address evenly divisible by 16, they will not be processed correctly. (TODO: add offset option for this?)
Kinda...! Try one and see. Some graphics load, but there may be something more to Game Boy Color tile data. I haven't gotten there yet.