Omnimaga

Calculator Community => Completed => Major Community Projects => Portal X => Topic started by: Builderboy on December 08, 2010, 07:16:09 pm

Title: Compression Challenge
Post by: Builderboy on December 08, 2010, 07:16:09 pm
So i have started working on the title screen, and it is quite detailed and i want to refrain from just posting all 768 bytes into the program, as i feel that would be a bit large.  And so, i have decided to make a compression challenge!  Whoever can compress this screen into the least number of bytes will get their name in the credits and my eternal respect and gratitude :D Note that the final size should include everything that is needed to put the screen into L6, through whatever means necessary.

Note: I decided to release the real title screen :P
Title: Re: Compression Challenge
Post by: Runer112 on December 08, 2010, 07:23:51 pm
/me accepts your challenge >:D

EDIT: I should ask: what drawing routines will already exist in the program? I don't want to use the rectangle routine, for instance, if it doesn't already exist and adding it would inflate the code larger than using some other method.
Title: Re: Compression Challenge
Post by: nemo on December 08, 2010, 07:24:17 pm
Do you use Rect()/RectI() in portal's code already? because then the routines are only like 15 bytes to call instead of having to include a 200 byte subroutine.
by the way, the image is 192 x 134... is that intentional?
Title: Re: Compression Challenge
Post by: Builderboy on December 08, 2010, 07:27:53 pm
Yes rect and rectI() are both used, including line() and all the pixel/sprite commands.  As for the size, D: i'll upload a new version really quick
Title: Re: Compression Challenge
Post by: nemo on December 08, 2010, 07:29:53 pm
Yes rect and rectI() are both used, including line() and all the pixel/sprite commands.  As for the size, D: i'll upload a new version really quick

unless you plan on having a title screen that can scroll an amazing..... three pixels!
Title: Re: Compression Challenge
Post by: Builderboy on December 08, 2010, 07:30:53 pm
Haha negative :P
Title: Re: Compression Challenge
Post by: willrandship on December 08, 2010, 07:40:35 pm
wouldn't that be three screens?
Title: Re: Compression Challenge
Post by: Builderboy on December 08, 2010, 07:41:30 pm
Hmm?  In what way?
Title: Re: Compression Challenge
Post by: nemo on December 08, 2010, 07:45:22 pm
can the screen be assumed cleared?
Title: Re: Compression Challenge
Post by: Builderboy on December 08, 2010, 07:45:40 pm
Sure
Title: Re: Compression Challenge
Post by: Runer112 on December 08, 2010, 07:56:13 pm
Does the DrawInv routine already exist?
Title: Re: Compression Challenge
Post by: Builderboy on December 08, 2010, 08:04:15 pm
Nope
Title: Re: Compression Challenge
Post by: nemo on December 08, 2010, 08:04:41 pm
RotCC/RotC?
Title: Re: Compression Challenge
Post by: Builderboy on December 08, 2010, 08:07:59 pm
Nope
Title: Re: Compression Challenge
Post by: Runer112 on December 08, 2010, 09:52:48 pm
The tricky part of this is trying to compress it in a way that the size of the code itself doesn't offset the amount of data saved, because not much data is being compressed.

But I got 608 bytes. Storing the data as a raw picture and putting it onto the screen and buffer would take 777 bytes. If anyone gets any better, let me (and Builderboy) know.

EDIT: 606 bytes.

EDIT 2: 605 bytes.

