AminetAminet
Search:
82051 packages online
About
Recent
Browse
Search
Upload
Setup
Services

util/pack/cranker.lha

Mirror:Random
Showing:m68k-amigaosgeneric
No screenshot available
Short:Amiga executable and data cruncher
Author:bifat/tek
Uploader:bifat neoscientists org
Type:util/pack
Version:0.64
Architecture:m68k-amigaos
Date:2017-07-20
Download:http://aminet.net/util/pack/cranker.lha - View contents
Readme:http://aminet.net/util/pack/cranker.readme
Downloads:919
Cranker by The Electronic Knights
---------------------------------------------------------------------


Cranker is an Amiga executable and data cruncher and decruncher.

Executables decrunch while loading and decrunching requires no
additional memory. Cranker is by far the fastest way to run large
executables from disk on old, unexpanded Amigas.

You can choose from different executable headers: plain/standard,
minimal, with text progress or graphical progress display.

All source codes are included, including cruncher, executable and
data decrunchers. You can specify a modified decruncher in the
commandline and produce custom executables, for example showing
a logo of your group, or run an OS-legal effect while loading.

As of version 0.51, only an Amiga executable of the cruncher is
included. See download section for other platforms, and src/INSTALL
on how to build Cranker yourself and using it on different platforms.


Rationale:

Large OCS demos (onefilers) often reserve most available memory in
their executable sections. This is best practice and recommended.

Crunching them with most crunchers like Imploder or Powerpacker is
not an option, because all crunched data plus all sections must fit
into memory at the same time, so the demo will fail to run in the 
minimal configuration (typically 512k+512k).

Titanics cruncher was 30 years ahead of its time in that it includes
a decruncher that loads from an overlay hunk, which requires no (or
little) additional memory. Unfortunately the Titanics decruncher is
very slow (it probably does not really load and decrunch at the same
time, but alternates between loading and decrunching), and its crunch
ratio is bad. Another issue found with Titanics is that if a program 
disables multitasking, the disk motor can keep spinning for the whole
time it is running.

Cranker addresses all this, and more. It certainly does load and
decrunch at the same time, it uses no additional memory, it has a
solid crunch ratio, and it is blazingly fast. Since version 0.40
Cranker also addresses the disk motor issue.


Some benchmarks:

Rebels Retrodentro, crunched size:
----------------------------------
Original : 499768 Bytes
Titanics : 236388 Bytes
Cranker  : 217548 Bytes
Imploder : 213332 Bytes - does not work with 1mb
Shrinkler: 179472 Bytes

Starting time, Kick 1.3:
----------------------------------
Cranker  : 20s
Imploder : 28s - does not work with 1mb
Titanics : 35s
Original : 41s
Shrinkler: 87s

Starting time, Kick 2.04:
----------------------------------
Cranker  : 14s
Imploder : 24s - does not work with 1mb
Original : 33s
Titanics : 46s
Shrinkler: 86s


Usage:

$ cranker -h
argument template:
    -f FROM       input file
    -o TO         output file
   -mo MAXOVH/N   max. overhead (else store hunk, or error)
    -q QUIET/S    quiet operation
Data options:
   -cd CDATA/S    crunch raw data
   -dd DDATA/S    decrunch raw data
   -eo ENCOVH/S   encode overhead into first header byte
Executable options:
    -m MERGE/S    merge hunks (dangerous)
    -s STORE/S    do not crunch, store all hunks
    -a APPEND/K   userdata file to append to executable
    -t TEXT/K     text line to display while loading
   -tf TEXTFILE/K text file to display while loading
    -p PICTURE/K  IFF ILBM picture to show while loading
    -b BLACK/S    black screen (same as '-d black')
    -d DECRANKER  name of an internal decranker to use
   -ld LISTDEC/S  list available internal decrankers
   -ed EXTDEC/K   use external decranker from this file

A 'decranker' is an executable header with certain features.
You can specify an internal decranker using the -d option:

default         can show text
progress        can show text and shows progress
minimal         silent, read-ahead disabled
cinema          shows a progress bar on a black screen
picture         shows a picture while loading
black           black screen while loading

All decrankers are fully conformant to the operating system. The
executables should run on all real Amigas, all OS versions and from
all filesystems and devices.

