Exemplo n.º 1
0
            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
                }
            }
Exemplo n.º 2
0
            protected override void AddPlatformExtendedData(RomExDataBuilder builder, byte[] rom, RomData data)
            {
                if (rom.Length >= GbaHeader.GbaHeaderSize)
                {
                    var HeaderCat = RomExDataBuilder.HeaderCat;
                    var header    = new GbaHeader(rom, 0);

                    builder.AddData(HeaderCat, "Logo present", header.ValidGbaLogo.AsYesNo());
                    builder.AddData(HeaderCat, "Header checksum", header.HeaderChecksum.ToString("X2"));
                    builder.AddData(HeaderCat, "Header checksum valid", header.HeaderChecksumValid.AsYesNo());
                    builder.AddData(HeaderCat, "Title", header.Title);
                    builder.AddData(HeaderCat, "Game Maker", header.MakerCode);
                    builder.AddData(HeaderCat, "Game Code", header.GameCode);

                    builder.AddData(HeaderCat, "Mask ROM version", header.RomVersion.ToString());
                }
            }
Exemplo n.º 3
0
            protected override void AddPlatformExtendedData(RomExDataBuilder builder, byte[] rom, RomData data)
            {
                var HeaderCat = RomExDataBuilder.HeaderCat;


                if (rom.Length < 0x10)
                {
                    return;
                }

                var header = new iNesHeader(rom, 0);

                if (header.MagicNumberIsCorrect)
                {
                    builder.AddData(HeaderCat, "CHR Banks", header.ChrRomCount.ToString());
                    builder.AddData(HeaderCat, "PRG Banks", header.PrgRomCount.ToString());
                    builder.AddData(HeaderCat, "Battery backed", header.BatteryPacked ? "Yes" : "No");

                    if ((int)header.Mapper > 9)
                    {
                        builder.AddData(HeaderCat, "Mapper", ((int)header.Mapper).ToString() + " ($" + (((int)header.Mapper).ToString("x")) + ") - " + header.Mapper.ToString());
                    }
                    else
                    {
                        builder.AddData(HeaderCat, "Mapper", ((int)header.Mapper).ToString() + " - " + header.Mapper.ToString());
                    }
                    builder.AddData(HeaderCat, "Mirroring", header.Mirroring.ToString());
                    builder.AddData(HeaderCat, "Region", header.PalFlagSet ? "PAL" : "NTSC");;
                    //builder.AddData(HeaderCat, "SRAM Present", header.SRamFlag ? "Yes" : "No"); ;
                    //builder.AddData(HeaderCat, "SRAM Size", (header.PrgRamCount * 8).ToString() + " kb");

                    builder.AddData(HeaderCat, "Trainer present", header.HasTrainer ? "Yes" : "No");
                    builder.AddData(HeaderCat, "Bus conflicts", header.HasBusConflicts ? "Yes" : "No");
                    builder.AddData(HeaderCat, "VS Unisystem", header.VsUnisystem ? "Yes" : "No");
                    builder.AddData(HeaderCat, "Playchoice 10", header.PlayChoice10 ? "Yes" : "No");

                    builder.AddData(HeaderCat, "iNES 2.0", header.iNES2_0 ? "Yes" : "No");
                }
            }
Exemplo n.º 4
0
            protected override void AddPlatformExtendedData(RomExDataBuilder builder, byte[] rom, RomData data)
            {
                byte[] romImage;
                // If our previously de-interleaved ROM is still in memory, use that instead of re-de-interleaving
                if (BinRomImage == null)
                {
                    romImage = GetBinFormat(rom);
                }
                else
                {
                    romImage = BinRomImage.Target as byte[];
                    if (romImage == null)
                    {
                        romImage = GetBinFormat(rom);
                    }
                }

                bool interleaved, ext, s32x;
                bool InternalHeaderFound = Gen.HasInternalHeader(rom, out interleaved, out ext, out s32x);

                builder.AddData(RomExDataBuilder.GeneralCat, "32X", s32x.AsYesNo());
                builder.AddData(RomExDataBuilder.GeneralCat, "Internal Header Found", InternalHeaderFound.AsYesNo());
                builder.AddData(RomExDataBuilder.GeneralCat, "Interleaved", interleaved.AsYesNo());

                if (InternalHeaderFound)
                {
                    const string hdr    = RomExDataBuilder.HeaderCat;
                    GenHeader    header = new GenHeader(romImage);
                    builder.AddData(hdr, "Platform", header.Platform);
                    builder.AddData(hdr, "Name", header.GameName);
                    builder.AddData(hdr, "International Name", header.AltName);
                    builder.AddData(hdr, "Copyright", GetCopyrightString(header.Copyright));
                    builder.AddData(hdr, "Memo", header.Memo);
                    builder.AddData(hdr, "Modem", header.Modem);
                    builder.AddData(hdr, "Product Type/ID", header.ProductID);
                    builder.AddData(hdr, "Region", header.Region);
                    builder.AddData(hdr, "ROM range", header.RomStart.ToString("X8") + "-" + header.RomEnd.ToString("X8"));
                    builder.AddData(hdr, "RAM range", header.RamStart.ToString("X8") + "-" + header.RamEnd.ToString("X8"));
                    builder.AddData(hdr, "Checksum", header.Checksum.ToString("X4"));
                    builder.AddData(hdr, "IO Devices", GetIOString(header.IOSupport));
                }
            }
Exemplo n.º 5
0
            protected override void AddPlatformExtendedData(RomExDataBuilder builder, byte[] rom, RomData data)
            {
                if (rom.Length >= GbHeader.GbHeaderOffset + GbHeader.GbHeaderSize)
                {
                    var HeaderCat = RomExDataBuilder.HeaderCat;
                    var header    = new GbHeader(rom, GbHeader.GbHeaderOffset);

                    builder.AddData(RomExDataBuilder.GeneralCat, "ROM checksum", header.RomChecksum.ToString("X4"));
                    builder.AddData(RomExDataBuilder.GeneralCat, "Checksum valid", header.RomChecksumValid.AsYesNo());

                    builder.AddData(HeaderCat, "Logo present", header.ValidGbLogo.AsYesNo());
                    builder.AddData(HeaderCat, "Header checksum", header.HeaderChecksum.ToString("X2"));
                    builder.AddData(HeaderCat, "Header checksum valid", header.HeaderChecksumValid.AsYesNo());
                    builder.AddData(HeaderCat, "ROM checksum", header.RomChecksum.ToString("X4"));
                    builder.AddData(HeaderCat, "ROM checksum valid", header.RomChecksumValid.AsYesNo());
                    builder.AddData(HeaderCat, "Title", header.Title);
                    builder.AddData(HeaderCat, "Manufacturer", header.Manufacturer);
                    builder.AddData(HeaderCat, "Gameboy Color support", header.CGBFlag.GetDescription());
                    builder.AddData(HeaderCat, "Super Gameboy support", header.SupportsSgb.AsYesNo());
                    builder.AddData(HeaderCat, "Cart type", header.CartType.GetDescription());

                    builder.AddData(HeaderCat, "ROM size", header.RomSize.GetDescription());
                    builder.AddData(HeaderCat, "RAM size", header.RamSize.GetDescription());

                    builder.AddData(HeaderCat, "Mask ROM version", header.RomVersion.ToString());


                    builder.AddData(HeaderCat, "Licensee code", "$" + header.Licensee.ToString("X2"));
                    builder.AddData(HeaderCat, "Licensee code (extended)", header.LicenseeEx);
                }
            }
Exemplo n.º 6
0
        /// <summary>
        /// Adds standard ROM details
        /// </summary>
        /// <param name="builder">Data builder</param>
        /// <param name="rom">ROM image</param>
        /// <param name="data">ROM information</param>
        private void AddStandardData(RomExDataBuilder builder, byte[] rom, RomData data)
        {
            const string general = RomExDataBuilder.GeneralCat;

            builder.AddData(general, "Platform", data.Platform.ID.GetDescription());
            builder.AddData(general, "ROM format", data.FormatName);
            if (data.ExternalHeader != null)
            {
                builder.AddData(general, "External Header", data.ExternalHeader.Value ? "Yes" : "No");
            }
            builder.AddData(general, "File Size", data.FileSize.ToString() + " (" + data.FileSize.ToString("x") + ")");
            builder.AddData(general, "ROM Size", data.RomSize.ToString() + " (" + data.RomSize.ToString("x") + ")");

            // ROM hashes
            var crc32 = data.GetHash(HashFlags.RomHash | HashFlags.CRC32);
            var sha1  = data.GetHash(HashFlags.RomHash | HashFlags.SHA1);

            if (crc32 != null)
            {
                builder.AddData(general, RomHash.GetHashName(HashFlags.RomHash | HashFlags.CRC32), Hex.FormatHex(crc32.Value));
            }
            if (sha1 != null)
            {
                builder.AddData(general, RomHash.GetHashName(HashFlags.RomHash | HashFlags.SHA1), Hex.FormatHex(sha1.Value));
            }

            // File hashes as a last resort when ROM hashes aren't present
            if (crc32 == null)
            {
                crc32 = data.GetHash(HashFlags.FileHash | HashFlags.CRC32);
                if (crc32 != null)
                {
                    builder.AddData(general, RomHash.GetHashName(HashFlags.FileHash | HashFlags.CRC32), Hex.FormatHex(crc32.Value));
                }
            }
            if (sha1 == null)
            {
                sha1 = data.GetHash(HashFlags.FileHash | HashFlags.SHA1);
                if (sha1 != null)
                {
                    builder.AddData(general, RomHash.GetHashName(HashFlags.FileHash | HashFlags.SHA1), Hex.FormatHex(sha1.Value));
                }
            }

            for (int i = 0; i < data.DatabaseMatches.Count; i++)
            {
                var match = data.DatabaseMatches[i];
                builder.AddData(general, match.Database.Name + " entry", match.Entry.name);
            }

            for (int i = 0; i < data.Hashes.Count; i++)
            {
                builder.AddData(
                    RomExDataBuilder.HashesCat,
                    RomHash.GetHashName(data.Hashes[i].Type),
                    Hex.FormatHex(data.Hashes[i].Value));
            }
        }