public override bool IsPlatformMatch(byte[] rom) { if (rom.Length < 0x2000) { return(false); } if (rom.Length < 4200000 && rom.Length >= 0x8000) // Too slow for massive ROMS { var checksum = SNES.CalculateChecksum(rom); if (checksum != 0 && checksum == SNES.GetInternalChecksum(rom)) { return(true); } } if (SNES.HasGoodSmcHeader(rom)) { return(true); } if (SNES.HasGoodSwcHeader(rom)) { return(true); } return(false); }
protected override void AddPlatformExtendedData(RomExDataBuilder builder, byte[] rom, RomData data) { var checksum = SNES.CalculateChecksum(rom); int romOffset = SNES.HasExternalHeader(rom) ? SNES.ExternalHeaderSize : 0; string header = RomExDataBuilder.HeaderCat; object o_snesheader; SnesHeader snesheader; if (data.MiscData.TryGetValue(DataTags.DecodedHeader, out o_snesheader)) { //if (snesheader != null) { snesheader = o_snesheader as SnesHeader; builder.AddData(RomExDataBuilder.GeneralCat, "Checksum valid", (checksum == snesheader.Checksum) ? "Yes" : "No"); builder.AddData(header, "Mapping", snesheader.Mapping.ToString()); //builder.AddData(header,"Name", GetAscii } }