Neo TeAm Forum

The 9th. NEO Project for SNES => The 9th. NEO Project for SNES Dev kit. => SNES development section => Topic started by: mic_ on June 24, 2010, 06:57:42 PM

Title: Decompression routines
Post by: mic_ on June 24, 2010, 06:57:42 PM
Here are some decrunchers that I've ported to various processors: http://jiggawatt.org/badc0de/decrunch/ (http://jiggawatt.org/badc0de/decrunch/)

For the 65816 (SNES) I've got an LZSS decoder and an aPLib decoder. Both are available in plain assembly versions, as well as versions that can be called from C code compiled with the SNESSDK.
Title: Re: Decompression routines
Post by: Conle on June 24, 2010, 08:05:53 PM
Here are some decrunchers that I've ported to various processors: http://jiggawatt.org/badc0de/decrunch/ (http://jiggawatt.org/badc0de/decrunch/)

For the 65816 (SNES) I've got an LZSS decoder and an aPLib decoder. Both are available in plain assembly versions, as well as versions that can be called from C code compiled with the SNESSDK.

Great work ! Thanks!  :D

By the way , we've used with ChillyWilly your lzss code(68k version) in the past for a demo and here's a proper version that can be used within C code(Check the attachment).
Those changes actually , push all the registers that are used by the routine(d2 ~ d7,a2 ~ a4) on the stack , then instead using the temporary unused registers in the beginning to keep track of the arguments it points to the actual offset on the stack(which is 4bytes for the return adderss + (4bytes*(d7-d2)) + (4bytes *(a4-a2))) where the registers are saved.

Before returning ,the stack is popped back and all registers are restored.

Edit : By the way i've redone the changes in the latest source just in case  ~sm-92.gif~.gif
Title: Re: Decompression routines
Post by: mic_ on June 27, 2010, 03:45:02 AM
I've added a few more routines to the page mentioned above. I wrote two aPLib decrunchers for the NES (6502), and a PackFire tiny mode depacker for the SNES (65816).
Title: Re: Decompression routines
Post by: Conle on June 27, 2010, 04:14:59 AM
Mic_,  ~sm-72.gif~.gif
You're unstoppable  8) .
Title: Re: Decompression routines
Post by: mic_ on July 30, 2010, 04:25:28 AM
My tile compression utility (http://jiggawatt.org/badc0de/sixpack/) now has some updated aPLib decoders for the SNES and TurboGrafx.

Both of them have been optimized a bit using the block move instructions available of the respective CPUs. They also support a special mode where planar data is converted to linear before being compressed (this usually helps the compressor a bit). The option to add when converting an image is -chain, and demo\snes\test_aplib.asm and demo\tgx\test_aplib.asm shows how to decompress such data.