Omnimaga

Calculator Community => Other Calc-Related Projects and Ideas => TI Z80 => Topic started by: squidgetx on October 15, 2011, 07:18:34 pm

Title: On-Calc RLE Compressor
Post by: squidgetx on October 15, 2011, 07:18:34 pm
Hey, so as a side effect of work on A:P and Gravity Guy, I've come out with a general use whole-byte row-length-encoding compressor that can be run ON-CALC :D

You can choose nearly any file on your calc (appvars, programs or protected programs) to compress. The compressed data is then sent to Str1, easily recallable into some program you want to compile for use in Axe. You can choose the offset from the beginning of the file as well as how many bytes to compress. For protected programs, adjustment of the offset for the 3 byte header of asm() programs is included. (I should probably make this an option. I probably won't bother to account for MOS and DCS headers etc. since I don't think people will be trying to compress those...)

Known bugs:

To do:

However, it's still extremely functional. So anyone who thinks they might use this, enjoy!

COMP is the Asm() executable, and ACOMP is the Axe source
Title: Re: On-Calc RLE Compressor
Post by: mrmprog on October 15, 2011, 07:30:40 pm
Nice job! This is really handy, I will download it now.
Title: Re: On-Calc RLE Compressor
Post by: Happybobjr on October 15, 2011, 08:25:57 pm
how do you uncompress the data so you can use it?
Also compress groups?
Title: Re: On-Calc RLE Compressor
Post by: squidgetx on October 15, 2011, 08:42:57 pm
It's my recommendation that anyone using this should understand how RLE works and be able to write their own decompression routines. I believe that Builderboy and Nemo both have tutorials on RLE decompression somewhere on this forum.

I didn't add groups since this tool is mainly aimed at developers who want to compress levels and maps and such in their Axe projects, not for general calc variable compression (Also I don't think that groups would compress very well :P)
Title: Re: On-Calc RLE Compressor
Post by: Happybobjr on October 15, 2011, 09:05:59 pm
okay then :P

and i just realized how stupid it was to ask about groups :/
Title: Re: On-Calc RLE Compressor
Post by: ztrumpet on October 15, 2011, 09:27:10 pm
Wow, this is great!  Awesome job, squidgetx.  I think someone was asking if one of these existed recently.
Title: Re: On-Calc RLE Compressor
Post by: Deep Toaster on October 15, 2011, 10:03:38 pm
I like the UI :D Nice job!

And Happybobjr has a point -- compress groups and we'll finally have true compressed archive files on calculators. Not pressuring you to make one, but that just seemed like one of those glaring differences between the TI and any comp OS.
Title: Re: On-Calc RLE Compressor
Post by: Builderboy on October 15, 2011, 10:47:37 pm
The thing about RLE, is that is is mostly useless in compressing programs, and is best when used on things like level data.  Compressing groups for the purpose of archiving programs would most likely need a different type of compression routine.
Title: Re: On-Calc RLE Compressor
Post by: ztrumpet on October 15, 2011, 10:48:22 pm
I like the UI :D Nice job!

And Happybobjr has a point -- compress groups and we'll finally have true compressed archive files on calculators. Not pressuring you to make one, but that just seemed like one of those glaring differences between the TI and any comp OS.
Actually Iambian made something for this purpose a while ago.  I forget what it was called, though.
Title: Re: On-Calc RLE Compressor
Post by: Iambian on October 15, 2011, 11:04:35 pm
Athena. That project was called Athena.

http://www.omnimaga.org/index.php?action=downloads;sa=view;down=612

It's not perfect. The compressor was designed to be used PC-side, and you really, REALLY have to read the ReadME files just to understand how to use the compression set. It doesn't save anything as "group" files but the files it generates function just the same, except compressed.

That, and Athena uses pucrunch, not RLE. Well... pucrunch uses a combination of LZ77 and RLE...
Title: Re: On-Calc RLE Compressor
Post by: Happybobjr on October 16, 2011, 12:32:55 am
How about a shell that runs RLE compressed files :P
Title: Re: On-Calc RLE Compressor
Post by: shmibs on October 16, 2011, 07:23:54 am
unless you're going to be running the same instruction hundreds of dozens of times in a row, like builder said, RLE would be counter-productive in compressing executables(and even then it couldn't be straight up byte-by-byte RLE compression like is being used here.) this is a neat tool (thanks, squidget. you've saved a lot of people a lot of trouble with this =D), but it shouldn't really be used on anything other than tilesets or other data arrays with lots of repeated values.
Title: On-Calc RLE Compressor
Post by: squidgetx on October 22, 2011, 12:55:01 pm
Added to DL section.
I fixed (most of) the bugs and added the error messages.



http://www.omnimaga.org/index.php?action=downloads;sa=view;down=730