Commit 16838ed4 authored by deuce's avatar deuce
Browse files

Add PETSCII[UL] codepages.

Remove xlat.
Rearrange Commdore fonts to match ASCII.
Clean up C64 emulation a lot...
Set the Commodore background to black in CTerm... it seems pretty much
all terminals do this.
parent 171eb2d2
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -80,7 +80,6 @@ CIOLIBEXPORT int _wscroll=1;
CIOLIBEXPORT int directvideo=0;
CIOLIBEXPORT int hold_update=0;
CIOLIBEXPORT int puttext_can_move=0;
CIOLIBEXPORT int ciolib_xlat=0;
CIOLIBEXPORT int ciolib_reaper=TRUE;
CIOLIBEXPORT char *ciolib_appname=NULL;
static int initialized=0;
......@@ -1159,140 +1158,6 @@ CIOLIBEXPORT void CIOLIBCALL ciolib_normvideo(void)
ciolib_textattr(cio_textinfo.normattr);
}
static char c64_bg_xlat(char colour)
{
switch(colour) {
case BLACK:
return 0;
case BLUE:
return 6;
case GREEN:
return 5;
case CYAN:
return 3;
case RED:
return 2;
case MAGENTA:
return 4;
case BROWN:
return 7;
case LIGHTGRAY:
return 1;
}
return 0;
}
static char c64_bg_rev(char colour)
{
switch(colour) {
case 0:
return BLACK;
case 6:
return BLUE;
case 5:
return GREEN;
case 3:
return CYAN;
case 2:
return RED;
case 4:
return MAGENTA;
case 7:
return BROWN;
case 1:
return LIGHTGRAY;
}
return 0;
}
static char c64_color_xlat(char colour)
{
switch(colour) {
case BLACK:
return 0;
case BLUE:
return 6;
case GREEN:
return 5;
case CYAN:
return 3;
case RED:
return 2;
case MAGENTA:
return 4;
case BROWN:
return 9;
case LIGHTGRAY:
return 15;
case DARKGRAY:
return 11;
case LIGHTBLUE:
return 14;
case LIGHTGREEN:
return 13;
case LIGHTCYAN:
return 12; // Gray...
case LIGHTRED:
return 10;
case LIGHTMAGENTA:
return 8;
case YELLOW:
return 7;
case WHITE:
return 1;
}
return 0;
}
static char c64_color_rev(char colour)
{
switch(colour) {
case 0:
return BLACK;
case 6:
return BLUE;
case 5:
return GREEN;
case 3:
return CYAN;
case 2:
return RED;
case 4:
return MAGENTA;
case 9:
return BROWN;
case 15:
return LIGHTGRAY;
case 11:
return DARKGRAY;
case 14:
return LIGHTBLUE;
case 13:
return LIGHTGREEN;
case 12:
return LIGHTCYAN;
case 10:
return LIGHTRED;
case 8:
return LIGHTMAGENTA;
case 7:
return YELLOW;
case 1:
return WHITE;
}
return 0;
}
static char c64_attr_xlat(unsigned char orig)
{
return (orig & 0x80) | c64_color_xlat(orig & 0x0f) | (c64_bg_xlat((orig&0x70)>>4)<<4);
}
static char c64_attr_rev(unsigned char orig)
{
return (orig & 0x80) | c64_color_rev(orig & 0x0f) | (c64_bg_rev((orig&0x70)>>4)<<4);
}
/* **MUST** be implemented */
/*
* Non-zero on success
......@@ -1300,42 +1165,9 @@ static char c64_attr_rev(unsigned char orig)
CIOLIBEXPORT int CIOLIBCALL ciolib_puttext(int a,int b,int c,int d,void *e)
{
char *buf=e;
int i;
int font;
int ret;
CIOLIB_INIT();
if(ciolib_xlat) {
font = ciolib_getfont(1);
if (font >= 0) {
buf=malloc((c-a+1)*(d-b+1)*2);
if(!buf)
return 0;
if (conio_fontdata[font].put_xlat == NULL && cio_textinfo.currmode != C64_40X25) {
memcpy(buf, e, (c-a+1)*(d-b+1)*2);
}
else {
for (i=0; i<(c-a+1)*(d-b+1)*2; i+=2) {
if (ciolib_xlat & CIOLIB_XLAT_CHARS) {
if (((char *)e)[i] > 31 && ((char *)e)[i] < 127 && conio_fontdata[font].put_xlat != NULL)
buf[i] = conio_fontdata[font].put_xlat[((char *)e)[i]-32];
else
buf[i] = ((char *)e)[i];
}
else
buf[i] = ((char *)e)[i];
if (ciolib_xlat & CIOLIB_XLAT_ATTR) {
if (cio_textinfo.currmode == C64_40X25)
buf[i+1]=c64_attr_xlat(((char *)e)[i+1]);
else
buf[i+1]=((char *)e)[i+1];
}
else
buf[i+1]=((char *)e)[i+1];
}
}
}
}
ret = cio_api.puttext(a,b,c,d,(void *)buf);
if (buf != e)
free(buf);
......@@ -1347,9 +1179,7 @@ CIOLIBEXPORT int CIOLIBCALL ciolib_puttext(int a,int b,int c,int d,void *e)
CIOLIBEXPORT int CIOLIBCALL ciolib_gettext(int a,int b,int c,int d,void *e)
{
char *ch;
char xlat;
int i;
int font;
int ret;
struct vmem_cell *buf;
CIOLIB_INIT();
......@@ -1364,31 +1194,10 @@ CIOLIBEXPORT int CIOLIBCALL ciolib_gettext(int a,int b,int c,int d,void *e)
*(ch++)=buf[i].ch;
*(ch++)=buf[i].legacy_attr;
}
free(buf);
}
else
ret = cio_api.gettext(a,b,c,d,e);
if(ciolib_xlat) {
font = ciolib_getfont(1);
if (font >= 0) {
if (conio_fontdata[font].put_xlat || cio_textinfo.currmode == C64_40X25) {
for (i=0; i<(c-a+1)*(d-b+1)*2; i+=2) {
if (ciolib_xlat & CIOLIB_XLAT_CHARS) {
if (conio_fontdata[font].put_xlat) {
xlat = ((char *)e)[i];
if ((ch = memchr(conio_fontdata[font].put_xlat, ((char *)e)[i], 128))!=NULL)
xlat = (char)(ch-conio_fontdata[font].put_xlat)+32;
((char *)e)[i] = xlat;
}
}
if (ciolib_xlat & CIOLIB_XLAT_ATTR) {
if (cio_textinfo.currmode == C64_40X25) {
((char *)e)[i+1] = c64_attr_rev(((char *)e)[i+1]);;
}
}
}
}
}
}
return ret;
}
......
......@@ -249,7 +249,6 @@ struct conio_font_data_struct {
char *eight_by_sixteen;
char *eight_by_fourteen;
char *eight_by_eight;
char *put_xlat;
char *desc;
enum ciolib_codepage cp;
};
......@@ -375,12 +374,6 @@ CIOLIBEXPORTVAR int _wscroll;
CIOLIBEXPORTVAR int directvideo;
CIOLIBEXPORTVAR int hold_update;
CIOLIBEXPORTVAR int puttext_can_move;
CIOLIBEXPORTVAR int ciolib_xlat;
#define CIOLIB_XLAT_NONE 0
#define CIOLIB_XLAT_CHARS 1
#define CIOLIB_XLAT_ATTR 2
#define CIOLIB_XLAT_ALL (CIOLIB_XLAT_CHARS | CIOLIB_XLAT_ATTR)
CIOLIBEXPORTVAR int ciolib_reaper;
CIOLIBEXPORTVAR char *ciolib_appname;
......
......@@ -3919,6 +3919,21 @@ static void do_ansi(struct cterminal *cterm, char *retbuf, size_t retsize, int *
cterm->sequence=0;
}
static void
c64_set_reverse(struct cterminal *cterm, int on)
{
if (on != cterm->c64reversemode)
cterm->c64reversemode = on;
}
static uint8_t
c64_get_attr(struct cterminal *cterm)
{
if (cterm->c64reversemode)
return (cterm->attr >> 4 | cterm->attr << 4);
return cterm->attr;
}
static void
cterm_reset(struct cterminal *cterm)
{
......@@ -3959,7 +3974,16 @@ cterm_reset(struct cterminal *cterm)
cterm->saved_mode_mask = 0;
cterm->c64reversemode = 0;
gettextinfo(&ti);
cterm->attr = ti.normattr;
switch (ti.currmode) {
case C64_40X25:
case C128_40X25:
case C128_80X25:
cterm->attr = 15;
break;
default:
cterm->attr = ti.normattr;
break;
}
attr2palette(cterm->attr, &cterm->fg_color, &cterm->bg_color);
cterm->doorway_mode = 0;
cterm->doorway_char = 0;
......@@ -4093,7 +4117,16 @@ void CIOLIBCALL cterm_start(struct cterminal *cterm)
if (!cterm->started) {
GETTEXTINFO(&ti);
cterm->attr = ti.normattr;
switch (ti.currmode) {
case C64_40X25:
case C128_40X25:
case C128_80X25:
cterm->attr = 15;
break;
default:
cterm->attr = ti.normattr;
break;
}
attr2palette(cterm->attr, &cterm->fg_color, &cterm->bg_color);
FREE_AND_NULL(cterm->fg_tc_str);
FREE_AND_NULL(cterm->bg_tc_str);
......@@ -4967,17 +5000,20 @@ CIOLIBEXPORT char* CIOLIBCALL cterm_write(struct cterminal * cterm, const void *
/* Movement */
case 13: /* "\r\n" and disabled reverse. */
cterm->c64reversemode = 0;
c64_set_reverse(cterm, 0);
/* Fall-through */
case 141:
TERM_XY(&x, &y);
GOTOXY(TERM_MINX, y);
x = TERM_MINX;
/* Fall-through */
case 17:
if(y == TERM_MAXY)
if(y == TERM_MAXY) {
scrollup(cterm);
y = TERM_MAXY;
}
else
GOTOXY(x, y + 1);
y++;
GOTOXY(x, y);
break;
case 147:
cterm_clearscreen(cterm, cterm->attr);
......@@ -5064,10 +5100,10 @@ CIOLIBEXPORT char* CIOLIBCALL cterm_write(struct cterminal * cterm, const void *
SETFONT(34,FALSE,1);
break;
case 18: /* Reverse mode on */
cterm->c64reversemode = 1;
c64_set_reverse(cterm, 1);
break;
case 146: /* Reverse mode off */
cterm->c64reversemode = 0;
c64_set_reverse(cterm, 0);
break;
/* Extras */
......@@ -5081,40 +5117,13 @@ CIOLIBEXPORT char* CIOLIBCALL cterm_write(struct cterminal * cterm, const void *
}
break;
/* Translate to screen codes */
default:
k=buf[j];
if(k<32) {
break;
}
else if(k<64) {
/* No translation */
}
else if(k<96) {
k -= 64;
}
else if(k<128) {
k -= 32;
}
else if(k<160) {
if(k<32 || (k > 127 && k < 160)) {
break;
}
else if(k<192) {
k -= 64;
}
else if(k<224) {
k -= 128;
}
else {
if(k==255)
k = 94;
else
k -= 128;
}
if(cterm->c64reversemode)
k += 128;
ch[0] = k;
ch[1] = cterm->attr;
ch[1] = c64_get_attr(cterm);
SCR_XY(&sx, &sy);
PUTTEXT(sx, sy, sx, sy, ch);
ch[1]=0;
......
......@@ -1392,6 +1392,180 @@ static uint32_t atascii_ext_table[256] = {
0x0078, 0x0079, 0x007a, 0x2660, 0x007c, 0x21b0, 0x25c0, 0x25b6
};
static struct ciolib_cpmap petsciiu_table[193] = {
{0x0020, 32}, {0x0021, 33}, {0x0022, 34}, {0x0023, 35},
{0x0024, 36}, {0x0025, 37}, {0x0026, 38}, {0x0027, 39},
{0x0028, 40}, {0x0029, 41}, {0x002a, 42}, {0x002b, 43},
{0x002c, 44}, {0x002d, 45}, {0x002e, 46}, {0x002f, 47},
{0x0030, 48}, {0x0031, 49}, {0x0032, 50}, {0x0033, 51},
{0x0034, 52}, {0x0035, 53}, {0x0036, 54}, {0x0037, 55},
{0x0038, 56}, {0x0039, 57}, {0x003a, 58}, {0x003b, 59},
{0x003c, 60}, {0x003d, 61}, {0x003e, 62}, {0x003f, 63},
{0x0040, 64}, {0x0041, 65}, {0x0042, 66}, {0x0043, 67},
{0x0044, 68}, {0x0045, 69}, {0x0046, 70}, {0x0047, 71},
{0x0048, 72}, {0x0049, 73}, {0x004a, 74}, {0x004b, 75},
{0x004c, 76}, {0x004d, 77}, {0x004e, 78}, {0x004f, 79},
{0x0050, 80}, {0x0051, 81}, {0x0052, 82}, {0x0053, 83},
{0x0054, 84}, {0x0055, 85}, {0x0056, 86}, {0x0057, 87},
{0x0058, 88}, {0x0059, 89}, {0x005a, 90}, {0x005b, 91},
{0x005d, 93}, {0x00a0, 160}, {0x00a0, 224}, {0x00a3, 92},
{0x03c0, 222}, {0x03c0, 126}, {0x03c0, 255}, {0x2190, 95},
{0x2191, 94}, {0x2500, 96}, {0x2500, 192}, {0x2502, 125},
{0x2502, 221}, {0x250c, 240}, {0x250c, 176}, {0x2510, 238},
{0x2510, 174}, {0x2514, 237}, {0x2514, 173}, {0x2518, 253},
{0x2518, 189}, {0x251c, 171}, {0x251c, 235}, {0x2524, 179},
{0x2524, 243}, {0x252c, 242}, {0x252c, 178}, {0x2534, 241},
{0x2534, 177}, {0x253c, 123}, {0x253c, 219}, {0x256d, 213},
{0x256d, 117}, {0x256e, 105}, {0x256e, 201}, {0x256f, 203},
{0x256f, 107}, {0x2570, 106}, {0x2570, 202}, {0x2571, 110},
{0x2571, 206}, {0x2572, 109}, {0x2572, 205}, {0x2573, 214},
{0x2573, 118}, {0x2581, 164}, {0x2581, 228}, {0x2582, 175},
{0x2582, 239}, {0x2583, 185}, {0x2583, 249}, {0x2584, 162},
{0x2584, 226}, {0x258c, 225}, {0x258c, 161}, {0x258d, 181},
{0x258d, 245}, {0x258e, 244}, {0x258e, 180}, {0x258f, 229},
{0x258f, 165}, {0x2592, 230}, {0x2592, 166}, {0x2594, 227},
{0x2594, 163}, {0x2595, 167}, {0x2595, 231}, {0x2596, 251},
{0x2596, 187}, {0x2597, 172}, {0x2597, 236}, {0x2598, 254},
{0x2598, 190}, {0x259a, 191}, {0x259d, 188}, {0x259d, 252},
{0x25cb, 119}, {0x25cb, 215}, {0x25cf, 209}, {0x25cf, 113},
{0x25e4, 169}, {0x25e4, 233}, {0x25e5, 127}, {0x25e5, 223},
{0x2660, 193}, {0x2660, 97}, {0x2663, 216}, {0x2663, 120},
{0x2665, 211}, {0x2665, 115}, {0x2666, 218}, {0x2666, 122},
{0x1fb70, 116},{0x1fb70, 212},{0x1fb71, 103},{0x1fb71, 199},
{0x1fb72, 194},{0x1fb72, 98},{0x1fb74, 200},{0x1fb74, 104},
{0x1fb75, 121},{0x1fb75, 217},{0x1fb76, 101},{0x1fb76, 197},
{0x1fb77, 196},{0x1fb77, 100},{0x1fb78, 195},{0x1fb78, 99},
{0x1fb7a, 198},{0x1fb7a, 102},{0x1fb7b, 114},{0x1fb7b, 210},
{0x1fb7c, 204},{0x1fb7c, 108},{0x1fb7d, 207},{0x1fb7d, 111},
{0x1fb7e, 112},{0x1fb7e, 208},{0x1fb7f, 186},{0x1fb7f, 250},
{0x1fb82, 247},{0x1fb82, 183},{0x1fb83, 248},{0x1fb83, 184},
{0x1fb87, 234},{0x1fb87, 170},{0x1fb88, 246},{0x1fb88, 182},
{0x1fb8c, 220},{0x1fb8c, 124},{0x1fb8f, 232},{0x1fb8f, 168},
{0xfffd, '?'}
};
static uint32_t petsciiu_unicode_table[256] = {
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027,
0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f,
0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037,
0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f,
0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047,
0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f,
0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057,
0x0058, 0x0059, 0x005a, 0x005b, 0x00a3, 0x005d, 0x2191, 0x2190,
0x2500, 0x2660,0x1fb72,0x1fb78,0x1fb77,0x1fb76,0x1fb7a,0x1fb71,
0x1fb74,0x256e, 0x2570, 0x256f,0x1fb7c, 0x2572, 0x2571,0x1fb7d,
0x1fb7e,0x25cf,0x1fb7b, 0x2665,0x1fb70, 0x256d, 0x2573, 0x25cb,
0x2663,0x1fb75, 0x2666, 0x253c,0x1fb8c, 0x2502, 0x03c0, 0x25e5,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0x00a0, 0x258c, 0x2584, 0x2594, 0x2581, 0x258f, 0x2592, 0x2595,
0x1fb8f,0x25e4,0x1fb87, 0x251c, 0x2597, 0x2514, 0x2510, 0x2582,
0x250c, 0x2534, 0x252c, 0x2524, 0x258e, 0x258d,0x1fb88,0x1fb82,
0x1fb83,0x2583,0x1fb7f, 0x2596, 0x259d, 0x2518, 0x2598, 0x259a,
0x2500, 0x2660,0x1fb72,0x1fb78,0x1fb77,0x1fb76,0x1fb7a,0x1fb71,
0x1fb74,0x256e, 0x2570, 0x256f,0x1fb7c, 0x2572, 0x2571,0x1fb7d,
0x1fb7e,0x25cf,0x1fb7b, 0x2665,0x1fb70, 0x256d, 0x2573, 0x25cb,
0x2663,0x1fb75, 0x2666, 0x253c,0x1fb8c, 0x2502, 0x03c0, 0x25e5,
0x00a0, 0x258c, 0x2584, 0x2594, 0x2581, 0x258f, 0x2592, 0x2595,
0x1fb8f,0x25e4,0x1fb87, 0x251c, 0x2597, 0x2514, 0x2510, 0x2582,
0x250c, 0x2534, 0x252c, 0x2524, 0x258e, 0x258d,0x1fb88,0x1fb82,
0x1fb83,0x2583,0x1fb7f, 0x2596, 0x259d, 0x2518, 0x2598, 0x03c0
};
static struct ciolib_cpmap petsciil_table[193] = {
{0x0020, 32}, {0x0021, 33}, {0x0022, 34}, {0x0023, 35},
{0x0024, 36}, {0x0025, 37}, {0x0026, 38}, {0x0027, 39},
{0x0028, 40}, {0x0029, 41}, {0x002a, 42}, {0x002b, 43},
{0x002c, 44}, {0x002d, 45}, {0x002e, 46}, {0x002f, 47},
{0x0030, 48}, {0x0031, 49}, {0x0032, 50}, {0x0033, 51},
{0x0034, 52}, {0x0035, 53}, {0x0036, 54}, {0x0037, 55},
{0x0038, 56}, {0x0039, 57}, {0x003a, 58}, {0x003b, 59},
{0x003c, 60}, {0x003d, 61}, {0x003e, 62}, {0x003f, 63},
{0x0040, 64}, {0x0041, 97}, {0x0041, 193}, {0x0042, 194},
{0x0042, 98}, {0x0043, 195}, {0x0043, 99}, {0x0044, 196},
{0x0044, 100}, {0x0045, 101}, {0x0045, 197}, {0x0046, 198},
{0x0046, 102}, {0x0047, 199}, {0x0047, 103}, {0x0048, 200},
{0x0048, 104}, {0x0049, 105}, {0x0049, 201}, {0x004a, 202},
{0x004a, 106}, {0x004b, 107}, {0x004b, 203}, {0x004c, 108},
{0x004c, 204}, {0x004d, 109}, {0x004d, 205}, {0x004e, 206},
{0x004e, 110}, {0x004f, 207}, {0x004f, 111}, {0x0050, 208},
{0x0050, 112}, {0x0051, 113}, {0x0051, 209}, {0x0052, 114},
{0x0052, 210}, {0x0053, 115}, {0x0053, 211}, {0x0054, 212},
{0x0054, 116}, {0x0055, 213}, {0x0055, 117}, {0x0056, 118},
{0x0056, 214}, {0x0057, 119}, {0x0057, 215}, {0x0058, 216},
{0x0058, 120}, {0x0059, 217}, {0x0059, 121}, {0x005a, 218},
{0x005a, 122}, {0x005b, 91}, {0x005d, 93}, {0x0061, 65},
{0x0062, 66}, {0x0063, 67}, {0x0064, 68}, {0x0065, 69},
{0x0066, 70}, {0x0067, 71}, {0x0068, 72}, {0x0069, 73},
{0x006a, 74}, {0x006b, 75}, {0x006c, 76}, {0x006d, 77},
{0x006e, 78}, {0x006f, 79}, {0x0070, 80}, {0x0071, 81},
{0x0072, 82}, {0x0073, 83}, {0x0074, 84}, {0x0075, 85},
{0x0076, 86}, {0x0077, 87}, {0x0078, 88}, {0x0079, 89},
{0x007a, 90}, {0x00a0, 160}, {0x00a0, 224}, {0x00a3, 92},
{0x2190, 95}, {0x2191, 94}, {0x2500, 96}, {0x2500, 192},
{0x2502, 221}, {0x2502, 125}, {0x250c, 240}, {0x250c, 176},
{0x2510, 174}, {0x2510, 238}, {0x2514, 237}, {0x2514, 173},
{0x2518, 253}, {0x2518, 189}, {0x251c, 235}, {0x251c, 171},
{0x2524, 179}, {0x2524, 243}, {0x252c, 242}, {0x252c, 178},
{0x2534, 241}, {0x2534, 177}, {0x253c, 123}, {0x253c, 219},
{0x2581, 164}, {0x2581, 228}, {0x2582, 175}, {0x2582, 239},
{0x2583, 185}, {0x2583, 249}, {0x2584, 226}, {0x2584, 162},
{0x258c, 225}, {0x258c, 161}, {0x258d, 181}, {0x258d, 245},
{0x258e, 180}, {0x258e, 244}, {0x258f, 165}, {0x258f, 229},
{0x2592, 230}, {0x2592, 166}, {0x2594, 227}, {0x2594, 163},
{0x2595, 231}, {0x2595, 167}, {0x2596, 187}, {0x2596, 251},
{0x2597, 236}, {0x2597, 172}, {0x2598, 254}, {0x2598, 190},
{0x259a, 191}, {0x259d, 188}, {0x259d, 252}, {0x2713, 186},
{0x2713, 250},{0x1fb82, 247},{0x1fb82, 183},{0x1fb83, 248},
{0x1fb83, 184},{0x1fb87, 170},{0x1fb87, 234},{0x1fb88, 246},
{0x1fb88, 182},{0x1fb8c, 220},{0x1fb8c, 124},{0x1fb8f, 232},
{0x1fb8f, 168},{0x1fb96, 255},{0x1fb96, 222},{0x1fb96, 126},
{0x1fb98, 127},{0x1fb98, 223},{0x1fb99, 169},{0x1fb99, 233},
{0xfffd, '?'}
};
static uint32_t petsciil_unicode_table[256] = {
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027,
0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f,
0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037,
0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f,
0x0040, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067,
0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f,
0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077,
0x0078, 0x0079, 0x007a, 0x005b, 0x00a3, 0x005d, 0x2191, 0x2190,
0x2500, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047,
0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f,
0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057,
0x0058, 0x0059, 0x005a, 0x253c,0x1fb8c, 0x2502,0x1fb96,0x1fb98,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0x00a0, 0x258c, 0x2584, 0x2594, 0x2581, 0x258f, 0x2592, 0x2595,
0x1fb8f,0x1fb99,0x1fb87,0x251c, 0x2597, 0x2514, 0x2510, 0x2582,
0x250c, 0x2534, 0x252c, 0x2524, 0x258e, 0x258d,0x1fb88,0x1fb82,
0x1fb83,0x2583, 0x2713, 0x2596, 0x259d, 0x2518, 0x2598, 0x259a,
0x2500, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047,
0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f,
0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057,
0x0058, 0x0059, 0x005a, 0x253c,0x1fb8c, 0x2502,0x1fb96,0x1fb98,
0x00a0, 0x258c, 0x2584, 0x2594, 0x2581, 0x258f, 0x2592, 0x2595,
0x1fb8f,0x1fb99,0x1fb87,0x251c, 0x2597, 0x2514, 0x2510, 0x2582,
0x250c, 0x2534, 0x252c, 0x2524, 0x258e, 0x258d,0x1fb88,0x1fb82,
0x1fb83,0x2583, 0x2713, 0x2596, 0x259d, 0x2518, 0x2598,0x1fb96
};
static int
cmptab(const void *key, const void *entry)
{
......@@ -1770,6 +1944,12 @@ struct codepage_def ciolib_cp[CIOLIB_CP_COUNT] = {
{"ATASCII", CIOLIB_ATASCII, ftstr_to_utf8, utf8_to_cpstr, ft_from_unicode_cpoint, ft_from_unicode_cpoint_ext,
atascii_table, sizeof(atascii_table) / sizeof(atascii_table[0]),
atascii_unicode_table, atascii_ext_table},