public void WrapByteArray(byte[] data) { NSFData = data; var ms = new MemoryStream(data); var br = new BinaryReader(ms); br.BaseStream.Position += 5; Version = br.ReadByte(); TotalSongs = br.ReadByte(); StartingSong = br.ReadByte(); LoadAddress = br.ReadUInt16(); InitAddress = br.ReadUInt16(); PlayAddress = br.ReadUInt16(); SongName = br.ReadStringFixedAscii(32); ArtistName = br.ReadStringFixedAscii(32); CopyrightHolder = br.ReadStringFixedAscii(32); SpeedNTSC = br.ReadUInt16(); br.Read(BankswitchInitValues, 0, 8); SpeedPAL = br.ReadUInt16(); byte temp = br.ReadByte(); if ((temp & 2) != 0) IsNTSC = IsPAL = true; else if ((temp & 1) != 0) IsPAL = true; else IsNTSC = true; ExtraChips = (eExtraChips)br.ReadByte(); }
public void WrapByteArray(byte[] data) { NSFData = data; var ms = new MemoryStream(data); var br = new BinaryReader(ms); br.BaseStream.Position += 5; Version = br.ReadByte(); TotalSongs = br.ReadByte(); StartingSong = br.ReadByte(); LoadAddress = br.ReadUInt16(); InitAddress = br.ReadUInt16(); PlayAddress = br.ReadUInt16(); SongName = br.ReadStringFixedAscii(32); ArtistName = br.ReadStringFixedAscii(32); CopyrightHolder = br.ReadStringFixedAscii(32); SpeedNTSC = br.ReadUInt16(); br.Read(BankswitchInitValues, 0, 8); SpeedPAL = br.ReadUInt16(); byte temp = br.ReadByte(); if ((temp & 2) != 0) { IsNTSC = IsPAL = true; } else if ((temp & 1) != 0) { IsPAL = true; } else { IsNTSC = true; } ExtraChips = (eExtraChips)br.ReadByte(); }