From 87cd0730e6e9d708b6998f859984c844d99d7912 Mon Sep 17 00:00:00 2001 From: zeromus Date: Sat, 14 May 2011 20:14:21 +0000 Subject: [PATCH] disc: clarify behaviour of ReadLBA --- BizHawk.Emulation/Disc/Disc.cs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/BizHawk.Emulation/Disc/Disc.cs b/BizHawk.Emulation/Disc/Disc.cs index ae1c65a383..e9fdd3813c 100644 --- a/BizHawk.Emulation/Disc/Disc.cs +++ b/BizHawk.Emulation/Disc/Disc.cs @@ -283,10 +283,19 @@ namespace BizHawk.Disc } } - //main api for reading a 2352-byte LBA from a disc - public void ReadLBA(int fad, byte[] buffer, int offset) + //main api for reading a 2352-byte LBA from a disc. + //this starts at the beginning of the disc (at the lead-in) + //so add 150 to get to a FAD-address in the user data area + public void ReadLBA(int lba, byte[] buffer, int offset) { - Sectors[fad].Sector.Read(buffer, offset); + if (lba < 150) { + //lead-in area not supported yet + //in the future it will return something to mate with the + //subchannel data which we will load or calculate from the TOC + return; + } + + Sectors[lba-150].Sector.Read(buffer, offset); } //main api for reading the TOC from a disc