Added a 320x200x256 TGI driver to the Commander X16 library.
Made the mandelbrot sample program handle the X16's 256 colors.
This commit is contained in:
@@ -51,6 +51,7 @@ void mandelbrot (signed short x1, signed short y1, signed short x2,
|
||||
register signed short r, r1, i;
|
||||
register signed short xs, ys, xx, yy;
|
||||
register signed short x, y;
|
||||
register unsigned char maxcol = MAXCOL;
|
||||
|
||||
/* Calc stepwidth */
|
||||
xs = ((x2 - x1) / (SCREEN_X));
|
||||
@@ -76,10 +77,15 @@ void mandelbrot (signed short x1, signed short y1, signed short x2,
|
||||
if (count == maxiterations) {
|
||||
tgi_setcolor (0);
|
||||
} else {
|
||||
if (MAXCOL == 2) {
|
||||
switch (maxcol) {
|
||||
case 2:
|
||||
tgi_setcolor (1);
|
||||
} else {
|
||||
tgi_setcolor (count % MAXCOL);
|
||||
break;
|
||||
case 0: /* 256 colors */
|
||||
tgi_setcolor (count);
|
||||
break;
|
||||
default:
|
||||
tgi_setcolor (count % maxcol);
|
||||
}
|
||||
}
|
||||
/* Set pixel */
|
||||
|
||||
Reference in New Issue
Block a user