How Listaller got LZMA decompression…

Cause the new IPK-package specs only allow LZMA compression, I had to add LZMA to Listaller. (IPK is Listaller’s own package format, based on TAR files and LZMA)

I thought it was no big deal cause there is an LZMA-SDK for Pascal which worked quite well. So I dropped the old Abbrevia component set which was used for decompressing the old IPK0.8 files and replaced it with the LZMA-Algorithm. Compressing worked. Decompressing did not. Changing back to ZIP was a very bad idea because LZMA was one of the goals for Listaller 0.4. Which mend I had to fix the algorithm by myself. I discovered the problem only exists on 64bit machines, 32bit worked as it should. Debugging the code was _really_ the most complex debugging thing I ever had to do: I didn’t know the algorithm and the code was completely undocumented.

Fortunately JoshyFun, a member of the FPC-Users list, finally found the problem which was an invalid bitshift that only worked on 32bit. The new code needs a little testing now and will be present in Listaller 0.4 for sure!

I also learned a new command to print the position where a command was executed:

writeln({$I %LINE%},variable);

This will be very useful if I get similar problems again.

One thought on “How Listaller got LZMA decompression…

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.