I'm on my phone so I can't look it up but I recall one of the emulator authors trying to do something similar. Why he failed isn't the point but I do recall him saying that most roms out there have headers that were added by whatever tool was used to pull the data or whatever the emulator author put there. Might be worth a read. Let me see if I can find it tonight.
Well understand that I'm not talking about supplementary headers (those are in there and you have to deal with them) I'm talking about actual headers...... these are part of the original rom image and aren't tacked on by the dump tools.
For example snes roms with the "SFC" extension have nintendo's internal header as well as the SFC header. We promptly ignore the SFC header and use nintendo's internal one. Now keep in mind that hacked roms probably have their original headers in tact, but again, I have no interest in dealing with hacked roms.
TBH, neither do I. It especially irritates me that rom dumpers or writers feel the need to tack on a bunch of ---steaming pile of meadow muffin--- that wasn't there to begin with. Use ---smurfing--- tables for crying out loud. These consoles have a finite number of games so tables aren't unfeasible.
The fad of writing/hacking games that are emulator specific that can't or won't run on the actual emulator pisses me off too. Building an entire game around a known feature bug that doesn't exist in the original hardware is just asinine.
But that's off topic. I just thought I would point out the original article but for the life of me I can't remember which emulator author lamented about this. He also proposed how to manage the ROMS. I thought it would be a worthwhile read for ideas. The only thing I can recall is that he makes it a point to write his emulator for accuracy and not on the whims of the audience. He drew back from the scene and claims to only write his emulator for his own benefit and thus... his emulator lacks many of the "special" features most other emulators have. I think it was an NES emulator but I could be wrong. SNES maybe? I tried searching but no luck.
I agree completely.. it's stupid. Even if the authors of these emulators were too lazy to make a huge table, they could have wrote cfg files for each individual rom that are external. They could have wrapped both files in a zip and been done with it.
There are a ton of hurdles to overcome with such a project.... the main one being that even if I manage to write a converter people would actually have to start using it. That's a hard one. I tried to standardize visual pinball tables years ago and the vp authors basically told me to "get bent" in a nice way. And still to this day it's next to impossible to know for sure which variant of a table you have.
But back to progress.
Looked into sega master system roms. They have a header as well and also each game has a unique id. The only tricky thing is that the bytes are flipped (my app already had compensated for that) and that the values are written in Binary Decimal Conversion. Once I added support for reading individual bits it was easy to add. Also Game Gear roms apparently have the same exact header, so I got two for one! The only problem is that these unique ids never appear anywhere on the cart or box, they are simply internal.
From my research I've ran into several variants and this is how I propose we deal with them.
1.Cart/Box has a clear id. Id is also contained in the header: This is our ideal rom format. We simply rename based on the internal header. We can also create a ini file/table with id number to Real game name lookup. As you said, console roms have a finite number of games, so this is doable.
2.No id on Cart/Box but unique id is contained in the header: We can still rename based on internal header, but because the id isn't documented, someone would have to take a good tools version of the whole set and convert it to get the game names. A little more work, but still doable.
3.Id on the cart/box, but no id in the header. Header is unique though: We would need a two stage ini for this one. First a ini that converts the relevant header bits (like the game name + the region code + the version number in a snes header) to the official cart id. Then a second ini that shows the game name in relation to the cart id. This is what will have to be done for the snes, which is a pain in the ass, but still doable.
4. Id on the cart/box, but no id in the header. Header is NOT unique: Unfortuantely this is how the nes games are. Fortuantely, somebody has already made a table of all known nes games and their corresponding id. The problem comes with rom identification. It obviously can't be done with the header, but perhaps a crc check of the the rom AFTER the header (because as you've stated, emu authors and rom hackers tend to monkey with the headers and/or tack extra data on.) Many roms including nes roms, allow you to tak some data on the end of the file. Once a rom is crc checked, we might be able to "tag" it with the game id and game name. I'm not so sure about messing with the actual rom data though.
5. No id: If there's some sort of unique header or soemthing we could make up id's for all the games. This would be time consuming though. If not then these sad examples might have to remain in goodtools land.
So yeah a ton of work would be involved. I'm just playing with the idea atm... trying to write a little program that can parse the headers of all the popular consoles. I would need help with this though if we proceed. It's not like I'm going to sit down and document hundreds of roms by myself.