mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Fix new SL dats
New SL dats have the size in the dataarea tag and NOT the rom tag. This should fix the issues from that.
This commit is contained in:
@@ -449,8 +449,23 @@ namespace SabreTools.Helper
|
||||
}
|
||||
|
||||
// Get the roms from the machine
|
||||
long dataAreaSize = -1;
|
||||
switch (subreader.Name)
|
||||
{
|
||||
case "dataarea":
|
||||
if (xtr.GetAttribute("size") == null)
|
||||
{
|
||||
dataAreaSize = -1;
|
||||
}
|
||||
else if (xtr.GetAttribute("size") != null && xtr.GetAttribute("size").Contains("0x"))
|
||||
{
|
||||
dataAreaSize = Convert.ToInt64(xtr.GetAttribute("size"), 16);
|
||||
}
|
||||
else if (xtr.GetAttribute("size") != null)
|
||||
{
|
||||
Int64.TryParse(xtr.GetAttribute("size"), out dataAreaSize);
|
||||
}
|
||||
break;
|
||||
case "rom":
|
||||
case "disk":
|
||||
// If the rom is nodump, skip it
|
||||
@@ -460,8 +475,16 @@ namespace SabreTools.Helper
|
||||
break;
|
||||
}
|
||||
|
||||
// Take care of hex-sized files
|
||||
// If the size was in the dataarea, use that instead
|
||||
long size = -1;
|
||||
if (dataAreaSize != -1)
|
||||
{
|
||||
size = dataAreaSize;
|
||||
dataAreaSize = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Take care of hex-sized files
|
||||
if (xtr.GetAttribute("size") != null && xtr.GetAttribute("size").Contains("0x"))
|
||||
{
|
||||
size = Convert.ToInt64(xtr.GetAttribute("size"), 16);
|
||||
@@ -470,6 +493,7 @@ namespace SabreTools.Helper
|
||||
{
|
||||
Int64.TryParse(xtr.GetAttribute("size"), out size);
|
||||
}
|
||||
}
|
||||
|
||||
// Sanitize the hashes from null, hex sizes, and "true blank" strings
|
||||
string crc = (xtr.GetAttribute("crc") != null ? xtr.GetAttribute("crc").ToLowerInvariant().Trim() : "");
|
||||
|
||||
Reference in New Issue
Block a user