import ndscodes, ndsheader, uromkan, log, arclib class IdentifyError(Exception): pass def identify(rom, games): ibc = identify_by_crc(rom, games) if ibc: return ibc else: return False # the most trusted match possible def identify_by_crc(rom, games): log.vv("attempting to identify by crc") rom.get_crc() for game in games: if rom.crc.lower() == game.crc.lower(): log.v("CRC match! (%s : %s)" % (rom.name, game.name)) return [game] log.vv("match failed") return [] """All of this was really cute, but totally worthless. There wasn't ever enough of a decisive match going just by DAT file information and the information that is in the header of the NDS game. Newer versions of this software will move towards going with it's own precompiled db, complete with support for other people to compile their own db off of their own set (thus freeing me from the burden of updating it until the end of life of the system. If we don't have a CRC match, the image is screwed up anyway (or a NUKE, and we explicitly don't handle those for now). """