About the decrankers 'cinema', 'picture', and 'black': These
decrankers obscure the shell or Workbench with a screen until the
executable exits. They make little sense if they are not used to run
fullscreen applications, games or demos. Don't worry: This is a
regular Intuition screen, and it will be opened after all memory
for the program has been allocated, so if the system runs out of
memory, the screen will not open, but the executable is started
anyway.

About the 'picture' decranker: Supports IFF pictures with up to 32
colors, plus EHB and HAM. On v36 or later tries to enforce a PAL
screen. Better do not use freaked-out image dimensions, it is
recommended to stick with 320x256 (or less).

Regarding the APPEND option: This allows extra data to be added to
the executable. Your program, when started, can load the extra data
from e.g. BPTR filehandle = FindTask(NULL)->tc_UserData . This must
be commented in in decranker.asm, it is not available by default.

Expect bugs and problems. In any case, keep your original binaries.
Feedback is welcome.


Technical info:

Cranker does not allocate memory. All allocations are made by the OS
loader. Hence it is decided right at the beginning if the executable
fits into memory and will be loaded at all. It uses a combination of
techniques, hunk overlay, asynchronous and buffered I/O, and in-place
decrunching with one of the fastest decrunchers in existence. Relocs
are packed into 1, 2, and 4 bytes entities.

Due to its complexity, the decrunch header is quite large, but the
decrunch header and a few extra bytes to allow in-place decrunching
are the only memory that adds to the required memory of the
executable. It will be freed by the OS at exit, like all other
sections.

So why is it tricky? Cranker operates on three data pointers at the
same time, one for loading, one for reading crunched data, one for
writing out the decrunched data. All three pointers wander forwards
in a hunk's memory area and must not overrun each other:
 _______________________________________________________  hunk
|                 |                  :                : |
|   decrunched    |   crunched data  :  yet unloaded  : |
|_________________|__________________:________________:_|
^---->            ^---->             ^---->            ^- overhead
destptr           srcptr             loadptr

The crunched data is aligned towards the end of the hunk. 
The overhead (usually only a few bytes) gets calculated for the
particular data and ensures that the destination pointer does not
overrun the source pointer. Loading takes place in DOS packets, which
are requested from the executable's file handler task. When a packet
arrives, the load pointer is updated and the next packet requested.
The decruncher starts immediately with the first packet, but it
suspends waiting for the next packet if and when the source pointer
catches up with the load pointer. Another complexity is imposed by
the reloc tables, because after loading a hunk, for loading them
efficiently, the loader has to switch from asynchronous to buffered
I/O (with a small load buffer on the stack), and back to asynchronous
for the next hunk.

At least when loading from floppy disk the construct should be I/O
bound under all practical circumstances, even if asynchronoucy kicks
in just a little. 


Download:

http://neoscientists.org/~bifat/binarydistillery/cranker.lha
Precompiled Linux, Windows, Mac OS X binaries:
http://neoscientists.org/~bifat/binarydistillery/cranker/


Authors:

Coding by Bifat/TEK <bifat at neoscientists.org>
LZO by Markus Franz Xaver Johannes Oberhumer


Changes:

0.64
Added 'picture' decranker (and -p option) for showing an IFF ILBM
picture while loading. Added 'black' decranker (and -b option) that
shows a black screen while loading. Added an 'append' option that
allows to append a file of userdata to the executable (to be loaded
from inside your program - see decranker.asm on how to obtain the
filehandle). In case of an I/O error, the cinema decranker forgot
to close the progress bar screen, corrected.

0.63
Errors were not reported when saving the crunched file, corrected.
The crunched format has changed: Now an initial payload of up to
65535 bytes can be passed to hooks. This can be used with the new
TEXTFILE option for displaying large texts (ANSI logos, etc.) - not
just a single line of text. The NOFLASH option has been removed - if
you want a decranker that pokes to the background color register,
assemble one yourself. Major code cleanup; all decrankers are now
built from the same source. Improved source code documentation on
writing custom hooks. 

0.60
This version can continue loading ahead. (Previous versions loaded
ahead one readsize only.) This allows for faster loading, depending
on the media, CPU and filesystem fragmentation. 
The decruncher has been reworked and is faster, too.

