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

Fix unicode -> Prestel mapping

We want ASCII to map directly, and unicode values need to be sorted
ascending for bsearch() to work properly.

Fixes Prestel keyboard input not working in GDI mode.
parent df71fae5
Branches
Tags
No related merge requests found
Pipeline #7282 passed
...@@ -1467,33 +1467,19 @@ const static uint32_t petsciil_unicode_table[256] = { ...@@ -1467,33 +1467,19 @@ const static uint32_t petsciil_unicode_table[256] = {
const static struct ciolib_cpmap prestel_table[] = { const static struct ciolib_cpmap prestel_table[] = {
{0xa3, '#'}, // £ {0xa3, '#'}, // £
{0x2190, '['}, // {0xbc, '{'}, // ¼
{0xbd, '\\'}, // ½ {0xbd, '\\'}, // ½
{0x2192, ']'}, // → {0xbe, '}'}, // ¾
{0xf7, '~'}, // ÷
{0x2015, '`'}, // Horizontal bar *
{0x2190, '['}, // ←
{0x2191, '^'}, // ↑ {0x2191, '^'}, // ↑
{0x2192, ']'}, // →
{0x2317, '_'}, // Viewdata square {0x2317, '_'}, // Viewdata square
{0x2015, '`'}, // Horizontal bar *
{0xbc, '{'}, // ¼
{0x23f8, '|'}, // Double vertical bar * {0x23f8, '|'}, // Double vertical bar *
{0xbe, '}'}, // ¾ {0x258c, 149},
{0xf7, '~'}, // ÷ {0x2590, 170},
{0x2588, 191},
/* 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}, { 0x258c, 149}, {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}, { 0x2590, 170}, {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}, { 0x2588, 191},
/* Space */ {0x1ce51, 193}, {0x1ce52, 194}, {0x1ce53, 195}, /* Space */ {0x1ce51, 193}, {0x1ce52, 194}, {0x1ce53, 195},
{0x1ce54, 196}, {0x1ce55, 197}, {0x1ce56, 198}, {0x1ce57, 199}, {0x1ce54, 196}, {0x1ce55, 197}, {0x1ce56, 198}, {0x1ce57, 199},
...@@ -1510,7 +1496,24 @@ const static struct ciolib_cpmap prestel_table[] = { ...@@ -1510,7 +1496,24 @@ const static struct ciolib_cpmap prestel_table[] = {
{0x1ce80, 240}, {0x1ce81, 241}, {0x1ce82, 242}, {0x1ce83, 243}, {0x1ce80, 240}, {0x1ce81, 241}, {0x1ce82, 242}, {0x1ce83, 243},
{0x1ce84, 244}, {0x1ce85, 245}, {0x1ce86, 246}, {0x1ce87, 247}, {0x1ce84, 244}, {0x1ce85, 245}, {0x1ce86, 246}, {0x1ce87, 247},
{0x1ce88, 248}, {0x1ce89, 249}, {0x1ce8a, 250}, {0x1ce8b, 251}, {0x1ce88, 248}, {0x1ce89, 249}, {0x1ce8a, 250}, {0x1ce8b, 251},
{0x1ce8c, 252}, {0x1ce8d, 253}, {0x1ce8e, 254}, {0x1ce8f, 255} {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}
}; };
const static uint32_t prestel_unicode_table[256] = { const static uint32_t prestel_unicode_table[256] = {
...@@ -2007,7 +2010,7 @@ const struct codepage_def ciolib_cp[CIOLIB_CP_COUNT] = { ...@@ -2007,7 +2010,7 @@ const struct codepage_def ciolib_cp[CIOLIB_CP_COUNT] = {
petsciil_table, sizeof(petsciil_table) / sizeof(petsciil_table[0]), petsciil_table, sizeof(petsciil_table) / sizeof(petsciil_table[0]),
petsciil_unicode_table, empty_ext_table}, petsciil_unicode_table, empty_ext_table},
{"PRESTEL", CIOLIB_PRESTEL, ftstr_to_utf8, utf8_to_cpstr, ft_from_unicode_cpoint, ft_cpoint_from_cptable, cpoint_from_cptable_ext, {"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_table, sizeof(prestel_table) / sizeof(prestel_table[0]),
prestel_unicode_table, empty_ext_table}, prestel_unicode_table, empty_ext_table},
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment