Originally Posted by jmseight
Excellent demo! I was looking at the code and wondering what sv was. It was worth running to the end.
Anyway, I run into the header issue when I tried to compile it with tcc. I alway compile you code and run using tcc.
I notice the diterh code is different this time and will try to figure it out.
I was thinking about making a fractal demo with your code...
Also, when I saw the speckle demo, I remember when I was going to school one of my classmates made a random dot stereogram http://en.wikipedia.org/wiki/Random_dot_stereogram
tcc is great for utility apps, but for SOME of the graphics demos you pay a large performance penalty. Some apps run up to 5 times faster compiled with GCC instead of TCC.
Although tcc can compile 5x to 9x faster than gcc, the final code is much less optimized. In this demo, I hand-optimized some of the code (batching the dither per-page instead of per-pixel, loop unrolling, splitting common logical expression phrases and moving outside loop body, etc.). These are things done for you by a good optimizing compiler, but I did them in the code (adding to its size and complexity) to make it work better with tcc.
For most of my demos that run WIDE OPEN (no delays), it is worth running BOTH the gcc and tcc versions and comparing. The speckle demo (sparkle) is one such case -- you should see it run on the version I provided.
I compiled the gcc version like this:
arm-linux-gcc -O3 -o newtrix newtrix.c
The -O3 option tells it to do extra optimization.
I have a 256-color mandelbrot demo in progress. It is the original reason I began work on the 256-color dithering down to the 16-color hardware palette. But I used mostly existing code for a testbed, and kept that in the final program to provide various test "stages".
For my unreleased "kindlebrot - kindle mandelbot demo" I am holding off until I have a menu to select from the nice looking default parameter sets. I also need an input method to provide custom navigation in the mandelbrot set. The kindle is not so fast using floating point, so eventually I was thinking of an integer mandelbrot re-write.
By the way, you can use tccmake to link the math library like this:
tccmake kindlebrot -lm