Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugs in Compression.cs #1

Open
theonlydude opened this issue Jan 17, 2019 · 1 comment
Open

Bugs in Compression.cs #1

theonlydude opened this issue Jan 17, 2019 · 1 comment

Comments

@theonlydude
Copy link

Hello,

I've found bugs in Compression.cs:

Compress method:

  • "if (i - CopyLengths [i].Address < 32)" => not 32 but 0xFF as the address is stored on one byte, otherwise it uses WriteCopy instead of WriteNegativeCopy which uses one more byte

CalculateWordFill method:

  • if carry == 3 write 2 instead, because no compression is achieved when replacing [b0, b1, b0] with [cmd, b0, b1]
  • missing last carry value in WordFillLengths

MatchSubSequences method:

  • the method was buggy, I've replaced its content

You can find the corrected code there (it's in Python): https://github.com/theonlydude/RandomMetroidSolver/blob/master/compression.py

Anyway, thanks for your work on SM3E, we've used it as a documentation when we needed to get the doors information (for the areas randomization) and now the compression/decompression (for the palettes randomization) for the VARIA Randomizer.

@theonlydude
Copy link
Author

computeCopy was too slow, I've rewritten it too (currently in palette_rando branch).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant