/*****************************************************************************\ ** mandelbrot sample program for cc65. ** ** ** ** (w) 2002 by groepaz/hitmen, TGI support by Stefan Haubenthal ** \*****************************************************************************/ #include #include #include #include #include #include "common.h" //#link "multilines.c" void setup_bitmap_multi(); void set_pixel(byte x, byte y, byte color); /* Graphics definitions */ #define SCREEN_X 160 #define SCREEN_Y 192 #define MAXCOL 16 #define maxiterations 16 #define fpshift (10) #define tofp(_x) ((_x)<>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 = COLORS[count % MAXCOL]; } /* Set pixel */ set_pixel(x, y, color); } } } int main (void) { setup_bitmap_multi(); VIC.bgcolor0 = 0x00; /* Calc mandelbrot set */ mandelbrot (tofp (-2), tofp (-2), tofp (2), tofp (2)); /* Fetch the character from the keyboard buffer and discard it */ cgetc (); /* Done */ return EXIT_SUCCESS; }