From 722459177f2d04717d9e6df542e8c716ac95b224 Mon Sep 17 00:00:00 2001 From: Jean-Philip Desjardins Date: Sat, 22 Jul 2017 12:46:06 -0400 Subject: [PATCH] Tweak dual layer detection heuristic. Was not working with Wild Arms: Alter Code F. --- Source/OpticalMedia.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Source/OpticalMedia.cpp b/Source/OpticalMedia.cpp index bc1e285f..283cc7c6 100644 --- a/Source/OpticalMedia.cpp +++ b/Source/OpticalMedia.cpp @@ -66,7 +66,11 @@ void COpticalMedia::CheckDualLayerDvd(const StreamPtr& stream) //We need to look for the start of the second layer //The second layer is at most as big as the first one, so //we can start looking from half of the disk image - auto searchBlockAddress = imageBlockCount / 2; + + //NOTE: Wild Arms: Alter Code F seems to have a second layer that's a bit + //larger than the first one? That's why we start looking at 15 / 32 of the image's size + + auto searchBlockAddress = imageBlockCount * 15 / 32; stream->Seek(static_cast(searchBlockAddress) * blockSize, Framework::STREAM_SEEK_SET); //Scan all blocks from the search point, looking for a valid ISO9660 descriptor