gunzip.c64

classic Classic list List threaded Threaded
22 messages Options
12
Reply | Threaded
Open this post in threaded view
|

gunzip.c64

Pasi Ojala
I added a very early beta version of my gzip decompressor
to the web at http://www.cs.tut.fi/~albert/Dev/ -> gunzip.c64

You are welcome to try it. (A diskimage was decompressed
in 8:15 with a 1581, makes it 0.345kB/sec. But this is just
the first version.)

Current operation reads a named gzipped file from a named
drive and decompress the contents to another named drive (so
you can use two drives). If a file contains many concatenated
gzip-files, they are all decompressed.

All three deflate modes are supported: stored, fixed huffman and
dynamic huffman.

What it lacks is
1) 'proper' load and save routines
   (even just changing from CHARIN/CHAROUT to serial bus routines
    would probably help)
2) 'spiffy' user interface
3) most error checking (how do I check for "file not found" and
   "file already exists" after OPEN? Do I absolutely need to open
   a command channel for that?)
4) direct write mode for D64.gz -> disk

So, anyone interested in helping me in these?

-Pasi
--
"In the memory of the nine and the one."
        -- Sheridan waking up in Babylon 5:"Confessions and Lamentations"
-
This message was sent through the cbm-hackers mailing list.
To unsubscribe: echo unsubscribe | mail [hidden email].

Reply | Threaded
Open this post in threaded view
|

Re: gunzip.c64

Russell Reed

-----Original Message-----
From: Ojala Pasi 'Albert' <[hidden email]>
To: [hidden email] <[hidden email]>
Date: Saturday, February 27, 1999 6:01 PM
Subject: gunzip.c64


>I added a very early beta version of my gzip decompressor
>to the web at http://www.cs.tut.fi/~albert/Dev/ -> gunzip.c64


Pasi, were you aware that Errol Smith's unzip program will handle gzip files
as well?

http://www.ros.com.au/~errol/64.html

Russell Reed


-
This message was sent through the cbm-hackers mailing list.
To unsubscribe: echo unsubscribe | mail [hidden email].

Reply | Threaded
Open this post in threaded view
|

Re: gunzip.c64

Pasi Ojala
> Pasi, were you aware that Errol Smith's unzip program will handle
> gzip files as well?

I did not know the new version has been released. The last I
read in comp.sys.cbm was that the next version will do this.
I had some talks with Errol many months ago, but still decided
to go ahead with my own version. After spending a week in
bad flu I decided to finish it. Of course hoping that my
version would be faster.

Just checked. Both gunzip.c64 and unzip64v2 took 8 minutes to
dissolve a test disk image I had (the result is 170.75kB).
Okay. Now I just have to make my version doubly faster.. :-)
(It would've been a real disappointment to have my version be
 a lot slower, what a relief..)

-Pasi
--
"So, if we go down there, it blows. If we don't it blows anyway,
 just a little later. It's a good thing I'm russian, we're used to
 hopeless situations."
        -- Ivanova to Sinclair in Babylon 5:"A Voice in the Wilderness #2"
-
This message was sent through the cbm-hackers mailing list.
To unsubscribe: echo unsubscribe | mail [hidden email].

Reply | Threaded
Open this post in threaded view
|

Re: gunzip.c64

Nicolas Welte-2
Ojala Pasi 'Albert' wrote:
> Just checked. Both gunzip.c64 and unzip64v2 took 8 minutes to
> dissolve a test disk image I had (the result is 170.75kB).
> Okay. Now I just have to make my version doubly faster.. :-)
> (It would've been a real disappointment to have my version be
>  a lot slower, what a relief..)

Did you use some sort of DOS speeder? 8 minutes sounds a lot like the
time needed to transfer the source into memory and the result back to
disk with the slow Commodore DOS. I guess I'll give it a try with some
emulator and disk i/o switched to fast emulation.

Nicolas
-
This message was sent through the cbm-hackers mailing list.
To unsubscribe: echo unsubscribe | mail [hidden email].

Reply | Threaded
Open this post in threaded view
|

Re: gunzip.c64

