コード例 #1
0
        protected Gap[] GetNormalizedGaps(TrackSide track, int maxSize)
        {
            Gap[] gaps = new Gap[5];
            track.gaps[0].Size += 4;    // adding 4 equals the gap to openMSX/DskPro
            for (int i = 0; i < 5; i++)
            {
                gaps[i] = new Gap(track.gaps[i]);
            }
            int trackSize = GetTrackSize(track);
            int oversize  = trackSize - maxSize;

            if (oversize > 0)
            {
                oversize -= reduceGaps(oversize, gaps, new int[] { 4 }, new int[] { 100 });
            }
            if (oversize > 0)
            {
                int sectors = track.sectors.Count;
                if (sectors > 0)
                {
                    oversize -= (sectors * reduceGaps((oversize / sectors) + 1, gaps, new int[] { 3, 2 }, new int[] { 20, 20 }));
                }
            }
            if (oversize > 0)
            {
                // Utils.Multiprint(String.Format("Can't reduce track {0}, head {1} from {2} to {3}", track.physicalTrackNr, track.HeadNr, trackSize, maxSize),true);
            }
            if (oversize < 0)
            {
                gaps[4].Size -= oversize;   // just put any oversize in the lead out gap
            }
            return(gaps);
        }
コード例 #2
0
ファイル: TrackSide.cs プロジェクト: tcm1998/Dis
 public TrackSide()
 {
     gaps = new Gap[5];
     for (int i = 0; i < 5; i++)
     {
         gaps[i] = new Gap();
     }
     sectors = new List <SectorInfo>();
 }
コード例 #3
0
 protected void WriteGap(BinaryWriter writer, Gap gap)
 {
     WriteBytes(writer, gap.Filler, gap.Size);
 }
コード例 #4
0
 public Gap(Gap gap)
 {
     Size   = gap.Size;
     Filler = gap.Filler;
 }