ZX Club #06
31 декабря 1997
  Софт  

Users group - File Compression Screen: Overview of the software. Discography. Analysis of the results of compression.

<b>Users group</b> - File Compression Screen: Overview of the software. Discography. Analysis of the results of compression.
The only independent program,
written by Hughes in his entire Garrisson
life - is it a vital program CREDO.

Crafty hackers (the most cunning of them is his own wife) has 
repeatedly tried to force the vital program of Hughes

Garrissona, but they have nothing came of it.
CREDO program is protected impenetrable selfishness and 
laziness of the author impassable. 

History of creation InterNet. From a letter to Hughes
Garrissona hacker Haku: "Hack!" As long as you can
endure! I have three times I click "mouse"
but your program does nothing that reads my thoughts and print 
them on printer ... And send the editors who will? " And then 
the hacker Haq struck a brilliant idea creating a global 
network InterNet. Now, on the third click "mouse", the immortal

Hughes thought Garrissona sent directly to
purpose: the global community.



        SCREEN FILE COMPRESSION

1. Introduction ........................... 36
2. Overview of the software. Library ............... 133
3. Bibliography ........................ 341
4. Analysis of the results of compression ....... 491



              1. Entry


  This article is addressed primarily
users who do not break the "barrier machine code, but 
something, I dare to hope may be of interest and encoders.



  I am familiar with at least two lovers Spectrum, happy writing
the bulk of the program on Basic, but with caution
and distrust related to everything
is related to Machine Code. And it's not that they are 
fundamentally and categorically do not want to use a bunch of 
obscure tsifirey. Detailed explanation of the basic programming 
techniques in the past is not particularly paid attention, in 
Most articles are all "self-evident", "long known", "not just 
covered," etc. One gets the impression that the authors were 
just too lazy to type a few additional lines of text. And yet

is a category of users for whom
important as these times are missing
line.


  The users who write programs for
Basic, may have the impression that
machine codes, and even more so - issues compression code 
blocks, they do not relate to any side. Is this true? 


  Try to write a program of educational
or for reference without using the compression code blocks or 
in general without the use of machine code. Normal development 
of the program is unlikely to fit in one disc. What will be its 
commercial value? So, Dear Users, if you want your programs

interested in someone else besides yourself, let's get together 
and hurrying to sort out as possible, doing a minimum of tools 
and knowledge to create something similar to this product.



  With confidence I can say that most users are unaware of
many application programs use
which in programming is easy, convenient, and sometimes - is 
necessary. Among These programs may include compressors display 
files, a special place among them is remarkable Laser Compact 
Dmitry Pyankov of Gorno-Altaisk. With bitterness must be noted 
that despite the availability of programs of its existence,

even more so - about its capabilities, know a few local 
sinkleristy. 


                 *


  The main purpose of the program-compressors - saving memory 
space and time data exchange. Depending on your destination 
program compression code blocks can be divided into

two major groups:


       1) compressor, "wrappers";

       2) compressor-archiver.


  The first group includes compressors
autostart programs and, accordingly, an automatic decompression 
code blocks after you download them in compressed form in RAM 
on your computer. Purposes as "packers": Fast downloads from 
Disk and training programs to work (saving time), saving disk 
space. 


  Second group - the more prosaic and is intended solely for 
economical archival storage of data on diskettes. To use the 
archive file, it must first decompress with Using 
the-decompressor, and only then decompressed file can be 
downloaded to your computer. 


  Here we will focus on the analysis of
compressors, "packers", emphasizing
compressive display files - "pictures"
(Address: 16384, length: 6912).



         2. Overview of the software. Discography


    2.1. Specialized programs


  ASC v.2.06


  Andrew Screen Crasher (C) Andrew Sendetsky (Dnepropetrovsk, 
1991). Distributed Inforkom on the system diskette with cipher 
CD18. 


  The program writes the compressed block codes
(Display file with the decompressor), on
at 27000. Loading can produce
at the address of start, located above RAMTOP. To call the 
"picture" on screen, rather, should contact

start:

...
095 REM Load the compressed "image"

        in the computer's RAM
100 RANDOMIZE USR 15619: REM: LOAD

    "Name $" CODE start
105 REM Call the "picture" on the screen
110 RANDOMIZE USR start
...


  Before unpacking the screen (by calling the "pictures" on the 
screen) it is desirable to establish the same color "black" and 
"paper". For example: 

102 INK 0: PAPER 0: CLS

or use the extra screen
Spectrum 128.


  COMPRES * (C) AS Cologne, 1992


  The program terminates short of "picture" of
at 50000. You can download the code block
at any address, start and cause
"Picture" to the screen command RANDOMIZE USR
start. Distributed Inforkom on the system diskette with the 
code CD10, CD13. 


  VD v.1.2


  Visual Decompressor (C) Thimoty (St. Petersburg, 1995), from 
a software application e-zine "Spectrofon", 14. During 
compression the display file is given one of the 12 possible 
modes of inference "pictures" on the screen. Nontrivial 
conclusion "pictures" overestimates the length of compressed 
code block, but it is fully compensated for the service: the 
problem of the spectacular display on the screen saver is 
solved automatically. Load address of code blocks: 40000 
(unmovable file). 


  LC v.3.1


  Laser Compact (C) Dmitry Pyankov (Gorno-Altaisk, 1995). 
Distributed Inforkom on the system diskette with the code and 
AC12 author: 659,700 rep. Altai, Gorno-Altaisk, st. 
Choros-Gurkin, 49 - 6. Since December 1997. to disseminate 
programs Dmitry Pyankov joined ZX-club (Barnaul). Author 
diskette can be ordered at Editorial "ZX-club" or buy into the 
firm Komel department store "Maple" (Barnaul,

st. G. Isakov, 239).


  The program creates self-extracting
relocatable file: address discharge - 40000;
load address - is arbitrary. As
packet to the Laser Compact is attached
Program Connect LC v.3.1, allowing
combine compressed image in a code block with the ability to 
call the "pictures" on the screen by its number in the 
generated block. Besides the obvious convenience use of such a 
candy bar in the program, the length of the candy bar is less 
than the arithmetic sum of the lengths of its constituent 
compressed "images." Additional features LC: Compression of 
individual segments of the screen (1 st, 2 nd, Third), the 
compression segment pairs (1-2, 2-3). 


     2.2. Programme of general-purpose


  PCD v.6.1


  Powerful Code Decreaser (C) KSA (Moscow, 1996). Distributed 
by Inforkom system diskette with the code AC32.



  The program has two modes:
screen (display file compression), code
(Compression code blocks). By default,
compressed "image" is discharged, together with the 
decompressor at 49,152; download - at any address. If you wish 
to address unloading can be changed as well - record 
uncompressed file without decompression. The obvious drawback 
of the program - amazed confusion: the operations on

which other compressors go in seconds, take up working with PCD
already minute usage time. Comprehensive testing program was 
not in my plans, so the following remark is not an absolute 
truth, but a case of working practices with the compressor on 
emulator UKV Spectrum Debugger v.1.2 (K. Uglekov, Moscow). When 
the program starts from the regime of 128K and further attempts 
to bring a compressed "image" on the screen from BASIC, 
computer freezes completely and irrevocably. Correct work - 
using the 48K. 


  HRUM v.3.5i (C) Dmitry Pyankov, 1997.


  Distributed by the author: 659,700 rep.
Altai, Gorno-Altaisk, st. Choros-Gurkin, 49-6. HRUM v.3.5i part 
of the Disc authoring Dmitry Pyankov (see above - LC v.3.1).



  Separate treatment program did not screen
has, therefore, the average compression ratio
namely on-screen file it is somewhat lower than that of the 
specialized programs ASC and Laser Compact. However, on the 
overall work: the degree of compression, while Operation - HRUM 
significantly exceed program PCD. More information on the 
program, see the article by Dmitry Pyankov "Compression of code 
blocks. 


  Perhaps a program of general purpose
which is HRUM, incorrectly mentioned in the article devoted to 
the special matter compression display files. Firstly, - HRUM 
designed to compress heterogeneous information: text, graphics,

sound, etc. Secondly, - graphic files
such programs to unpack, as a rule, not the screen, in a 
dedicated for this buffer, and only after decompressing image 
is thrown onto the screen. AND Yet I not only left the program 
in Review of the software, but also introduced her to the table

comparative tests. The reasons have prompted me to make this 
decision, will be discussed separately in the fourth paragraph 
of this article. 


                 *


  As a summary of the Review of the software
make a few considerations that have arisen in
me during the preparatory work.


  The apparent abundance of software is deceptive. Trying to 
"separate the wheat from the chaff, I watched almost all

public programs and found only
Four (4) workable and not morally
obsolete (meaning specialized programs-packers display files). 
To the above list you can add the program SUPERPAK v.2.0 (C) V. 
Vasilevsky / V. Kataev (Kirov / Vyatka 1993) - code CD9 catalog 
Inforkom. However, I have copies available, including 
distributive, successfully pressing the "pictures" in no way 
wish to decompress. However, and a valid copy of can be safely 
classified as a moral legacy. And, morally, this program could 
not compete even at the moment publication.



  Particular attention should be paid to the
COPYRIGHT annotations to the program: Be wary of statements like
"... The best (most powerful) today
Day ...", "... does not have analogues on the effectiveness of 
..." etc. Such assurances are present in virtually all 
mentioned programs. Looking ahead, I will say that the block 
exponent compression-screen program files 91-year (ASC v.2.6) 
was only at the end 95-year (LC v.3.1)! And how to understand 
if the words "... the best screen optimizer ...", Related to 
program 96-year (PCD v.6.1), if on the parameters it is 
inferior even to ASC '91? Perhaps the reason for such confusion 
lies in the lack of works as a survey character and work

research - on specific issues.
Try, at least in part, to fill
this gap.


             3. Bibliography


  This paragraph could give a name
"In the pages ZX-Revue", because I have no
time, no particular desire to bury his head in the compression 
issues and conduct wide search, shtudiruya special literature. 
Another thing - "Handbook" sinklerista, which undoubtedly can be

include books Inforkom of graphic series. On the feasibility 
review materials I mentioned above, here Updated: began to 
develop an issue, just need to learn from their predecessors, 
if you will not be in a ridiculous position, "the inventor of a 
bike." In addition, having at hand a bibliographic reference, 
you can quickly pick up ready-made procedure for use in its 
program. 


  3.1. The theory of compression code blocks


  3.1.1. ZX-Revue 1 / 95.: Professional
approach. - With. 16-22.

Sergei Simonovic. Archiving, compression,
compression. "... There are many different
methods of data compression. But if you look at their essence, 
we can distinguish two main naprvleniya. First naprvlenie 
represent a variety of methods based by using long sequences

duplicate data (method RLE - Run
Length Encoding). Second naprvlenie associated with using 
non-repeating length data, and the frequency of their 
repetition, and these methods are based on an algorithm named 
after Huffman (Huffman). "


In connection with the description of the method of Huffman for
gives examples of two systems of binary
coding of characters and uncover the secret of compiling 
dictionaries in computer games. 


  3.1.2. Applied Graphics. - M.: Inforkom, 1993, pp. 57-67.

The principle of packing capture, which consists in creating a 
file template graphics. At the same time for each screen must 
be created "Map" placement patterns. Compression techniques 
discussed in detail for the preparation of archive (library) 
patterns and decompression of templates to display them in a 
display file or in a buffer screen.


Here we have in mind that the archived
data constitute a single block of code to any program, are an 
integral part and are loaded with it in RAM computer.



         3.2. Compression Graphics


  3.2.1. Collection ZX-Revue '91.: MACHINE
