Skip to content

Commit 4e478e5

Browse files
authored
Add files via upload
1 parent 27daa18 commit 4e478e5

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

Compression/README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,13 @@ Used by ZX0 compressor
4343
?a?b?c?d?e?f?g?h? = ? a ? b ? c ? d ? e ? f ? g ? h ? -> 1:abcdefgh
4444

4545

46-
Reading from the bit stream is always 2 bits apart, so even. This makes it possible to solve the test whether the buffer in `A` is empty only in odd reading.
46+
Reading from the bit stream is always 2 bits apart, so `even`. This makes it possible to solve the test whether the buffer in `A` is empty only in `odd` reading.
4747

4848
A stop bit with a value of 1 is loaded into the accumulator, indicating the end of the data in the buffer.
4949

5050
Each read means moving a bit from `A` to the carry register.
5151

52-
In the case of an odd reading, before using the carry, it is checked whether the accumulator is empty.
52+
In the case of an `odd` reading, before using the carry, it is checked whether the accumulator is empty.
5353
If there is, then there is no data in the carry, but a bit stop.
5454
So, a new byte is read into the accumulator and a new bit is read rotation "rla" or "adc A,A" load a new bit and at the same time set the stop bit.
5555

@@ -60,21 +60,21 @@ So `A` looks like this:
6060
???s0000
6161
?s000000
6262
```
63-
Where `?` is waiting data, `s` is stop bit and `0` is filled.
63+
Where `?` is pending data, `s` is stop bit and `0` is filled.
6464

65-
So another even read is sure that there is data in the accumulator.
65+
So another `even` read is sure that there is data in the accumulator.
6666

67-
All values stored in Elias gamma coding have an odd number of bits.
68-
This, together with one bit specifying the type of the literal, means that the total read is always an even number of bits.
67+
All values stored in Elias gamma coding have an `odd` number of bits.
68+
This, together with one bit specifying the type of the Literal, means that the total read is always an `even` number of bits.
6969

70-
The only exception is the second read of the literal for the new offset.
70+
The only exception is the second read of the Literal for the new offset.
7171

7272
So reading the length is called after the test of the first bit. This means that the stored value must be greater than 1.
7373

74-
That wouldn't be a problem, because the literal is effective from length 2...
74+
That wouldn't be a problem, because the Literal is effective from length 2...
7575

76-
But the author decided to reduce this value by 1 when saving to possibly save space.
77-
So it is solved in such a way that to solve the problem that the length is equal to two, one bit is added.
76+
But the author decided to reduce this value by 1 when saving to possibly save one bit space.
77+
So a way that to solve the problem that the length is equal to two, one bit is added...
7878
It is placed in the LSB offset so that it does not add space.
7979
If the lowest bit is non-zero then Elias is not read and the length is set to 2.
8080

Compression/compres.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ fi
8888

8989

9090
[ ! -d ${to} ] && mkdir ${to}
91-
[ $? != 0 ] && exit 6
91+
[ $? != 0 ] && printf "Error: Not found destination directory!\n" >&2 exit 6
9292

9393
bin_files=""
9494

@@ -128,7 +128,7 @@ do
128128

129129
if [ "$compression" = "zx0" ] ; then
130130
pack_files="$pack_files $to/${no_suffix}.zx0"
131-
./$compression $file ${to}/${no_suffix}.zx0
131+
./$compression -f $file ${to}/${no_suffix}.zx0
132132
error=$?
133133
[ $error != 0 ] && printf "$compression error: $error\n" >&2 && exit 8
134134

0 commit comments

Comments
 (0)