Ejemplo n.º 1
0
		public void Run()
		{
			switch (IN_DiscInterface)
			{
				case DiscInterface.LibMirage:
					throw new NotSupportedException("LibMirage not supported yet");
				case DiscInterface.BizHawk:
					RunBizHawk();
					break;
				case DiscInterface.MednaDisc:
					RunMednaDisc();
					break;
			}

			if (OUT_Disc != null)
			{
				OUT_Disc.Name = Path.GetFileName(IN_FromPath);

				//generate toc and structure:
				//1. TOCRaw from RawTOCEntries
				var tocSynth = new Synthesize_DiscTOC_From_RawTOCEntries_Job() { Entries = OUT_Disc.RawTOCEntries };
				tocSynth.Run();
				OUT_Disc.TOC = tocSynth.Result;
				//2. Structure from TOCRaw
				var structureSynth = new Synthesize_DiscStructure_From_DiscTOC_Job() { IN_Disc = OUT_Disc, TOCRaw = OUT_Disc.TOC };
				structureSynth.Run();
				OUT_Disc.Structure = structureSynth.Result;

				//insert a synth provider to take care of the leadout track
				//currently, we let mednafen take care of its own leadout track (we'll make that controllable later)
				if (IN_DiscInterface != DiscInterface.MednaDisc)
				{
					var ss_leadout = new SS_Leadout()
					{
						SessionNumber = 1,
						Policy = IN_DiscMountPolicy
					};
					Func<int, bool> condition = (int lba) => lba >= OUT_Disc.Session1.LeadoutLBA;
					new ConditionalSectorSynthProvider().Install(OUT_Disc, condition, ss_leadout);
				}

				//apply SBI if it exists
				var sbiPath = Path.ChangeExtension(IN_FromPath, ".sbi");
				if (File.Exists(sbiPath) && SBI.SBIFormat.QuickCheckISSBI(sbiPath))
				{
					var loadSbiJob = new SBI.LoadSBIJob() { IN_Path = sbiPath };
					loadSbiJob.Run();
					var applySbiJob = new ApplySBIJob();
					applySbiJob.Run(OUT_Disc, loadSbiJob.OUT_Data, IN_DiscMountPolicy.SBI_As_Mednafen);
				}
			}

			FinishLog();
		}
Ejemplo n.º 2
0
        public void Run()
        {
            switch (IN_DiscInterface)
            {
            case DiscInterface.LibMirage:
                throw new NotSupportedException("LibMirage not supported yet");

            case DiscInterface.BizHawk:
                RunBizHawk();
                break;

            case DiscInterface.MednaDisc:
                RunMednaDisc();
                break;
            }

            if (OUT_Disc != null)
            {
                OUT_Disc.Name = Path.GetFileName(IN_FromPath);

                //generate toc and structure:
                //1. TOCRaw from RawTOCEntries
                var tocSynth = new Synthesize_DiscTOC_From_RawTOCEntries_Job()
                {
                    Entries = OUT_Disc.RawTOCEntries
                };
                tocSynth.Run();
                OUT_Disc.TOC = tocSynth.Result;
                //2. Structure from TOCRaw
                var structureSynth = new Synthesize_DiscStructure_From_DiscTOC_Job()
                {
                    IN_Disc = OUT_Disc, TOCRaw = OUT_Disc.TOC
                };
                structureSynth.Run();
                OUT_Disc.Structure = structureSynth.Result;

                //insert a synth provider to take care of the leadout track
                //currently, we let mednafen take care of its own leadout track (we'll make that controllable later)
                if (IN_DiscInterface != DiscInterface.MednaDisc)
                {
                    var ss_leadout = new SS_Leadout()
                    {
                        SessionNumber = 1,
                        Policy        = IN_DiscMountPolicy
                    };
                    Func <int, bool> condition = (int lba) => lba >= OUT_Disc.Session1.LeadoutLBA;
                    new ConditionalSectorSynthProvider().Install(OUT_Disc, condition, ss_leadout);
                }

                //apply SBI if it exists
                var sbiPath = Path.ChangeExtension(IN_FromPath, ".sbi");
                if (File.Exists(sbiPath) && SBI.SBIFormat.QuickCheckISSBI(sbiPath))
                {
                    var loadSbiJob = new SBI.LoadSBIJob()
                    {
                        IN_Path = sbiPath
                    };
                    loadSbiJob.Run();
                    var applySbiJob = new ApplySBIJob();
                    applySbiJob.Run(OUT_Disc, loadSbiJob.OUT_Data, IN_DiscMountPolicy.SBI_As_Mednafen);
                }
            }

            FinishLog();
        }