From cd65961b53c90b2fb60c51871d9eab6a4cad42a2 Mon Sep 17 00:00:00 2001 From: beirich Date: Mon, 15 Aug 2011 04:22:54 +0000 Subject: [PATCH] fixed subcode stuff and a stupid bug in CDAudio.cs --- BizHawk.Emulation/Consoles/PC Engine/ScsiCDBus.cs | 8 ++------ BizHawk.Emulation/Sound/CDAudio.cs | 4 ++-- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/BizHawk.Emulation/Consoles/PC Engine/ScsiCDBus.cs b/BizHawk.Emulation/Consoles/PC Engine/ScsiCDBus.cs index 718fe1328e..6e8ca05af5 100644 --- a/BizHawk.Emulation/Consoles/PC Engine/ScsiCDBus.cs +++ b/BizHawk.Emulation/Consoles/PC Engine/ScsiCDBus.cs @@ -497,8 +497,7 @@ throw new Exception("requesting 0 sectors read............................."); private void CommandReadSubcodeQ() { //TODO VECNA - i changed this for you but maybe i did it wrong - var sectorEntry = disc.ReadSectorEntry(CurrentReadingSector); - + var sectorEntry = disc.ReadSectorEntry(pce.CDAudio.CurrentSector); DataIn.Clear(); @@ -510,10 +509,7 @@ throw new Exception("requesting 0 sectors read............................."); } DataIn.Enqueue(sectorEntry.q_status); // unused? - - //DataIn.Enqueue((byte)pce.CDAudio.PlayingTrack); // track //vecna's - DataIn.Enqueue(sectorEntry.q_tno.BCDValue); // track //zero's - + DataIn.Enqueue(sectorEntry.q_tno.BCDValue); // track DataIn.Enqueue(sectorEntry.q_index.BCDValue); // index DataIn.Enqueue(sectorEntry.q_min.BCDValue); // M(rel) DataIn.Enqueue(sectorEntry.q_sec.BCDValue); // S(rel) diff --git a/BizHawk.Emulation/Sound/CDAudio.cs b/BizHawk.Emulation/Sound/CDAudio.cs index 9621a1d3db..b854117261 100644 --- a/BizHawk.Emulation/Sound/CDAudio.cs +++ b/BizHawk.Emulation/Sound/CDAudio.cs @@ -36,7 +36,7 @@ namespace BizHawk.Emulation.Sound public int StartLBA, EndLBA; public int PlayingTrack; - private int CurrentSector, SectorOffset; // Offset is in SAMPLES, not bytes. Sector is 588 samples long. + public int CurrentSector, SectorOffset; // Offset is in SAMPLES, not bytes. Sector is 588 samples long. private int CachedSector; private byte[] SectorCache = new byte[2352]; @@ -74,7 +74,7 @@ namespace BizHawk.Emulation.Sound if (lba >= trackStart && lba < trackEnd) { foundTrack = true; - StartLBA = trackStart; + StartLBA = lba; EndLBA = trackEnd; break; }