From e9e82243f292bed68215c5c1fb76c2c6b638b240 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Tue, 19 Jan 2016 18:25:09 +0100 Subject: [PATCH] Fixed gpu.getScreen for OpenOS --- src/lua/core/init.lua | 2 +- src/lua/core/textgpu.lua | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/lua/core/init.lua b/src/lua/core/init.lua index bd9e04b..880c854 100644 --- a/src/lua/core/init.lua +++ b/src/lua/core/init.lua @@ -69,7 +69,7 @@ function main() modules.eeprom.register() modules.filesystem.register("root") 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.boot.boot() diff --git a/src/lua/core/textgpu.lua b/src/lua/core/textgpu.lua index 66f9428..796e823 100644 --- a/src/lua/core/textgpu.lua +++ b/src/lua/core/textgpu.lua @@ -47,7 +47,6 @@ end function textgpu.start() local gpu = {} function gpu.bind() return false, "This is static bound gpu" end - function gpu.getScreen() return "n/a" end function gpu.setBackground(color, isPaletteIndex) checkArg(1, color, "number") checkArg(2, isPaletteIndex, "boolean", "nil") @@ -219,6 +218,12 @@ function textgpu.start() return true end + local screenAddr + + function gpu.getScreen() + return screenAddr + end + write("\x1b[?25l") --Disable cursor local w, h = gpu.getResolution() prepareBuffers(w, h) @@ -226,7 +231,7 @@ function textgpu.start() gpu.setBackground(0x000000) 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", {}) deadhooks[#deadhooks + 1] = function()