mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Convert Rom size field to long?
This commit is contained in:
@@ -478,7 +478,7 @@ namespace SabreTools.Library.FileTypes
|
||||
.Concat(Utilities.StringToByteArray(rom.CRC)) // CRC
|
||||
.ToArray();
|
||||
sw.Write(data);
|
||||
sw.Write((ulong)rom.Size); // Long size (Unsigned, Mirrored)
|
||||
sw.Write((ulong)(rom.Size ?? 0)); // Long size (Unsigned, Mirrored)
|
||||
|
||||
// Now create a deflatestream from the input file
|
||||
ZlibBaseStream ds = new ZlibBaseStream(outputStream, CompressionMode.Compress, CompressionLevel.BestCompression, ZlibStreamFlavor.DEFLATE, true);
|
||||
@@ -496,7 +496,7 @@ namespace SabreTools.Library.FileTypes
|
||||
|
||||
// Now write the standard footer
|
||||
sw.Write(Utilities.StringToByteArray(rom.CRC).Reverse().ToArray());
|
||||
sw.Write((uint)rom.Size);
|
||||
sw.Write((uint)(rom.Size ?? 0));
|
||||
|
||||
// Dispose of everything
|
||||
sw.Dispose();
|
||||
|
||||
@@ -342,7 +342,7 @@ namespace SabreTools.Library.FileTypes
|
||||
|
||||
// Copy the input stream to the output
|
||||
inputStream.Seek(0, SeekOrigin.Begin);
|
||||
tarFile.AddEntry(rom.Name, inputStream, size: rom.Size, modified: usableDate);
|
||||
tarFile.AddEntry(rom.Name, inputStream, size: rom.Size ?? 0, modified: usableDate);
|
||||
}
|
||||
|
||||
// Otherwise, sort the input files and write out in the correct order
|
||||
@@ -394,7 +394,7 @@ namespace SabreTools.Library.FileTypes
|
||||
{
|
||||
// Copy the input file to the output
|
||||
inputStream.Seek(0, SeekOrigin.Begin);
|
||||
tarFile.AddEntry(rom.Name, inputStream, size: rom.Size, modified: usableDate);
|
||||
tarFile.AddEntry(rom.Name, inputStream, size: rom.Size ?? 0, modified: usableDate);
|
||||
}
|
||||
|
||||
// Otherwise, copy the file from the old archive
|
||||
@@ -514,7 +514,7 @@ namespace SabreTools.Library.FileTypes
|
||||
}
|
||||
|
||||
// Copy the input stream to the output
|
||||
tarFile.AddEntry(roms[index].Name, FileExtensions.TryOpenRead(inputFiles[index]), size: roms[index].Size, modified: usableDate);
|
||||
tarFile.AddEntry(roms[index].Name, FileExtensions.TryOpenRead(inputFiles[index]), size: roms[index].Size ?? 0, modified: usableDate);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -574,7 +574,7 @@ namespace SabreTools.Library.FileTypes
|
||||
}
|
||||
|
||||
// Copy the input file to the output
|
||||
tarFile.AddEntry(roms[-index - 1].Name, FileExtensions.TryOpenRead(inputFiles[-index - 1]), size: roms[-index - 1].Size, modified: usableDate);
|
||||
tarFile.AddEntry(roms[-index - 1].Name, FileExtensions.TryOpenRead(inputFiles[-index - 1]), size: roms[-index - 1].Size ?? 0, modified: usableDate);
|
||||
}
|
||||
|
||||
// Otherwise, copy the file from the old archive
|
||||
|
||||
Reference in New Issue
Block a user