Welcome, Guest. Please login or register.


Author Topic: UnZIP ("Deflate") tool for Z80 machines - any interests? :) (Read 7591 times)

Offline Prodatron

  • EP user
  • *
  • Posts: 256
  • Country: de
  • Back on the Z80
    • http://www.symbos.de
Hi guys,

in the MSX scene there is currently a rush regarding UnZIP tools, which are based on the "deflate" algorythm, which is used for ZIP archives, GZIP (GZ) files, PNG graphics etc.
- GuyveR800 released the first UnZIP tool for ZIP archives ever for the MSX in July this year
- Grauw released the first version of Gunzip in October, which is for GZ(ip) files
- as it's open source Louthrax was able to release his tool SofaUnZip for ZIP archives only 9 days later, which can even handle long filenames and subdirectories
- Grauw and Wouter managed to improve the speed of the uncompressor a lot, and so yesterday Wouter released his modified version of the Deflate uncompressor as well
- I am currently working on a version for SymbOS

So we will have 5 different Un(G)Zip tools for the MSX within one year, which is quite funny. The SymbOS version, which will support both ZIP and GZ files, of course will run on all supported platforms, so on the EP as well :) I just wonder if someone is interested in building a version for EXOS directly? Using the source codes of Grauw or Wouter should be quite easy (I will release my as well as soon as it is finished).

CU,
Prodatron

Offline Zozosoft

  • Global Moderator
  • EP addict
  • *
  • Posts: 14721
  • Country: hu
    • http://enterprise.iko.hu/
Re: UnZIP ("Deflate") tool for Z80 machines - any interests? :)
« Reply #1 on: 2015.November.12. 15:52:06 »
Wow, great news!
Many years ago I searched about unzip for Z80, but don't found.

Offline Prodatron

  • EP user
  • *
  • Posts: 256
  • Country: de
  • Back on the Z80
    • http://www.symbos.de
Re: UnZIP ("Deflate") tool for Z80 machines - any interests? :)
« Reply #2 on: 2015.November.12. 16:09:08 »
Many years ago I searched about unzip for Z80, but don't found.
The only other Z80 based project I know is Samflate for the Sam Coupe:
http://sourceforge.net/projects/samflate/
The advantage of the Deflate algorithm is the fact, that the size of the dictionary is "only" 32KB. So it can still be handled by the Z80 within the visible address room in a good way. Most other modern compression algorithms are working with (much) larger dictionaries. And ZIP is still the most popular format.

Offline lgb

  • EP addict
  • *
  • Posts: 3563
  • Country: hu
  • æðsta yfirmaður
    • http://lgb.hu/
Re: UnZIP ("Deflate") tool for Z80 machines - any interests? :)
« Reply #3 on: 2015.November.12. 17:50:45 »
Hmm, cool, guessing what can be done still with SymbOS as a future development plan :) And for SymbOS file browser you can even "change directory into" the archive as with the file browsers on "big" machines? :)

Offline Prodatron

  • EP user
  • *
  • Posts: 256
  • Country: de
  • Back on the Z80
    • http://www.symbos.de
Re: UnZIP ("Deflate") tool for Z80 machines - any interests? :)
« Reply #4 on: 2015.November.16. 20:46:46 »
For the command line interface (SymShell) it's more easy, so I started this one.

[ Guests cannot view attachments ]

[ Guests cannot view attachments ]

But a GUI based applications will follow as well, it's not that difficult :)

Offline Zozosoft

  • Global Moderator
  • EP addict
  • *
  • Posts: 14721
  • Country: hu
    • http://enterprise.iko.hu/
Re: UnZIP ("Deflate") tool for Z80 machines - any interests? :)
« Reply #5 on: 2015.November.16. 20:48:49 »
Which is the latest/best version sources from the many versions? :oops:

Offline Prodatron

  • EP user
  • *
  • Posts: 256
  • Country: de
  • Back on the Z80
    • http://www.symbos.de
Re: UnZIP ("Deflate") tool for Z80 machines - any interests? :)
« Reply #6 on: 2015.November.16. 21:26:23 »
Which is the latest/best version sources from the many versions? :oops:
I hope to get it finish this week. It's a little bit crazy but only because of this new UnZIP tool I discovered a 10,5 years old bug in SymbOS itself. I will publish both, so hopefully soon you will have a full working Un(G)Zip tool on the EP as well :)

Offline Zozosoft

  • Global Moderator
  • EP addict
  • *
  • Posts: 14721
  • Country: hu
    • http://enterprise.iko.hu/
Re: UnZIP ("Deflate") tool for Z80 machines - any interests? :)
« Reply #7 on: 2015.November.16. 21:31:41 »
But I also want to make the EXOS expansion version :-)

