Inheritance: DiskInfo
Exemple #1
0
 public void RegisterForFlush(Disk disk)
 {
     this._flusher.QueueToFlush(disk);
 }
Exemple #2
0
        public void LoadDisk(int driveIndex, Disk disk)
        {
            if (!this._uiDispatcher.CheckAccess())
            {
                this._uiDispatcher.Invoke(new Action(() => LoadDisk(driveIndex, disk)));
                return;
            }

            var loadedDrive = this._configuration.Drives.SingleOrDefault(dr => dr.HasMedia && dr.Media.Disk.Filename == disk.Filename);
            if (loadedDrive != null)
            {
                loadedDrive.Eject();
            }
            var libraryDisk = this._configuration.Library.Disks.SingleOrDefault(d => d.Disk.Filename == disk.Filename);
            if (libraryDisk != null)
            {
                this._configuration.Library.RemoveDisk(libraryDisk);
            }
            var newDisk = this._configuration.Library.AddSpecificDisk(disk);
            this._configuration.Drives[driveIndex].LoadMedia(newDisk);
        }
        public BuildOutput Build(IBuildManager manager, ISolution solution, IProject project, IBuildProgressMonitor monitor)
        {
            var watch = new Stopwatch();
            var entries = new List<DiskEntry>();
            var buildSvc = this._workspace.GetService<ISimpleFileBuildService>();
            var msgs = new List<ICompileMessage>();
            var projPath = Path.GetDirectoryName(project.AbsolutePath);
            var fname = Path.Combine(projPath, project.GetProperty("outputFilename"));

            watch.Start();

            foreach (var file in project.Files)
            {
                DiskEntry newEntry;
                var fet = file.GetProperty("disk.entryTypeName");
                var op = buildSvc.Build(manager, solution, project, file, monitor, false);
                ushort[] words = op.Words;

                msgs.AddRange(op.Messages);

                if (!op.Success || words == null)
                {
                    monitor.StatusUpdate("Build failed for " + file.AbsolutePath);
                    return new BuildOutput { Success = false, Time = watch.Elapsed, Messages = msgs };
                }

                switch (fet)
                {
                    case "sector":
                        newEntry = new SpecificSectorDiskEntry { Name = file.Path, Sector = int.Parse(file.GetProperty("disk.index") ?? "0"), Words = words };
                        break;

                    case "offset":
                        newEntry = new SpecificOffsetDiskEntry { Name = file.Path, Offset = int.Parse(file.GetProperty("disk.index") ?? "0"), Words = words };
                        break;

                    case null:
                    case "":
                    case "fileSystem":
                        newEntry = new FileSystemDiskEntry { Name = file.Path, Path = file.Path, Words = words };
                        break;

                    default:
                        continue;
                }

                entries.Add(newEntry);
            }

            var disk = new Disk(this._plugin, project.Name, fname);
            disk.Compress = bool.Parse(project.GetProperty("compress") ?? "true");

            var provider = this._workspace.GetServices<IDiskFormatProvider>().Single(df => df.FormatName == project.GetProperty("filesystem.type"));
            provider.BuildDisk(disk, entries);

            disk.Save();

            watch.Stop();

            if (bool.Parse(project.GetProperty("autoLoad.enabled") ?? "false"))
            {
                int driveIndex = int.Parse(project.GetProperty("autoLoad.drive") ?? "0");
                this._plugin.LoadDisk(driveIndex, disk);
            }

            return new BuildOutput
                       {
                           CodeModel = null,
                           DebugInfo = null,
                           Messages = msgs,
                           Success = true,
                           Time = watch.Elapsed,
                           Words = disk.GetData()
                       };
        }
Exemple #4
0
 void IDriveSystem.LoadDisk(int driveIndex, Disk disk)
 {
     this._drives[driveIndex].ChangeMedia(disk);
 }
Exemple #5
0
        public void ChangeMedia(Disk disk)
        {
            this._currentDisk = disk;
            this._currentHeadSector = 0;

            if (this.MediaStatusInterruptFlag)
            {
                RaiseInterrupt(InterruptType.MEDIA_STATUS);
            }
        }