GithubHelp home page GithubHelp logo

zlib6502's People

Contributors

pfusik avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

zlib6502's Issues

Literal/Length code with 256-wide sub-tree a problem

I'm pretty sure this file: rep16.bin.gz will not decode properly. The literal/length Huffman tree has 256 symbols whose code length is 9. This will overflow nBitCode_totalCount .

I imagine this is not a very common case but nonetheless I think it should be fixed. I've not the 6502 experience to suggest a good approach but it is clear that at most only one code length of the tree can possibly have 256 symbols. I expect handling that possible special case shouldn't add too much code or slow things down very much.

It pains me to report this bug as the subroutine is a wonderful piece of work with some very good insights into the deflate format from an 8-bit perspective.

Test Case: Huffman with 258 x 9 bit and 4 x 10 bit codes

This file has 258 symbols with code length 9 and 4 symbols with code length 10. The 258 symbols of code length 9 include all 256 literal values. And, of course, there are some other code lengths in order to balance out the tree.

code258low.bin.gz

Constructed as before by crafting an input file and passing it to gzip -9. Here's hoping the code handles this case correctly already.

Decompression issues when expanding to $A000 on a C64

I am trying to decompress data behind the basic or the kernal ROM on a commodore 64.
If you are not familiar with the C64, in the shadowed areas, reads return the ROM data, writes go to the RAM under it.
Decompressing the exact same data to regular RAM and then using memcpy to the shadowed area work perfectly.
I suspect inflatemem reads from the destination area during decompression.
I looked at the inflatemem source but I can't figure out if my theory is correct.
I would really appreciate any help/insight you could provide.

258-wide Huffman sub-tree

Here's a compressed file with 258 literal/length symbols having the same code length:

code258.bin.gz

Specifically, symbols 0 through 257 have 10 bit Huffman codes. All 256 literals appear and have the same code length.

This file was generated by crafting an input file and passing it to "gzip -9". It would be possible to add a few more "length" symbols with Huffman code length 10 but I'm guessing this is a sufficient test case.

With 256 literals the same length nBitCode_literalCount will have an entry that overflows to zero.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.