Skip to content

Add support for ARC Trim method#181

Open
chasonr wants to merge 1 commit intoMacPaw:masterfrom
chasonr:arc-trim
Open

Add support for ARC Trim method#181
chasonr wants to merge 1 commit intoMacPaw:masterfrom
chasonr:arc-trim

Conversation

@chasonr
Copy link
Copy Markdown

@chasonr chasonr commented Apr 20, 2026

Trim is a compression method that late versions of SEA ARC supported.

The necessary algorithms are mostly already implemented. Trim is mainly a close variant of the LZSS plus adaptive Huffman coding used for the LH1 method in LZH files. The 0x100 symbol from the Huffman code indicates end of file, and 0x101 and up are copy lengths, but copy one byte less than in LH1. Trim, like several other ARC compression methods, uses RLE90 before passing to the next compression stage.

The main difficulty in supporting Trim is that its method number (10) conflicts with that used by Crush in the NoGate Consulting PAK program. The relevant versions of SEA ARC generate a comment record with 20 in the compression method field and an empty string for the file name; NoGate PAK does not generate this record. The patch looks for this record and assumes that method 10 is Trim if the record is found.

Some samples for testing can be found at http://cd.textfiles.com/hof91/LANT/ . LANMODEM.ARC and NETCRACK.ARC are truncated, and NETWATCH.ARC is badly corrupted, but the others unpack when this patch is applied.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant