53 lines
1.4 KiB
Lua
53 lines
1.4 KiB
Lua
@[[if not svar.get("CRESCENT_KARGS") then
|
|
svar.set("CRESCENT_KARGS", "")
|
|
end]]
|
|
|
|
local version = "1.0"
|
|
|
|
local gpu = component.list("gpu")()
|
|
local w, h
|
|
local screen = component.list('screen')()
|
|
for address in component.list('screen') do
|
|
if #component.invoke(address, 'getKeyboards') > 0 then
|
|
screen = address
|
|
end
|
|
end
|
|
local cls = function()end
|
|
if gpu and screen then
|
|
component.invoke(gpu, "bind", screen)
|
|
w, h = component.invoke(gpu, "getResolution")
|
|
component.invoke(gpu, "setResolution", w, h)
|
|
component.invoke(gpu, "setBackground", 0x000000)
|
|
component.invoke(gpu, "setForeground", 0xFFFFFF)
|
|
component.invoke(gpu, "fill", 1, 1, w, h, " ")
|
|
cls = function()component.invoke(gpu,"fill", 1, 1, w, h, " ")end
|
|
end
|
|
local y = 1
|
|
local function status(msg)
|
|
if gpu and screen then
|
|
component.invoke(gpu, "set", 1, y, msg)
|
|
if y == h then
|
|
component.invoke(gpu, "copy", 1, 2, w, h - 1, 0, -1)
|
|
component.invoke(gpu, "fill", 1, h, w, 1, " ")
|
|
else
|
|
y = y + 1
|
|
end
|
|
end
|
|
end
|
|
|
|
local loadspin = 1
|
|
local spins = {
|
|
"-", "\\", "|", "/"
|
|
}
|
|
|
|
local function lsc()
|
|
loadspin = (loadspin % 4) + 1
|
|
return spins[loadspin]
|
|
end
|
|
|
|
--#include "crescent/velx.lua"
|
|
--#include "crescent/tsar.lua"
|
|
--#include "crescent/loader.lua"
|
|
|
|
status("crescent loader v"..version)
|
|
boot_kernel("--root=$ --security=none"..$(CRESCENT_KARGS)) |