|
|
@ -630,8 +630,6 @@ class TermScreen { |
|
|
|
// Map of (cell index) -> boolean, whether or not a cell needs to be redrawn
|
|
|
|
// Map of (cell index) -> boolean, whether or not a cell needs to be redrawn
|
|
|
|
const updateMap = new Map(); |
|
|
|
const updateMap = new Map(); |
|
|
|
|
|
|
|
|
|
|
|
const cursorActive = (this.cursor.blinkOn || !this.cursor.blinkEnable); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (let cell = 0; cell < screenLength; cell++) { |
|
|
|
for (let cell = 0; cell < screenLength; cell++) { |
|
|
|
let x = cell % width; |
|
|
|
let x = cell % width; |
|
|
|
let y = Math.floor(cell / width); |
|
|
|
let y = Math.floor(cell / width); |
|
|
@ -639,7 +637,8 @@ class TermScreen { |
|
|
|
&& this.cursor.x === x |
|
|
|
&& this.cursor.x === x |
|
|
|
&& this.cursor.y === y; |
|
|
|
&& this.cursor.y === y; |
|
|
|
|
|
|
|
|
|
|
|
let invertForCursor = isCursor && cursorActive && this.cursor.style === 'block'; |
|
|
|
let invertForCursor = isCursor && this.cursor.blinkOn |
|
|
|
|
|
|
|
&& this.cursor.style === 'block'; |
|
|
|
|
|
|
|
|
|
|
|
let inSelection = this.isInSelection(x, y); |
|
|
|
let inSelection = this.isInSelection(x, y); |
|
|
|
|
|
|
|
|
|
|
@ -653,7 +652,7 @@ class TermScreen { |
|
|
|
|
|
|
|
|
|
|
|
if (inSelection) { |
|
|
|
if (inSelection) { |
|
|
|
fg = -1; |
|
|
|
fg = -1; |
|
|
|
bg = -2 |
|
|
|
bg = -2; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
let needsUpdate = text !== this.drawnScreen[cell] || |
|
|
|
let needsUpdate = text !== this.drawnScreen[cell] || |
|
|
@ -712,7 +711,7 @@ class TermScreen { |
|
|
|
this.drawnScreenAttrs[cell] = attrs; |
|
|
|
this.drawnScreenAttrs[cell] = attrs; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (isCursor && cursorActive && this.cursor.style !== 'block') { |
|
|
|
if (isCursor && this.cursor.blinkOn && this.cursor.style !== 'block') { |
|
|
|
ctx.save(); |
|
|
|
ctx.save(); |
|
|
|
ctx.beginPath(); |
|
|
|
ctx.beginPath(); |
|
|
|
if (this.cursor.style === 'bar') { |
|
|
|
if (this.cursor.style === 'bar') { |
|
|
@ -781,29 +780,26 @@ class TermScreen { |
|
|
|
let trackMouseClicks = !!(attributes & (1 << 5)); |
|
|
|
let trackMouseClicks = !!(attributes & (1 << 5)); |
|
|
|
let trackMouseMovement = !!(attributes & (1 << 6)); |
|
|
|
let trackMouseMovement = !!(attributes & (1 << 6)); |
|
|
|
|
|
|
|
|
|
|
|
let cursorShape = (attributes >> 9 & 0b111) |
|
|
|
// 0 - Block blink 2 - Block steady (1 is unused)
|
|
|
|
if (cursorShape === 1) { |
|
|
|
// 3 - Underline blink 4 - Underline steady
|
|
|
|
this.cursor.style = 'block' |
|
|
|
// 5 - I-bar blink 6 - I-bar steady
|
|
|
|
|
|
|
|
let cursorShape = (attributes >> 9) & 0x07; |
|
|
|
|
|
|
|
|
|
|
|
if (!this.cursor.blinking) { |
|
|
|
// if it's not zero, decrement such that the two most significant bits
|
|
|
|
this.cursor.blinking = true; |
|
|
|
// are the type and the least significant bit is the blink state
|
|
|
|
this.resetCursorBlink(); |
|
|
|
if (cursorShape > 0) cursorShape--; |
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
if (cursorShape > 0) cursorShape-- |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let cursorStyle = cursorShape >> 1 |
|
|
|
let cursorStyle = cursorShape >> 1; |
|
|
|
let cursorBlinking = !(cursorShape & 1) |
|
|
|
let cursorBlinking = !(cursorShape & 1); |
|
|
|
if (cursorStyle === 0) this.cursor.style = 'block' |
|
|
|
|
|
|
|
else if (cursorStyle === 1) this.cursor.style = 'line' |
|
|
|
if (cursorStyle === 0) this.cursor.style = 'block'; |
|
|
|
else if (cursorStyle === 2) this.cursor.style = 'bar' |
|
|
|
else if (cursorStyle === 1) this.cursor.style = 'line'; |
|
|
|
|
|
|
|
else if (cursorStyle === 2) this.cursor.style = 'bar'; |
|
|
|
|
|
|
|
|
|
|
|
if (this.cursor.blinking !== cursorBlinking) { |
|
|
|
if (this.cursor.blinking !== cursorBlinking) { |
|
|
|
this.cursor.blinking = cursorBlinking; |
|
|
|
this.cursor.blinking = cursorBlinking; |
|
|
|
|
|
|
|
|
|
|
|
this.resetCursorBlink(); |
|
|
|
this.resetCursorBlink(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Input.setMouseMode(trackMouseClicks, trackMouseMovement); |
|
|
|
Input.setMouseMode(trackMouseClicks, trackMouseMovement); |
|
|
|
this.selection.selectable = !trackMouseMovement; |
|
|
|
this.selection.selectable = !trackMouseMovement; |
|
|
@ -819,13 +815,6 @@ class TermScreen { |
|
|
|
$('.x-term-conf-btn').toggleClass('hidden', !showConfigLinks); |
|
|
|
$('.x-term-conf-btn').toggleClass('hidden', !showConfigLinks); |
|
|
|
$('#action-buttons').toggleClass('hidden', !showButtons); |
|
|
|
$('#action-buttons').toggleClass('hidden', !showButtons); |
|
|
|
|
|
|
|
|
|
|
|
let cursorStyle = (attributes >> 9) & 0x07; |
|
|
|
|
|
|
|
// 0 - Block blink, 2 - Block steady
|
|
|
|
|
|
|
|
// 3 - Under blink, 4 - Under steady
|
|
|
|
|
|
|
|
// 5 - I-bar blink, 6 - I-bar steady
|
|
|
|
|
|
|
|
this.cursor.style = cursorStyle<3?'block':cursorStyle<5?'line':'bar'; |
|
|
|
|
|
|
|
this.cursor.blinkEnable = cursorStyle === 0 || cursorStyle === 3 || cursorStyle === 5; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// content
|
|
|
|
// content
|
|
|
|
let fg = 7; |
|
|
|
let fg = 7; |
|
|
|
let bg = 0; |
|
|
|
let bg = 0; |
|
|
|