Просмотр исходного кода

more control code support for the terminal emulator

pull/1/head
XeonSquared 4 лет назад
Родитель
Сommit
5d2d09fbcf
1 измененных файлов: 18 добавлений и 1 удалений
  1. +18
    -1
      module/vt100.lua

+ 18
- 1
module/vt100.lua Просмотреть файл

@@ -14,7 +14,7 @@ function vt100emu(gpu) -- takes GPU component proxy *gpu* and returns a function
gpu.setResolution(mx,my)
gpu.fill(1,1,mx,my," ")

function termwrite(s)
local function termwrite(s)
local rs = ""
s=s:gsub("\8","\27[D")
pc = gpu.get(cx,cy)
@@ -81,6 +81,23 @@ function vt100emu(gpu) -- takes GPU component proxy *gpu* and returns a function
rs = string.format("%s\27[%d;%d0c",rs,mx,my)
elseif cc == "n" and lc == "6" then
rs = string.format("%s\27[%d;%dR",rs,cx,cy)
elseif cc == "K" then
if lc == "1" then
gpu.fill(1,cy,cx,1," ")
elseif lc == "2" then
gpu.fill(cx,cy,mx,1," ")
else
gpu.fill(1,cy,mx,1," ")
end
elseif cc == "J" then
if lc == "1" then
gpu.fill(1,1,mx,cy," ")
elseif lc == "2" then
gpu.full(1,1,mx,my," ")
cx,cy = 1, 1
else
gpu.fill(1,cy,mx,my," ")
end
elseif cc == "m" then
for num in cs:gmatch("%d+") do
num=tonumber(num)


Загрузка…
Отмена
Сохранить