Fixed performance issue.

This commit is contained in:
sam 2020-05-17 00:23:43 -04:00
parent 3b484d8c5c
commit d4b07eebc1
11 changed files with 143 additions and 22 deletions

View File

@ -1,5 +1,6 @@
{
{type="managed", path="bios/managed.bios"},
{type="initramfs", path="bios/initramfs.bios"},
--{type="osdi", path="bios/osdi.bios"},
--{type="romfs", path="bios/romfs.bios"},
--{type="proxfs", path="bios/proxfs.bios"}

View File

@ -19,6 +19,7 @@
{name="minitel", cat="net", path="lib/net_minitel.zy2l"},
--{name="vdev", cat="util", path="mods/util_vdev.zy2m"},
{name="classic", cat="menu", path="mods/menu_classic.zy2m"},
{name="luaconsole", cat="util", path="mods/util_luaconsole.zy2m"},
--{name="vdevrt", cat="rtmod", path="mods/rtmod_vdevrt.zy2m"},
--{name="tsukinet", cat="net", path="mods/net_tsukinet"},
--{name="biosemu", cat="loader", path="mods/loader_biosemu.zy2m", warning="warn_mod_biosemu"},

View File

@ -59,7 +59,7 @@ function thd.run()
dl = computer.uptime() + (dl or math.huge)
threads[i][4] = dl
threads[i].delta = computer.uptime() - dt
sigs[#sigs+1] = {ps(0)}
--sigs[#sigs+1] = {ps(0)}
end
end
end

View File

@ -3,9 +3,53 @@ local arcfs = {}
function arcfs.make(arc)
local proxy = {}
local function ni()return nil, "not implemented"end
local hands = {}
proxy.remove = ni
proxy.makeDirectory = ni
function proxy.exists(path)
return arc:exists(path)
end
function proxy.spaceUsed()
return 0
end
function proxy.open(path, mode)
if mode ~= "r" and mode ~= "rb" then
return nil, "read-only filesystem"
end
end
function proxy.isReadOnly()
return true
end
proxy.write = ni
function proxy.spaceTotal()
return 0
end
function proxy.isDirectory(dir)
if arc.isdir then return arc:isdir(dir) end
return #arc:list(dir) > 0
end
function proxy.list(path)
return arc:list(path)
end
function proxy.lastModified(path)
return 0
end
function proxy.getLabel()
return "ARCFS_VOLUME"
end
function proxy.close(hand)
end
function proxy.size(path)
end
function proxy.read(hand, count)
end
function proxy.seek(hand, whence, amt)
end
function proxy.setLabel()
return "ARCFS_VOLUME"
end
end

12
mods/net_minitel/init.lua Normal file
View File

@ -0,0 +1,12 @@
local net = {}
net.port = 4096
net.modems = {}
local sockets = {}
local sock = {}
--#include "minitel-3.lua"
--#include "minitel-4.lua"
--#include "minitel-5.lua"

View File

View File

View File

@ -0,0 +1,29 @@
local c_sock = {}
local h_sock = {}
function c_sock:read(a)
local dat = self.data:sub(1, a-1)
self.data = self.data:sub(a)
return dat
end
function c_sock:recieve(a)
end
function c_sock:write(d)
end
function c_sock:send(d)
end
function c_sock:close()
end
function c_sock:timeout(t)
if t then self.to = t endsi
return self.to
end

View File

@ -88,7 +88,7 @@ return function(autorun)
tty.print(s())
end, function(e)
tty.setcolor(0x4)
tty.print(debug.traceback(e):gsub("\t", " "):gsub("\r", ""))
tty.print(debug.traceback(e):gsub("\t", " "):gsub("\r", "\n"))
end)
end
tty.setcolor(2)

View File

@ -157,8 +157,8 @@ do
for i=1, #args do
args[i] = tostring(args[i])
end
local str = table.concat(args, " ").."\n"
for m in str:gmatch("(.*)\n") do
local str = table.concat(args, " ").."\n" -- ugly hack
for m in str:gmatch("(.-)\n") do
tty.write(m)
local x, y = tty.getcursor()
if (x ~= 1) then

View File

@ -57,25 +57,36 @@ local gpu = proxy(list("gpu")())
if (not gpu.getScreen()) then
gpu.bind(list("screen")())
end
local usepal
if (gpu.getDepth() > 1) then
usepal = true
gpu.setPaletteColor(0, 0x000000)
gpu.setPaletteColor(1, 0xFFFFFF)
gpu.setPaletteColor(2, 0x4444FF)
gpu.setPaletteColor(3, 0xFF7F44)
gpu.setPaletteColor(4, 0x00007F)
gpu.setPaletteColor(5, 0x7F00FF)
gpu.setPaletteColor(6, 0x595959)
end
local function gc(c)
if usepal then
return c, true
end
return (c == 1) and 1 or 0
end
--Load palette
gpu.setPaletteColor(0, 0x000000)
gpu.setPaletteColor(1, 0xFFFFFF)
gpu.setPaletteColor(2, 0x4444FF)
gpu.setPaletteColor(3, 0xFF7F44)
gpu.setPaletteColor(4, 0x00007F)
gpu.setPaletteColor(5, 0x7F00FF)
gpu.setPaletteColor(6, 0x595959)
gpu.setBackground(0, true)
gpu.setBackground(gc(0))
local w, h = gpu.getViewport()
gpu.fill(1, 2, w, h-1, " ")
gpu.setBackground(5, true)
gpu.setBackground(gc(5))
gpu.fill(1, 1, w, 1, " ")
local title = "Zorya NEO Installer v2.0"
local spos = (w/2)-(#title/2)
gpu.setForeground(1, true)
gpu.setForeground(gc(1))
gpu.set(spos, 1, title)
gpu.setForeground(1, true)
gpu.setBackground(5, true)
--[[
gpu.setForeground(gc(1))
gpu.setBackground(gc(5))
gpu.fill(6,6,w-12,h-12, " ")
gpu.set(6,6,characters[1])
gpu.set(w-6,6,characters[2])
@ -84,17 +95,39 @@ gpu.set(w-6,h-6,characters[6])
gpu.fill(7,6,w-13,1,characters[3])
gpu.fill(7,h-6,w-13,1,characters[3])
gpu.fill(6,7,1,h-13,characters[4])
gpu.fill(w-6,7,1,h-13,characters[4])
function setStatus(stat)
gpu.setBackground(5, true)
gpu.setForeground(1, true)
gpu.fill(w-6,7,1,h-13,characters[4])]]
function drawBox(x, y, w, h)
gpu.setForeground(gc(1))
gpu.setBackground(gc(5))
gpu.fill(x,y,x+w,y+h, " ")
gpu.fill(x,y,w,1,characters[3])
gpu.fill(x,y+h,w,1,characters[3])
gpu.fill(x,y,1,h,characters[4])
gpu.fill(x+w,y,1,h,characters[4])
gpu.set(x,y,characters[1])
gpu.set(x+w,y,characters[2])
gpu.set(x,y+h,characters[5])
gpu.set(x+w,y+h,characters[6])
end
function drawCenteredBox(x, y)
local marginx, marginy = (w-x)//2, (h-y)//2
drawBox(marginx, marginy, x, y)
end
function setStatus(stat, l1, l2)
l1 = l1 or ""
l2 = l2 or ""
gpu.setBackground(gc(5))
gpu.setForeground(gc(1))
gpu.fill(7,(h/2)-3, w-13, 1, " ")
gpu.set((w/2)-(#stat/2), (h/2)-3, stat)
end
function setBar(pos)
gpu.setBackground(6, true)
gpu.setBackground(gc(6))
gpu.fill(8, (h/2)+1, w-16, 1, " ")
gpu.setBackground(2, true)
gpu.setBackground(gc((usepal and 2) or 1))
gpu.fill(8, (h/2)+1, ((w-16)/100)*pos, 1, " ")
computer.pullSignal(0)
end
@ -103,6 +136,7 @@ function mkdir(fs, path)
fs.makeDirectory(path)
end
drawCenteredBox(w-8, h-8)
setStatus("Setting up directories...")
setBar(100)