Nicolas Welte-2
In reply to this post by Pasi Ojala
Ojala Pasi 'Albert' wrote:
> Just checked. Both gunzip.c64 and unzip64v2 took 8 minutes to
> dissolve a test disk image I had (the result is 170.75kB).

I checked both programs under PC64 (100% CPU) with fast disk emulation
now and both took 56s to dissolve an example d64.gz of mine. So adding a
disk turbo would probably help a _lot_ for decompression time. One step
d64.gz to real 1541 disk would be even better, of course ;-)

Nicolas
-
This message was sent through the cbm-hackers mailing list.
To unsubscribe: echo unsubscribe | mail [hidden email].

Reply | Threaded
Open this post in threaded view
|

Re: gunzip.c64

Peter Karlsson
In reply to this post by Pasi Ojala
> 4) direct write mode for D64.gz -> disk

Cool. Hmmm. Perhaps I should switch to use d64.gz as the distribution format
for my PD library disks...?

--
\\//
Peter - http://www.softwolves.pp.se/cbm/

-
This message was sent through the cbm-hackers mailing list.
To unsubscribe: echo unsubscribe | mail [hidden email].

Reply | Threaded
Open this post in threaded view
|

Re: gunzip.c64

Andre Fachat
In reply to this post by Nicolas Welte-2
Nicolas Welte wrote:
> Ojala Pasi 'Albert' wrote:
> > Just checked. Both gunzip.c64 and unzip64v2 took 8 minutes to
> > dissolve a test disk image I had (the result is 170.75kB).
>
> I checked both programs under PC64 (100% CPU) with fast disk emulation
> now and both took 56s to dissolve an example d64.gz of mine. So adding a
> disk turbo would probably help a _lot_ for decompression time. One step
> d64.gz to real 1541 disk would be even better, of course ;-)

Why not build in a mode to use the "b-w" floppy commands to
directly write it to a disk (or did I miss something and it does
so already?)

Andre

--
Email address may be invalid. Use "fachat AT physik DOT tu-chemnitz DOT de"
------Fight SPAM - join CAUCE http://www.cauce.org------Thanks, spammers...
Andre Fachat, Institute of physics, Technische Universität Chemnitz, FRG
                http://www.tu-chemnitz.de/~fachat
-
This message was sent through the cbm-hackers mailing list.
To unsubscribe: echo unsubscribe | mail [hidden email].

Reply | Threaded
Open this post in threaded view
|

Re: gunzip.c64

Marko Mäkelä-2
On Mon, 1 Mar 1999, Andre Fachat wrote:

> Why not build in a mode to use the "b-w" floppy commands to
> directly write it to a disk (or did I miss something and it does
> so already?)

B-W is a bit problematic, since it can mess up with the buffer pointer
(set with B-P), but U2 should work properly.  You can get the example code
from prlink's prdisk.  It supports up to 999 tracks and sectors and uses
the ILLEGAL TRACK OR SECTOR error for stepping tracks.

But using sector interleave 1 is not optimal.  You should try to use a
better interleave (maybe try making the interleave smaller until the time
between sector writes increases).  This requires a table of flags, for
determining which sectors have already been written, and of course a
buffer for the whole track (not a problem on the C64, but on the VIC-20
it could be).

Also, the check whether all sectors on the track have been written becomes
a bit more tricky, since you can get the ILLEGAL TRACK OR SECTOR message
e.g. for sector 25 if using interleave 5, while the track has sectors
0..21, and you've written everything but sector 21.

In order to speed up the transfer further, you should have fully custom
track-write routines.  In this case the write would only work on 1541
compatible drives, but this shouldn't be a problem, since you typically
want to extract the files to 1541 disks.  Besides, the slow but compatible
method could be provided as an alternative.

        Marko

-
This message was sent through the cbm-hackers mailing list.
To unsubscribe: echo unsubscribe | mail [hidden email].

Reply | Threaded
Open this post in threaded view
|

Re: gunzip.c64

Andre Fachat
Marko Mäkelä wrote:

> On Mon, 1 Mar 1999, Andre Fachat wrote:
>
> > Why not build in a mode to use the "b-w" floppy commands to
> > directly write it to a disk (or did I miss something and it does
> > so already?)
>
> B-W is a bit problematic, since it can mess up with the buffer pointer
> (set with B-P), but U2 should work properly.  You can get the example code
> from prlink's prdisk.  It supports up to 999 tracks and sectors and uses
> the ILLEGAL TRACK OR SECTOR error for stepping tracks.

Argh. Slap me on the back of my head ;-)

I meant U2 of course. My small Basic/ML programs "disk2file" and "file2dsk"
for the PET and C64 use exactly the same ILLEGAL TRACK OR SECTOR trick
to dump/restore any CBM disk image. However, I had to implement a check
for track 78 or so because reading an 8050 (single sided) disk on a
8250 (double sided) drive gives a READ ERROR but no ILLEGAL TRACK OR SECTOR.

BTW, I uploaded those prgs to funet, where did they end up?

Andre

--
Email address may be invalid. Use "fachat AT physik DOT tu-chemnitz DOT de"
------Fight SPAM - join CAUCE http://www.cauce.org------Thanks, spammers...
Andre Fachat, Institute of physics, Technische Universität Chemnitz, FRG
                http://www.tu-chemnitz.de/~fachat
-
This message was sent through the cbm-hackers mailing list.
To unsubscribe: echo unsubscribe | mail [hidden email].

Reply | Threaded
Open this post in threaded view
|

Re: gunzip.c64

Marko Mäkelä-2
On Mon, 1 Mar 1999, Andre Fachat wrote:

> BTW, I uploaded those prgs to funet, where did they end up?

/dev/null, it seems, unless they are part of an archive file.  A grep on
/pub/cbm/ALLFILES doesn't reveal anything.  Could you upload them again?

Also, I think I should create an HTML document tree under /pub/cbm.  It
could house all the stuff from your page and from my CBM page (and maybe
from other pages whose authors wish so).  Could you maybe upload your home
pages to ftp.funet.fi, including the Perl scripts you use for generating
the indices? (that's the plural for index, isn't it?)

        Marko

-
This message was sent through the cbm-hackers mailing list.
To unsubscribe: echo unsubscribe | mail [hidden email].

Reply | Threaded
Open this post in threaded view
|

Re: gunzip.c64

Andre Fachat
Marko Mäkelä wrote:
> On Mon, 1 Mar 1999, Andre Fachat wrote:
>
> > BTW, I uploaded those prgs to funet, where did they end up?
>
> /dev/null, it seems, unless they are part of an archive file.  A grep on
> /pub/cbm/ALLFILES doesn't reveal anything.  Could you upload them again?

done.

> Also, I think I should create an HTML document tree under /pub/cbm.  It
> could house all the stuff from your page and from my CBM page (and maybe
> from other pages whose authors wish so).  Could you maybe upload your home
> pages to ftp.funet.fi, including the Perl scripts you use for generating
> the indices? (that's the plural for index, isn't it?)

Ah, which parts of my homepage do you want to host?
Including the selfbuilt 6502 computers? That makes about 17M.
(Vice has moved already, luckily :-) [2]

I can send you the _shell_ scripts as well[1], although they can
be found on my homepage. However, before I would put them
on funet, I would clean up and update the pages etc.
And I can only do this after my PhD.

Andre

[1] May Perl be fort to hell ;-)
[2] Although it made my web pages the second-most accessed user page
    of the Chemnitz University :-)
--
Email address may be invalid. Use "fachat AT physik DOT tu-chemnitz DOT de"
------Fight SPAM - join CAUCE http://www.cauce.org------Thanks, spammers...
Andre Fachat, Institute of physics, Technische Universität Chemnitz, FRG
                http://www.tu-chemnitz.de/~fachat
-
This message was sent through the cbm-hackers mailing list.
To unsubscribe: echo unsubscribe | mail [hidden email].

Reply | Threaded
Open this post in threaded view
|

Re: gunzip.c64

Cameron Kaiser
>[1] May Perl be fort to hell ;-)

HEY!

Look for my Perl BASIC<->ASCII tokeniser/lister combo in Perl Journal #14.

--
Cameron Kaiser *** http://calvin.ptloma.edu/~spectre/ *** [hidden email]
"Please dispose of this message in the usual manner." -- Mission: Impossible
-
This message was sent through the cbm-hackers mailing list.
To unsubscribe: echo unsubscribe | mail [hidden email].

Reply | Threaded
Open this post in threaded view
|

Re: gunzip.c64

Marko Mäkelä-2
In reply to this post by Andre Fachat
On Tue, 2 Mar 1999, Andre Fachat wrote:

> Ah, which parts of my homepage do you want to host?
> Including the selfbuilt 6502 computers? That makes about 17M.

That would still be only a few percent of the current size of /pub/cbm.

> I can send you the _shell_ scripts as well[1], although they can
> be found on my homepage.

I bet you haven't tested the scripts with "funny" characters in command
line arguments or file names.  Perl doesn't require double quotes around
all variable names.  Well, but don't let's start a flame war on this.

> However, before I would put them on funet, I would clean up and update
> the pages etc. And I can only do this after my PhD.

That's fine with me.

        Marko

-
This message was sent through the cbm-hackers mailing list.
To unsubscribe: echo unsubscribe | mail [hidden email].

Reply | Threaded
Open this post in threaded view
|

Re: gunzip.c64

Howard Herman
In reply to this post by Cameron Kaiser
Cameron Kaiser wrote:
>
> >[1] May Perl be fort to hell ;-)
>
> HEY!
>
> Look for my Perl BASIC<->ASCII tokeniser/lister combo in Perl Journal #14.

And, where might one find PJ#14?
--
                    ___  ___  ___      ___  ___
                   / //_/ // / //     / //_/ //
Howard Herman     / ___  // / //___  / ___  //
[hidden email]    /_// /_// /_____// /_// /_//
-
This message was sent through the cbm-hackers mailing list.
To unsubscribe: echo unsubscribe | mail [hidden email].

Reply | Threaded
Open this post in threaded view
|

Re: gunzip.c64

Cameron Kaiser
>> HEY!
>>
>> Look for my Perl BASIC<->ASCII tokeniser/lister combo in Perl Journal #14.
>
>And, where might one find PJ#14?

Comes out on newsstands late March/early April, I believe. See

http://www.tpj.com/

--
Cameron Kaiser *** http://calvin.ptloma.edu/~spectre/ *** [hidden email]
"Please dispose of this message in the usual manner." -- Mission: Impossible
-
This message was sent through the cbm-hackers mailing list.
To unsubscribe: echo unsubscribe | mail [hidden email].

Reply | Threaded
Open this post in threaded view
|

Re: gunzip.c64

Cameron Kaiser
In reply to this post by Howard Herman
>> HEY!
>>
>> Look for my Perl BASIC<->ASCII tokeniser/lister combo in Perl Journal #14.
>
>And, where might one find PJ#14?

Oopsie. It's issue #13, in any case.


--
Cameron Kaiser *** http://calvin.ptloma.edu/~spectre/ *** [hidden email]
"Please dispose of this message in the usual manner." -- Mission: Impossible
-
This message was sent through the cbm-hackers mailing list.
To unsubscribe: echo unsubscribe | mail [hidden email].

Reply | Threaded
Open this post in threaded view
|

Re: gunzip.c64

Pasi Ojala
In reply to this post by Marko Mäkelä-2
> But using sector interleave 1 is not optimal. [..]
> buffer for the whole track (not a problem on the C64, but on the VIC-20
> it could be).

You need a 32kB buffer anyway for the LZ77 history buffer. It doubles
as an output buffer. I generate 32kB of data and then write the whole
buffer, then generate another 32kB etc..

Currently I simply use the 1-interleave as it was important to just
get it working. There is time later to make it intelligent.

> In order to speed up the transfer further, you should have fully custom
> track-write routines.

Because of two simultaneously open channels that really means custom.
In practise you need to be able "abort" the transfer at any point
and switch from read to write device and vice versa.

I'll go the slow-but-compatible path a while still. Then it's maybe
time for other people to take it from there..

-Pasi
--
"You are going to resist, I hope."
        -- Ivanova to Major Lianna Kemmer in Babylon 5:"Survivors"
-
This message was sent through the cbm-hackers mailing list.
To unsubscribe: echo unsubscribe | mail [hidden email].

Reply | Threaded
Open this post in threaded view
|

Printer 4022 problems

Geoff Oltmans
In reply to this post by Andre Fachat
Hey guys!

I've got a 4022 printer that doesn't work. I can't even make it do the
self-test print pattern (that is, if it does a print pattern). The paper
out light does blink five times in a repeating pattern. Any clues?

I've tried changing the 6522 since I had some of those laying around,
but that didn't help.

Oh yeah, the printer does this when connected or not to the computer.
(well, at least while the reset line on the IEEE port is high, if the
computer is off, it doesn't blink at all).

*Geoff!*
-
This message was sent through the cbm-hackers mailing list.
To unsubscribe: echo unsubscribe | mail [hidden email].

Reply | Threaded
Open this post in threaded view
|

Re: Printer 4022 problems

Larry Anderson
Geoff Oltmans wrote:
>
> Hey guys!
>
> I've got a 4022 printer that doesn't work. I can't even make it do the
> self-test print pattern (that is, if it does a print pattern).

I think it does, I used a 2022 in school and it had one.  Hold down the
line-feed button when you turn it on...

> The paper
> out light does blink five times in a repeating pattern. Any clues?

It's obviously an error message, but I don;t have nay blink-code references
for printers... for the 8050/8250 5 means - Zero Page - 6530, K3, 6504, H3;
But I don't think it would match for the 4022...  :/

> I've tried changing the 6522 since I had some of those laying around,
> but that didn't help.


Only thing I can think of (as I'm not the hardware expert) is check the fuses,
I know on later printers (MPS 801) there is more than one fuse in it.

> Oh yeah, the printer does this when connected or not to the computer.
> (well, at least while the reset line on the IEEE port is high, if the
> computer is off, it doesn't blink at all).


--
01000011 01001111 01001101 01001101 01000100 01001111 01010010 01000101
Larry Anderson - Sysop of Silicon Realms BBS (209) 754-1363 - 2400 baud
  Commodore 8-bit page at: http://www.jps.net/foxnhare/commodore.html
01000011 01001111 01001101 01010000 01010101 01010100 01000101 01010011
-
This message was sent through the cbm-hackers mailing list.
To unsubscribe: echo unsubscribe | mail [hidden email].

Reply | Threaded
Open this post in threaded view
|

Re: gunzip.c64

Pasi Ojala
In reply to this post by Nicolas Welte-2
> disk turbo would probably help a _lot_ for decompression time. One step
> d64.gz to real 1541 disk would be even better, of course ;-)

Gunzip.c64 version 0.5 now has both two-drive and one-drive
d64.gz -> 1541 disk routines. It was surprisingly easy to code.
Well, maybe not so easy, but I didn't need to debug the code
at all because it worked on the first try. And fortunately it
worked the second time also!:-)

http://www.cs.tut.fi/~albert/Dev/ -> gunzip.c64

So, current features:
- decompresses gzip and zip packets
- enter input filename or select from directory
  (enter empty filename)
- CRC32 and file size checking
- can skip files and change output names or dissolve all
  (handy for file types, e.g. d.txt -> d.txt,s,w)
- standard file I/O (+ custom 1541 disk write)
- d64.gz -> 1541/1571 disk image with one drive (10mins)

Error checking is not complete, but adequate. If you are
using a single drive for a d64.gz->1541 disk, you better
change the disk when it is requested. There's no checking
for which disk is in the drive..

Tested with 1581 and 1541-II. Comments on behavior with 1571
(and other drives?) are appreciated. And other comments also.

A thought: if you have two related d64 images that compress
well enough (so they fit in 644 blocks), you can just cat them
together and have both disk sides conveniently in one file and
you can very easily unpack both sides with gunzip.c64.
I didn't try this though..

-Pasi
--
"It might be helpful for you to know that you are not alone. And that
 in the long, twilight struggle, which lies ahead of us, there is the
 possibility of hope."
        -- Draal to Sheridan in Babylon 5:"The Long, Twilight Struggle"
-
This message was sent through the cbm-hackers mailing list.
To unsubscribe: echo unsubscribe | mail [hidden email].

12