fix little bug in mednadisc loading
This commit is contained in:
parent
66eba89a94
commit
31267ce85a
|
@ -38,6 +38,7 @@ namespace BizHawk.Emulation.DiscSystem
|
||||||
crc.Add(disc.TOC.LastRecordedTrackNumber);
|
crc.Add(disc.TOC.LastRecordedTrackNumber);
|
||||||
for (int i = 1; i <= 100; i++)
|
for (int i = 1; i <= 100; i++)
|
||||||
{
|
{
|
||||||
|
//if (disc.TOC.TOCItems[i].Exists) Console.WriteLine("{0:X8} {1:X2} {2:X2} {3:X8}", crc.Current, (int)disc.TOC.TOCItems[i].Control, disc.TOC.TOCItems[i].Exists ? 1 : 0, disc.TOC.TOCItems[i].LBATimestamp.Sector); //a little debugging
|
||||||
crc.Add((int)disc.TOC.TOCItems[i].Control);
|
crc.Add((int)disc.TOC.TOCItems[i].Control);
|
||||||
crc.Add(disc.TOC.TOCItems[i].Exists ? 1 : 0);
|
crc.Add(disc.TOC.TOCItems[i].Exists ? 1 : 0);
|
||||||
crc.Add((int)disc.TOC.TOCItems[i].LBATimestamp.Sector);
|
crc.Add((int)disc.TOC.TOCItems[i].LBATimestamp.Sector);
|
||||||
|
|
|
@ -89,15 +89,17 @@ namespace BizHawk.Emulation.DiscSystem
|
||||||
q_crc = 0 //meaningless
|
q_crc = 0 //meaningless
|
||||||
};
|
};
|
||||||
|
|
||||||
//a special fixup: mednafen's entry 100 is the lead-out track
|
//a special fixup: mednafen's entry 100 is the lead-out track, so change it into the A2 raw toc entry
|
||||||
if (i == 100)
|
if (i == 100)
|
||||||
|
{
|
||||||
q.q_index.BCDValue = 0xA2;
|
q.q_index.BCDValue = 0xA2;
|
||||||
|
}
|
||||||
|
|
||||||
disc.RawTOCEntries.Add(new RawTOCEntry { QData = q });
|
disc.RawTOCEntries.Add(new RawTOCEntry { QData = q });
|
||||||
}
|
}
|
||||||
|
|
||||||
//synth A1 and A2 entries instead of setting FirstRecordedTrackNumber and LastRecordedTrackNumber below
|
//synth A0 and A1 entries (indicating first and last recorded tracks and also session type)
|
||||||
var qA1 = new SubchannelQ
|
var qA0 = new SubchannelQ
|
||||||
{
|
{
|
||||||
q_status = SubchannelQ.ComputeStatus(kADR, kUnknownControl),
|
q_status = SubchannelQ.ComputeStatus(kADR, kUnknownControl),
|
||||||
q_tno = BCD2.FromDecimal(0), //unknown with mednadisc
|
q_tno = BCD2.FromDecimal(0), //unknown with mednadisc
|
||||||
|
@ -107,12 +109,12 @@ namespace BizHawk.Emulation.DiscSystem
|
||||||
frame = BCD2.FromDecimal(0), //unknown with mednadisc
|
frame = BCD2.FromDecimal(0), //unknown with mednadisc
|
||||||
zero = 0, //unknown with mednadisc
|
zero = 0, //unknown with mednadisc
|
||||||
ap_min = BCD2.FromDecimal(md.TOC.first_track),
|
ap_min = BCD2.FromDecimal(md.TOC.first_track),
|
||||||
ap_sec = BCD2.FromDecimal(0),
|
ap_sec = BCD2.FromDecimal(md.TOC.disc_type),
|
||||||
ap_frame = BCD2.FromDecimal(0),
|
ap_frame = BCD2.FromDecimal(0),
|
||||||
q_crc = 0, //meaningless
|
q_crc = 0, //meaningless
|
||||||
};
|
};
|
||||||
disc.RawTOCEntries.Add(new RawTOCEntry { QData = qA1 });
|
disc.RawTOCEntries.Add(new RawTOCEntry { QData = qA0 });
|
||||||
var qA2 = new SubchannelQ
|
var qA1 = new SubchannelQ
|
||||||
{
|
{
|
||||||
q_status = SubchannelQ.ComputeStatus(kADR, kUnknownControl),
|
q_status = SubchannelQ.ComputeStatus(kADR, kUnknownControl),
|
||||||
q_tno = BCD2.FromDecimal(0), //unknown with mednadisc
|
q_tno = BCD2.FromDecimal(0), //unknown with mednadisc
|
||||||
|
@ -126,7 +128,7 @@ namespace BizHawk.Emulation.DiscSystem
|
||||||
ap_frame = BCD2.FromDecimal(0),
|
ap_frame = BCD2.FromDecimal(0),
|
||||||
q_crc = 0, //meaningless
|
q_crc = 0, //meaningless
|
||||||
};
|
};
|
||||||
disc.RawTOCEntries.Add(new RawTOCEntry { QData = qA2 });
|
disc.RawTOCEntries.Add(new RawTOCEntry { QData = qA1 });
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue