forked from Hyperion/HyperionOS
update to start working on SysInit
This commit is contained in:
105
Build/lib/modules/CC-Tweaked/tty.kmod
Executable file
105
Build/lib/modules/CC-Tweaked/tty.kmod
Executable file
@@ -0,0 +1,105 @@
|
||||
local args={...}
|
||||
local kernel=args[1]
|
||||
local apis=kernel.apis
|
||||
local native=apis.peripheral
|
||||
local driver={}
|
||||
local sides = {"top", "bottom", "left", "right", "front", "back"}
|
||||
|
||||
local function getType(name)
|
||||
if native.isPresent(name) then
|
||||
return native.getType(name)
|
||||
end
|
||||
for n = 1, #sides do
|
||||
local side = sides[n]
|
||||
if native.hasType(side, "peripheral_hub") and native.call(side, "isPresentRemote", name) then
|
||||
return native.call(side, "getTypeRemote", name)
|
||||
end
|
||||
end
|
||||
return nil
|
||||
end
|
||||
|
||||
local function getNames()
|
||||
local names = {}
|
||||
for n = 1, #sides do
|
||||
local side = sides[n]
|
||||
if native.isPresent(side) then
|
||||
table.insert(names, side)
|
||||
end
|
||||
if native.hasType(side, "peripheral_hub") then
|
||||
local hubSides = native.call(side, "getConnectedSides")
|
||||
for _, hubSide in ipairs(hubSides) do
|
||||
table.insert(names, hubSide)
|
||||
end
|
||||
end
|
||||
end
|
||||
return names
|
||||
end
|
||||
|
||||
driver.name="CCT TTY Module"
|
||||
driver.version="0.1.0"
|
||||
driver.type="tty"
|
||||
driver.description="CCT TTY Module Kernel Module"
|
||||
driver.arch="cct"
|
||||
driver.author="HyperionOS Dev Team"
|
||||
driver.license="MIT"
|
||||
driver.api={}
|
||||
|
||||
local colors={
|
||||
[0]=0x000000, -- #000000
|
||||
0xFFFFFF, -- #FFFFFF
|
||||
0xFF0000, -- #FF0000
|
||||
0x00FF00, -- #00FF00
|
||||
0x0000FF, -- #0000FF
|
||||
0x00FFFF, -- #00FFFF
|
||||
0xFF00FF, -- #FF00FF
|
||||
0xFFFF00, -- #FFFF00
|
||||
0xFF6D00, -- #FF6D00
|
||||
0x6DFF55, -- #6DFF55
|
||||
0x24FFFF, -- #24FFFF
|
||||
0x924900, -- #924900
|
||||
0x6D6D55, -- #6D6D55
|
||||
0xDBDBAA, -- #DBDBAA
|
||||
0x6D00FF, -- #6D00FF
|
||||
0xB6FF00 -- #B6FF00
|
||||
}
|
||||
|
||||
local icolors={
|
||||
[0x1] =0, -- #000000
|
||||
[0x2] =1, -- #FFFFFF
|
||||
[0x4] =2, -- #FF0000
|
||||
[0x8] =3, -- #00FF00
|
||||
[0x10] =4, -- #0000FF
|
||||
[0x20] =5, -- #00FFFF
|
||||
[0x40] =6, -- #FF00FF
|
||||
[0x80] =7, -- #FFFF00
|
||||
[0x100] =8, -- #FF6D00
|
||||
[0x200] =9, -- #6DFF55
|
||||
[0x400] =10, -- #24FFFF
|
||||
[0x800] =11, -- #924900
|
||||
[0x1000] =12, -- #6D6D55
|
||||
[0x2000] =13, -- #DBDBAA
|
||||
[0x4000] =14, -- #6D00FF
|
||||
[0x8000] =15 -- #B6FF00
|
||||
}
|
||||
|
||||
local function getAllScreens()
|
||||
|
||||
end
|
||||
|
||||
local function wrapScreens()
|
||||
|
||||
end
|
||||
|
||||
function driver.load()
|
||||
-- Nothing to load
|
||||
end
|
||||
|
||||
function driver.unload()
|
||||
-- Nothing to unload
|
||||
end
|
||||
|
||||
function driver.main()
|
||||
-- Nothing to run
|
||||
end
|
||||
|
||||
kernel.drivers.register(driver)
|
||||
Reference in New Issue
Block a user