0.53
Now supports dreloc32 hunks, can now crunch vbcc executables.
Reduced memory consumption for crunching.
Major source code cleanup.
Improved error messages, safe decrunching of defective data.
Added cinema decranker. Added multiple inbuilt decrankers.

0.51
Partially uninitialized hunks are now supported.
Debug and symbol hunks are now handled and stripped away.
The merge option appears to be more stable now.
Added -eo option to encode the overhead into the crunched data
header. Suggested by Origo.
The build procedure and sources have been cleaned up. The Linux,
Windows, and Mac OS X binaries have been dropped from this package.
See src/INSTALL on building them yourself.

0.42
The Amiga version now works on Kickstart 1.x and on 68000 CPUs, 
a FPU is no longer required. Requested by Sachy. Crunching fastmem
hunks is now supported. Added an external example decrunch header.

0.40
When an executable was started that disabled multitasking, the disk
motor could keep spinning while the executable was running. Corrected
by synchronizing on an ACTION_FLUSH packet. Found the same issue with
Titanics later, so this is another reason for using Cranker now.

0.31
Mac OS X version and Makefile included, supplied by Bonefish. Thanks!

0.3
Added options CDATA, DDATA, MAXOVH, MERGE, renamed EXTDECR to
EXTHEAD. Removed former hardcoded limit of 64 bytes maximum overhead.

0.21
Fixed a bug in the decrunch header when a load error occurred

0.2
Added options for displaying text and to avoid poking to the bgcolor
register. Incompressible hunks are being stored now. The source of
the decrunch header is now included and a custom header can be
specified in the command line. This way you can use Cranker as a
loader system, show a progress bar, or disable crunching in the
commandline and just exploit async I/O to show an effect while
loading.

0.1
initial release


