allow mednadisc to use its own leadout track generator
This commit is contained in:
parent
e6e1716c02
commit
01987abac4
|
@ -41,19 +41,7 @@ namespace BizHawk.Emulation.DiscSystem
|
|||
|
||||
//this is the sole sector synthesizer we'll need
|
||||
var synth = new SS_MednaDisc();
|
||||
|
||||
//make sector interfaces:
|
||||
//1. mandatory track 1 pregap
|
||||
for (int i = 0; i < 150; i++)
|
||||
{
|
||||
disc._Sectors.Add(synth);
|
||||
}
|
||||
|
||||
//2. actual sectors
|
||||
for (int i = 0; i < nSectors; i++)
|
||||
{
|
||||
disc._Sectors.Add(synth);
|
||||
}
|
||||
OUT_Disc.SynthProvider = new SimpleSectorSynthProvider() { SS = synth };
|
||||
|
||||
//ADR (q-Mode) is necessarily 0x01 for a RawTOCEntry
|
||||
const int kADR = 1;
|
||||
|
|
|
@ -65,14 +65,6 @@ namespace BizHawk.Emulation.DiscSystem
|
|||
{
|
||||
OUT_Disc.Name = Path.GetFileName(IN_FromPath);
|
||||
|
||||
//setup the lowest level synth provider
|
||||
var sssp = new SimpleSectorSynthProvider()
|
||||
{
|
||||
Sectors = OUT_Disc._Sectors,
|
||||
FirstLBA = -150
|
||||
};
|
||||
OUT_Disc.SynthProvider = sssp;
|
||||
|
||||
//generate toc and structure:
|
||||
//1. TOCRaw from RawTOCEntries
|
||||
var tocSynth = new Synthesize_DiscTOC_From_RawTOCEntries_Job() { Entries = OUT_Disc.RawTOCEntries };
|
||||
|
@ -84,13 +76,17 @@ namespace BizHawk.Emulation.DiscSystem
|
|||
OUT_Disc.Structure = structureSynth.Result;
|
||||
|
||||
//insert a synth provider to take care of the leadout track
|
||||
var ss_leadout = new SS_Leadout()
|
||||
//currently, we let mednafen take care of its own leadout track (we'll make that controllable later)
|
||||
if (IN_DiscInterface != DiscInterface.MednaDisc)
|
||||
{
|
||||
SessionNumber = 1,
|
||||
Policy = IN_DiscMountPolicy
|
||||
};
|
||||
Func<int,bool> condition = (int lba) => lba >= OUT_Disc.Session1.LeadoutLBA;
|
||||
new ConditionalSectorSynthProvider().Install(OUT_Disc, condition, ss_leadout);
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
FinishLog();
|
||||
|
@ -185,6 +181,14 @@ namespace BizHawk.Emulation.DiscSystem
|
|||
}
|
||||
|
||||
DONE: ;
|
||||
|
||||
//setup the lowest level synth provider
|
||||
var sssp = new ArraySectorSynthProvider()
|
||||
{
|
||||
Sectors = OUT_Disc._Sectors,
|
||||
FirstLBA = -150
|
||||
};
|
||||
OUT_Disc.SynthProvider = sssp;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -125,7 +125,7 @@ namespace BizHawk.Emulation.DiscSystem
|
|||
/// <summary>
|
||||
/// an ISectorSynthProvider that just returns a value from an array of pre-made sectors
|
||||
/// </summary>
|
||||
class SimpleSectorSynthProvider : ISectorSynthProvider
|
||||
class ArraySectorSynthProvider : ISectorSynthProvider
|
||||
{
|
||||
public List<ISectorSynthJob2448> Sectors = new List<ISectorSynthJob2448>();
|
||||
public int FirstLBA;
|
||||
|
@ -137,6 +137,16 @@ namespace BizHawk.Emulation.DiscSystem
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// an ISectorSynthProvider that just returns a fixed synthesizer
|
||||
/// </summary>
|
||||
class SimpleSectorSynthProvider : ISectorSynthProvider
|
||||
{
|
||||
public ISectorSynthJob2448 SS;
|
||||
|
||||
public ISectorSynthJob2448 Get(int lba) { return SS; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns 'Patch' synth if the provided condition is met
|
||||
/// </summary>
|
||||
|
|
Loading…
Reference in New Issue