diff --git a/html_orig/css/app.css b/html_orig/css/app.css index 409c132..880dd7d 100644 --- a/html_orig/css/app.css +++ b/html_orig/css/app.css @@ -700,8 +700,6 @@ input[type="number"], input[type="password"], input[type="text"], textarea, sele @media screen and (max-width: 544px) { .page-term #screen span:hover { outline: 0 none; } } - .page-term #screen .fg8, .page-term #screen .fg9, .page-term #screen .fg10, .page-term #screen .fg11, .page-term #screen .fg12, .page-term #screen .fg13, .page-term #screen .fg14, .page-term #screen .fg15 { - font-weight: bold; } .page-term #buttons { margin-top: 10px; white-space: nowrap; } @@ -750,7 +748,7 @@ input[type="number"], input[type="password"], input[type="text"], textarea, sele .ansiref.w100 { width: 100%; } .ansiref.w100 td:nth-child(1) { - width: 6em; } + width: 7em; } .ansiref.w100 td:nth-child(2) { width: 8em; } @@ -850,6 +848,12 @@ input[type="number"], input[type="password"], input[type="text"], textarea, sele .bg15 { background-color: #EEEEEC; } +.fg8, .fg9, .fg10, .fg11, .fg12, .fg13, .fg14, .fg15 { + font-weight: bold; } + +.nb { + font-weight: normal !important; } + @media screen and (min-width: 545px) { .mq-phone { display: none; } } diff --git a/html_orig/help.html b/html_orig/help.html index da76f63..46af6cd 100644 --- a/html_orig/help.html +++ b/html_orig/help.html @@ -44,7 +44,7 @@ Foreground
- 30 + 30 31 32 33 @@ -55,7 +55,7 @@
- 90 + 90 91 92 93 @@ -68,18 +68,18 @@ Background
- 40 - 41 - 42 + 40 + 41 + 42 43 - 44 - 45 - 46 + 44 + 45 + 46 47
- 100 + 100 101 102 103 diff --git a/html_orig/js/app.js b/html_orig/js/app.js index 7b8aced..787b4d0 100644 --- a/html_orig/js/app.js +++ b/html_orig/js/app.js @@ -896,19 +896,6 @@ $._loader = function(vis) { var screen = []; var blinkIval; - /** Colors table */ - var CLR = [// dark gray #2E3436 - // 0 black, 1 red, 2 green, 3 yellow - // 4 blue, 5 mag, 6 cyan, 7 white - '#111213','#CC0000','#4E9A06','#C4A000', - '#3465A4','#75507B','#06989A','#D3D7CF', - // BRIGHT - // 8 black, 9 red, 10 green, 11 yellow - // 12 blue, 13 mag, 14 cyan, 15 white - '#555753','#EF2929','#8AE234','#FCE94F', - '#729FCF','#AD7FA8','#34E2E2','#EEEEEC' - ]; - /** Clear screen */ function cls() { screen.forEach(function(cell, i) { @@ -958,9 +945,7 @@ $._loader = function(vis) { bg = inv ? cell.fg : cell.bg; // Update e.innerText = (cell.t+' ')[0]; - e.style.color = colorHex(fg); - e.style.backgroundColor = colorHex(bg); - e.style.fontWeight = fg > 7 ? 'bold' : 'normal'; + e.className = 'fg'+fg+' bg'+bg; } /** Show entire screen */ @@ -1028,13 +1013,6 @@ $._loader = function(vis) { blitAll(); } - /** Parse color */ - function colorHex(c) { - c = parseInt(c); - if (c < 0 || c > 15) c = 0; - return CLR[c]; - } - /** Init the terminal */ function init(obj) { W = obj.w; diff --git a/html_orig/jssrc/term.js b/html_orig/jssrc/term.js index 1e3af32..78ac418 100644 --- a/html_orig/jssrc/term.js +++ b/html_orig/jssrc/term.js @@ -8,20 +8,8 @@ var screen = []; var blinkIval; - /** Colors table */ - var CLR = [// dark gray #2E3436 - // 0 black, 1 red, 2 green, 3 yellow - // 4 blue, 5 mag, 6 cyan, 7 white - '#111213','#CC0000','#4E9A06','#C4A000', - '#3465A4','#75507B','#06989A','#D3D7CF', - // BRIGHT - // 8 black, 9 red, 10 green, 11 yellow - // 12 blue, 13 mag, 14 cyan, 15 white - '#555753','#EF2929','#8AE234','#FCE94F', - '#729FCF','#AD7FA8','#34E2E2','#EEEEEC' - ]; - - /** Clear screen */ +/* + /!** Clear screen *!/ function cls() { screen.forEach(function(cell, i) { cell.t = ' '; @@ -30,6 +18,7 @@ blit(cell); }); } +*/ /** Set text and color at XY */ function cellAt(y, x) { @@ -41,14 +30,15 @@ return cellAt(cursor.y, cursor.x); } - /** Enable or disable cursor visibility */ +/* + /!** Enable or disable cursor visibility *!/ function cursorEnable(enable) { cursor.hidden = !enable; cursor.a &= enable; blit(cursorCell(), cursor.a); } - /** Safely move cursor */ + /!** Safely move cursor *!/ function cursorSet(y, x) { // Hide and prevent from showing up during the move cursor.suppress = true; @@ -61,6 +51,7 @@ cursor.suppress = false; blit(cursorCell(), cursor.a); } +*/ /** Update cell on display. inv = invert (for cursor) */ function blit(cell, inv) { @@ -70,10 +61,7 @@ bg = inv ? cell.fg : cell.bg; // Update e.innerText = (cell.t+' ')[0]; - e.classList.className = 'fg'+fg+' bg'+bg; - // e.style.color = colorHex(fg); - // e.style.backgroundColor = colorHex(bg); - // e.style.fontWeight = fg > 7 ? 'bold' : 'normal'; + e.className = 'fg'+fg+' bg'+bg; } /** Show entire screen */ @@ -141,13 +129,6 @@ blitAll(); } - /** Parse color */ - function colorHex(c) { - c = parseInt(c); - if (c < 0 || c > 15) c = 0; - return CLR[c]; - } - /** Init the terminal */ function init(obj) { W = obj.w; diff --git a/html_orig/sass/_term-colors.scss b/html_orig/sass/_term-colors.scss index c1b1d1c..b665aee 100644 --- a/html_orig/sass/_term-colors.scss +++ b/html_orig/sass/_term-colors.scss @@ -14,3 +14,11 @@ $term-colors: .fg#{$i - 1} { color: $c; } .bg#{$i - 1} { background-color: $c; } } + +.fg8, .fg9, .fg10, .fg11, .fg12, .fg13, .fg14, .fg15 { + font-weight: bold; +} + +.nb { + font-weight: normal !important; +} diff --git a/html_orig/sass/pages/_about.scss b/html_orig/sass/pages/_about.scss index 3669cd1..e60565e 100644 --- a/html_orig/sass/pages/_about.scss +++ b/html_orig/sass/pages/_about.scss @@ -53,7 +53,7 @@ width: 100%; td:nth-child(1) { - width: 6em; + width: 7em; } td:nth-child(2) { diff --git a/html_orig/sass/pages/_term.scss b/html_orig/sass/pages/_term.scss index 8b44437..d642e6d 100755 --- a/html_orig/sass/pages/_term.scss +++ b/html_orig/sass/pages/_term.scss @@ -26,10 +26,6 @@ } } } - - .fg8, .fg9, .fg10, .fg11, .fg12, .fg13, .fg14, .fg15 { - font-weight: bold; - } } #buttons { diff --git a/html_orig/server.sh b/html_orig/server.sh new file mode 100755 index 0000000..4b0b817 --- /dev/null +++ b/html_orig/server.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +xterm -e "php -S localhost:2000" diff --git a/html_orig/term_test.php b/html_orig/term_test.php index 6b04bc5..939d1ee 100644 --- a/html_orig/term_test.php +++ b/html_orig/term_test.php @@ -10,6 +10,6 @@ $f = str_replace('%screenData%', "screen": "70 t259" }', $f); -$f = str_replace('window.location.host', '"192.168.0.15"', $f); +$f = str_replace('window.location.host', '"192.168.0.18"', $f); echo $f; diff --git a/user/screen.c b/user/screen.c index 1e157b3..d73079a 100644 --- a/user/screen.c +++ b/user/screen.c @@ -75,25 +75,18 @@ static volatile int notifyLock = 0; if (notifyLock == 0) screen_notifyChange(); \ } while(0) -/** - * Reset a cell - */ -static inline void -cell_init(Cell *cell) -{ - cell->c = ' '; - cell->fg = SCREEN_DEF_FG; - cell->bg = SCREEN_DEF_BG; -} - /** * Clear range, inclusive */ static inline void clear_range(unsigned int from, unsigned int to) { + Color fg = cursor.inverse ? cursor.bg : cursor.fg; + Color bg = cursor.inverse ? cursor.fg : cursor.bg; for (unsigned int i = from; i <= to; i++) { - cell_init(&screen[i]); + screen[i].c = ' '; + screen[i].fg = fg; + screen[i].bg = bg; } } @@ -122,11 +115,7 @@ void ICACHE_FLASH_ATTR screen_init(void) { NOTIFY_LOCK(); - for (unsigned int i = 0; i < MAX_SCREEN_SIZE; i++) { - cell_init(&screen[i]); - } - - cursor_reset(); + screen_reset(); NOTIFY_DONE(); } @@ -137,8 +126,8 @@ void ICACHE_FLASH_ATTR screen_reset(void) { NOTIFY_LOCK(); - screen_clear(CLEAR_ALL); cursor_reset(); + screen_clear(CLEAR_ALL); NOTIFY_DONE(); } diff --git a/user/user_main.h b/user/user_main.h index d596baf..01379a6 100644 --- a/user/user_main.h +++ b/user/user_main.h @@ -1,7 +1,7 @@ #ifndef USER_MAIN_H_H #define USER_MAIN_H_H -#define FIRMWARE_VERSION "0.4" +#define FIRMWARE_VERSION "0.5" #define TERMINAL_GITHUB_REPO "https://github.com/MightyPork/esp-vt100-firmware" #endif //USER_MAIN_H_H