* Mostly code cleanup & minor refactors

This commit is contained in:
Bryan Ashby
2015-04-27 22:40:05 -06:00
parent cb5fc13da5
commit 99fb3b34c7
6 changed files with 68 additions and 184 deletions

View File

@@ -267,96 +267,6 @@ function setCursorStyle(cursorStyle) {
}
/*
var FONT_MAP = {
// Codepage 437 English
'cp437' : 0,
'ibmpc' : 0,
'ibm_pc' : 0,
'ibm_vga' : 0,
'pc' : 0,
'cp437_art' : 0,
'ibmpcart' : 0,
'ibmpc_art' : 0,
'ibm_pc_art' : 0,
'msdos_art' : 0,
'msdosart' : 0,
'pc_art' : 0,
'pcart' : 0,
// Codepage 1251 Cyrillic, (swiss)
'cp1251-swiss' : 1,
// Russian koi8-r
'koi8_r' : 2,
'koi8-r' : 2,
'koi8r' : 2,
// ISO-8859-2 Central European
'iso8859_2' : 3,
'iso8859-2' : 3,
// ISO-8859-4 Baltic wide (VGA 9bit mapped)
'iso8859_4-baltic9b' : 4,
// Codepage 866 (c) Russian
'cp866-c' : 5,
'iso8859_9' : 6,
'haik8' : 7,
'iso8859_8' : 8,
'koi8_u' : 9,
'iso8859_15-thin' : 10,
'iso8859_4' : 11,
'koi8_r_b' : 12,
'iso8859_4-baltic-wide' : 13,
'iso8859_5' : 14,
'ARMSCII_8' : 15,
'iso8859_15' : 16,
'cp850' : 17,
'cp850-thin' : 18,
'cp885-thin' : 19,
'cp1251' : 20,
'iso8859_7' : 21,
'koi8-r_c' : 22,
'iso8859_4-baltic' : 23,
'iso8859_1' : 24,
'cp866' : 25,
'cp437-thin' : 26,
'cp866-b' : 27,
'cp885' : 28,
'cp866_u' : 29,
'iso8859_1-thin' : 30,
'cp1131' : 31,
'c64_upper' : 32,
'c64_lower' : 33,
'c128_upper' : 34,
'c128_lower' : 35,
'atari' : 36,
'atarist' : 36,
'pot_noodle' : 37,
'p0tnoodle' : 37,
'mo_soul' : 38,
'mosoul' : 38,
'mO\'sOul' : 38,
'microknight_plus' : 39,
'topaz_plus' : 40,
'topazplus' : 40,
'amiga_topaz_2+' : 40,
'topaz2plus' : 40,
'microknight' : 41,
'topaz' : 42,
};
*/
// Create methods such as up(), nextLine(),...
Object.keys(CONTROL).forEach(function onControlName(name) {
var code = CONTROL[name];
@@ -422,7 +332,7 @@ function clearScreen() {
}
function resetScreen() {
return exports.goHome() + exports.reset() + exports.eraseData(2);
return exports.reset() + exports.eraseData(2) + exports.goHome();
}
function normal() {
@@ -440,26 +350,6 @@ function disableVT100LineWrapping() {
return ESC_CSI + '7l';
}
//
// See http://cvs.synchro.net/cgi-bin/viewcvs.cgi/*checkout*/src/conio/cterm.txt
//
/*
function setFont(name, fontPage) {
name = name.toLowerCase().replace(/ /g, '_'); // conform to map
var p1 = miscUtil.valueWithDefault(fontPage, 0);
assert(p1 >= 0 && p1 <= 3);
var p2 = FONT_MAP[name];
if(_.isNumber(p2)) {
return ESC_CSI + p1 + ';' + p2 + ' D';
}
return '';
}
*/
// Also add:
// * fromRenegade(): |<0-23>
// * fromCelerity(): |<case sensitive letter>