Ejemplo n.º 1
0
            public override bool IsPlatformMatch(byte[] rom)
            {
                //15Eh    2     Header Checksum, CRC-16 of [000h-15Dh]
                if (rom.Length < 0x200)
                {
                    return(false);
                }

                byte[] bytesToHash = new byte[HeaderCrcRegionSize];
                Array.Copy(rom, 0, bytesToHash, 0, HeaderCrcRegionSize);

                var hash = Crc16.CalculateHash(bytesToHash, 0, bytesToHash.Length);

                if ((hash & 0xFF) == rom[0x15e] && (hash >> 8) == rom[0x15F])
                {
                    return(true);
                }

                return(false);
            }