|
|
@ -1350,13 +1350,13 @@ var Screen = (function () { |
|
|
|
if (num != H || num2 != W) { |
|
|
|
if (num != H || num2 != W) { |
|
|
|
_rebuild(num, num2); |
|
|
|
_rebuild(num, num2); |
|
|
|
} |
|
|
|
} |
|
|
|
console.log("Size ",num, num2); |
|
|
|
// console.log("Size ",num, num2);
|
|
|
|
|
|
|
|
|
|
|
|
// Cursor position
|
|
|
|
// Cursor position
|
|
|
|
num = parse2B(str, i); i += 2; // row
|
|
|
|
num = parse2B(str, i); i += 2; // row
|
|
|
|
num2 = parse2B(str, i); i += 2; // col
|
|
|
|
num2 = parse2B(str, i); i += 2; // col
|
|
|
|
cursorSet(num, num2); |
|
|
|
cursorSet(num, num2); |
|
|
|
console.log("Cursor at ",num, num2); |
|
|
|
// console.log("Cursor at ",num, num2);
|
|
|
|
|
|
|
|
|
|
|
|
// Attributes
|
|
|
|
// Attributes
|
|
|
|
num = parse2B(str, i); i += 2; // fg bg bold hidden
|
|
|
|
num = parse2B(str, i); i += 2; // fg bg bold hidden
|
|
|
@ -1364,7 +1364,7 @@ var Screen = (function () { |
|
|
|
cursor.bg = (num & 0xF0) >> 4; |
|
|
|
cursor.bg = (num & 0xF0) >> 4; |
|
|
|
cursor.bold = !!(num & 0x100); |
|
|
|
cursor.bold = !!(num & 0x100); |
|
|
|
cursor.hidden = !(num & 0x200); |
|
|
|
cursor.hidden = !(num & 0x200); |
|
|
|
console.log("FG ",cursor.fg, ", BG ", cursor.bg,", BOLD ", cursor.bold, ", HIDE ", cursor.hidden); |
|
|
|
// console.log("FG ",cursor.fg, ", BG ", cursor.bg,", BOLD ", cursor.bold, ", HIDE ", cursor.hidden);
|
|
|
|
|
|
|
|
|
|
|
|
fg = cursor.fg; |
|
|
|
fg = cursor.fg; |
|
|
|
bg = cursor.bg; |
|
|
|
bg = cursor.bg; |
|
|
@ -1380,11 +1380,11 @@ var Screen = (function () { |
|
|
|
fg = num & 0x0F; |
|
|
|
fg = num & 0x0F; |
|
|
|
bg = (num & 0xF0) >> 4; |
|
|
|
bg = (num & 0xF0) >> 4; |
|
|
|
bold = !!(num & 0x100); |
|
|
|
bold = !!(num & 0x100); |
|
|
|
console.log("Switch to ",fg,bg,bold); |
|
|
|
// console.log("Switch to ",fg,bg,bold);
|
|
|
|
} |
|
|
|
} |
|
|
|
else if (jc == SEQ_REPEAT) { |
|
|
|
else if (jc == SEQ_REPEAT) { |
|
|
|
num = parse2B(str, i); i += 2; |
|
|
|
num = parse2B(str, i); i += 2; |
|
|
|
console.log("Repeat x ",num); |
|
|
|
// console.log("Repeat x ",num);
|
|
|
|
for (; num>0 && ci<W*H; num--) { |
|
|
|
for (; num>0 && ci<W*H; num--) { |
|
|
|
cell = screen[ci++]; |
|
|
|
cell = screen[ci++]; |
|
|
|
cell.fg = fg; |
|
|
|
cell.fg = fg; |
|
|
@ -1400,7 +1400,7 @@ var Screen = (function () { |
|
|
|
cell.fg = fg; |
|
|
|
cell.fg = fg; |
|
|
|
cell.bg = bg; |
|
|
|
cell.bg = bg; |
|
|
|
cell.bold = bold; |
|
|
|
cell.bold = bold; |
|
|
|
console.log("Symbol ", j); |
|
|
|
// console.log("Symbol ", j);
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -1412,6 +1412,7 @@ var Screen = (function () { |
|
|
|
qs('h1').textContent = pieces[0]; |
|
|
|
qs('h1').textContent = pieces[0]; |
|
|
|
qsa('#buttons button').forEach(function(x, i) { |
|
|
|
qsa('#buttons button').forEach(function(x, i) { |
|
|
|
var s = pieces[i+1].trim(); |
|
|
|
var s = pieces[i+1].trim(); |
|
|
|
|
|
|
|
// if empty string, use the "dim" effect and put nbsp instead to stretch the btn vertically
|
|
|
|
x.innerHTML = s.length >0 ? e(s) : " "; |
|
|
|
x.innerHTML = s.length >0 ? e(s) : " "; |
|
|
|
x.style.opacity = s.length > 0 ? 1 : 0.2; |
|
|
|
x.style.opacity = s.length > 0 ? 1 : 0.2; |
|
|
|
}); |
|
|
|
}); |
|
|
|