Lz77 Data compression|uncompression

  • Hello everyone..


    I am an english hacker so I will be talking english here..
    I am making a tool that can be seen over pokecommunity at the moment...
    My name is same there as well...


    And I was really willing to know the Lz77 data compression and uncompression...
    If anyone could tell me how those are done then I would be really thankful...


    And also I am seeing that hackers here are not using the English version of rom...
    I want to make my tool compatible with whatever versions of ROM you guys are using.. If you are interested to help me then msg me or just make a reply..


    BUT my major topic for help is about the Lz77 data compression and uncompression...
    Hope you guys will help me :)



    UPDATE:


    Solved the uncompression issue...
    made a function for VB and here is the link.
    https://github.com/TheLearneer/Lz77-Uncompression


    You might find the codes little off-the-place (if you are a coder) but also this code has no bugs and works perfectly for the 16 color mode. :)

  • Hello, the compression is described at GBATEK, since the AGB uses a compression format similar to the standard compression used for example by 7zip. During the implementation of my own tools I wrote a short algorithm for decompressing lz77 ABG data. It is coded in Python put can easily be transfered to any other language (C++ or C#).

  • Hi The_Learner,


    a user named Aeonos did a tutorial on this topic some years ago.
    Maybe it will help you.


    If you have any trouble translating the text, feel free to send me a pm.

    Hello, the compression is described at GBATEK, since the AGB uses a compression format similar to the standard compression used for example by 7zip. During the implementation of my own tools I wrote a short algorithm for decompressing lz77 ABG data. It is coded in Python put can easily be transfered to any other language (C++ or C#).


    Thank you guys for reply...
    .
    Both of you provided me amazing links....
    .
    Will probably look upto them when i use my pc...(at the moment i am in mobile)


    I dont think i will have problem with translation as google chrome translates the whole page automatically.... Kicklee
    .
    And about your codes Wodka i hope if i get confused you will help me... ( at the moment i know only basics of c and dont know python at all)
    .
    And what do you guys say about the tool I am making.... want to make it compatible with the rom versions you guys use????


    Here is the link though...
    https://www.pokecommunity.com/showthread.php?t=386291
    Waiting for your reply...


    And thanks again for the links :)

  • I dont use tools, yet for the majority of the RH community it would be helpful to have those available for their local rom versions - however, if you want to support many versions you could always just use some sort of configurable interface, e.g. an INI, JSON, XML, ... file to specify the required information on any local platform.


    As for LZ77, especially the decompression algorithm is fairly easy to implement, because it's basically step by step reforming pseudo code into real code (whatever language you are using), and with the help of some data structures (especially lists) the code should be just about 50'ish lines long. Compression is a bit more in-depth, as I recall, and you won't find many (good) examples especially on agb stuff. If you are looking for a decompression example you can eighter look at those provided, or if you are more confident in C-Type languages I have an implementation in C#: https://hastebin.com/atuyipiqac.cs Feel free to use or adapt with respects of the GPLv3.


    Have fun programming!


    ~Sturmvogel


    Let the old ways live and prosper in the hearts of our young



  • Ok i will look onto those c codes....
    And do you have any compression functions as well???
    .
    Also for my tool there is already an ini support... just need the researchs done here so i can insert it in the tool :)

  • I would love to see multi language support on your tool, as it seems really great. I would offer my help, in terms of researching, if I’d only have time. Sadly atm I don’t, but I still wish you the best of luck, since your tool does indeed look great. :)

  • I would love to see multi language support on your tool, as it seems really great. I would offer my help, in terms of researching, if I’d only have time. Sadly atm I don’t, but I still wish you the best of luck, since your tool does indeed look great. :)

    Well thanks for telling that the tool seems great...


    even I am putting lot more effort to make it even better...


    not problem if you have not got enough time atm..
    you can help out any time you get free.
    even if its some days later.. or some months or even some years :) ;)