EDIT 3: 602 bytes. I think this is as small as I'm going to get it, so I'm attaching what I have. I included two versions because, although the second is 2 bytes larger than the first, you might consider it better. Whereas the second one updates the screen all at once, the first one updates the screen 4 times throughout the process due to the Bitmap() calls drawing directly to the screen. This slight delay isn't very noticable, but I figure I'll just give you both options.
Title: Re: Compression Challenge
Post by: Builderboy on December 08, 2010, 10:01:55 pm
Yeah, i know what you mean runner, i couldn't get much better numbers than those.  I might just end up storing the whole thing to one big buffer :/
Title: Re: Compression Challenge
Post by: Runer112 on December 08, 2010, 10:10:20 pm
Although not a terribly large saving, you may as well use what I've been working on and save yourself about 170 bytes.
Title: Re: Compression Challenge
Post by: Builderboy on December 08, 2010, 10:17:59 pm
True ^^ although i'll wait to see if nemo can best you :P
Title: Re: Compression Challenge
Post by: nemo on December 08, 2010, 10:20:06 pm
i doubt it, i'm having issues with my program. too much java, clearly.
Title: Re: Compression Challenge
Post by: Runer112 on December 08, 2010, 11:14:06 pm
I attatched my solution (602 bytes) to my original post (http://ourl.ca/8230/151102) saying that I had completed it.
Title: Re: Compression Challenge
Post by: DJ Omnimaga on December 08, 2010, 11:20:27 pm
wouldn't that be three screens?
Nah, he just zoomed the image so it's easier to look at on forums. On calc it will be 96x64. :P

Also Nice runer! Not a huge size gain but still a size gain. How fast does it decompress? In addition to that you're close to 666 posts. :P
Title: Re: Compression Challenge
Post by: SirCmpwn on December 08, 2010, 11:48:39 pm
Wait for me!  I wanna compress it!
Title: Re: Compression Challenge
Post by: Builderboy on December 09, 2010, 12:01:19 am
Haha okay good Sir
Title: Re: Compression Challenge
Post by: SirCmpwn on December 09, 2010, 12:04:26 am
Okay, so I have a few questions.  The Y and the A in your menu text (maybe the X too?) are not the same as the TIOS font, but everything else is.  Can we change it?  Also, can we use inline asm?
I think I can shrink this sucker down to size ;)
Title: Re: Compression Challenge
Post by: Runer112 on December 09, 2010, 12:09:18 am
I noticed that about the font too, but I didn't change it because that would be cheating. :P
Also, I purposely avoided inline because that would be cheating too. :P
(Unless Builderboy specifies otherwise)
Title: Re: Compression Challenge
Post by: Builderboy on December 09, 2010, 12:14:15 am
You can use the Ti-OS font ^^ but i'd like it all to be pure Axe :)
Title: Re: Compression Challenge
Post by: SirCmpwn on December 09, 2010, 12:15:52 am
Great, pure Axe it is, and the TIOS font I shall use :)
Title: Re: Compression Challenge
Post by: Runer112 on December 09, 2010, 12:32:06 am
In which case the size to beat is 586 bytes. ;)
(Remarks distinguishing the two versions I attached can be found on the bottom of the first page)

EDIT: I just realized that I had previously added comments with the size of the code, but I hadn't updated it. So ignore all the comments that declare a size of 608 bytes.
Title: Re: Compression Challenge
Post by: DJ Omnimaga on December 09, 2010, 01:03:14 am
Cool :D I wonder how small this can get...
Title: Re: Compression Challenge
Post by: SirCmpwn on December 09, 2010, 06:50:58 pm
Okay, with no reliable way of transferring files from my calc, I can't really do this effectively.  Nevermind, then :(
Title: Re: Compression Challenge
Post by: DJ Omnimaga on December 09, 2010, 07:17:27 pm
Sorry to hear. :(

By the way I hear you saying you have no way to send files to your calc more and more often lately. I might have forgotten, but is it because you lost your link cable or is it because your parents became even more strict on what you can do on your computer?
Title: Re: Compression Challenge
Post by: SirCmpwn on December 09, 2010, 07:26:36 pm
No, it's because I don't have admin access, and TI-Connect doesn't work without it.  I've been playing around with it to try and fix the problem.
Title: Re: Compression Challenge
Post by: Builderboy on December 09, 2010, 08:00:03 pm
Aw thats too bad, well it looks like i'll be using Runner's screen then :D
Title: Re: Compression Challenge
Post by: fb39ca4 on December 09, 2010, 08:07:39 pm
How long will this contest be open? I had a good compression idea, but I'm too busy to work on it until this Sunday.
Title: Re: Compression Challenge
Post by: DJ Omnimaga on December 10, 2010, 02:20:29 am
No, it's because I don't have admin access, and TI-Connect doesn't work without it.  I've been playing around with it to try and fix the problem.
Ah, right, I see now. X.x
Title: Re: Compression Challenge
Post by: Builderboy on December 10, 2010, 02:22:08 am
How long will this contest be open? I had a good compression idea, but I'm too busy to work on it until this Sunday.

Until the release of PortalX
Title: Re: Compression Challenge
Post by: DJ Omnimaga on December 10, 2010, 02:37:10 am
This long? O.O Won't you need the title screen at one point, though? Or is the code really easy to replace?
Title: Re: Compression Challenge
Post by: Builderboy on December 10, 2010, 02:42:19 am
It should be easy to replace, so i'm just using the plain 768 bytes and replacing it near the end
Title: Re: Compression Challenge
Post by: DJ Omnimaga on December 10, 2010, 09:10:21 am
Ah ok, thanks for the info :)
Title: Re: Compression Challenge
Post by: fb39ca4 on December 10, 2010, 03:50:30 pm
So by l6 do you mean the list l6, or is it an axe variable? Sorry, I'm an axe n00b.
Title: Re: Compression Challenge
Post by: Builderboy on December 10, 2010, 04:09:03 pm
L6 is neither a List nor a variable, its whats known as a pointer.  What it does is 'points' to the location of the screen buffer.  What this means is that it gives you the location of start of the screen buffer in RAM.  In reality, L6 is just a number, just as the start address to the screen buffer is just a number
Title: Re: Compression Challenge
Post by: matthias1992 on December 10, 2010, 04:37:51 pm
I assume it is supposed to be made procedurally? I think I can sqeeuze it quite a bit but I am not sure...
Title: Re: Compression Challenge
Post by: Builderboy on December 10, 2010, 04:43:24 pm
It can be made any way you like as long as its smaller XD