1
0
mirror of https://github.com/TomHarte/CLK.git synced 2026-04-21 17:16:44 +00:00

Completed curly bracket movement.

This commit is contained in:
Thomas Harte
2017-03-26 14:34:47 -04:00
parent 3229502fa1
commit e01f3f06c8
83 changed files with 1542 additions and 3077 deletions
+4 -8
View File
@@ -8,12 +8,10 @@
#include "Commodore.hpp"
std::wstring Storage::Data::Commodore::petscii_from_bytes(const uint8_t *string, int length, bool shifted)
{
std::wstring Storage::Data::Commodore::petscii_from_bytes(const uint8_t *string, int length, bool shifted) {
std::wstring result;
wchar_t unshifted_characters[256] =
{
wchar_t unshifted_characters[256] = {
L'\0', L'\0', L'\0', L'\0', L'\0', L'\0', L'\0', L'\0', L'\0', L'\0', L'\0', L'\0', L'\0', L'\r', L'\0', L'\0',
L'\0', L'\0', L'\0', L'\0', L'\b', L'\0', L'\0', L'\0', L'\0', L'\0', L'\0', L'\0', L'\0', L'\0', L'\0', L'\0',
L' ', L'!', L'"', L'#', L'$', L'%', L'&', L'\'', L'(', L')', L'*', L'+', L',', L'-', L'.', L'/',
@@ -32,8 +30,7 @@ std::wstring Storage::Data::Commodore::petscii_from_bytes(const uint8_t *string,
L'', L'', L'', L'', L'', L'', L'', L'', L'', L'', L'', L'', L'', L'', L'', L'π',
};
wchar_t shifted_characters[256] =
{
wchar_t shifted_characters[256] = {
L'\0', L'\0', L'\0', L'\0', L'\0', L'\0', L'\0', L'\0', L'\0', L'\0', L'\0', L'\0', L'\0', L'\r', L'\0', L'\0',
L'\0', L'\0', L'\0', L'\0', L'\b', L'\0', L'\0', L'\0', L'\0', L'\0', L'\0', L'\0', L'\0', L'\0', L'\0', L'\0',
L' ', L'!', L'"', L'#', L'$', L'%', L'&', L'\'', L'(', L')', L'*', L'+', L',', L'-', L'.', L'/',
@@ -53,8 +50,7 @@ std::wstring Storage::Data::Commodore::petscii_from_bytes(const uint8_t *string,
};
wchar_t *table = shifted ? shifted_characters : unshifted_characters;
for(int c = 0; c < length; c++)
{
for(int c = 0; c < length; c++) {
wchar_t next_character = table[string[c]];
if(next_character) result.push_back(next_character);
}