@@ 26,7 26,11 @@ namespace {
}
const std::string_view StringConversions::_formats[static_cast<size_t>(StringConversions::Format::NumFormats)] = {
- std::string_view("petscii"),
+ std::string_view("vic20"),
+ std::string_view("c16"),
+ std::string_view("plus4"),
+ std::string_view("c64"),
+ std::string_view("c128"),
std::string_view("zx80"),
std::string_view("zx81"),
std::string_view("ascii7"),
@@ 54,17 58,9 @@ StringConversions::StringConversions()
static_assert(core::array_num_elements(StringConversions::_locales) == static_cast<size_t>(StringConversions::Locale::NumLocales), "Formats mismatch");
static_assert(core::array_num_elements(StringConversions::_flags) == static_cast<size_t>(StringConversions::NumFlags), "Formats mismatch");
- _conversions.insert(format_hash(Format::Petscii, SubFormat::Lowercase, Locale::English));
- _conversions.insert(format_hash(Format::Petscii, SubFormat::LowercaseScreen, Locale::English));
- _conversions.insert(format_hash(Format::Petscii, SubFormat::Uppercase, Locale::English));
- _conversions.insert(format_hash(Format::Petscii, SubFormat::UppercaseScreen, Locale::English));
- _conversions.insert(format_hash(Format::ZX80, SubFormat::Default, Locale::English));
- _conversions.insert(format_hash(Format::ZX81, SubFormat::Default, Locale::English));
- _conversions.insert(format_hash(Format::Ascii7, SubFormat::Default, Locale::English));
-
{
// fill petascii lowercase
- ConversionMap &map = _conversions.at(format_hash(Format::Petscii, SubFormat::Lowercase, Locale::English));
+ ConversionMap map;
for (wchar_t c = 0; c < 32; ++c)
map[c + 32] = c + 32;
map[L'@'] = 64;
@@ 97,11 93,16 @@ StringConversions::StringConversions()
map[L'\u2598'] = 190; // quadrant upper right
map[L'\u259a'] = 191; // quadrant upper left lower right
+ _conversions[format_hash(Format::Vic20, SubFormat::Lowercase, Locale::English)] = map;
+ _conversions[format_hash(Format::C16, SubFormat::Lowercase, Locale::English)] = map;
+ _conversions[format_hash(Format::Plus4, SubFormat::Lowercase, Locale::English)] = map;
+ _conversions[format_hash(Format::C64, SubFormat::Lowercase, Locale::English)] = map;
+ _conversions[format_hash(Format::C128, SubFormat::Lowercase, Locale::English)] = map;
}
{
// fill petascii uppercase
- ConversionMap &map = _conversions.at(format_hash(Format::Petscii, SubFormat::Uppercase, Locale::English));
+ ConversionMap map;
for (wchar_t c = 0; c < 32; ++c)
map[c + 32] = c + 32;
map[L'@'] = 64;
@@ 142,11 143,17 @@ StringConversions::StringConversions()
map[L'\u251b'] = 189; // up and left bend
map[L'\u2598'] = 190; // quadrant upper right
map[L'\u259a'] = 191; // quadrant upper left lower right
+
+ _conversions[format_hash(Format::Vic20, SubFormat::Uppercase, Locale::English)] = map;
+ _conversions[format_hash(Format::C16, SubFormat::Uppercase, Locale::English)] = map;
+ _conversions[format_hash(Format::Plus4, SubFormat::Uppercase, Locale::English)] = map;
+ _conversions[format_hash(Format::C64, SubFormat::Uppercase, Locale::English)] = map;
+ _conversions[format_hash(Format::C128, SubFormat::Uppercase, Locale::English)] = map;
}
{
// fill pet screencode lowercase
- ConversionMap &map = _conversions.at(format_hash(Format::Petscii, SubFormat::LowercaseScreen, Locale::English));
+ ConversionMap map;
for (wchar_t c = 0; c < 32; ++c)
map[c + 32] = c + 32;
map[L'@'] = 0;
@@ 178,11 185,17 @@ StringConversions::StringConversions()
map[L'\u251b'] = 125; // up and left bend
map[L'\u2598'] = 126; // quadrant upper right
map[L'\u259a'] = 127; // quadrant upper left lower right
+
+ _conversions[format_hash(Format::Vic20, SubFormat::LowercaseScreen, Locale::English)] = map;
+ _conversions[format_hash(Format::C16, SubFormat::LowercaseScreen, Locale::English)] = map;
+ _conversions[format_hash(Format::Plus4, SubFormat::LowercaseScreen, Locale::English)] = map;
+ _conversions[format_hash(Format::C64, SubFormat::LowercaseScreen, Locale::English)] = map;
+ _conversions[format_hash(Format::C128, SubFormat::LowercaseScreen, Locale::English)] = map;
}
{
// fill pet screencode uppercase
- ConversionMap &map = _conversions.at(format_hash(Format::Petscii, SubFormat::UppercaseScreen, Locale::English));
+ ConversionMap map;
for (wchar_t c = 0; c < 32; ++c)
map[c + 32] = c + 32;
map[L'@'] = 0;
@@ 225,6 238,12 @@ StringConversions::StringConversions()
map[L'\u251b'] = 125; // up and left bend
map[L'\u2598'] = 126; // quadrant upper right
map[L'\u259a'] = 127; // quadrant upper left lower right
+
+ _conversions[format_hash(Format::Vic20, SubFormat::UppercaseScreen, Locale::English)] = map;
+ _conversions[format_hash(Format::C16, SubFormat::UppercaseScreen, Locale::English)] = map;
+ _conversions[format_hash(Format::Plus4, SubFormat::UppercaseScreen, Locale::English)] = map;
+ _conversions[format_hash(Format::C64, SubFormat::UppercaseScreen, Locale::English)] = map;
+ _conversions[format_hash(Format::C128, SubFormat::UppercaseScreen, Locale::English)] = map;
}
{
@@ 305,7 324,7 @@ StringConversions::StringConversions()
L'\u259a', 136,
L'\u2592', 137,
};
- ConversionMap &map = _conversions.at(format_hash(Format::ZX80, SubFormat::Default, Locale::English));
+ ConversionMap &map = _conversions[format_hash(Format::ZX80, SubFormat::Default, Locale::English)];
add_characters(conversions, map);
}
@@ 387,12 406,12 @@ StringConversions::StringConversions()
L'\u2597', 135,
L'\u2592', 136,
};
- ConversionMap &map = _conversions.at(format_hash(Format::ZX81, SubFormat::Default, Locale::English));
+ ConversionMap &map = _conversions[format_hash(Format::ZX81, SubFormat::Default, Locale::English)];
add_characters(conversions, map);
}
{
- ConversionMap &map = _conversions.at(format_hash(Format::Ascii7, SubFormat::Default, Locale::English));
+ ConversionMap &map = _conversions[format_hash(Format::Ascii7, SubFormat::Default, Locale::English)];
for(wchar_t c = L'\x0'; c < L'\x80'; ++c) {
map[c] = c;
}
@@ 2,6 2,10 @@
section code, "main", $8000 {
define byte[] = {
- string("ABC", "petscii", "uppercase")
+ string("ABC", "vic20", "uppercase"),
+ string("ABC", "c16", "uppercase"),
+ string("ABC", "plus4", "uppercase"),
+ string("ABC", "c64", "uppercase"),
+ string("ABC", "c128", "uppercase")
}
}