CODE. - With. 6, 24.

Procedures for compression / decompression screen.
Author: N. Devyatko, Nalchik. Assembly code of the programs 
supplied with detailed commentary, which makes it possible to 
understand implementation of the compression algorithm. If 
desired, you can type a hex dump and use the code block in 
their programs. 


  3.2.2. Collection ZX-Revue '93.: Forum. - With.
59-63.

1. The program "Compressor". Basic-Program
boot code blocks: a character set, a compressor / decompressor 
screen files. Author compression procedure: Alexander Balashov, 
Konakovo Tver region. The program is designed to work with 
recorder and the procedure completed boot code block without a 
title. Assembly code of procedure, compression accompanied by 
detailed commentaries, which give representation on the 
algorithm of the procedure; parallel computer codes are in 
hexadecimal representation. 

2. Another option compression screens. "...
At the core of the program contains a well-known
many users block codes, "compress"
CODE 28000, 650. Beysikovaya part is made
virtually from scratch, which allowed to use the program with 
greater convenience and pleasure. In addition, we give two

version of the program: Tape and
drive. ... Perhaps the compression
as the entire screen, and randomly selected
any one or two adjacent segments
screen (compare with LC v.3.1. - SWdZ) ".

The article discussed in detail Beysikovaya
part of the program, and the results of comparative tests, 
which held the author of this text, are shown in Table 4.1 (see 
below). 


  3.2.3. ZX-Review 3 / 96.: Forum. - With. 41-45.

The procedure for compression / decompression of the screen
"COMPRESSOR 2. Author: Dmitry Bulavin, city
Samara. "... I suggested that the beneficial
compress the screen is not on the lines, and on
familiarity, ie, first 8 bytes of 1
familiarity, then 8 bytes are read and
etc. It turns out that the first byte of the 1 st
familiarity compared to the second, the second with
3rd ,..., 8th with the first byte of the next
familiarity. "

Beysikovaya part of the program, the compressor is written to 
work with the recorder. Code compressor unit is loaded with

BASIC DATA command.


  3.2.4. Elementary schedule. - M.: Inforkom, 1993, pp. 201-207.

In the third part of the book - Workshop on the graph in the 
native - are coded blocks and disassembler software compression 
/ decompression of the screen. To send a procedure parameters - 
the address from which begins the area reserved for the 
compressed images, and the address from from which the stored 
compressed image - proposed device based for use in BASIC 
user-defined functions - DEF FN. Details with this technique 
can be found by reading the chapter "Standard Format function 
user "(p. 109-111). 


     4. Analysis of the results of compression

             display files


  For analysis, we selected 10 screens
files, 8 of which are well known, are the intros to the games 
and were cited as examples in articles published in the 
"ZX-Revue" (see Section 3 "Bibliography"). The results of 
compression are summarized in Table. 4.1. To view the "image", 
press one of numeric keys: <1> - $ 1 ... <0> - $ 10.



                               Table 4.1

Compromise. / ASC Comp Comp LC 3.1 '95 PCD HRUM
Screen. v2.6 res * ress 6.1 3.5i
file 1991 1992 1993 1996 1997 max

$ 1 1402 2209 2306 1246 1327 1352 1310
$ 2 1896 3182 3185 1673 1813 2427 2367
$ 3 1986 3072 3070 1676 1851 2573 2509
$ 4 2205 2203 2128 2021 2086 2452 2386
$ 5 2237 3553 4205 2054 2177 2747 2654
$ 6 2292 2613 2545 2126 2248 2632 2554
$ 7 3080 3433 3439 2797 2889 3180 3125
$ 8 3364 3925 3946 3156 3281 3839 3723
$ 9 3659 3456 3638 3342 3464 3255 3194
$ 10 3922 4595 4731 3697 3916 4305 4198

Total: 25.4 31.2 32.4 23.2 24.5 28.1 27.4

