Linux_4k_Intro_Coding_asm06.pdf

(85 KB) Pobierz
Linux 4k Intro Coding
Aug 3 2006
Markku “Marq” Reunanen
rd
Contents
Overview
Choosing the language
Dealing with GCC
Dynamic library loading
Music generation
Compression
Code level tricks
Useful tools and some pointers
Overview
Linux 4k intros have been around a few years
Suitable platform because of good tools, useful
libraries and minimal executable overhead
By knowing the tricks of the trade you can spend
the precious 4096 for the actual content
You can save hundreds of bytes with a little extra work
The methods presented here are based on the three
4k intros by me and Antti “NF” Silvast
Yellow Rose of Texas (Asm'03)
Je Regrette (Asm'04)
Make It 4k (Asm'05)
Choosing the language (1)
Asm
You know what you're doing. No overhead but error
prone and not easy to try out or tweak stuff.
More overhead but still suitably small. Less painful
than pure asm :)
Too much overhead for a 4k. Painful name mangling.
For example Perl is pretty much available everywhere.
No interface to gfx/music but potential for scripting.
Shader asm & GLSL
C
C++
Others
Choosing the language (2)
Our approach: combined C and asm
System level code, soft synth and startup in asm
These need to be written only once
As small as it gets
Easy to code and portable
We were able to release Linux/Win/OSX/SGI versions
in less than a week
Effect code in C
There's still some overhead in using C but that's
the penalty of being lazy
Zgłoś jeśli naruszono regulamin