コード例 #1
0
ファイル: NSFFormat.cs プロジェクト: CadeLaRen/BizHawk
		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();
		}
コード例 #2
0
        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();
        }