Esempio n. 1
0
 /// <summary>
 /// Reads in the content of the TZX file so that it can be played
 /// </summary>
 /// <returns>True, if read was successful; otherwise, false</returns>
 public override bool ReadContent()
 {
     var success = base.ReadContent();
     var blocks = DataBlocks.Where(b => b is ISupportsTapeBlockPlayback)
         .Cast<ISupportsTapeBlockPlayback>()
         .ToList();
     _player = new TapeBlockSetPlayer(blocks);
     return success;
 }
Esempio n. 2
0
        public int GetSectionOffset(int section)
        {
            if (section < 0 || section >= SectionCount)
            {
                throw new ArgumentOutOfRangeException(nameof(section));
            }

            //treat 0 as being the header
            if (section == 0)
            {
                return(0);
            }

            var totalPrevious = DataBlocks.Where(b => b.Section < section).Sum(b => b.Size);

            return(Header.HeaderSize + totalPrevious);
        }