Description
FilePack is simply a tool that can compress any kind of data. It typically perform a 50% compression ratio on code and graphics.
Utilisation
FilePack can compress files, but also restore files that have been compressed.
To compress a file:
%OSDK%\bin\FilePack -p source_file compressed_file
To decompress a file:
%OSDK%\bin\FilePack -u compressed_file destination file
Packed file format
The format of packed files is actually very simple, and is mostly based on a 8 bytes header followed by compressed data.
+0 'L' +1 'Z' +2 '7' +3 '7' +4 Unpacked size (low byte) +5 Unpacked size (high byte) +6 Packed size (low byte) +7 Packed size (high byte) +8 Compressed data starts here
Please note that this header is present only when packed in default mode (-p1), if you pack in -p0 mode the header is not present. In place of the header you will find a text file having the same name that your "program.s", looking like this:
#define run_adress $600 ; Come from original TAP executable #define unpacked_size $1000 ; Come from original TAP executable
Depacking
For depacking a file, you can simply use the corresponding library routine:
void file_unpack(void *ptr_dst,void *ptr_src);
Please note that this routine expect the data to get a header, so it will not work for files packed in -p0 mode. To unpack these files you need to use another routine.
Historic
Here is the list of all releases with a short description of things that changed:
Version 0.004
- Added p0/p1 mode to pack a file without appending the header. Very usefull when you want to spare a maximum of bytes in a minigame compo...Version 0.001-0.003
- First released version