#include static const unsigned cp437_table[] = { 0x0, 0x0, //NULL 0x1, 0x1, //START OF HEADING 0x2, 0x2, //START OF TEXT 0x3, 0x3, //END OF TEXT 0x4, 0x4, //END OF TRANSMISSION 0x5, 0x5, //ENQUIRY 0x6, 0x6, //ACKNOWLEDGE 0x7, 0x7, //BELL 0x8, 0x8, //BACKSPACE 0x9, 0x9, //HORIZONTAL TABULATION 0xA, 0xA, //LINE FEED 0xB, 0xB, //VERTICAL TABULATION 0xC, 0xC, //FORM FEED 0xD, 0xD, //CARRIAGE RETURN 0xE, 0xE, //SHIFT OUT 0xF, 0xF, //SHIFT IN 0x10, 0x10, //DATA LINK ESCAPE 0x11, 0x11, //DEVICE CONTROL ONE 0x12, 0x12, //DEVICE CONTROL TWO 0x13, 0x13, //DEVICE CONTROL THREE 0x14, 0x14, //DEVICE CONTROL FOUR 0x15, 0x15, //NEGATIVE ACKNOWLEDGE 0x16, 0x16, //SYNCHRONOUS IDLE 0x17, 0x17, //END OF TRANSMISSION BLOCK 0x18, 0x18, //CANCEL 0x19, 0x19, //END OF MEDIUM 0x1A, 0x1A, //SUBSTITUTE 0x1B, 0x1B, //ESCAPE 0x1C, 0x1C, //FILE SEPARATOR 0x1D, 0x1D, //GROUP SEPARATOR 0x1E, 0x1E, //RECORD SEPARATOR 0x1F, 0x1F, //UNIT SEPARATOR 0x20, 0x20, //SPACE 0x21, 0x21, //EXCLAMATION MARK 0x22, 0x22, //QUOTATION MARK 0x23, 0x23, //NUMBER SIGN 0x24, 0x24, //DOLLAR SIGN 0x25, 0x25, //PERCENT SIGN 0x26, 0x26, //AMPERSAND 0x27, 0x27, //APOSTROPHE 0x28, 0x28, //LEFT PARENTHESIS 0x29, 0x29, //RIGHT PARENTHESIS 0x2A, 0x2A, //ASTERISK 0x2B, 0x2B, //PLUS SIGN 0x2C, 0x2C, //COMMA 0x2D, 0x2D, //HYPHEN-MINUS 0x2E, 0x2E, //FULL STOP 0x2F, 0x2F, //SOLIDUS 0x30, 0x30, //DIGIT ZERO 0x31, 0x31, //DIGIT ONE 0x32, 0x32, //DIGIT TWO 0x33, 0x33, //DIGIT THREE 0x34, 0x34, //DIGIT FOUR 0x35, 0x35, //DIGIT FIVE 0x36, 0x36, //DIGIT SIX 0x37, 0x37, //DIGIT SEVEN 0x38, 0x38, //DIGIT EIGHT 0x39, 0x39, //DIGIT NINE 0x3A, 0x3A, //COLON 0x3B, 0x3B, //SEMICOLON 0x3C, 0x3C, //LESS-THAN SIGN 0x3D, 0x3D, //EQUALS SIGN 0x3E, 0x3E, //GREATER-THAN SIGN 0x3F, 0x3F, //QUESTION MARK 0x40, 0x40, //COMMERCIAL AT 0x41, 0x41, //LATIN CAPITAL LETTER A 0x42, 0x42, //LATIN CAPITAL LETTER B 0x43, 0x43, //LATIN CAPITAL LETTER C 0x44, 0x44, //LATIN CAPITAL LETTER D 0x45, 0x45, //LATIN CAPITAL LETTER E 0x46, 0x46, //LATIN CAPITAL LETTER F 0x47, 0x47, //LATIN CAPITAL LETTER G 0x48, 0x48, //LATIN CAPITAL LETTER H 0x49, 0x49, //LATIN CAPITAL LETTER I 0x4A, 0x4A, //LATIN CAPITAL LETTER J 0x4B, 0x4B, //LATIN CAPITAL LETTER K 0x4C, 0x4C, //LATIN CAPITAL LETTER L 0x4D, 0x4D, //LATIN CAPITAL LETTER M 0x4E, 0x4E, //LATIN CAPITAL LETTER N 0x4F, 0x4F, //LATIN CAPITAL LETTER O 0x50, 0x50, //LATIN CAPITAL LETTER P 0x51, 0x51, //LATIN CAPITAL LETTER Q 0x52, 0x52, //LATIN CAPITAL LETTER R 0x53, 0x53, //LATIN CAPITAL LETTER S 0x54, 0x54, //LATIN CAPITAL LETTER T 0x55, 0x55, //LATIN CAPITAL LETTER U 0x56, 0x56, //LATIN CAPITAL LETTER V 0x57, 0x57, //LATIN CAPITAL LETTER W 0x58, 0x58, //LATIN CAPITAL LETTER X 0x59, 0x59, //LATIN CAPITAL LETTER Y 0x5A, 0x5A, //LATIN CAPITAL LETTER Z 0x5B, 0x5B, //LEFT SQUARE BRACKET 0x5C, 0x5C, //REVERSE SOLIDUS 0x5D, 0x5D, //RIGHT SQUARE BRACKET 0x5E, 0x5E, //CIRCUMFLEX ACCENT 0x5F, 0x5F, //LOW LINE 0x60, 0x60, //GRAVE ACCENT 0x61, 0x61, //LATIN SMALL LETTER A 0x62, 0x62, //LATIN SMALL LETTER B 0x63, 0x63, //LATIN SMALL LETTER C 0x64, 0x64, //LATIN SMALL LETTER D 0x65, 0x65, //LATIN SMALL LETTER E 0x66, 0x66, //LATIN SMALL LETTER F 0x67, 0x67, //LATIN SMALL LETTER G 0x68, 0x68, //LATIN SMALL LETTER H 0x69, 0x69, //LATIN SMALL LETTER I 0x6A, 0x6A, //LATIN SMALL LETTER J 0x6B, 0x6B, //LATIN SMALL LETTER K 0x6C, 0x6C, //LATIN SMALL LETTER L 0x6D, 0x6D, //LATIN SMALL LETTER M 0x6E, 0x6E, //LATIN SMALL LETTER N 0x6F, 0x6F, //LATIN SMALL LETTER O 0x70, 0x70, //LATIN SMALL LETTER P 0x71, 0x71, //LATIN SMALL LETTER Q 0x72, 0x72, //LATIN SMALL LETTER R 0x73, 0x73, //LATIN SMALL LETTER S 0x74, 0x74, //LATIN SMALL LETTER T 0x75, 0x75, //LATIN SMALL LETTER U 0x76, 0x76, //LATIN SMALL LETTER V 0x77, 0x77, //LATIN SMALL LETTER W 0x78, 0x78, //LATIN SMALL LETTER X 0x79, 0x79, //LATIN SMALL LETTER Y 0x7A, 0x7A, //LATIN SMALL LETTER Z 0x7B, 0x7B, //LEFT CURLY BRACKET 0x7C, 0x7C, //VERTICAL LINE 0x7D, 0x7D, //RIGHT CURLY BRACKET 0x7E, 0x7E, //TILDE 0x7F, 0x7F, //DELETE 0x80, 0xC7, //LATIN CAPITAL LETTER C WITH CEDILLA 0x81, 0xFC, //LATIN SMALL LETTER U WITH DIAERESIS 0x82, 0xE9, //LATIN SMALL LETTER E WITH ACUTE 0x83, 0xE2, //LATIN SMALL LETTER A WITH CIRCUMFLEX 0x84, 0xE4, //LATIN SMALL LETTER A WITH DIAERESIS 0x85, 0xE0, //LATIN SMALL LETTER A WITH GRAVE 0x86, 0xE5, //LATIN SMALL LETTER A WITH RING ABOVE 0x87, 0xE7, //LATIN SMALL LETTER C WITH CEDILLA 0x88, 0xEA, //LATIN SMALL LETTER E WITH CIRCUMFLEX 0x89, 0xEB, //LATIN SMALL LETTER E WITH DIAERESIS 0x8A, 0xE8, //LATIN SMALL LETTER E WITH GRAVE 0x8B, 0xEF, //LATIN SMALL LETTER I WITH DIAERESIS 0x8C, 0xEE, //LATIN SMALL LETTER I WITH CIRCUMFLEX 0x8D, 0xEC, //LATIN SMALL LETTER I WITH GRAVE 0x8E, 0xC4, //LATIN CAPITAL LETTER A WITH DIAERESIS 0x8F, 0xC5, //LATIN CAPITAL LETTER A WITH RING ABOVE 0x90, 0xC9, //LATIN CAPITAL LETTER E WITH ACUTE 0x91, 0xE6, //LATIN SMALL LIGATURE AE 0x92, 0xC6, //LATIN CAPITAL LIGATURE AE 0x93, 0xF4, //LATIN SMALL LETTER O WITH CIRCUMFLEX 0x94, 0xF6, //LATIN SMALL LETTER O WITH DIAERESIS 0x95, 0xF2, //LATIN SMALL LETTER O WITH GRAVE 0x96, 0xFB, //LATIN SMALL LETTER U WITH CIRCUMFLEX 0x97, 0xF9, //LATIN SMALL LETTER U WITH GRAVE 0x98, 0xFF, //LATIN SMALL LETTER Y WITH DIAERESIS 0x99, 0xD6, //LATIN CAPITAL LETTER O WITH DIAERESIS 0x9A, 0xDC, //LATIN CAPITAL LETTER U WITH DIAERESIS 0x9B, 0xA2, //CENT SIGN 0x9C, 0xA3, //POUND SIGN 0x9D, 0xA5, //YEN SIGN 0x9E, 0x20A7, //PESETA SIGN 0x9F, 0x192, //LATIN SMALL LETTER F WITH HOOK 0xA0, 0xE1, //LATIN SMALL LETTER A WITH ACUTE 0xA1, 0xED, //LATIN SMALL LETTER I WITH ACUTE 0xA2, 0xF3, //LATIN SMALL LETTER O WITH ACUTE 0xA3, 0xFA, //LATIN SMALL LETTER U WITH ACUTE 0xA4, 0xF1, //LATIN SMALL LETTER N WITH TILDE 0xA5, 0xD1, //LATIN CAPITAL LETTER N WITH TILDE 0xA6, 0xAA, //FEMININE ORDINAL INDICATOR 0xA7, 0xBA, //MASCULINE ORDINAL INDICATOR 0xA8, 0xBF, //INVERTED QUESTION MARK 0xA9, 0x2310, //REVERSED NOT SIGN 0xAA, 0xAC, //NOT SIGN 0xAB, 0xBD, //VULGAR FRACTION ONE HALF 0xAC, 0xBC, //VULGAR FRACTION ONE QUARTER 0xAD, 0xA1, //INVERTED EXCLAMATION MARK 0xAE, 0xAB, //LEFT-POINTING DOUBLE ANGLE QUOTATION MARK 0xAF, 0xBB, //RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK 0xB0, 0x2591, //LIGHT SHADE 0xB1, 0x2592, //MEDIUM SHADE 0xB2, 0x2593, //DARK SHADE 0xB3, 0x2502, //BOX DRAWINGS LIGHT VERTICAL 0xB4, 0x2524, //BOX DRAWINGS LIGHT VERTICAL AND LEFT 0xB5, 0x2561, //BOX DRAWINGS VERTICAL SINGLE AND LEFT DOUBLE 0xB6, 0x2562, //BOX DRAWINGS VERTICAL DOUBLE AND LEFT SINGLE 0xB7, 0x2556, //BOX DRAWINGS DOWN DOUBLE AND LEFT SINGLE 0xB8, 0x2555, //BOX DRAWINGS DOWN SINGLE AND LEFT DOUBLE 0xB9, 0x2563, //BOX DRAWINGS DOUBLE VERTICAL AND LEFT 0xBA, 0x2551, //BOX DRAWINGS DOUBLE VERTICAL 0xBB, 0x2557, //BOX DRAWINGS DOUBLE DOWN AND LEFT 0xBC, 0x255D, //BOX DRAWINGS DOUBLE UP AND LEFT 0xBD, 0x255C, //BOX DRAWINGS UP DOUBLE AND LEFT SINGLE 0xBE, 0x255B, //BOX DRAWINGS UP SINGLE AND LEFT DOUBLE 0xBF, 0x2510, //BOX DRAWINGS LIGHT DOWN AND LEFT 0xC0, 0x2514, //BOX DRAWINGS LIGHT UP AND RIGHT 0xC1, 0x2534, //BOX DRAWINGS LIGHT UP AND HORIZONTAL 0xC2, 0x252C, //BOX DRAWINGS LIGHT DOWN AND HORIZONTAL 0xC3, 0x251C, //BOX DRAWINGS LIGHT VERTICAL AND RIGHT 0xC4, 0x2500, //BOX DRAWINGS LIGHT HORIZONTAL 0xC5, 0x253C, //BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL 0xC6, 0x255E, //BOX DRAWINGS VERTICAL SINGLE AND RIGHT DOUBLE 0xC7, 0x255F, //BOX DRAWINGS VERTICAL DOUBLE AND RIGHT SINGLE 0xC8, 0x255A, //BOX DRAWINGS DOUBLE UP AND RIGHT 0xC9, 0x2554, //BOX DRAWINGS DOUBLE DOWN AND RIGHT 0xCA, 0x2569, //BOX DRAWINGS DOUBLE UP AND HORIZONTAL 0xCB, 0x2566, //BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL 0xCC, 0x2560, //BOX DRAWINGS DOUBLE VERTICAL AND RIGHT 0xCD, 0x2550, //BOX DRAWINGS DOUBLE HORIZONTAL 0xCE, 0x256C, //BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL 0xCF, 0x2567, //BOX DRAWINGS UP SINGLE AND HORIZONTAL DOUBLE 0xD0, 0x2568, //BOX DRAWINGS UP DOUBLE AND HORIZONTAL SINGLE 0xD1, 0x2564, //BOX DRAWINGS DOWN SINGLE AND HORIZONTAL DOUBLE 0xD2, 0x2565, //BOX DRAWINGS DOWN DOUBLE AND HORIZONTAL SINGLE 0xD3, 0x2559, //BOX DRAWINGS UP DOUBLE AND RIGHT SINGLE 0xD4, 0x2558, //BOX DRAWINGS UP SINGLE AND RIGHT DOUBLE 0xD5, 0x2552, //BOX DRAWINGS DOWN SINGLE AND RIGHT DOUBLE 0xD6, 0x2553, //BOX DRAWINGS DOWN DOUBLE AND RIGHT SINGLE 0xD7, 0x256B, //BOX DRAWINGS VERTICAL DOUBLE AND HORIZONTAL SINGLE 0xD8, 0x256A, //BOX DRAWINGS VERTICAL SINGLE AND HORIZONTAL DOUBLE 0xD9, 0x2518, //BOX DRAWINGS LIGHT UP AND LEFT 0xDA, 0x250C, //BOX DRAWINGS LIGHT DOWN AND RIGHT 0xDB, 0x2588, //FULL BLOCK 0xDC, 0x2584, //LOWER HALF BLOCK 0xDD, 0x258C, //LEFT HALF BLOCK 0xDE, 0x2590, //RIGHT HALF BLOCK 0xDF, 0x2580, //UPPER HALF BLOCK 0xE0, 0x3B1, //GREEK SMALL LETTER ALPHA 0xE1, 0xDF, //LATIN SMALL LETTER SHARP S 0xE2, 0x393, //GREEK CAPITAL LETTER GAMMA 0xE3, 0x3C0, //GREEK SMALL LETTER PI 0xE4, 0x3A3, //GREEK CAPITAL LETTER SIGMA 0xE5, 0x3C3, //GREEK SMALL LETTER SIGMA 0xE6, 0xB5, //MICRO SIGN 0xE7, 0x3C4, //GREEK SMALL LETTER TAU 0xE8, 0x3A6, //GREEK CAPITAL LETTER PHI 0xE9, 0x398, //GREEK CAPITAL LETTER THETA 0xEA, 0x3A9, //GREEK CAPITAL LETTER OMEGA 0xEB, 0x3B4, //GREEK SMALL LETTER DELTA 0xEC, 0x221E, //INFINITY 0xED, 0x3C6, //GREEK SMALL LETTER PHI 0xEE, 0x3B5, //GREEK SMALL LETTER EPSILON 0xEF, 0x2229, //INTERSECTION 0xF0, 0x2261, //IDENTICAL TO 0xF1, 0xB1, //PLUS-MINUS SIGN 0xF2, 0x2265, //GREATER-THAN OR EQUAL TO 0xF3, 0x2264, //LESS-THAN OR EQUAL TO 0xF4, 0x2320, //TOP HALF INTEGRAL 0xF5, 0x2321, //BOTTOM HALF INTEGRAL 0xF6, 0xF7, //DIVISION SIGN 0xF7, 0x2248, //ALMOST EQUAL TO 0xF8, 0xB0, //DEGREE SIGN 0xF9, 0x2219, //BULLET OPERATOR 0xFA, 0xB7, //MIDDLE DOT 0xFB, 0x221A, //SQUARE ROOT 0xFC, 0x207F, //SUPERSCRIPT LATIN SMALL LETTER N 0xFD, 0xB2, //SUPERSCRIPT TWO 0xFE, 0x25A0, //BLACK SQUARE 0xFF, 0xA0, //NO-BREAK SPACE }; static unsigned find(unsigned ch) { for(unsigned n=0; n<256; ++n) if(cp437_table[n*2 + 1] == ch) return cp437_table[n*2 + 0]; return 0xFFDF; } static const unsigned char font8x16[] = { #include "8x16.inc" }; static const unsigned special_symbols[] = { 0b000000000000000000000000, // nom 0b000000000000000000000000, 0b000000000000000000000000, 0b000000000000000000000000, 0b000000000000000000000000, 0b000000001010001100110100, 0b000000001101010010101010, 0b000000001001010010101010, 0b000000001001010010101010, 0b000000001001010010101010, 0b000000001001001100101010, 0b000000000000000000000000, 0b000000000000000000000000, 0b000000000000000000000000, 0b000000000000000000000000, 0b000000000000000000000000, //// 0b000000000000000000000000, // gen 0b000000000000000000000000, 0b000000000000000000000000, 0b000000000000000000000000, 0b000000000000000000000000, 0b000000000011010110010100, 0b000000000100101001011010, 0b000000000100101001010010, 0b000000000100101110010010, 0b000000000011001000010010, 0b000000000100000111010010, 0b000000000011100000000000, 0b000000000100010000000000, 0b000000000011100000000000, 0b000000000000000000000000, 0b000000000000000000000000, //// 0b000000000000000000000000, // ess 0b000000000000000000000000, 0b000000000000000000000000, 0b000000000000000000000000, 0b000000000000000000000000, 0b000000000011000110001100, 0b000000000100101001010010, 0b000000000100100100001000, 0b000000000111000010000100, 0b000000000100001001010010, 0b000000000011100110001100, 0b000000000000000000000000, 0b000000000000000000000000, 0b000000000000000000000000, 0b000000000000000000000000, 0b000000000000000000000000, //// 0b000000000000000000000000, // part 0b000000000000000000000000, 0b000000000000000000000000, 0b000000000000000000000100, 0b000000000000000000000100, 0b000000010100011001011110, 0b000000011010000101100100, 0b000000010010011101000100, 0b000000010010100101000100, 0b000000011010101101000100, 0b000000010100010101000110, 0b000000010000000000000000, 0b000000010000000000000000, 0b000000010000000000000000, 0b000000000000000000000000, 0b000000000000000000000000, //// 0b000000000000000000000000, // transl 0b000000000000000000000000, 0b000000000000000000000000, 0b010000000000000000000110, 0b010000000000000000000010, 0b111010111001010001100010, 0b010011000101101010010010, 0b010010011101001001000010, 0b010010100101001000100010, 0b010010101101001010010010, 0b011010010101001001100111, 0b000000000000000000000000, 0b000000000000000000000000, 0b000000000000000000000000, 0b000000000000000000000000, 0b000000000000000000000000, //// 0b000000000000000000000000, // ade 0b000000000000000000000000, 0b000000000000000000000000, 0b000000000000000011000000, 0b000000000000000001000000, 0b000000000011000101001100, 0b000000000000101011010010, 0b000000000011101001010010, 0b000000000100101001011100, 0b000000000101101011010000, 0b000000000010100101001110, 0b000000000000000000000000, 0b000000000000000000000000, 0b000000000000000000000000, 0b000000000000000000000000, 0b000000000000000000000000, //// 0b000000000000000000000000, // ine 0b000000000000000000000000, 0b000000000000000000000000, 0b000000000001000000000000, 0b000000000000000000000000, 0b000000000011001010001100, 0b000000000001001101010010, 0b000000000001001001010010, 0b000000000001001001011100, 0b000000000001001001010000, 0b000000000011101001001110, 0b000000000000000000000000, 0b000000000000000000000000, 0b000000000000000000000000, 0b000000000000000000000000, 0b000000000000000000000000, //// 0b000000000000000000000000, // abl 0b000000000000000000000000, 0b000000000000000000000000, 0b000000000000001000001100, 0b000000000000001000000100, 0b000000000011001011000100, 0b000000000000101100100100, 0b000000000011101000100100, 0b000000000100101000100100, 0b000000000101101100100100, 0b000000000010101011001110, 0b000000000000000000000000, 0b000000000000000000000000, 0b000000000000000000000000, 0b000000000000000000000000, 0b000000000000000000000000, //// 0b000000000000000000000000, // ela 0b000000000000000000000000, 0b000000000000000000000000, 0b000000000000001100000000, 0b000000000000000100000000, 0b000000000011000100011100, 0b000000000100100100000010, 0b000000000100100100011110, 0b000000000111000100100010, 0b000000000100000100100110, 0b000000000011101110011010, 0b000000000000000000000000, 0b000000000000000000000000, 0b000000000000000000000000, 0b000000000000000000000000, 0b000000000000000000000000, //// 0b000000000000000000000000, // all 0b000000000000000000000000, 0b000000000000000000000000, 0b000000000000000011001100, 0b000000000000000001000100, 0b000000000001110001000100, 0b000000000000001001000100, 0b000000000001111001000100, 0b000000000010001001000100, 0b000000000010011001000100, 0b000000000001101011101110, 0b000000000000000000000000, 0b000000000000000000000000, 0b000000000000000000000000, 0b000000000000000000000000, 0b000000000000000000000000, //// 0b000000000000000000000000, // ill 0b000000000000000000000000, 0b000000000000000000000000, 0b000000000000100110011000, 0b000000000000000010001000, 0b000000000001100010001000, 0b000000000000100010001000, 0b000000000000100010001000, 0b000000000000100010001000, 0b000000000000100010001000, 0b000000000001110111011100, 0b000000000000000000000000, 0b000000000000000000000000, 0b000000000000000000000000, 0b000000000000000000000000, 0b000000000000000000000000, //// 0b000000000000000000000000, // abes 0b000000000000000000000000, 0b000000000000000000000000, 0b000000100000000000000000, 0b000000100000000000000000, 0b001100101000110001000100, 0b000010110101001010101010, 0b001110100101001010001000, 0b010010100101110001000100, 0b010110110101000100110010, 0b001010101000111011001100, 0b000000000000000000000000, 0b000000000000000000000000, 0b000000000000000000000000, 0b000000000000000000000000, 0b000000000000000000000000, //// 0b000000000000000000000000, // akk 0b000000000000000000000000, 0b000000000000000000000000, 0b000001000010000000000000, 0b000001000010000000000000, 0b011001001010010101001100, 0b000101010010100101010010, 0b011101100011000101001000, 0b100101010010100101000100, 0b101101010010100101010010, 0b010101001010010011001100, 0b000000000000000000000000, 0b000000000000000000000000, 0b000000000000000000000000, 0b000000000000000000000000, 0b000000000000000000000000, }; #include int main(void) { unsigned n_special_symbols = (std::end(special_symbols) - std::begin(special_symbols)) / 16; std::fprintf(stderr, "font is %zu bytes\n", sizeof(font8x16)); for(unsigned side=0; side<2; ++side) for(unsigned ch=0; ch<256; ++ch) { unsigned src = find(ch); if(src >= 0x100) src = ch; std::fprintf(stderr, "%u (0x%02X): src=%u (0x%02X)\n", ch, ch, src, src); std::fflush(stderr); //for(unsigned t=0; t<2; ++t){ std::printf(".byt "); for(unsigned row=side*8; row<(side*8+8); ++row) { unsigned char byte = font8x16[src*16 + row]; if(ch == 0x5F) { byte = (row==14 || row == 13) ? 0xFF : 0x00; } if(ch == 0x60) { byte = (row==14) ? 0xFF : 0x00; } if(ch >= 0x9B && ch < 0x9B + n_special_symbols*3) { unsigned word = (ch-0x9B); unsigned bits = special_symbols[(word/3) * 16 + row]; byte = bits >> (8*(2-(word%3))); } //if(row==8) std::printf("\n.byt "); if(row%8) std::printf(","); std::printf("$%02X,$%02X", byte,0); //std::printf("$%02X", byte); for(unsigned n=0; n<8; ++n) std::fprintf(stderr, "%c", ((byte >> (7-n))&1) ? '*' : '.'); std::fprintf(stderr, "\n"); } std::printf("\n"); //} } }