diff --git a/ROADMAP.md b/ROADMAP.md index d8a96bb..58a0378 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -21,14 +21,16 @@ Reverse direction is a known limitation: the original UC2 Pro cannot read UC2 v3 archives due to compression bitstream differences.) -- [x] Single-file backward compatibility with original UC2 Pro - (listing + extraction verified in DOSBox-X) -- [x] Single-file backward compatibility with original UC2 Pro - (listing + extraction verified in automated DOSBox-X test). -- [x] Multi-file backward compatibility with original UC2 Pro - (listing + extraction verified for 4 files in automated - DOSBox-X test). Fix: always assign custom master indices - (>= 2), never SuperMaster (0), matching the original's behavior. +- [x] Backward compatibility with original UC2 Pro (listing + + extraction verified for multi-file archives in both directions + in automated DOSBox-X test). +- [ ] Custom Huffman tree compatibility with original UC2 Pro. + Currently uses the default tree for all blocks (~40% worse + compression for text, ~0% for random data). Our treegen + produces valid trees but the original's nuke1 ASM kernel + depends on the exact tree shapes from the original TreeGen. + Improving this requires bit-exact treegen or understanding + nuke1's tree assumptions. - [ ] Give UC2 a voice: status and progress messages with personality, continuing the original's tradition ("Do not worry, you have got the tree", "decompression always lightspeed", FAST/TIGHT/S-TIGHT diff --git a/lib/src/compress.c b/lib/src/compress.c index deb3f9a..73f8c5d 100644 --- a/lib/src/compress.c +++ b/lib/src/compress.c @@ -697,9 +697,11 @@ static int flush_block(struct compressor *c, int is_last) u8 lengths[NumSymbols]; /* Use the default tree for backward compatibility with the original - UC2 Pro's ASM decompressor kernel. Custom trees from our treegen - cause the original to hang (the tree encoding is valid but the - ASM kernel has undocumented assumptions about tree shapes). */ + UC2 Pro's ASM decompressor (nuke1). Custom trees from our treegen + produce valid bitstreams but nuke1 hangs on them — the original's + tree generation (TREEGEN.CPP) produces different Huffman code + assignments that nuke1 depends on. The default tree gives ~40% + worse compression but full backward compatibility. */ uc2_default_lengths(lengths); /* Emit block-present flag */