Offline Prodatron

  • EP user
  • *
  • Posts: 256
  • Country: de
  • Back on the Z80
    • http://www.symbos.de
Re: UnZIP ("Deflate") tool for Z80 machines - any interests? :)
« Reply #8 on: 2015.November.17. 07:19:03 »
Sorry, now I got you, here are the latest source codes of the "object oriented" way of the implementation (by Grauw):
https://bitbucket.org/grauw/gunzip/src
See especially the folder /src/deflate/ , the main file is "inflate.asm".

And this is the version without the OOP-approach, which is more optimized and faster (by Wouter):
https://github.com/m9710797/msx-gunzip/blob/master/src/gunzip.asm

Both should be 100% stable,
the second one is the faster one, the first is a nice demonstration how to do object oriented programming in Z80 assembler.
My own version is similiar to the second one, but not 100% finished yet.

Offline IstvanV

  • EP addict
  • *
  • Posts: 4822
Re: UnZIP ("Deflate") tool for Z80 machines - any interests? :)
« Reply #9 on: 2015.November.17. 09:49:59 »
For decompressing archives created on the PC, there is also the "uncompress" extension in the epcompress package, which is included in the IVIEW.ROM with ep128emu as well. The disadvantage is that it does not use the standard ZIP format, but it may be faster to decompress because it does not use Huffman coding. Multiple files are compressed as a "solid" archive, which allows for more efficient compression, but individual files cannot be extracted. Paths are not preserved in the archive.

Offline ssr86

  • EP user
  • *
  • Posts: 355
  • Country: pl
Re: UnZIP ("Deflate") tool for Z80 machines - any interests? :)
« Reply #10 on: 2015.November.17. 17:28:28 »
Sorry, now I got you, here are the latest source codes of the "object oriented" way of the implementation (by Grauw):
https://bitbucket.org/grauw/gunzip/src
See especially the folder /src/deflate/ , the main file is "inflate.asm".
Fun to see how oop looks from the asm level. Is it based on a specific "implementation" of classes - I mean is it based on C++ generated code or Java or...well I don't know if there are any differences. Because I have never thought about how it's done in machine code :oops:
« Last Edit: 2015.November.17. 19:49:20 by ssr86 »

Offline lgb

  • EP addict
  • *
  • Posts: 3563
  • Country: hu
  • æðsta yfirmaður
    • http://lgb.hu/
Re: UnZIP ("Deflate") tool for Z80 machines - any interests? :)
« Reply #11 on: 2015.November.17. 19:47:43 »
Fun to see how oop looks from the asm level. Is it based on a specific "implementation" of classes - I mean is it based on C++ generated code or Java or...well I don't know if there are any differences. Because I have never though how it's done in machine code :oops:

As the famous and funny "proverb" says: "if something can't be done in assembly, then it can't be done (with any other languages either)" :)

Offline IstvanV

  • EP addict
  • *
  • Posts: 4822
Re: UnZIP ("Deflate") tool for Z80 machines - any interests? :)
« Reply #12 on: 2015.November.17. 22:01:11 »
And this is the version without the OOP-approach, which is more optimized and faster (by Wouter):
https://github.com/m9710797/msx-gunzip/blob/master/src/gunzip.asm

I have created an EP version of this as a simple EXOS header type 5 program, and it is indeed quite fast.

Offline Zozosoft

  • Global Moderator
  • EP addict
  • *
  • Posts: 14721
  • Country: hu
    • http://enterprise.iko.hu/
Re: UnZIP ("Deflate") tool for Z80 machines - any interests? :)
« Reply #13 on: 2015.November.18. 13:40:33 »
I have created an EP version of this as a simple EXOS header type 5 program, and it is indeed quite fast.
Can you also make the EXOS expansion version?

Offline IstvanV

  • EP addict
  • *
  • Posts: 4822
Re: UnZIP ("Deflate") tool for Z80 machines - any interests? :)
« Reply #14 on: 2015.November.18. 22:00:26 »
Can you also make the EXOS expansion version?

It should be possible, although it would be more work to implement the memory management and paging for an extension or ROM version. The original code runs on page 0 and uses all four pages.

This is the (very simple) EXOS 5 port I used for testing. It cannot print messages, and the input and output file name need to be edited in the source code at the beginning of the file. If compiled with sjasm, there are some error messages about "bytes lost" (due to converting negative integers to a smaller type), but these can be ignored. The input file needs to be on a disk or other device that supports seeking.
[ Guests cannot view attachments ]
« Last Edit: 2015.November.18. 22:08:50 by IstvanV »