Fixed gpu.getScreen for OpenOS

This commit is contained in:
Łukasz Magiera 2016-01-19 18:25:09 +01:00
parent d40aab48ea
commit e9e82243f2
2 changed files with 8 additions and 3 deletions

View File

@ -69,7 +69,7 @@ function main()
modules.eeprom.register() modules.eeprom.register()
modules.filesystem.register("root") modules.filesystem.register("root")
modules.filesystem.register("/") --TODO: remove from release modules.filesystem.register("/") --TODO: remove from release
modules.computer.tmp = modules.filesystem.register("/tmp/" .. modules.random.uuid()) modules.computer.tmp = modules.filesystem.register("/tmp/lupi-" .. modules.random.uuid())
modules.textgpu.start() modules.textgpu.start()
modules.boot.boot() modules.boot.boot()

View File

@ -47,7 +47,6 @@ end
function textgpu.start() function textgpu.start()
local gpu = {} local gpu = {}
function gpu.bind() return false, "This is static bound gpu" end function gpu.bind() return false, "This is static bound gpu" end
function gpu.getScreen() return "n/a" end
function gpu.setBackground(color, isPaletteIndex) function gpu.setBackground(color, isPaletteIndex)
checkArg(1, color, "number") checkArg(1, color, "number")
checkArg(2, isPaletteIndex, "boolean", "nil") checkArg(2, isPaletteIndex, "boolean", "nil")
@ -219,6 +218,12 @@ function textgpu.start()
return true return true
end end
local screenAddr
function gpu.getScreen()
return screenAddr
end
write("\x1b[?25l") --Disable cursor write("\x1b[?25l") --Disable cursor
local w, h = gpu.getResolution() local w, h = gpu.getResolution()
prepareBuffers(w, h) prepareBuffers(w, h)
@ -226,7 +231,7 @@ function textgpu.start()
gpu.setBackground(0x000000) gpu.setBackground(0x000000)
modules.component.api.register(nil, "gpu", gpu) modules.component.api.register(nil, "gpu", gpu)
modules.component.api.register(nil, "screen", {getKeyboards = function() return {"TODO:SetThisUuid"} end}) --verry dummy screen, TODO: make it better, kbd uuid also in epoll.c screenAddr = modules.component.api.register(nil, "screen", {getKeyboards = function() return {"TODO:SetThisUuid"} end}) --verry dummy screen, TODO: make it better, kbd uuid also in epoll.c
modules.component.api.register("TODO:SetThisUuid", "keyboard", {}) modules.component.api.register("TODO:SetThisUuid", "keyboard", {})
deadhooks[#deadhooks + 1] = function() deadhooks[#deadhooks + 1] = function()