fix bug in CUE processing resulting in final sectors of data track in mixed mode disc being kind of messed up
This commit is contained in:
parent
786cf97f0a
commit
6bfa842ad3
|
@ -321,7 +321,9 @@ namespace BizHawk.Emulation.DiscSystem
|
|||
toc_track.Indexes.Add(toc_index);
|
||||
if (index == 0)
|
||||
{
|
||||
toc_index.aba = track_disc_pregap_aba - (cue_track.Indexes[1].Timestamp.Sector - cue_track.Indexes[0].Timestamp.Sector);
|
||||
//zero 18-dec-2014 - uhhhh cant make sense of this.
|
||||
//toc_index.aba = track_disc_pregap_aba - (cue_track.Indexes[1].Timestamp.Sector - cue_track.Indexes[0].Timestamp.Sector);
|
||||
toc_index.aba = track_disc_pregap_aba;
|
||||
}
|
||||
else toc_index.aba = Sectors.Count;
|
||||
|
||||
|
|
|
@ -261,6 +261,13 @@ FILE ""xarp.barp.marp.farp"" BINARY
|
|||
int aba = 0;
|
||||
int dpIndex = 0;
|
||||
|
||||
//NOTE: discs may have subcode which is nonsense or possibly not recoverable from a sensible disc structure.
|
||||
//but this function does what it says.
|
||||
|
||||
//SO: heres the main idea of how this works.
|
||||
//we have the Structure.Points (whose name we dont like) which is a list of sectors where the tno/index changes.
|
||||
//So for each sector, we see if we've advanced to the next point.
|
||||
//TODO - check if this is synthesized correctly when producing a structure from a TOCRaw
|
||||
while (aba < Sectors.Count)
|
||||
{
|
||||
if (dpIndex < Structure.Points.Count - 1)
|
||||
|
@ -275,6 +282,11 @@ FILE ""xarp.barp.marp.farp"" BINARY
|
|||
var se = Sectors[aba];
|
||||
|
||||
EControlQ control = dp.Track.Control;
|
||||
bool pause = true;
|
||||
if (dp.Num != 0)
|
||||
pause = false;
|
||||
if ((dp.Track.Control & EControlQ.DataUninterrupted)!=0)
|
||||
pause = false;
|
||||
|
||||
//we always use ADR=1 (mode-1 q block)
|
||||
//this could be more sophisticated but it is almost useless for emulation (only useful for catalog/ISRC numbers)
|
||||
|
@ -299,6 +311,10 @@ FILE ""xarp.barp.marp.farp"" BINARY
|
|||
|
||||
var bss = new BufferedSubcodeSector();
|
||||
bss.Synthesize_SubchannelQ(ref sq, true);
|
||||
|
||||
//TEST: need this for psx?
|
||||
if(pause) bss.Synthesize_SubchannelP(true);
|
||||
|
||||
se.SubcodeSector = bss;
|
||||
|
||||
aba++;
|
||||
|
|
|
@ -23,6 +23,13 @@ namespace BizHawk.Emulation.DiscSystem
|
|||
/// </summary>
|
||||
class BufferedSubcodeSector : ISubcodeSector
|
||||
{
|
||||
public void Synthesize_SubchannelP(bool pause)
|
||||
{
|
||||
byte val = pause ? (byte)0xFF : (byte)0x00;
|
||||
for (int i = 0; i < 12; i++)
|
||||
SubcodeDeinterleaved[i] = val;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Fills this subcode buffer with subchannel Q data. calculates the required CRC, as well.
|
||||
/// Returns the crc, calculated or otherwise.
|
||||
|
|
|
@ -17,7 +17,10 @@ namespace BizHawk.Emulation.DiscSystem
|
|||
public List<Session> Sessions = new List<Session>();
|
||||
|
||||
/// <summary>
|
||||
/// List of Points described by the TOC
|
||||
/// List of Points described by the TOC.
|
||||
/// TODO - this is kind of garbage, but... I was using it for Synthesize_SubcodeFromStructure() :/
|
||||
/// Really, what it is, is a series of points where the tno/index change. Kind of an agenda. And thats how that function uses it.
|
||||
/// Maybe I should rename it something different, or at least comment it
|
||||
/// </summary>
|
||||
public List<TOCPoint> Points;
|
||||
|
||||
|
|
Loading…
Reference in New Issue