Exemplo n.º 1
0
        private void CreateHeader(Stream romDataStream)
        {
            /* We convert the rom header into high level information */
            romDataStream.Position = 0;

            BinaryReader binReader = new BinaryReader(romDataStream);

            m_BusConfig = new PiBusSpeedConfig(binReader.ReadByte(),
                                               binReader.ReadByte(),
                                               binReader.ReadByte(),
                                               binReader.ReadByte());

            m_Clockrate  = binReader.ReadInt32();
            m_EntryPoint = binReader.ReadInt32();
            m_Release    = binReader.ReadInt32();
            m_CRC1       = binReader.ReadInt32();
            m_CRC2       = binReader.ReadInt32();

            romDataStream.Position += 8;

            Byte[] nameBytes = new Byte[20];
            binReader.Read(nameBytes, 0, nameBytes.Length);
            m_Name = ASCIIEncoding.ASCII.GetString(nameBytes);

            romDataStream.Position += 4;

            Byte[] serial = new Byte[8];
            binReader.Read(serial, 0, serial.Length);
            m_SerialCode = new GameSerial(serial);
            m_Region     = m_SerialCode.GetRegionType();
        }
Exemplo n.º 2
0
        private void CreateHeader(Stream romDataStream)
        {
            /* We convert the rom header into high level information */
            romDataStream.Position = 0;

            BinaryReader binReader = new BinaryReader(romDataStream);

            m_BusConfig = new PiBusSpeedConfig(binReader.ReadByte(),
                                     binReader.ReadByte(),
                                     binReader.ReadByte(),
                                     binReader.ReadByte());

            m_Clockrate = binReader.ReadInt32();
            m_EntryPoint = binReader.ReadInt32();
            m_Release = binReader.ReadInt32();
            m_CRC1 = binReader.ReadInt32();
            m_CRC2 = binReader.ReadInt32();

            romDataStream.Position += 8;

            Byte[] nameBytes = new Byte[20];
            binReader.Read(nameBytes, 0, nameBytes.Length);
            m_Name = ASCIIEncoding.ASCII.GetString(nameBytes);

            romDataStream.Position += 4;

            Byte[] serial = new Byte[8];
            binReader.Read(serial, 0, serial.Length);
            m_SerialCode = new GameSerial(serial);
            m_Region = m_SerialCode.GetRegionType();
        }