/*****************************************************************************\ ** mandelbrot sample program for cc65. ** ** ** ** (w) 2002 by groepaz/hitmen, TGI support by Stefan Haubenthal ** \*****************************************************************************/ #include #include #include #include #include #include "common.h" //#link "mcbitmap.c" #include "mcbitmap.h" /* Graphics definitions */ #define SCREEN_X 160 #define SCREEN_Y 192 #define MAXCOL 16 #define maxiterations 64 #define fpshift (10) #define fpone (1<>fpshift) #define fpabs(_x) (abs(_x)) #define mulfp(_a,_b) ((((signed long)_a)*(_b))>>fpshift) #define divfp(_a,_b) ((((signed long)_a)<> (fpshift - 1)) + yy; r = r1; } if (count == maxiterations) { color = (0); } else { color = count < MAXCOL ? COLORS[count] : COLORS[MAXCOL-1]; set_pixel(x, y, color); } } } } int main (void) { setup_bitmap_multi(); VIC.bgcolor0 = 0x00; /* Calc mandelbrot set */ mandelbrot (-fpone/2, -fpone, 0, -fpone/2); /* Fetch the character from the keyboard buffer and discard it */ cgetc (); /* Done */ return EXIT_SUCCESS; }