fixed loading the mame 0.162 dat's using the 'machine' xml node.

This commit is contained in:
gjefferyes
2015-06-10 09:45:03 -05:00
parent b368f33351
commit 32f67308fa
3 changed files with 20 additions and 19 deletions

View File

@@ -28,20 +28,16 @@ namespace ROMVault2.DatReaders
XmlNodeList dirNodeList = doc.DocumentElement.SelectNodes("dir"); XmlNodeList dirNodeList = doc.DocumentElement.SelectNodes("dir");
if (dirNodeList != null) if (dirNodeList != null)
{ {
for (int i = 0; i < dirNodeList.Count; i++) foreach (XmlNode dirNode in dirNodeList)
{ LoadDirFromDat(ref tDat, dirNode, thisFileType);
LoadDirFromDat(ref tDat, dirNodeList[i], thisFileType);
}
} }
XmlNodeList gameNodeList = doc.DocumentElement.SelectNodes("game"); XmlNodeList gameNodeList = doc.DocumentElement.SelectNodes("game");
if (gameNodeList != null) if (gameNodeList != null)
{ {
for (int i = 0; i < gameNodeList.Count; i++) foreach (XmlNode gameNode in gameNodeList)
{ LoadGameFromDat(ref tDat, gameNode, thisFileType);
LoadGameFromDat(ref tDat, gameNodeList[i], thisFileType);
}
} }
return true; return true;
@@ -60,22 +56,27 @@ namespace ROMVault2.DatReaders
XmlNodeList dirNodeList = doc.DocumentElement.SelectNodes("dir"); XmlNodeList dirNodeList = doc.DocumentElement.SelectNodes("dir");
if (dirNodeList != null) if (dirNodeList != null)
{ {
for (int i = 0; i < dirNodeList.Count; i++) foreach (XmlNode dirNode in dirNodeList)
{ LoadDirFromDat(ref tDat, dirNode, thisFileType);
LoadDirFromDat(ref tDat, dirNodeList[i], thisFileType);
}
} }
XmlNodeList gameNodeList = doc.DocumentElement.SelectNodes("game"); XmlNodeList gameNodeList = doc.DocumentElement.SelectNodes("game");
if (gameNodeList != null) if (gameNodeList != null)
{ {
for (int i = 0; i < gameNodeList.Count; i++) foreach (XmlNode gameNode in gameNodeList)
{ LoadGameFromDat(ref tDat, gameNode, thisFileType);
LoadGameFromDat(ref tDat, gameNodeList[i], thisFileType);
}
} }
XmlNodeList machineNodeList = doc.DocumentElement.SelectNodes("machine");
if (machineNodeList != null)
{
foreach (XmlNode machineNode in machineNodeList)
LoadGameFromDat(ref tDat, machineNode, thisFileType);
}
return true; return true;
} }
@@ -149,7 +150,7 @@ namespace ROMVault2.DatReaders
} }
val = VarFix.String(packingNode.Attributes.GetNamedItem("dir")).ToLower(); // noautodir , nogame val = VarFix.String(packingNode.Attributes.GetNamedItem("dir")).ToLower(); // noautodir , nogame
if (!String.IsNullOrEmpty(val)) if (!String.IsNullOrEmpty(val))
tDat.AddData(RvDat.DatData.DirSetup,val); tDat.AddData(RvDat.DatData.DirSetup, val);
} }
} }

View File

@@ -15,7 +15,7 @@ namespace ROMVault2
//public static UsernamePassword Up; //public static UsernamePassword Up;
public static readonly Encoding Enc = Encoding.GetEncoding(28591); public static readonly Encoding Enc = Encoding.GetEncoding(28591);
public const string Version = "2.2"; public const string Version = "2.2";
public const int SubVersion = 1; public const int SubVersion = 2;
public static string ErrorMessage; public static string ErrorMessage;
public static string URL; public static string URL;

View File

@@ -35,7 +35,7 @@
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType> <DebugType>full</DebugType>
<Optimize>false</Optimize> <Optimize>false</Optimize>
<OutputPath>Stage\</OutputPath> <OutputPath>..\..\Stage\</OutputPath>
<DefineConstants>TRACE;DEBUG;UNMANAGED;COMPRESS;LZMA_STREAM;DOTNET20</DefineConstants> <DefineConstants>TRACE;DEBUG;UNMANAGED;COMPRESS;LZMA_STREAM;DOTNET20</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>