1
1
mirror of https://git.shadowkat.net/izaya/OC-PsychOS2.git synced 2024-11-22 12:04:20 -05:00

made nvt handle the cursor going off the edge of the screen

This commit is contained in:
XeonSquared 2020-04-11 05:54:53 +10:00
parent 583b300720
commit 459fd95992

View File

@ -45,9 +45,7 @@ function vt100emu(gpu) -- takes GPU component proxy *gpu* and returns a function
gpu.set(cx,cy,pc) gpu.set(cx,cy,pc)
for cc in s:gmatch(".") do for cc in s:gmatch(".") do
if mode == 0 then if mode == 0 then
if string.byte(cc) > 31 and string.byte(cc) < 128 then -- probably printable if cc == "\n" then
wb = wb .. cc
elseif cc == "\n" then
flushwb() flushwb()
cx,cy = 1, cy+1 cx,cy = 1, cy+1
elseif cc == "\t" then elseif cc == "\t" then
@ -55,6 +53,8 @@ function vt100emu(gpu) -- takes GPU component proxy *gpu* and returns a function
elseif cc == "\27" then elseif cc == "\27" then
flushwb() flushwb()
mode = 1 mode = 1
else
wb = wb .. cc
end end
elseif mode == 1 then elseif mode == 1 then
if cc == "[" then if cc == "[" then
@ -122,6 +122,7 @@ function vt100emu(gpu) -- takes GPU component proxy *gpu* and returns a function
end end
end end
flushwb() flushwb()
checkCursor()
pc = gpu.get(cx,cy) pc = gpu.get(cx,cy)
gpu.setForeground(bg) gpu.setForeground(bg)
gpu.setBackground(fg) gpu.setBackground(fg)