From c04bb9d0705c2882feb5129e263ecd32f287ad2d Mon Sep 17 00:00:00 2001 From: gjefferyes Date: Thu, 11 Jun 2015 10:12:36 -0500 Subject: [PATCH] Fixed a baddump merging issue (Thanks to Marco for the details to fix this.) --- ROMVault2/DatReaders/DatReader.cs | 12 ++++++++++-- ROMVault2/Program.cs | 2 +- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/ROMVault2/DatReaders/DatReader.cs b/ROMVault2/DatReaders/DatReader.cs index 7e11135..8f620b9 100644 --- a/ROMVault2/DatReaders/DatReader.cs +++ b/ROMVault2/DatReaders/DatReader.cs @@ -270,6 +270,10 @@ namespace ROMVault2.DatReaders // loop the ROMs in the parent sets for (int r1 = 0; r1 < romofGame.ChildCount; r1++) { + // don't search fixes for files marked as nodump + if (((RvFile)mGame.Child(r)).Status == "nodump" || ((RvFile)romofGame.Child(r1)).Status == "nodump") + continue; + // only find fixes if the Name and the Size of the ROMs are the same if (mGame.Child(r).Name != romofGame.Child(r1).Name || ((RvFile)mGame.Child(r)).Size != ((RvFile)romofGame.Child(r1)).Size) continue; @@ -285,11 +289,13 @@ namespace ROMVault2.DatReaders if (b1) { ((RvFile)mGame.Child(r)).CRC = ((RvFile)romofGame.Child(r1)).CRC; + ((RvFile)mGame.Child(r)).FileStatusSet(FileStatus.CRCFromDAT); ((RvFile)mGame.Child(r)).Status = "(CRCFound)"; } else { ((RvFile)romofGame.Child(r1)).CRC = ((RvFile)mGame.Child(r)).CRC; + ((RvFile)romofGame.Child(r1)).FileStatusSet(FileStatus.CRCFromDAT); ((RvFile)romofGame.Child(r1)).Status = "(CRCFound)"; } @@ -428,6 +434,8 @@ namespace ROMVault2.DatReaders byte[] chdMD51 = ((RvFile)romofGame.Child(r1)).MD5CHD; if (chdMD50 != null && chdMD51 != null && !ArrByte.bCompare(chdMD50, chdMD51)) continue; + // don't merge if only one of the ROM is nodump + if ((((RvFile)romofGame.Child(r1)).Status == "nodump") != (((RvFile)mGame.Child(r)).Status == "nodump")) continue; found = true; break; @@ -446,9 +454,9 @@ namespace ROMVault2.DatReaders return; string parentName = searchGame.Game.GetData(RvGame.GameData.RomOf); - if (String.IsNullOrEmpty(parentName) || parentName==searchGame.Name) + if (String.IsNullOrEmpty(parentName) || parentName == searchGame.Name) parentName = searchGame.Game.GetData(RvGame.GameData.CloneOf); - if (String.IsNullOrEmpty(parentName) || parentName==searchGame.Name) + if (String.IsNullOrEmpty(parentName) || parentName == searchGame.Name) return; int intIndex; diff --git a/ROMVault2/Program.cs b/ROMVault2/Program.cs index e91778d..90505e3 100644 --- a/ROMVault2/Program.cs +++ b/ROMVault2/Program.cs @@ -15,7 +15,7 @@ namespace ROMVault2 //public static UsernamePassword Up; public static readonly Encoding Enc = Encoding.GetEncoding(28591); public const string Version = "2.2"; - public const int SubVersion = 2; + public const int SubVersion = 3; public static string ErrorMessage; public static string URL;