Contents of util/pack/cranker.lha
PERMISSION  UID  GID    PACKED    SIZE  RATIO METHOD CRC     STAMP     NAME
---------- ----------- ------- ------- ------ ---------- ------------ ----------
drwxr-xr-x  2002/2001        0       0 ****** -lhd- 0000 Jul 20 12:54 cranker-0.64/
-rw-rw----  2002/2001     4691   11006  42.6% -lh5- 8e8a Jul 20 12:42 cranker-0.64/README
-rwxr-xr-x  2002/2001    73415  135588  54.1% -lh5- bedd Jul 20 12:48 cranker-0.64/cranker
-rw-rw----  2002/2001     1072    3741  28.7% -lh5- 7693 Jul 20 12:41 cranker-0.64/decruncher.asm
drwxr-xr-x  2002/2001        0       0 ****** -lhd- 0000 Jul 20 12:48 cranker-0.64/src/
-rw-rw----  2002/2001      978    2405  40.7% -lh5- 3c82 Jul 20 12:43 cranker-0.64/src/INSTALL
-rw-rw----  2002/2001      103     294  35.0% -lh5- 3bed Jul 20 12:43 cranker-0.64/src/MODLIST
-rw-rw----  2002/2001      887    2460  36.1% -lh5- b005 Jul 20 12:43 cranker-0.64/src/Makefile
drwxr-xr-x  2002/2001        0       0 ****** -lhd- 0000 Jul 20 12:47 cranker-0.64/src/bin/
-rwxrw----  2002/2001      293     465  63.0% -lh5- 2da6 Jul 20 12:44 cranker-0.64/src/bin/bin2lua.lua
-rwxrw----  2002/2001     2117    6376  33.2% -lh5- 6954 Jul 20 12:44 cranker-0.64/src/bin/compiler.lua
-rw-r--r--  2002/2001     2382    5383  44.3% -lh5- 08d3 May  9 09:27 cranker-0.64/src/bit.c
-rw-rw----  2002/2001    25353  116379  21.8% -lh5- 2026 Jul 20 12:45 cranker-0.64/src/classlib.c
-rw-rw----  2002/2001     7827   28756  27.2% -lh5- f512 Jul 20 12:46 cranker-0.64/src/cranker.lua
-rw-rw----  2002/2001     7715   30585  25.2% -lh5- 94b2 Jul 20 12:43 cranker-0.64/src/decranker.asm
-rw-r--r--  2002/2001      582    1616  36.0% -lh5- 925b May  9 09:27 cranker-0.64/src/llibs.c
drwxr-xr-x  2002/2001        0       0 ****** -lhd- 0000 Jul 20 12:47 cranker-0.64/src/lua/
-rw-rw----  2002/2001     5348   22773  23.5% -lh5- 0a03 Jul 20 12:44 cranker-0.64/src/lua/lapi.c
-rw-r--r--  2002/2001      209     262  79.8% -lh5- d78b May  9 09:27 cranker-0.64/src/lua/lapi.h
-rw-r--r--  2002/2001     4953   17417  28.4% -lh5- 6374 May  9 09:27 cranker-0.64/src/lua/lauxlib.c
-rw-r--r--  2002/2001     1584    5777  27.4% -lh5- 4e41 May  9 09:27 cranker-0.64/src/lua/lauxlib.h
-rw-r--r--  2002/2001     4842   17045  28.4% -lh5- 7072 May  9 09:27 cranker-0.64/src/lua/lbaselib.c
-rw-rw----  2002/2001     5714   21551  26.5% -lh5- aecc Jul 20 12:44 cranker-0.64/src/lua/lcode.c
-rw-r--r--  2002/2001      910    2750  33.1% -lh5- ff1f May  9 09:27 cranker-0.64/src/lua/lcode.h
-rw-r--r--  2002/2001     2833   10092  28.1% -lh5- 9a3e May  9 09:27 cranker-0.64/src/lua/ldblib.c
-rw-r--r--  2002/2001     5141   16920  30.4% -lh5- ad89 May  9 09:27 cranker-0.64/src/lua/ldebug.c
-rw-r--r--  2002/2001      446    1061  42.0% -lh5- 30dd May  9 09:27 cranker-0.64/src/lua/ldebug.h
-rw-r--r--  2002/2001     4776   15012  31.8% -lh5- 03a6 May  9 09:27 cranker-0.64/src/lua/ldo.c
-rw-r--r--  2002/2001      741    1897  39.1% -lh5- 0508 May  9 09:27 cranker-0.64/src/lua/ldo.h
-rw-r--r--  2002/2001     1406    3882  36.2% -lh5- a768 May  9 09:27 cranker-0.64/src/lua/ldump.c
-rw-r--r--  2002/2001     1571    4718  33.3% -lh5- 82a1 May  9 09:27 cranker-0.64/src/lua/lfunc.c
-rw-r--r--  2002/2001      431    1125  38.3% -lh5- c699 May  9 09:27 cranker-0.64/src/lua/lfunc.h
-rw-r--r--  2002/2001     6018   20177  29.8% -lh5- 8041 May  9 09:27 cranker-0.64/src/lua/lgc.c
-rw-r--r--  2002/2001     1133    3159  35.9% -lh5- 2263 May  9 09:27 cranker-0.64/src/lua/lgc.h
-rw-rw----  2002/2001      501    1005  49.9% -lh5- 9b57 Jul 20 12:44 cranker-0.64/src/lua/linit.c
-rw-r--r--  2002/2001     3951   13590  29.1% -lh5- bf07 May  9 09:27 cranker-0.64/src/lua/liolib.c
-rw-r--r--  2002/2001     3632   12581  28.9% -lh5- 95a8 May  9 09:27 cranker-0.64/src/lua/llex.c
-rw-r--r--  2002/2001      980    2177  45.0% -lh5- d9d6 May  9 09:27 cranker-0.64/src/lua/llex.h
-rw-r--r--  2002/2001     1090    2349  46.4% -lh5- 2202 May  9 09:27 cranker-0.64/src/lua/llimits.h
-rw-r--r--  2002/2001     1412    5832  24.2% -lh5- 72dd May  9 09:27 cranker-0.64/src/lua/lmathlib.c
-rw-r--r--  2002/2001      987    2202  44.8% -lh5- 5ca8 May  9 09:27 cranker-0.64/src/lua/lmem.c
-rw-r--r--  2002/2001      598    1494  40.0% -lh5- 2bea May  9 09:27 cranker-0.64/src/lua/lmem.h
-rw-rw----  2002/2001     5314   19365  27.4% -lh5- 09df Jul 20 12:44 cranker-0.64/src/lua/loadlib.c
-rw-r--r--  2002/2001     1946    5584  34.8% -lh5- fd73 May  9 09:27 cranker-0.64/src/lua/lobject.c
-rw-r--r--  2002/2001     2642    8507  31.1% -lh5- 0cb9 May  9 09:27 cranker-0.64/src/lua/lobject.h
-rw-r--r--  2002/2001      713    2884  24.7% -lh5- 957c May  9 09:27 cranker-0.64/src/lua/lopcodes.c
-rw-r--r--  2002/2001     2768    8086  34.2% -lh5- faa5 May  9 09:27 cranker-0.64/src/lua/lopcodes.h
-rw-rw----  2002/2001     2086    6140  34.0% -lh5- 1d0d Jul 20 12:45 cranker-0.64/src/lua/loslib.c
-rw-r--r--  2002/2001    10416   36706  28.4% -lh5- a016 May  9 09:27 cranker-0.64/src/lua/lparser.c
-rw-r--r--  2002/2001      972    2261  43.0% -lh5- b42d May  9 09:27 cranker-0.64/src/lua/lparser.h
-rw-r--r--  2002/2001     2017    5694  35.4% -lh5- cc38 May  9 09:27 cranker-0.64/src/lua/lstate.c
-rw-r--r--  2002/2001     1939    5011  38.7% -lh5- b593 May  9 09:27 cranker-0.64/src/lua/lstate.h
-rw-r--r--  2002/2001     1316    3140  41.9% -lh5- c2dc May  9 09:27 cranker-0.64/src/lua/lstring.c
-rw-r--r--  2002/2001      411     814  50.5% -lh5- 9858 May  9 09:27 cranker-0.64/src/lua/lstring.h
-rw-rw----  2002/2001     6632   23640  28.1% -lh5- b2bb Jul 20 12:45 cranker-0.64/src/lua/lstrlib.c
-rw-rw----  2002/2001     5285   16458  32.1% -lh5- 805b Jul 20 12:45 cranker-0.64/src/lua/ltable.c
-rw-r--r--  2002/2001      454    1186  38.3% -lh5- f638 May  9 09:27 cranker-0.64/src/lua/ltable.h
-rw-r--r--  2002/2001     2369    7343  32.3% -lh5- 8128 May  9 09:27 cranker-0.64/src/lua/ltablib.c
-rw-r--r--  2002/2001      822    1680  48.9% -lh5- 4557 May  9 09:27 cranker-0.64/src/lua/ltm.c
-rw-r--r--  2002/2001      552    1018  54.2% -lh5- bd80 May  9 09:27 cranker-0.64/src/lua/ltm.h
-rw-r--r--  2002/2001     3353   10163  33.0% -lh5- 2839 May  9 09:27 cranker-0.64/src/lua/lua.c
-rw-r--r--  2002/2001     3475   11699  29.7% -lh5- 1cf7 May  9 09:27 cranker-0.64/src/lua/lua.h
-rw-r--r--  2002/2001     1835    4661  39.4% -lh5- 8250 May  9 09:27 cranker-0.64/src/lua/luac.c
-rw-rw----  2002/2001     7827   23376  33.5% -lh5- f27a Jul 20 12:45 cranker-0.64/src/lua/luaconf.h
-rw-r--r--  2002/2001      401    1026  39.1% -lh5- 68e3 May  9 09:27 cranker-0.64/src/lua/lualib.h
-rw-r--r--  2002/2001     1894    5322  35.6% -lh5- 0556 May  9 09:27 cranker-0.64/src/lua/lundump.c
-rw-r--r--  2002/2001      445     890  50.0% -lh5- 6c9a May  9 09:27 cranker-0.64/src/lua/lundump.h
-rw-rw----  2002/2001     6398   23396  27.3% -lh5- d56c Jul 20 12:45 cranker-0.64/src/lua/lvm.c
-rw-r--r--  2002/2001      446    1159  38.5% -lh5- 97c4 May  9 09:27 cranker-0.64/src/lua/lvm.h
-rw-r--r--  2002/2001      720    1678  42.9% -lh5- 3ef2 May  9 09:27 cranker-0.64/src/lua/lzio.c
-rw-r--r--  2002/2001      664    1556  42.7% -lh5- 5fa9 May  9 09:27 cranker-0.64/src/lua/lzio.h
-rw-r--r--  2002/2001     2023    5255  38.5% -lh5- 3712 May  9 09:27 cranker-0.64/src/luamain.c
drwxr-xr-x  2002/2001        0       0 ****** -lhd- 0000 May  9 09:27 cranker-0.64/src/lzo/
-rw-r--r--  2002/2001     1086    2675  40.6% -lh5- 6f58 May  9 09:27 cranker-0.64/src/lzo/config1x.h
-rw-r--r--  2002/2001     1412    4482  31.5% -lh5- efd2 May  9 09:27 cranker-0.64/src/lzo/lzo1_d.ch
-rw-r--r--  2002/2001     1370    5869  23.3% -lh5- 84d8 May  9 09:27 cranker-0.64/src/lzo/lzo1x.h
-rw-r--r--  2002/2001     5388   24242  22.2% -lh5- aae9 May  9 09:27 cranker-0.64/src/lzo/lzo1x_9x.c
-rw-r--r--  2002/2001     2751   12748  21.6% -lh5- 4bf3 May  9 09:27 cranker-0.64/src/lzo/lzo1x_d.ch
-rw-r--r--  2002/2001      846    2392  35.4% -lh5- 7ae3 May  9 09:27 cranker-0.64/src/lzo/lzo1x_d2.c
-rw-r--r--  2002/2001     3096   10314  30.0% -lh5- 2ea2 May  9 09:27 cranker-0.64/src/lzo/lzo_conf.h
-rw-r--r--  2002/2001      884    1675  52.8% -lh5- 5519 May  9 09:27 cranker-0.64/src/lzo/lzo_dll.ch
-rw-r--r--  2002/2001     3560   19666  18.1% -lh5- 3ffd May  9 09:27 cranker-0.64/src/lzo/lzo_func.h
-rw-r--r--  2002/2001     2184    6800  32.1% -lh5- f5b0 May  9 09:27 cranker-0.64/src/lzo/lzo_init.c
-rw-r--r--  2002/2001     1758    5132  34.3% -lh5- 8ecc May  9 09:27 cranker-0.64/src/lzo/lzo_mchw.ch
-rw-r--r--  2002/2001     1435    3578  40.1% -lh5- 9ad1 May  9 09:27 cranker-0.64/src/lzo/lzo_ptr.h
-rw-r--r--  2002/2001    21655  118060  18.3% -lh5- 10f1 May  9 09:27 cranker-0.64/src/lzo/lzo_supp.h
-rw-r--r--  2002/2001     4473   17035  26.3% -lh5- bec7 May  9 09:27 cranker-0.64/src/lzo/lzo_swd.ch
-rw-r--r--  2002/2001     4263   15597  27.3% -lh5- 1bfe May  9 09:27 cranker-0.64/src/lzo/lzoconf.h
-rw-r--r--  2002/2001    17336  116578  14.9% -lh5- ac5e May  9 09:27 cranker-0.64/src/lzo/lzodefs.h
-rwxrw----  2002/2001      750    1593  47.1% -lh5- 940b Jul 20 12:43 cranker-0.64/src/main.lua
-rw-rw----  2002/2001      388     634  61.2% -lh5- 3d2c Jul 20 12:44 cranker-0.64/src/smakefile
drwxr-xr-x  2002/2001        0       0 ****** -lhd- 0000 May  9 09:27 cranker-0.64/src/tek/
-rw-r--r--  2002/2001     1587    5830  27.2% -lh5- ee32 May  9 09:27 cranker-0.64/src/tek/class.lua
drwxr-xr-x  2002/2001        0       0 ****** -lhd- 0000 May  9 09:27 cranker-0.64/src/tek/lib/
-rw-r--r--  2002/2001     3720   13623  27.3% -lh5- 9e5f May  9 09:27 cranker-0.64/src/tek/lib/args.lua
-rw-r--r--  2002/2001     1683    4938  34.1% -lh5- 1c34 May  9 09:27 cranker-0.64/src/tek/lib/compress.c
-rw-r--r--  2002/2001      436    1105  39.5% -lh5- 3dca May  9 09:27 cranker-0.64/src/tek/lib/tek_lua.h
---------- ----------- ------- ------- ------ ---------- ------------ ----------
 Total        97 files  348818 1192166  29.3%            Jul 20 20:49

Aminet © 1992-2017 Urban Müller and the Aminet team. Aminet contact address: <aminetaminet net>