/* write a string on screen */ static void tx0_draw_string(running_machine &machine, bitmap_ind16 &bitmap, const char *buf, int x, int y, int color) { while (* buf) { tx0_draw_char(machine, bitmap, *buf, x, y, color); x += 8; buf++; } }
void tx0_state::tx0_typewriter_drawchar(int character) { static const char ascii_table[2][64] = { { /* lower case */ '\0', '\0', 'e', '8', '\0', '|', 'a', '3', ' ', '=', 's', '4', 'i', '+', 'u', '2', '\0',/*color shift*/'.', 'd', '5', 'r', '1', 'j', '7', 'n', ',', 'f', '6', 'c', '-', 'k', '\0', 't', '\0', 'z', '\0',/*back space*/ 'l', '\0',/*tab*/ 'w', '\0', 'h', '\0',/*carr. return*/'y', '\0', 'p', '\0', 'q', '\0', 'o', '\0',/*stop*/ 'b', '\0', 'g', '\0', '9', '\0', 'm', '\0',/*upper case*/ 'x', '\0', 'v', '\0',/*lower case*/ '0', '\0'/*delete*/ }, { /* upper case */ '\0', '\0', 'E', '\210', '\0', '_', 'A', '\203', ' ', ':', 'S', '\204', 'I', '/', 'U', '\202', '\0',/*color shift*/')', 'D', '\205', 'R', '\201', 'J', '\207', 'N', '(', 'F', '\206', 'C', '\212',/*macron*/ 'K', '\0', 'T', '\0', 'Z', '\0',/*back space*/ 'L', '\0',/*tab*/ 'W', '\0', 'H', '\0',/*carr. return*/'Y', '\0', 'P', '\0', 'Q', '\0', 'O', '\0',/*stop*/ 'B', '\0', 'G', '\0', '\211', '\0', 'M', '\0',/*upper case*/ 'X', '\0', 'V', '\0',/*lower case*/ '\200', '\0'/*delete*/ } }; character &= 0x3f; switch (character) { case 020: #if 0 /* color shift */ m_typewriter_color = color_typewriter_black; m_typewriter_color = color_typewriter_red; #endif break; case 043: /* Backspace */ if (m_pos) m_pos--; break; case 045: /* Tab */ m_pos = m_pos + tab_step - (m_pos % tab_step); break; case 051: /* Carriage Return */ m_pos = 0; tx0_typewriter_linefeed(); break; case 061: /* Stop */ /* ?????? */ break; case 071: /* Upper case */ m_case_shift = 1; break; case 075: /* Lower case */ m_case_shift = 0; break; case 077: /* Delete */ /* ?????? */ break; default: /* Any printable character... */ if (m_pos >= 80) { /* if past right border, wrap around. (Right???) */ tx0_typewriter_linefeed(); /* next line */ m_pos = 0; /* return to start of line */ } /* print character (lookup ASCII equivalent in table) */ tx0_draw_char(m_typewriter_bitmap, ascii_table[m_case_shift][character], 8*m_pos, typewriter_write_offset_y, m_typewriter_color); /* print char */ m_pos++; /* step carriage forward */ break; } }