GP2X 1k Plasma Demo


sparr

Member
Joined
Jun 3, 2006
Messages
292
I was inspired on irc by jix, who made the first 1k demo I had seen on the GP2X, so I followed suit. Color cycling plasma in 1k. The real binary is actually about 1.4k, but jix introduced me to a neat trick using tail and zcat to decompress my binary at runtime with only a little overhead.

The important (large, reusable, improvable) parts, and their pre-compression sizes:
shell script wrapper, to decompress the binary and restart the menu, 82 bytes
palette calculation, 104 bytes
palette cycler, 136 bytes (to be improved)
random number generator, 52 bytes
recursive plasma fractal generator, 432 bytes (possibly nearly optimal)

For your enjoyment:
http://sparr.homeip.net/gp2x/plasma_1.gpe

Possible significant size improvements could still be made by moving some of the simpler algorithms to thumb mode.

At 432 bytes, the plasma generator itself makes up over 1/3 of the code. The demo-specific other parts total up to maybe 200 more bytes. Clearing all that out leaves me about 158 instructions worth of space to implement some sort of game. I am thinking maybe tron or pong in 1k would be a neat next project.
 
Very nice entry. I love the idea of tron or some other, actual game in 1k. I'm quite impressed :)

Care to post the source?
 
I'd like to see the source too and try making my own 1k demo :) maybe this would be a good place to post it and take us though your tips and tricks?
 
I will clean up the source tonight and release it. Probably squeeze out a few more bytes first too, just to get under the 1kb line instead of the 1kib line for the purists out there.
 
Sparr posted on Aug 21 2006 at 01:39 PM said:
I will clean up the source tonight and release it. Probably squeeze out a few more bytes first too, just to get under the 1kb line instead of the 1kib line for the purists out there.
When demo writers refer to 'k', they mean units of 1024 bytes. So 4k is 4096 bytes, 64k is 65536 bytes.

I kind of let my demo writing urges slide a bit but now I'm motivated to try a 4k demo.
 
Last edited by a moderator:
Back
Top