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
|
//this is the sole sector synthesizer we'll need
|
||||||
var synth = new SS_MednaDisc();
|
var synth = new SS_MednaDisc();
|
||||||
|
OUT_Disc.SynthProvider = new SimpleSectorSynthProvider() { SS = synth };
|
||||||
//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);
|
|
||||||
}
|
|
||||||
|
|
||||||
//ADR (q-Mode) is necessarily 0x01 for a RawTOCEntry
|
//ADR (q-Mode) is necessarily 0x01 for a RawTOCEntry
|
||||||
const int kADR = 1;
|
const int kADR = 1;
|
||||||
|
|
|
@ -65,14 +65,6 @@ namespace BizHawk.Emulation.DiscSystem
|
||||||
{
|
{
|
||||||
OUT_Disc.Name = Path.GetFileName(IN_FromPath);
|
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:
|
//generate toc and structure:
|
||||||
//1. TOCRaw from RawTOCEntries
|
//1. TOCRaw from RawTOCEntries
|
||||||
var tocSynth = new Synthesize_DiscTOC_From_RawTOCEntries_Job() { Entries = OUT_Disc.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;
|
OUT_Disc.Structure = structureSynth.Result;
|
||||||
|
|
||||||
//insert a synth provider to take care of the leadout track
|
//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,
|
var ss_leadout = new SS_Leadout()
|
||||||
Policy = IN_DiscMountPolicy
|
{
|
||||||
};
|
SessionNumber = 1,
|
||||||
Func<int,bool> condition = (int lba) => lba >= OUT_Disc.Session1.LeadoutLBA;
|
Policy = IN_DiscMountPolicy
|
||||||
new ConditionalSectorSynthProvider().Install(OUT_Disc, condition, ss_leadout);
|
};
|
||||||
|
Func<int, bool> condition = (int lba) => lba >= OUT_Disc.Session1.LeadoutLBA;
|
||||||
|
new ConditionalSectorSynthProvider().Install(OUT_Disc, condition, ss_leadout);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FinishLog();
|
FinishLog();
|
||||||
|
@ -185,6 +181,14 @@ namespace BizHawk.Emulation.DiscSystem
|
||||||
}
|
}
|
||||||
|
|
||||||
DONE: ;
|
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>
|
/// <summary>
|
||||||
/// an ISectorSynthProvider that just returns a value from an array of pre-made sectors
|
/// an ISectorSynthProvider that just returns a value from an array of pre-made sectors
|
||||||
/// </summary>
|
/// </summary>
|
||||||
class SimpleSectorSynthProvider : ISectorSynthProvider
|
class ArraySectorSynthProvider : ISectorSynthProvider
|
||||||
{
|
{
|
||||||
public List<ISectorSynthJob2448> Sectors = new List<ISectorSynthJob2448>();
|
public List<ISectorSynthJob2448> Sectors = new List<ISectorSynthJob2448>();
|
||||||
public int FirstLBA;
|
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>
|
/// <summary>
|
||||||
/// Returns 'Patch' synth if the provided condition is met
|
/// Returns 'Patch' synth if the provided condition is met
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
Loading…
Reference in New Issue