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

util/pack/cranker-mos.lha

Mirror:Random
Showing:ppc-warpupgeneric
No screenshot available
Short:Amiga executable and data cruncher
Uploader:bifat neoscientists org (bifat/tek)
Type:util/pack
Version:0.66
Architecture:ppc-morphos
URL:http://neoscientists.org/~bifat/binarydistillery/cranker/
Date:2023-03-04
Download:http://aminet.net/util/pack/cranker-mos.lha - View contents
Readme:http://aminet.net/util/pack/cranker-mos.readme
Downloads:777

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
   -st SHOWTIME/N min. number of seconds to display picture
    -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:

Recompiled with vbcc; the executable bit now set in the resulting
executable; also it's faster (20210913)

0.66
The picture option was pointless when starting an executable with a
fast CPU from harddisk. Added SHOWTIME argument, the minimum number
of seconds to display the picture. Default: 5. Flickers and glitches
removed from the decrankers black, picture, and cinema.

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-mos.lha
PERMISSION  UID  GID    PACKED    SIZE  RATIO METHOD CRC     STAMP     NAME
---------- ----------- ------- ------- ------ ---------- ------------ ----------
[generic]                99783  216348  46.1% -lh5- 07ca Mar  5 00:29 cranker-0.66/cranker
[generic]                 1072    3741  28.7% -lh5- 7693 Jan 22  2021 cranker-0.66/decruncher.asm
[generic]                 4888   11440  42.7% -lh5- 93bc Sep 13  2021 cranker-0.66/README
[generic]                  293     465  63.0% -lh5- 2da6 Jan 22  2021 cranker-0.66/src/bin/bin2lua.lua
[generic]                 2117    6376  33.2% -lh5- 6954 Jan 22  2021 cranker-0.66/src/bin/compiler.lua
[generic]                 2382    5383  44.3% -lh5- 08d3 Jan 22  2021 cranker-0.66/src/bit.c
[generic]                26715  118095  22.6% -lh5- 61a7 Jan 22  2021 cranker-0.66/src/classlib.c
[generic]                 7856   28827  27.3% -lh5- 52fe Jan 22  2021 cranker-0.66/src/cranker.lua
[generic]                 8085   32230  25.1% -lh5- 0d06 Jan 22  2021 cranker-0.66/src/decranker.asm
[generic]                  978    2405  40.7% -lh5- 3c82 Jan 22  2021 cranker-0.66/src/INSTALL
[generic]                  582    1616  36.0% -lh5- 925b Jan 22  2021 cranker-0.66/src/llibs.c
[generic]                 5348   22773  23.5% -lh5- 0a03 Jan 22  2021 cranker-0.66/src/lua/lapi.c
[generic]                  209     262  79.8% -lh5- d78b Jan 22  2021 cranker-0.66/src/lua/lapi.h
[generic]                 4953   17417  28.4% -lh5- 6374 Jan 22  2021 cranker-0.66/src/lua/lauxlib.c
[generic]                 1584    5777  27.4% -lh5- 4e41 Jan 22  2021 cranker-0.66/src/lua/lauxlib.h
[generic]                 4842   17045  28.4% -lh5- 7072 Jan 22  2021 cranker-0.66/src/lua/lbaselib.c
[generic]                 5714   21551  26.5% -lh5- aecc Jan 22  2021 cranker-0.66/src/lua/lcode.c
[generic]                  910    2750  33.1% -lh5- ff1f Jan 22  2021 cranker-0.66/src/lua/lcode.h
[generic]                 2833   10092  28.1% -lh5- 9a3e Jan 22  2021 cranker-0.66/src/lua/ldblib.c
[generic]                 5141   16920  30.4% -lh5- ad89 Jan 22  2021 cranker-0.66/src/lua/ldebug.c
[generic]                  446    1061  42.0% -lh5- 30dd Jan 22  2021 cranker-0.66/src/lua/ldebug.h
[generic]                 4776   15012  31.8% -lh5- 03a6 Jan 22  2021 cranker-0.66/src/lua/ldo.c
[generic]                  741    1897  39.1% -lh5- 0508 Jan 22  2021 cranker-0.66/src/lua/ldo.h
[generic]                 1406    3882  36.2% -lh5- a768 Jan 22  2021 cranker-0.66/src/lua/ldump.c
[generic]                 1571    4718  33.3% -lh5- 82a1 Jan 22  2021 cranker-0.66/src/lua/lfunc.c
[generic]                  431    1125  38.3% -lh5- c699 Jan 22  2021 cranker-0.66/src/lua/lfunc.h
[generic]                 6018   20177  29.8% -lh5- 8041 Jan 22  2021 cranker-0.66/src/lua/lgc.c
[generic]                 1133    3159  35.9% -lh5- 2263 Jan 22  2021 cranker-0.66/src/lua/lgc.h
[generic]                  501    1005  49.9% -lh5- 9b57 Jan 22  2021 cranker-0.66/src/lua/linit.c
[generic]                 3951   13590  29.1% -lh5- bf07 Jan 22  2021 cranker-0.66/src/lua/liolib.c
[generic]                 3632   12581  28.9% -lh5- 95a8 Jan 22  2021 cranker-0.66/src/lua/llex.c
[generic]                  980    2177  45.0% -lh5- d9d6 Jan 22  2021 cranker-0.66/src/lua/llex.h
[generic]                 1090    2349  46.4% -lh5- 2202 Jan 22  2021 cranker-0.66/src/lua/llimits.h
[generic]                 1412    5832  24.2% -lh5- 72dd Jan 22  2021 cranker-0.66/src/lua/lmathlib.c
[generic]                  987    2202  44.8% -lh5- 5ca8 Jan 22  2021 cranker-0.66/src/lua/lmem.c
[generic]                  598    1494  40.0% -lh5- 2bea Jan 22  2021 cranker-0.66/src/lua/lmem.h
[generic]                 5314   19365  27.4% -lh5- 09df Jan 22  2021 cranker-0.66/src/lua/loadlib.c
[generic]                 1946    5584  34.8% -lh5- fd73 Jan 22  2021 cranker-0.66/src/lua/lobject.c
[generic]                 2642    8507  31.1% -lh5- 0cb9 Jan 22  2021 cranker-0.66/src/lua/lobject.h
[generic]                  713    2884  24.7% -lh5- 957c Jan 22  2021 cranker-0.66/src/lua/lopcodes.c
[generic]                 2768    8086  34.2% -lh5- faa5 Jan 22  2021 cranker-0.66/src/lua/lopcodes.h
[generic]                 2086    6140  34.0% -lh5- 1d0d Jan 22  2021 cranker-0.66/src/lua/loslib.c
[generic]                10416   36706  28.4% -lh5- a016 Jan 22  2021 cranker-0.66/src/lua/lparser.c
[generic]                  972    2261  43.0% -lh5- b42d Jan 22  2021 cranker-0.66/src/lua/lparser.h
[generic]                 2017    5694  35.4% -lh5- cc38 Jan 22  2021 cranker-0.66/src/lua/lstate.c
[generic]                 1939    5011  38.7% -lh5- b593 Jan 22  2021 cranker-0.66/src/lua/lstate.h
[generic]                 1316    3140  41.9% -lh5- c2dc Jan 22  2021 cranker-0.66/src/lua/lstring.c
[generic]                  411     814  50.5% -lh5- 9858 Jan 22  2021 cranker-0.66/src/lua/lstring.h
[generic]                 6632   23640  28.1% -lh5- b2bb Jan 22  2021 cranker-0.66/src/lua/lstrlib.c
[generic]                 5285   16458  32.1% -lh5- 805b Jan 22  2021 cranker-0.66/src/lua/ltable.c
[generic]                  454    1186  38.3% -lh5- f638 Jan 22  2021 cranker-0.66/src/lua/ltable.h
[generic]                 2369    7343  32.3% -lh5- 8128 Jan 22  2021 cranker-0.66/src/lua/ltablib.c
[generic]                  822    1680  48.9% -lh5- 4557 Jan 22  2021 cranker-0.66/src/lua/ltm.c
[generic]                  552    1018  54.2% -lh5- bd80 Jan 22  2021 cranker-0.66/src/lua/ltm.h
[generic]                 3353   10163  33.0% -lh5- 2839 Jan 22  2021 cranker-0.66/src/lua/lua.c
[generic]                 3475   11699  29.7% -lh5- 1cf7 Jan 22  2021 cranker-0.66/src/lua/lua.h
[generic]                 1835    4661  39.4% -lh5- 8250 Jan 22  2021 cranker-0.66/src/lua/luac.c
[generic]                 7827   23376  33.5% -lh5- f27a Jan 22  2021 cranker-0.66/src/lua/luaconf.h
[generic]                  401    1026  39.1% -lh5- 68e3 Jan 22  2021 cranker-0.66/src/lua/lualib.h
[generic]                 1894    5322  35.6% -lh5- 0556 Jan 22  2021 cranker-0.66/src/lua/lundump.c
[generic]                  445     890  50.0% -lh5- 6c9a Jan 22  2021 cranker-0.66/src/lua/lundump.h
[generic]                 6398   23396  27.3% -lh5- d56c Jan 22  2021 cranker-0.66/src/lua/lvm.c
[generic]                  446    1159  38.5% -lh5- 97c4 Jan 22  2021 cranker-0.66/src/lua/lvm.h
[generic]                  720    1678  42.9% -lh5- 3ef2 Jan 22  2021 cranker-0.66/src/lua/lzio.c
[generic]                  664    1556  42.7% -lh5- 5fa9 Jan 22  2021 cranker-0.66/src/lua/lzio.h
[generic]                 2023    5255  38.5% -lh5- 3712 Jan 22  2021 cranker-0.66/src/luamain.c
[generic]                 1086    2675  40.6% -lh5- 6f58 Jan 22  2021 cranker-0.66/src/lzo/config1x.h
[generic]                 1370    5869  23.3% -lh5- 84d8 Jan 22  2021 cranker-0.66/src/lzo/lzo1x.h
[generic]                 5388   24242  22.2% -lh5- aae9 Jan 22  2021 cranker-0.66/src/lzo/lzo1x_9x.c
[generic]                 2751   12748  21.6% -lh5- 4bf3 Jan 22  2021 cranker-0.66/src/lzo/lzo1x_d.ch
[generic]                  846    2392  35.4% -lh5- 7ae3 Jan 22  2021 cranker-0.66/src/lzo/lzo1x_d2.c
[generic]                 1412    4482  31.5% -lh5- efd2 Jan 22  2021 cranker-0.66/src/lzo/lzo1_d.ch
[generic]                 4263   15597  27.3% -lh5- 1bfe Jan 22  2021 cranker-0.66/src/lzo/lzoconf.h
[generic]                17391  116578  14.9% -lh5- ac5e Jan 22  2021 cranker-0.66/src/lzo/lzodefs.h
[generic]                 3096   10314  30.0% -lh5- 2ea2 Jan 22  2021 cranker-0.66/src/lzo/lzo_conf.h
[generic]                  884    1675  52.8% -lh5- 5519 Jan 22  2021 cranker-0.66/src/lzo/lzo_dll.ch
[generic]                 3560   19666  18.1% -lh5- 3ffd Jan 22  2021 cranker-0.66/src/lzo/lzo_func.h
[generic]                 2184    6800  32.1% -lh5- f5b0 Jan 22  2021 cranker-0.66/src/lzo/lzo_init.c
[generic]                 1758    5132  34.3% -lh5- 8ecc Jan 22  2021 cranker-0.66/src/lzo/lzo_mchw.ch
[generic]                 1435    3578  40.1% -lh5- 9ad1 Jan 22  2021 cranker-0.66/src/lzo/lzo_ptr.h
[generic]                21697  118060  18.4% -lh5- 10f1 Jan 22  2021 cranker-0.66/src/lzo/lzo_supp.h
[generic]                 4473   17035  26.3% -lh5- bec7 Jan 22  2021 cranker-0.66/src/lzo/lzo_swd.ch
[generic]                  789    1668  47.3% -lh5- 1562 Jan 22  2021 cranker-0.66/src/main.lua
[generic]                  884    2453  36.0% -lh5- 1b0b Sep 13  2021 cranker-0.66/src/Makefile
[generic]                  103     294  35.0% -lh5- 3bed Jan 22  2021 cranker-0.66/src/MODLIST
[generic]                  388     634  61.2% -lh5- 3d2c Jan 22  2021 cranker-0.66/src/smakefile
[generic]                 1587    5830  27.2% -lh5- ee32 Jan 22  2021 cranker-0.66/src/tek/class.lua
[generic]                 3720   13623  27.3% -lh5- 9e5f Jan 22  2021 cranker-0.66/src/tek/lib/args.lua
[generic]                 1683    4938  34.1% -lh5- 1c34 Jan 22  2021 cranker-0.66/src/tek/lib/compress.c
[generic]                  436    1105  39.5% -lh5- 3dca Jan 22  2021 cranker-0.66/src/tek/lib/tek_lua.h
---------- ----------- ------- ------- ------ ---------- ------------ ----------
 Total        90 files  377277 1276860  29.5%            Mar  5 03:47

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