Skip to content
Snippets Groups Projects
Commit da951220 authored by Deucе's avatar Deucе :ok_hand_tone4:
Browse files

Update prestel unicode tables for new font layout

Pasting mosaics won't work properly, but it wouldn't anyway, so I'm
not too worried about it.

Also, I can't seem to find anything I can paste separated mosaics
into, but that may just be due to Unicode 16 being so new.
parent 848602f4
No related branches found
No related tags found
No related merge requests found
Pipeline #8187 passed
......@@ -1466,29 +1466,187 @@ const static uint32_t petsciil_unicode_table[256] = {
};
const static struct ciolib_cpmap prestel_table[] = {
{0xa3, '#'}, // £
{0xbc, '{'}, // ¼
{0xbd, '\\'}, // ½
{0xbe, '}'}, // ¾
{0xf7, '~'}, // ÷
{0x2015, '`'}, // Horizontal bar *
{0x2190, '['}, // ←
{0x2191, '^'}, // ↑
{0x2192, ']'}, // →
{0x2317, '_'}, // Viewdata square
{0x23f8, '|'}, // Double vertical bar *
{0x258c, 149},
{0x2590, 170},
{0x2588, 191},
/* Space */ {0x1ce51, 193}, {0x1ce52, 194}, {0x1ce53, 195},
{0x1ce54, 196}, {0x1ce55, 197}, {0x1ce56, 198}, {0x1ce57, 199},
{0x1ce58, 200}, {0x1ce59, 201}, {0x1ce5a, 202}, {0x1ce5b, 203},
{0x1ce5c, 204}, {0x1ce5d, 205}, {0x1ce5e, 206}, {0x1ce5f, 207},
{0x1ce60, 208}, {0x1ce61, 209}, {0x1ce62, 210}, {0x1ce63, 211},
{0x1ce64, 212}, {0x1ce65, 213}, {0x1ce66, 214}, {0x1ce67, 215},
{0x1ce68, 216}, {0x1ce69, 217}, {0x1ce6a, 218}, {0x1ce6b, 219},
{0x1ce6c, 220}, {0x1ce6d, 221}, {0x1ce6e, 222}, {0x1ce6f, 223},
{0x00080, 128}, {0x00081, 129}, {0x00082, 130}, {0x00083, 131},
{0x00084, 132}, {0x00085, 133}, {0x00086, 134}, {0x00087, 135},
{0x00088, 136}, {0x00089, 137}, {0x0008a, 138}, {0x0008b, 139},
{0x0008c, 140}, {0x0008d, 141}, {0x0008e, 142}, {0x0008f, 143},
{0x00090, 144}, {0x00091, 145}, {0x00092, 146}, {0x00093, 147},
{0x00094, 148}, {0x00095, 149}, {0x00096, 150}, {0x00097, 151},
{0x00098, 152}, {0x00099, 153}, {0x0009a, 154}, {0x0009b, 155},
{0x0009c, 156}, {0x0009d, 157}, {0x0009e, 158}, {0x0009f, 159},
{0x000a3, 35}, {0x000bc, 123}, {0x000bd, 92}, {0x000be, 125},
{0x000f7, 126}, {0x02015, 96}, {0x02190, 91}, {0x02191, 94},
{0x02192, 93}, {0x02317, 95}, {0x023f8, 124}, {0x02588, 255},
{0x0258c, 181}, {0x02590, 234}, {0x025e2, 213}, {0x025e3, 197},
{0x1fb00, 161}, {0x1fb01, 162}, {0x1fb02, 163}, {0x1fb03, 164},
{0x1fb04, 165}, {0x1fb05, 166}, {0x1fb06, 167}, {0x1fb07, 168},
{0x1fb08, 169}, {0x1fb09, 170}, {0x1fb0a, 171}, {0x1fb0b, 172},
{0x1fb0c, 173}, {0x1fb0d, 174}, {0x1fb0e, 175}, {0x1fb0f, 176},
{0x1fb10, 177}, {0x1fb11, 178}, {0x1fb12, 179}, {0x1fb13, 180},
{0x1fb14, 182}, {0x1fb15, 183}, {0x1fb16, 184}, {0x1fb17, 185},
{0x1fb18, 186}, {0x1fb19, 187}, {0x1fb1a, 188}, {0x1fb1b, 189},
{0x1fb1c, 190}, {0x1fb1d, 191},
{0x1fb1e, 224}, {0x1fb1f, 225}, {0x1fb20, 226}, {0x1fb21, 227},
{0x1fb22, 228}, {0x1fb23, 229}, {0x1fb24, 230}, {0x1fb25, 231},
{0x1fb26, 232}, {0x1fb27, 233}, {0x1fb28, 235}, {0x1fb29, 236},
{0x1fb2a, 237}, {0x1fb2b, 238}, {0x1fb2c, 239}, {0x1fb2d, 240},
{0x1fb2e, 241}, {0x1fb2f, 242}, {0x1fb30, 243}, {0x1fb31, 244},
{0x1fb32, 245}, {0x1fb33, 246}, {0x1fb34, 247}, {0x1fb35, 248},
{0x1fb36, 249}, {0x1fb37, 250}, {0x1fb38, 251}, {0x1fb39, 252},
{0x1fb3a, 253}, {0x1fb3b, 254},
{0x1fb3c, 192}, {0x1fb3d, 193}, {0x1fb3e, 194}, {0x1fb3f, 195},
{0x1fb40, 196}, {0x1fb41, 198}, {0x1fb42, 199}, {0x1fb43, 200},
{0x1fb44, 201}, {0x1fb45, 202}, {0x1fb46, 203}, {0x1fb47, 208},
{0x1fb48, 209}, {0x1fb49, 210}, {0x1fb4a, 211}, {0x1fb4b, 212},
{0x1fb4c, 214}, {0x1fb4d, 215}, {0x1fb4e, 216}, {0x1fb4f, 217},
{0x1fb50, 218}, {0x1fb51, 219},
{0x1fb68, 204}, {0x1fb69, 205},
{0x1fb6a, 220}, {0x1fb6b, 221},
};
const static uint32_t prestel_unicode_table[256] = {
0x00000, 0x00001, 0x00002, 0x00003,
0x00004, 0x00005, 0x00006, 0x00007,
0x00008, 0x00009, 0x0000a, 0x0000b,
0x0000c, 0x0000d, 0x0000e, 0x0000f,
0x00010, 0x00011, 0x00012, 0x00013,
0x00014, 0x00015, 0x00016, 0x00017,
0x00018, 0x00019, 0x0001a, 0x0001b,
0x0001c, 0x0001d, 0x0001e, 0x0001f,
0x00020, 0x00021, 0x00022, 0x000a3,
0x00024, 0x00025, 0x00026, 0x00027,
0x00028, 0x00029, 0x0002a, 0x0002b,
0x0002c, 0x0002d, 0x0002e, 0x0002f,
0x00030, 0x00031, 0x00032, 0x00033,
0x00034, 0x00035, 0x00036, 0x00037,
0x00038, 0x00039, 0x0003a, 0x0003b,
0x0003c, 0x0003d, 0x0003e, 0x0003f,
0x00040, 0x00041, 0x00042, 0x00043,
0x00044, 0x00045, 0x00046, 0x00047,
0x00048, 0x00049, 0x0004a, 0x0004b,
0x0004c, 0x0004d, 0x0004e, 0x0004f,
0x00050, 0x00051, 0x00052, 0x00053,
0x00054, 0x00055, 0x00056, 0x00057,
0x00058, 0x00059, 0x0005a, 0x02190,
0x000bd, 0x02192, 0x02191, 0x02317,
0x02015, 0x00061, 0x00062, 0x00063,
0x00064, 0x00065, 0x00066, 0x00067,
0x00068, 0x00069, 0x0006a, 0x0006b,
0x0006c, 0x0006d, 0x0006e, 0x0006f,
0x00070, 0x00071, 0x00072, 0x00073,
0x00074, 0x00075, 0x00076, 0x00077,
0x00078, 0x00079, 0x0007a, 0x000bc,
0x023f8, 0x000be, 0x000f7, 0x0007f,
0x00080, 0x00081, 0x00082, 0x00083,
0x00084, 0x00085, 0x00086, 0x00087,
0x00088, 0x00089, 0x0008a, 0x0008b,
0x0008c, 0x0008d, 0x0008e, 0x0008f,
0x00090, 0x00091, 0x00092, 0x00093,
0x00094, 0x00095, 0x00096, 0x00097,
0x00098, 0x00099, 0x0009a, 0x0009b,
0x0009c, 0x0009d, 0x0009e, 0x0009f,
0x00020, 0x1fb00, 0x1fb01, 0x1fb02,
0x1fb03, 0x1fb04, 0x1fb05, 0x1fb06,
0x1fb07, 0x1fb08, 0x1fb09, 0x1fb0a,
0x1fb0b, 0x1fb0c, 0x1fb0d, 0x1fb0e,
0x1fb0f, 0x1fb10, 0x1fb11, 0x1fb12,
0x1fb13, 0x258c, 0x1fb14, 0x1fb15,
0x1fb16, 0x1fb17, 0x1fb18, 0x1fb19,
0x1fb1a, 0x1fb1b, 0x1fb1c, 0x1fb1d,
0x1fb3c, 0x1fb3d, 0x1fb3e, 0x1fb3f,
0x1fb40, 0x25e3, 0x1fb41, 0x1fb42,
0x1fb43, 0x1fb44, 0x1fb45, 0x1fb46,
0x1fb68, 0x1fb69, 0x00020, 0x00020,
0x1fb47, 0x1fb48, 0x1fb49, 0x1fb4a,
0x1fb4b, 0x25e2, 0x1fb4c, 0x1fb4d,
0x1fb4e, 0x1fb4f, 0x1fb50, 0x1fb51,
0x1fb6a, 0x1fb6b, 0x00020, 0x00020,
0x1fb1e, 0x1fb1f, 0x1fb20, 0x1fb21,
0x1fb22, 0x1fb23, 0x1fb24, 0x1fb25,
0x1fb26, 0x1fb27, 0x2590, 0x1fb28,
0x1fb29, 0x1fb2a, 0x1fb2b, 0x1fb2c,
0x1fb2d, 0x1fb2e, 0x1fb2f, 0x1fb30,
0x1fb31, 0x1fb32, 0x1fb33, 0x1fb34,
0x1fb35, 0x1fb36, 0x1fb37, 0x1fb38,
0x1fb39, 0x1fb3a, 0x1fb3b, 0x2588,
/*
// Contiguous
0x00020, 0x1fb00, 0x1fb01, 0x1fb02,
0x1fb03, 0x1fb04, 0x1fb05, 0x1fb06,
0x1fb07, 0x1fb08, 0x1fb09, 0x1fb0a,
0x1fb0b, 0x1fb0c, 0x1fb0d, 0x1fb0e,
0x1fb0f, 0x1fb10, 0x1fb11, 0x1fb12,
0x1fb13, 0x258c, 0x1fb14, 0x1fb15,
0x1fb16, 0x1fb17, 0x1fb18, 0x1fb19,
0x1fb1a, 0x1fb1b, 0x1fb1c, 0x1fb1d,
0x1fb1e, 0x1fb1f, 0x1fb20, 0x1fb21,
0x1fb22, 0x1fb23, 0x1fb24, 0x1fb25,
0x1fb26, 0x1fb27, 0x2590, 0x1fb28,
0x1fb29, 0x1fb2a, 0x1fb2b, 0x1fb2c,
0x1fb2d, 0x1fb2e, 0x1fb2f, 0x1fb30,
0x1fb31, 0x1fb32, 0x1fb33, 0x1fb34,
0x1fb35, 0x1fb36, 0x1fb37, 0x1fb38,
0x1fb39, 0x1fb3a, 0x1fb3b, 0x2588,
// Separated
0x00020, 0x1ce51, 0x1ce52, 0x1ce53,
0x1ce54, 0x1ce55, 0x1ce56, 0x1ce57,
0x1ce58, 0x1ce59, 0x1ce5a, 0x1ce5b,
0x1ce5c, 0x1ce5d, 0x1ce5e, 0x1ce5f,
0x1ce60, 0x1ce61, 0x1ce62, 0x1ce63,
0x1ce64, 0x1ce65, 0x1ce66, 0x1ce67,
0x1ce68, 0x1ce69, 0x1ce6a, 0x1ce6b,
0x1ce6c, 0x1ce6d, 0x1ce6e, 0x1ce6f,
0x1ce70, 0x1ce71, 0x1ce72, 0x1ce73,
0x1ce74, 0x1ce75, 0x1ce76, 0x1ce77,
0x1ce78, 0x1ce79, 0x1ce7a, 0x1ce7b,
0x1ce7c, 0x1ce7d, 0x1ce7e, 0x1ce7f,
0x1ce80, 0x1ce81, 0x1ce82, 0x1ce83,
0x1ce84, 0x1ce85, 0x1ce86, 0x1ce87,
0x1ce88, 0x1ce89, 0x1ce8a, 0x1ce8b,
0x1ce8c, 0x1ce8d, 0x1ce8e, 0x1ce8f
*/
};
const static struct ciolib_cpmap prestel_table_sep[] = {
{0x00080, 128}, {0x00081, 129}, {0x00082, 130}, {0x00083, 131},
{0x00084, 132}, {0x00085, 133}, {0x00086, 134}, {0x00087, 135},
{0x00088, 136}, {0x00089, 137}, {0x0008a, 138}, {0x0008b, 139},
{0x0008c, 140}, {0x0008d, 141}, {0x0008e, 142}, {0x0008f, 143},
{0x00090, 144}, {0x00091, 145}, {0x00092, 146}, {0x00093, 147},
{0x00094, 148}, {0x00095, 149}, {0x00096, 150}, {0x00097, 151},
{0x00098, 152}, {0x00099, 153}, {0x0009a, 154}, {0x0009b, 155},
{0x0009c, 156}, {0x0009d, 157}, {0x0009e, 158}, {0x0009f, 159},
{0x000a3, 35},
{0x000bc, 123},
{0x000bd, 92},
{0x000be, 125}, {0x000f7, 126},
{0x02015, 96},
{0x02190, 91}, {0x02191, 94}, {0x02192, 93},
{0x02317, 95},
{0x023f8, 124},
{0x025e2, 213},
{0x025e3, 197},
{0x1ce51, 161}, {0x1ce52, 162}, {0x1ce53, 163}, {0x1ce54, 164},
{0x1ce55, 165}, {0x1ce56, 166}, {0x1ce57, 167}, {0x1ce58, 168},
{0x1ce59, 169}, {0x1ce5a, 170}, {0x1ce5b, 171}, {0x1ce5c, 172},
{0x1ce5d, 173}, {0x1ce5e, 174}, {0x1ce5f, 175}, {0x1ce60, 176},
{0x1ce61, 177}, {0x1ce62, 178}, {0x1ce63, 179}, {0x1ce64, 180},
{0x1ce65, 181}, {0x1ce66, 182}, {0x1ce67, 183}, {0x1ce68, 184},
{0x1ce69, 185}, {0x1ce6a, 186}, {0x1ce6b, 187}, {0x1ce6c, 188},
{0x1ce6d, 189}, {0x1ce6e, 190}, {0x1ce6f, 191},
{0x1ce70, 224}, {0x1ce71, 225}, {0x1ce72, 226}, {0x1ce73, 227},
{0x1ce74, 228}, {0x1ce75, 229}, {0x1ce76, 230}, {0x1ce77, 231},
{0x1ce78, 232}, {0x1ce79, 233}, {0x1ce7a, 234}, {0x1ce7b, 235},
......@@ -1498,25 +1656,20 @@ const static struct ciolib_cpmap prestel_table[] = {
{0x1ce88, 248}, {0x1ce89, 249}, {0x1ce8a, 250}, {0x1ce8b, 251},
{0x1ce8c, 252}, {0x1ce8d, 253}, {0x1ce8e, 254}, {0x1ce8f, 255},
/* Space */ {0x1fb00, 129}, {0x1fb01, 130}, {0x1fb02, 131},
{0x1fb03, 132}, {0x1fb04, 133}, {0x1fb05, 134}, {0x1fb06, 135},
{0x1fb07, 136}, {0x1fb08, 137}, {0x1fb09, 138}, {0x1fb0a, 139},
{0x1fb0b, 140}, {0x1fb0c, 141}, {0x1fb0d, 142}, {0x1fb0e, 143},
{0x1fb0f, 144}, {0x1fb10, 145}, {0x1fb11, 146}, {0x1fb12, 147},
{0x1fb13, 148}, {0x1fb14, 150}, {0x1fb15, 151},
{0x1fb16, 152}, {0x1fb17, 153}, {0x1fb18, 154}, {0x1fb19, 155},
{0x1fb1a, 156}, {0x1fb1b, 157}, {0x1fb1c, 158}, {0x1fb1d, 159},
{0x1fb1e, 160}, {0x1fb1f, 161}, {0x1fb20, 162}, {0x1fb21, 163},
{0x1fb22, 164}, {0x1fb23, 165}, {0x1fb24, 166}, {0x1fb25, 167},
{0x1fb26, 168}, {0x1fb27, 169}, {0x1fb28, 171}, {0x1fb29, 172},
{0x1fb2a, 173}, {0x1fb2b, 174}, {0x1fb2c, 175},
{0x1fb2d, 176}, {0x1fb2e, 177}, {0x1fb2f, 178}, {0x1fb30, 179},
{0x1fb31, 180}, {0x1fb32, 181}, {0x1fb33, 182}, {0x1fb34, 183},
{0x1fb35, 184}, {0x1fb36, 185}, {0x1fb37, 186}, {0x1fb38, 187},
{0x1fb39, 188}, {0x1fb3a, 189}, {0x1fb3b, 190}
{0x1fb3c, 192}, {0x1fb3d, 193}, {0x1fb3e, 194}, {0x1fb3f, 195},
{0x1fb40, 196},
{0x1fb41, 198}, {0x1fb42, 199},
{0x1fb43, 200}, {0x1fb44, 201}, {0x1fb45, 202}, {0x1fb46, 203},
{0x1fb47, 208}, {0x1fb48, 209}, {0x1fb49, 210},
{0x1fb4a, 211}, {0x1fb4b, 212},
{0x1fb4c, 214}, {0x1fb4d, 215}, {0x1fb4e, 216}, {0x1fb4f, 217},
{0x1fb50, 218}, {0x1fb51, 219},
{0x1fb68, 204}, {0x1fb69, 205},
{0x1fb6a, 220}, {0x1fb6b, 221},
};
const static uint32_t prestel_unicode_table[256] = {
const static uint32_t prestel_unicode_table_sep[256] = {
0x00000, 0x00001, 0x00002, 0x00003,
0x00004, 0x00005, 0x00006, 0x00007,
0x00008, 0x00009, 0x0000a, 0x0000b,
......@@ -1550,6 +1703,45 @@ const static uint32_t prestel_unicode_table[256] = {
0x00078, 0x00079, 0x0007a, 0x000bc,
0x023f8, 0x000be, 0x000f7, 0x0007f,
0x00080, 0x00081, 0x00082, 0x00083,
0x00084, 0x00085, 0x00086, 0x00087,
0x00088, 0x00089, 0x0008a, 0x0008b,
0x0008c, 0x0008d, 0x0008e, 0x0008f,
0x00090, 0x00091, 0x00092, 0x00093,
0x00094, 0x00095, 0x00096, 0x00097,
0x00098, 0x00099, 0x0009a, 0x0009b,
0x0009c, 0x0009d, 0x0009e, 0x0009f,
0x00020, 0x1ce51, 0x1ce52, 0x1ce53,
0x1ce54, 0x1ce55, 0x1ce56, 0x1ce57,
0x1ce58, 0x1ce59, 0x1ce5a, 0x1ce5b,
0x1ce5c, 0x1ce5d, 0x1ce5e, 0x1ce5f,
0x1ce60, 0x1ce61, 0x1ce62, 0x1ce63,
0x1ce64, 0x1ce65, 0x1ce66, 0x1ce67,
0x1ce68, 0x1ce69, 0x1ce6a, 0x1ce6b,
0x1ce6c, 0x1ce6d, 0x1ce6e, 0x1ce6f,
0x1fb3c, 0x1fb3d, 0x1fb3e, 0x1fb3f,
0x1fb40, 0x25e3, 0x1fb41, 0x1fb42,
0x1fb43, 0x1fb44, 0x1fb45, 0x1fb46,
0x1fb68, 0x1fb69, 0x00020, 0x00020,
0x1fb47, 0x1fb48, 0x1fb49, 0x1fb4a,
0x1fb4b, 0x25e2, 0x1fb4c, 0x1fb4d,
0x1fb4e, 0x1fb4f, 0x1fb50, 0x1fb51,
0x1fb6a, 0x1fb6b, 0x00020, 0x00020,
0x1ce70, 0x1ce71, 0x1ce72, 0x1ce73,
0x1ce74, 0x1ce75, 0x1ce76, 0x1ce77,
0x1ce78, 0x1ce79, 0x1ce7a, 0x1ce7b,
0x1ce7c, 0x1ce7d, 0x1ce7e, 0x1ce7f,
0x1ce80, 0x1ce81, 0x1ce82, 0x1ce83,
0x1ce84, 0x1ce85, 0x1ce86, 0x1ce87,
0x1ce88, 0x1ce89, 0x1ce8a, 0x1ce8b,
0x1ce8c, 0x1ce8d, 0x1ce8e, 0x1ce8f
/*
// Contiguous
0x00020, 0x1fb00, 0x1fb01, 0x1fb02,
0x1fb03, 0x1fb04, 0x1fb05, 0x1fb06,
0x1fb07, 0x1fb08, 0x1fb09, 0x1fb0a,
......@@ -1567,6 +1759,7 @@ const static uint32_t prestel_unicode_table[256] = {
0x1fb35, 0x1fb36, 0x1fb37, 0x1fb38,
0x1fb39, 0x1fb3a, 0x1fb3b, 0x2588,
// Separated
0x00020, 0x1ce51, 0x1ce52, 0x1ce53,
0x1ce54, 0x1ce55, 0x1ce56, 0x1ce57,
0x1ce58, 0x1ce59, 0x1ce5a, 0x1ce5b,
......@@ -1583,6 +1776,7 @@ const static uint32_t prestel_unicode_table[256] = {
0x1ce84, 0x1ce85, 0x1ce86, 0x1ce87,
0x1ce88, 0x1ce89, 0x1ce8a, 0x1ce8b,
0x1ce8c, 0x1ce8d, 0x1ce8e, 0x1ce8f
*/
};
static int
......@@ -1745,7 +1939,7 @@ utf8_bytes(uint32_t cp)
return 2;
if (cp < 0x10000)
return 3;
if (cp < 0x11000)
if (cp < 0x110000)
return 4;
return -1;
}
......@@ -2013,6 +2207,9 @@ const struct codepage_def ciolib_cp[CIOLIB_CP_COUNT] = {
{"PRESTEL", CIOLIB_PRESTEL, ftstr_to_utf8, utf8_to_cpstr, cptable_from_unicode_cpoint, ft_cpoint_from_cptable, cpoint_from_cptable_ext,
prestel_table, sizeof(prestel_table) / sizeof(prestel_table[0]),
prestel_unicode_table, empty_ext_table},
{"PRESTEL-SEP", CIOLIB_PRESTEL_SEP, ftstr_to_utf8, utf8_to_cpstr, cptable_from_unicode_cpoint, ft_cpoint_from_cptable, cpoint_from_cptable_ext,
prestel_table_sep, sizeof(prestel_table_sep) / sizeof(prestel_table_sep[0]),
prestel_unicode_table_sep, empty_ext_table},
};
uint8_t *cp_to_utf8(enum ciolib_codepage cp, const char *cpstr, size_t buflen, size_t *outlen)
......
......@@ -26,6 +26,7 @@ enum ciolib_codepage {
CIOLIB_PETSCIIU,
CIOLIB_PETSCIIL,
CIOLIB_PRESTEL,
CIOLIB_PRESTEL_SEP,
CIOLIB_CP_COUNT
};
......
......@@ -266,12 +266,12 @@ mousedrag(struct vmem_cell *scrollback)
for (pos = startpos; pos <= endpos; pos++) {
size_t outlen;
uint8_t *utf8str;
int cp = conio_fontdata[screen[pos].font].cp;
if (cp == CIOLIB_PRESTEL && (screen[pos].bg & 0x20000000))
cp = CIOLIB_PRESTEL_SEP;
utf8str =
cp_to_utf8(conio_fontdata[screen[pos].font].cp,
(char *)&screen[pos].ch,
1,
&outlen);
cp_to_utf8(cp, (char *)&screen[pos].ch, 1, &outlen);
if (utf8str == NULL)
continue;
memcpy(copybuf + outpos, utf8str, outlen);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment