30 April 2020, 22:46 | #1 |
Registered User
Join Date: Feb 2011
Location: Italy/Rome
Posts: 2,281
|
Need Help: Packing and Unpacking
I need to pack and unpack data into my exe,for incoming game, never done before. What utils should I use? Any suggestion?
|
30 April 2020, 23:05 | #2 |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,160
|
RNC cruncher comes to mind. There are others too but that one has packers & unpackers from Windows & Amiga. Amiga unpack is pure asm & can do in-place decrunch.
A lot of games from the 1990 era used it. |
01 May 2020, 07:46 | #3 |
Registered User
Join Date: Feb 2020
Location: Germany
Posts: 177
|
I use the LZ4
|
01 May 2020, 08:00 | #4 |
Registered User
Join Date: Feb 2011
Location: Italy/Rome
Posts: 2,281
|
@JoeJoe
Any link to get stuffs? |
01 May 2020, 09:42 | #5 |
Lemon. / Core Design
Join Date: Mar 2016
Location: Tier 5
Posts: 1,209
|
|
01 May 2020, 09:45 | #6 |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,160
|
|
01 May 2020, 12:38 | #8 |
Registered User
Join Date: Feb 2011
Location: Italy/Rome
Posts: 2,281
|
Thanks to all! First time working around pack and unpack on Amiga!
|
01 May 2020, 17:13 | #9 |
Registered User
Join Date: Feb 2011
Location: Italy/Rome
Posts: 2,281
|
I'll work around ProPack. First I have to pack my projects' datas.
|
15 May 2020, 09:26 | #10 |
Registered User
Join Date: Sep 2019
Location: Essen/Germany
Age: 55
Posts: 463
|
I use zlib. Portable and easy to use and can also do inmem de-/packing.
|
07 September 2020, 15:59 | #11 |
Registered User
Join Date: Jun 2020
Location: Brno
Posts: 90
|
Hello. Hopefully someone can help me. I wanted to use LZ4 in my current project. However I'm out of luck to make decompression to work. I use 68k depack routine by Arnaud Carré (Leonard) (https://github.com/arnaud-carre/lz4-68k) - lz4_normal.asm, and to pack data I use original Win64 CLI (https://lz4.github.io/lz4/). I figured out that I have to compress data using the legacy format ("-l" parameter), otherwise depack routine crashes. However, even then my data are not correctly depacked. I tried various command-line parameters (block sizes, compression values, ...) - no luck. I also tried LZ4X and smallz4 - same result. What am I missing? What packer do you use? |
07 September 2020, 17:17 | #12 |
Registered User
Join Date: Jun 2016
Location: europe
Posts: 1,039
|
Did you use --no-frame-crc? A while ago I was experimenting with lz4 and didn't have any problems with decompression.
|
07 September 2020, 18:21 | #13 | |
Registered User
Join Date: Jun 2020
Location: Brno
Posts: 90
|
Quote:
I tried normal and fast LZ4 decrunch routines. Just to be sure that I don't have bug in a different part of my code I compressed data (4bpl 320x192 image in this case) by RNC packer (Lab313 version) and used ProPack routine from Aminet -- everything is fine. So currently I'm rather inclined to use RNC instead of LZ4. In my case, the compression is slightly better and speed is comparable. Yet, it haunts me what am I doing wrong? |
|
07 September 2020, 19:20 | #14 |
Registered User
Join Date: Jun 2016
Location: europe
Posts: 1,039
|
Hmm, ok.. Looking at his code now. He assumes there is no header, and a0 points to a packed data block. Now depending on compression flags (like CRC or no CRC) you have to skip a few bytes containing the header. With no CRC and no other flags that would be 11 bytes (4 magic ID, 3 frame descriptor, 4 block length in little-endian format). If you wanted to include the original file length (--content-size flag) it would be additional 8 bytes, for example (if I remember correctly).
Or alternatively, if you want to parse the frame descriptor you can figure out which parts of the header are present and which are not, and based on that skip as many bytes as needed. |
07 September 2020, 19:27 | #15 |
OCS forever!
Join Date: Mar 2019
Location: Birmingham, UK
Posts: 418
|
Check out my github where I wrapped up various routines like LZ4, NRV2S, RNC, cranker, shrinkler, etc.
ConvertAssets.cmd shows the correct command line for the various utils. IntroLibrary.s shows how to call the depack routines with a source in a0, dest in a1 type api. https://github.com/jonathanbennett73/amiga-depack |
07 September 2020, 19:43 | #16 | |
Registered User
Join Date: Apr 2013
Location: paris
Posts: 133
|
Quote:
As the comment says, it depacks data packed with this exact command line: ; Depack data produced by LZ4.exe command line: ; lz4.exe -9 --no-frame-crc <input_file> <output_file> https://github.com/arnaud-carre/lz4-68k#lz4-frame Hope it helps! Last edited by leonard; 07 September 2020 at 19:51. |
|
07 September 2020, 19:59 | #17 | |
Registered User
Join Date: Jun 2020
Location: Brno
Posts: 90
|
Quote:
Thanks for your tip! So obviously I was really just missing something important -- I haven't looked at "lz4_frame.asm" where it's already correctly implemented! Well, shame on me. Thanks again. Your collection is quite handy. |
|
07 September 2020, 20:01 | #18 | |
Registered User
Join Date: Jun 2020
Location: Brno
Posts: 90
|
Quote:
Yes, at last I noticed my mistake when browsing through Antiriad's code. I was so focused on fastest/normal/smallest source code files that I completely missed importance of lz4_frame.s! Thank you all for helping me. |
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
original packing pics of Rasterbike | elcayon | request.Other | 0 | 19 January 2018 18:22 |
ACA500 unpacking error 3? | TjLaZer | support.Hardware | 1 | 03 October 2015 17:50 |
Unpacking of Multiple .gz files | andyhants | support.Apps | 4 | 17 March 2014 03:16 |
LZX 1.21 packing..... | BarrySWE | support.Apps | 17 | 31 October 2005 15:00 |
LZX unpacking??? | Medvind | support.Apps | 25 | 27 November 2002 12:33 |
|
|