Author Topic: Decompression routines  (Read 2428 times)

0 Members and 1 Guest are viewing this topic.

Offline mic_

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 632
Decompression routines
« on: June 24, 2010, 06:57:42 PM »
Here are some decrunchers that I've ported to various processors: 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.

Offline Conle

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2203
Re: Decompression routines
« Reply #1 on: June 24, 2010, 08:05:53 PM »
Here are some decrunchers that I've ported to various processors: 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
« Last Edit: June 24, 2010, 08:13:44 PM by Conle »

Offline mic_

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 632
Re: Decompression routines
« Reply #2 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).

Offline Conle

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2203
Re: Decompression routines
« Reply #3 on: June 27, 2010, 04:14:59 AM »
Mic_,  ~sm-72.gif~.gif
You're unstoppable  8) .

Offline mic_

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 632
Re: Decompression routines
« Reply #4 on: July 30, 2010, 04:25:28 AM »
My tile compression utility 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.