Author Topic: On-Calc RLE Compressor  (Read 3400 times)

0 Members and 1 Guest are viewing this topic.

Offline squidgetx

  • Food.
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1881
  • Rating: +503/-17
  • rawr.
    • View Profile
On-Calc RLE Compressor
« 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:
  • Display glitches if you don't have a lot of programs on your calc
  • Possible crash if the output is greater than 716 bytes
  • Display glitch if the percent compression figure is negative
  • Random debug output in the compressing screen that I forgot to take out

To do:
  • Adjust for any size input
  • Fix bugs
  • Make an error screen if not enough free RAM or if the output is larger than the input

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
« Last Edit: October 15, 2011, 07:32:36 pm by squidgetx »

Offline mrmprog

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 559
  • Rating: +35/-1
    • View Profile
Re: On-Calc RLE Compressor
« Reply #1 on: October 15, 2011, 07:30:40 pm »
Nice job! This is really handy, I will download it now.

Offline Happybobjr

  • James Oldiges
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2325
  • Rating: +128/-20
  • Howdy :)
    • View Profile
Re: On-Calc RLE Compressor
« Reply #2 on: October 15, 2011, 08:25:57 pm »
how do you uncompress the data so you can use it?
Also compress groups?
« Last Edit: October 15, 2011, 08:26:21 pm by Happybobjr »
School: East Central High School
 
Axe: 1.0.0
TI-84 +SE  ||| OS: 2.53 MP (patched) ||| Version: "M"
TI-Nspire    |||  Lent out, and never returned
____________________________________________________________

Offline squidgetx

  • Food.
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1881
  • Rating: +503/-17
  • rawr.
    • View Profile
Re: On-Calc RLE Compressor
« Reply #3 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)

Offline Happybobjr

  • James Oldiges
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2325
  • Rating: +128/-20
  • Howdy :)
    • View Profile
Re: On-Calc RLE Compressor
« Reply #4 on: October 15, 2011, 09:05:59 pm »
okay then :P

and i just realized how stupid it was to ask about groups :/
School: East Central High School
 
Axe: 1.0.0
TI-84 +SE  ||| OS: 2.53 MP (patched) ||| Version: "M"
TI-Nspire    |||  Lent out, and never returned
____________________________________________________________

Offline ztrumpet

  • The Rarely Active One
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5712
  • Rating: +364/-4
  • If you see this, send me a PM. Just for fun.
    • View Profile
Re: On-Calc RLE Compressor
« Reply #5 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.

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: On-Calc RLE Compressor
« Reply #6 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.




Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: On-Calc RLE Compressor
« Reply #7 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.

Offline ztrumpet

  • The Rarely Active One
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5712
  • Rating: +364/-4
  • If you see this, send me a PM. Just for fun.
    • View Profile
Re: On-Calc RLE Compressor
« Reply #8 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.

Offline Iambian

  • Coder Of Tomorrow
  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 739
  • Rating: +216/-3
  • Cherry Flavoured Nommer of Fishies
    • View Profile
Re: On-Calc RLE Compressor
« Reply #9 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...
« Last Edit: October 15, 2011, 11:06:31 pm by Iambian »
A Cherry-Flavored Iambian draws near... what do you do? ...

Offline Happybobjr

  • James Oldiges
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2325
  • Rating: +128/-20
  • Howdy :)
    • View Profile
Re: On-Calc RLE Compressor
« Reply #10 on: October 16, 2011, 12:32:55 am »
How about a shell that runs RLE compressed files :P
School: East Central High School
 
Axe: 1.0.0
TI-84 +SE  ||| OS: 2.53 MP (patched) ||| Version: "M"
TI-Nspire    |||  Lent out, and never returned
____________________________________________________________

Offline shmibs

  • しらす丼
  • Administrator
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2132
  • Rating: +281/-3
  • try to be ok, ok?
    • View Profile
    • shmibbles.me
Re: On-Calc RLE Compressor
« Reply #11 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.

Offline squidgetx

  • Food.
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1881
  • Rating: +503/-17
  • rawr.
    • View Profile
On-Calc RLE Compressor
« Reply #12 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
« Last Edit: October 22, 2011, 12:56:46 pm by squidgetx »