From f103d5aac97e980898c7efd69bf1cf7c8fe3e7f8 Mon Sep 17 00:00:00 2001 From: Dominic Cerquetti Date: Sun, 17 Dec 2023 12:34:44 -0500 Subject: [PATCH] RomBytes save: lower threshold for printing offsets in file - only increases filesize by about 200K but greatly improves chances you can merge things by hand, easy tradeoff --- .../serialization/xml_serializer/RomBytesXMLSerializer.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Diz.Core/serialization/xml_serializer/RomBytesXMLSerializer.cs b/Diz.Core/serialization/xml_serializer/RomBytesXMLSerializer.cs index 6e645e4d..08a049c2 100644 --- a/Diz.Core/serialization/xml_serializer/RomBytesXMLSerializer.cs +++ b/Diz.Core/serialization/xml_serializer/RomBytesXMLSerializer.cs @@ -79,8 +79,10 @@ public record RomBytesOutputFormatSettings /// less search area when doing tricky merges. /// Comments are ignore on load. /// This is only used when saving, not loading. + /// Smaller numbers here make easier merges, but, increase the filesize. + /// 0x4000 is a nice tradeoff between negligible file increase and much better merge friendliness /// - public int InsertCommentIntoOutputLinesEveryNBytes { get; init; } = 0x4000; + public int InsertCommentIntoOutputLinesEveryNBytes { get; init; } = 0x800; } @@ -328,7 +330,7 @@ public void Write(IFormatWriter writer, RomBytes instance) { // at this lower level we do have all the rom bytes but we don't have bank/mapping info. // so, try to keep InsertCommentIntoOutputLinesEveryNBytes a multiple of something that lines up on every bank length on the SNES. - lines.Add($";offset={romOffset:X6}"); + lines.Add($";pos={romOffset:X6}"); } // debug check, optional: