diff --git a/SabreTools.Models/Compression/LZ/Constants.cs b/SabreTools.Models/Compression/LZ/Constants.cs index f210c4e..ef46eb7 100644 --- a/SabreTools.Models/Compression/LZ/Constants.cs +++ b/SabreTools.Models/Compression/LZ/Constants.cs @@ -7,13 +7,5 @@ namespace SabreTools.Models.Compression.LZ public static readonly byte[] SZDDSignatureBytes = [0x53, 0x5A, 0x44, 0x44, 0x88, 0xF0, 0x27, 0x33]; public static readonly byte[] QBasicSignatureBytes = [0x53, 0x5A, 0x20, 0x88, 0xF0, 0x27, 0x33, 0xD1]; - - public const int GETLEN = 2048; - - public const int LZ_TABLE_SIZE = 0x1000; - - public const int MAX_LZSTATES = 16; - - public const int LZ_MIN_HANDLE = 0x400; } } \ No newline at end of file diff --git a/SabreTools.Models/Compression/LZ/Enums.cs b/SabreTools.Models/Compression/LZ/Enums.cs index 61967aa..2c47ee5 100644 --- a/SabreTools.Models/Compression/LZ/Enums.cs +++ b/SabreTools.Models/Compression/LZ/Enums.cs @@ -70,28 +70,13 @@ namespace SabreTools.Models.Compression.LZ HasAdditionalText = 0x0020, } - /// - public enum LZERROR - { - LZERROR_OK = 1, - LZERROR_NOT_LZ = 0, - LZERROR_BADINHANDLE = -1, - LZERROR_BADOUTHANDLE = -2, - LZERROR_READ = -3, - LZERROR_WRITE = -4, - LZERROR_GLOBALLOC = -5, - LZERROR_GLOBLOCK = -6, - LZERROR_BADVALUE = -7, - LZERROR_UNKNOWNALG = -8, - } - /// /// - public enum SZDDCompressionType : byte + public enum ExpandCompressionType : byte { /// /// Only valid compression type: 'A' /// - LZ = 0x41, + A = 0x41, } } \ No newline at end of file diff --git a/SabreTools.Models/Compression/LZ/SZDDHeader.cs b/SabreTools.Models/Compression/LZ/ExpandHeader.cs similarity index 85% rename from SabreTools.Models/Compression/LZ/SZDDHeader.cs rename to SabreTools.Models/Compression/LZ/ExpandHeader.cs index e0e09cb..beb4903 100644 --- a/SabreTools.Models/Compression/LZ/SZDDHeader.cs +++ b/SabreTools.Models/Compression/LZ/ExpandHeader.cs @@ -8,7 +8,7 @@ namespace SabreTools.Models.Compression.LZ /// /// [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] - public sealed class SZDDHeader + public sealed class ExpandHeader { /// /// "SZDD" signature @@ -19,9 +19,9 @@ namespace SabreTools.Models.Compression.LZ /// /// Compression mode /// - /// Only is supported + /// Only is supported [MarshalAs(UnmanagedType.U1)] - public SZDDCompressionType CompressionType; + public ExpandCompressionType CompressionType; /// /// The character missing from the end of the filename diff --git a/SabreTools.Models/Compression/LZ/State.cs b/SabreTools.Models/Compression/LZ/State.cs deleted file mode 100644 index f24efe9..0000000 --- a/SabreTools.Models/Compression/LZ/State.cs +++ /dev/null @@ -1,72 +0,0 @@ -using System.IO; - -namespace SabreTools.Models.Compression.LZ -{ - public sealed class State - { - /// - /// Internal backing stream - /// - public Stream? Source { get; set; } - - /// - /// The last char of the filename for replacement - /// - public char LastChar { get; set; } - - /// - /// Decompressed length of the file - /// - public uint RealLength { get; set; } - - /// - /// Position the decompressor currently is - /// - public uint RealCurrent { get; set; } - - /// - /// Position the user wants to read from - /// - public uint RealWanted { get; set; } - - /// - /// The rotating LZ table - /// - public byte[]? Table { get; set; } - - /// - /// CURrent TABle ENTry - /// - public uint CurrentTableEntry { get; set; } - - /// - /// Length and position of current string - /// - public byte StringLength { get; set; } - - /// - /// From stringtable - /// - public uint StringPosition { get; set; } - - /// - /// Bitmask within blocks - /// - public ushort ByteType { get; set; } - - /// - /// GETLEN bytes - /// - public byte[]? Window { get; set; } - - /// - /// Current read - /// - public uint WindowCurrent { get; set; } - - /// - /// Length last got - /// - public uint WindowLength { get; set; } - } -} \ No newline at end of file