refactor parallel code

This commit is contained in:
kepler155c@gmail.com
2019-04-05 17:32:22 -04:00
parent d5eb07c3b9
commit 426c856dfb
44 changed files with 3645 additions and 182 deletions

23
openos/apis/tty.lua Normal file
View File

@@ -0,0 +1,23 @@
local colors = _G.colors
local term = _G.term
local w, h = term.getSize()
local cmap = {
[ 0xCC2200 ] = colors.red,
[ 0x44CC00 ] = colors.lime,
[ 0xB0B00F ] = colors.yellow,
[ 0xFFFFFF ] = colors.white,
}
return {
gpu = function()
return {
setForeground = function(c) term.setTextColor(cmap[c]) end,
}
end,
getViewport = term.getSize,
window = {
width = w, height = h,
}
}