mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
DataArea width to long?
This commit is contained in:
@@ -255,11 +255,23 @@ namespace SabreTools.Library.DatFiles
|
||||
var dataArea = new DataArea
|
||||
{
|
||||
Name = reader.GetAttribute("name"),
|
||||
Size = Sanitizer.CleanSize(reader.GetAttribute("size")),
|
||||
Width = reader.GetAttribute("width"),
|
||||
Endianness = reader.GetAttribute("endianness").AsEndianness(),
|
||||
};
|
||||
|
||||
// Set the size
|
||||
if (reader.GetAttribute("size") != null)
|
||||
{
|
||||
if (Int64.TryParse(reader.GetAttribute("width"), out long size))
|
||||
dataArea.Size = size;
|
||||
}
|
||||
|
||||
// Set the width
|
||||
if (reader.GetAttribute("width") != null)
|
||||
{
|
||||
if (Int64.TryParse(reader.GetAttribute("width"), out long width))
|
||||
dataArea.Width = width;
|
||||
}
|
||||
|
||||
List<DatItem> roms = ReadDataArea(reader.ReadSubtree(), dataArea);
|
||||
|
||||
// If we got valid roms, add them to the list
|
||||
@@ -771,7 +783,7 @@ namespace SabreTools.Library.DatFiles
|
||||
xtw.WriteStartElement("dataarea");
|
||||
xtw.WriteRequiredAttributeString("name", dataAreaName);
|
||||
xtw.WriteOptionalAttributeString("size", rom.DataArea?.Size.ToString());
|
||||
xtw.WriteOptionalAttributeString("width", rom.DataArea?.Width);
|
||||
xtw.WriteOptionalAttributeString("width", rom.DataArea?.Width?.ToString());
|
||||
xtw.WriteOptionalAttributeString("endianness", rom.DataArea?.Endianness.FromEndianness());
|
||||
|
||||
xtw.WriteStartElement("rom");
|
||||
|
||||
Reference in New Issue
Block a user