Handheld Underground

GBX tool beta release

posted by taizou @ 2020-09-07 01:50:33 Other Stuff

I said a long-ass time ago that I would make a tool for managing the file footers on GBX ROMs and I absolutely never did

Anyway the other day I decided to learn Python and do it, so here it is!

The latest (and only) release as of this writing is v1.0.0-beta.

It can add, edit and remove headers, and also hash ROMs. It's still in a beta state, so I wouldn't call it robust exactly, but I've tested the various operations against some test ROMs and got the expected results. You should definitely verify its output in a hex editor if you're using it for a ROM you plan to release though.

You'll need to install the Python 3 interpreter for your platform to use it. Then, just download the source code zip from the beta release and run gbxtool.py as per the instructions.

2 Comments

GBX v1.0 important notice!

posted by taizou @ 2018-03-26 22:18:26 Other Stuff

Unfortunately, and perhaps inevitably, I fucked up a small part of the initial version of the GBX v1.0 spec - the text mistakenly specified all numbers should be little-endian, when the examples (and my emulator, and the ROMs I released) all use big-endian, which was my intent from the start.

I've fixed this and you can find the updated version here. Note that I'm not considering this a version update (because the old version was purely a mistake and contradicted its own examples in any case) so the version number 1.0 is retained.

6 Comments

GBX v1.0 is HERE

posted by taizou @ 2018-02-22 22:47:44 Other Stuff

The GBX ROM format v1.0 is now finalised!

The spec can be found here.

Thanks to everyone who gave feedback! Although v1.0 is final, any comments and suggestions for future versions are still welcome!

Now to the business of actually implementing emulator support, releasing ROMs in the format, making a tool to edit/add/remove GBX footers...

🦁💤

5 Comments

New Game Boy ROM format proposal(??!)

posted by taizou @ 2018-02-19 02:44:54 Other Stuff

SO A LITTLE BACKGROUND HERE.

Currently, the common format for Game Boy and Game Boy Color ROMs (usually given the .gb/.gbc file extension) is just a raw binary dump of the ROM data from the cartridge. Unlike the NES, where some extra data must be tacked on to tell an emulator crucial details such as which of the hundreds of different mappers is used by the game, Nintendo's requirements for Game Boy developers specified an internal ROM header that must be populated with this information. So that's fine right? Emulators can just read the internal header! Nintendo, unintentionally, solved the problem and made emulation easier for everyone! Right??

NOT SO FAST BUBSY HERE COME UNLICENSED GAMES TO FUCK EVERYTHING UP

For, you see, the header being populated correctly is a Nintendo requirement, not a hardware one. A real Game Boy requires a few things to be correct - the header checksum, the Nintendo logo, GBC/SGB flags to enable enhancements for those systems - but doesn't care about things like cartridge type and ROM size. So if you're an unlicensed dev, you can put any old shit in there. You might even intentionally set incorrect values to fool copiers and emulators. And if your game uses some kind of custom unlicensed mapper or copy protection, it's probably not even possible to represent it within the specs of Nintendo's header format!

Until now, most Game Boy emulators have relied on heuristic auto-detection for these games, checking for certain signifiers present in the ROM that can somewhat-reliably identify a given type of non-standard cartridge. hhugboy also allows you to select a cartridge type manually, to run games that are not correctly auto-detected. So far, this has sort of been okay - hhugboy's auto-detection works correctly for the most part, with only a handful of dumps needing manual selection.

But the new unlicensed dumps just keep coming, and the heuristic approach is getting increasingly unwieldy. I've recently dumped a bunch of games from a Certain Developer, and while it's possible to reliably identify their games, I haven't found a way to distinguish between the ones that run on their publisher's custom mapper and the ones that don't, meaning at least one set of those would end up only working via manual selection. There are a bunch of other carts I haven't yet tackled that I foresee causing similar problems.

So what I've been thinking is: why not create a new Game Boy ROM format, allowing all this information to be specified outside of the internal header? Admittedly the use cases for such a format at this point are fairly niche, so it would have to be low-overhead, backwards-compatible if possible and unintrusive. But hopefully it would be a step towards making emulation of unlicensed Game Boy games (and a handful of licensed ones too!) a much nicer thing to deal with and much less of a mess of heuristics and hacked dumps.

Here's my proposal for the format, which I'm tentatively calling GBX. Any and all feedback would be greatly appreciated, just leave a comment below! Even if you just want to call me a big dumbass or something!

(UPDATED 21/02/2018 current version 0.3)

When it's finalised, the next version of hhugboy will support it, and I'll probably make some kind of tool to allow for conversion to and from the new format, hashing, editing and other such stuff.

9 Comments

"mostly harmless - if obscure - fun"

posted by taizou @ 2012-11-17 03:42:56 Other Stuff

Came across something interesting in an issue of the UK's (excellent) N64 Magazine recently - all the way back in August 1999 they dedicated a two-page feature to bootleg Game Boy stuff, pretty unprecedented for the time. they even gave it a...slightly familiar name, almost like a knockoff version of this very site (...except theirs was 13 years earlier):

(the quality isn't the best, sorry - I didn't have access to a scanner when I found this, so I just had to photograph it, but it's readable at least)

With it being 1999, unlicensed development hadn't really got into full swing, so all they had to cover were hacks and multicarts and the like; they seemingly didn't realise Mario 4 was a hack at all (which is fair enough, given the obscurity of the source game, Crayon Shin-Chan 4) and although they hint at Sonic 6 being based on some unnamed "poor game", they don't recognise it as Speedy Gonzales, and they really lay into it. Poor Speedy :(

They also cover Monster Go! Go! Go!, which they do identify as a Smurfs hack (the colour version of Smurfs being a fairly recent release at that point), but they don't provide any screenshots - my hunch is that they played Mario 4 and Sonic 6 through ROMs they downloaded from the internet, but Monster Go Go Go probably wasn't dumped at that point, so I'd guess they either actually obtained a copy (possible) or just nicked the boxart from a website and wrote up something based on the site's description (likely).

Amusingly, given their likely ROM-based Mario and Sonic shenanigans, they then proceed to get on their soapbox about the GB X-Changer (because playing pirated roms on your computer is just fine, but if you put them on a cartridge you have CROSSED A LINE SIR), and then there's a bit about some crap old multicart that someone on staff no doubt picked up on holiday, and that's your lot!

8 Comments