AP,% 62,3 53,4 52,0 65,6 63,8 58,4 59,5

Notes:

1. When you use the Connect LC
v.3.1, total block of 10 compressed
"Pictures" are as follows:

mode of maximum compression is enabled -

                     - 22,542 bytes (67.4%);
maximum compression mode off -

                     - 23,806 bytes (65.6%).

2. The average compression ratio as a percentage
(Average percent):


       AP = [(TL - TLC) / TL] * 100%


  Naturally, the value of AP is correct
operate only for a certain set of screens.

3. The total amount of codes in uncompressed form
(Total length):


            TL = scr * n, B

 where scr - standard screen 6912 bytes;

       n - the number of screens, pcs.

4. The total amount of code in a compressed form:

TLC = scr (1) + scr (2) +...+ scr (i) + ...
... + Scr (n), B

 where scr (i) - volume of i-th screen in a compressed

              as bytes.

5. In line <Total> total in the compressed
as given in kilobytes: TLC/1024


                 *


  From a comparison of the results of compression
shows that the average program with the objective of general 
purpose compression display files cope less specialized 
programs, but in some cases (such as files $ 1 and $ 9) - is 
better. This confirms once more concluded that the issues of 
compression code blocks require individual and careful 
approach. Pay attention to the mentioned "Image" $ 1 and $ 9. 
In this set, they are limiting examples of "loose"

($ 1) and "dense" ($ 9) graphics. Therefore,
not surprising that the program utility efficiently compress 
these "pictures" since they are designed to work with exactly 
the kind of information: either the maximum ordered ("loose"), 
or the maximum disordered ("dense").



  To complete the cite criticism Dmitry Pyankov who carefully 
read the drafts and answered questions author of the article. 
When working decompressor, Program "... ASC, PCD, HRUM prohibit

interrupts, and output - are allowed. Therefore, when unpacking 
screen music, "hanging" on IM 2, is "whinge". Laser Compact 
does not change the status of interrupts, so the music while 
unpacking screensavers are not "howling "...". Next Dm. Pyankov 
wrote that the unpacker (decompressor) ASC this shortcoming is 
corrected to read as follows: Team Di (zero bytes) clogged 
NOP'om (zero). I'd add that "the team to score NOP'om Di" in 
the forces is not for everyone. And why? Table 4.1 shows 
clearly that the best file compressor on display today day 
program is a Laser Compact. Note the last paragraph with 
respect to status interrupt finally convinces

correctness of this conclusion.


                              Hughes Garrisson




Other articles:

From the Editor - ZX-CLUB growing and evolving.

Soft group - Driver input modes consistent and direct access from the file system TR-DOS. How to use driver.

Hard group - ZS Scorpion 2000 - on the GMX-controller.

Users group - File Compression Screen: Overview of the software. Discography. Analysis of the results of compression.

Users group - Compression code blocks - work with HRUM v3.5.

News - Barnaul Olympiad in Informatics 1997.

News - Barnaul firm Komel decided podderzhkeavtorskih programs.

News - contest for the best virus continues.

Dossier - On the activity of Barnaul programmers: Krotov Oleg Mayatsky Vitali, Rostov Alexander Kovalev Roman (DJ RUSH), Norton Commander (NC).

ZX-Potpourri - Letters from readers from Magadan and carpet, Voronezh, and Cheboksary.

Enjoy - How to Marry a programmer.

Fantasy - A Tale VA Petersburg "The Fourteenth Dimension".

Toys - Novella to the game "BISMARK".

Toys - a description of the game "BISMARK".

Toys - Dictionary of the game "BISMARK".


Темы: Игры, Программное обеспечение, Пресса, Аппаратное обеспечение, Сеть, Демосцена, Люди, Программирование

Similar articles:
Programming - Driver memory.
BBS - list of stations BBS ZXNet.
solid jokes - A story about a woodpecker.

В этот день...   2 May