1. Do *all* non-monochrome targets for which z88dk provides the Generic Console support printing in colour?
2. If not, what is the easiest way to find out which do and which do not? Do I have to compile ansivt52.c for each target, or is there a simpler way?
3. Can we check programmatically (at pre-processor time) whether colour printing is available?
4. For the Alphatronic PC I have noticed that ansivt52.c compiled with the current nightly looks different from the screenshot shown on the wiki:
Is this a bug, or have things changed since then?
5. On both the Coleco and PV-2000 targets, I have noticed that there seems to be no way to switch back to white foreground colour. Colour 7 seems to be some yellow / ochre colour, but white seems to be unavailable. Can we still somehow switch to white?
6. I'm not sure whether my approach is the best for cross-platform development. I'm doing this...
Code: Select all
// Compile with:
// zcc +alphatro -create-app -o vt52colour_alphatronic vt52colour.c
#include <stdio.h>
int main()
{
static int COLOUR_CODES_BACKGROUND[]={
4, // red
2, // green
1, // blue
5, // magenta
3, // cyan
7 // white
};
static int COLOUR_CODES_FOREGROUND[]={
7, // red background -> white
7, // green background -> white
7, // blue background -> white
7, // magenta background -> white
7, // cyan background -> white
0 // white background -> black
};
static char* TEXT_COLOURS[] = {
"%cc%c%cb%cR", // red
"%cc%c%cb%cG", // green
"%cc%c%cb%cB", // blue
"%cc%c%cb%cM", // magenta
"%cc%c%cb%cC", // cyan
"%cc%c%cb%cW" // white
};
static int COLOUR_CODE_RESET_BACKGROUND = 0;
static int COLOUR_CODE_RESET_FOREGROUND = 7;
static char* TEXT_COLOUR_RESET = "%cc%c%cb%c";
// Clear the screen
printf("%c",12);
printf("\x0c");
for (int i=0;i<=5;i++)
{
gotoxy(5+i,5);
printf(TEXT_COLOURS[i], 27, COLOUR_CODES_BACKGROUND[i] + 32, 27, COLOUR_CODES_FOREGROUND[i] + 32);
}
gotoxy(1,7);
printf(TEXT_COLOUR_RESET, 27, COLOUR_CODE_RESET_BACKGROUND + 32, 27, COLOUR_CODE_RESET_FOREGROUND + 32);
printf("press any key to exit...");
fgetc_cons();
// Clear the screen
printf("%c",12);
printf("\x0c");
}