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:
Greg King
2020-07-15 17:11:38 -04:00
parent 72fff0cfbc
commit 4296cbaf82
6 changed files with 465 additions and 22 deletions

View File

@@ -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 */