terminal.lua: Make 1st tier and 2nd tier GPU (or 2nd tier APU and 3rd tier APU) not suck

This commit is contained in:
2026-06-06 21:38:32 +03:00
parent 4d6dbadc32
commit 08af85f3b4
+77 -44
View File
@@ -40,50 +40,83 @@ function module.init()
table.insert(readHistory[id],hist) table.insert(readHistory[id],hist)
end end
local ANSIColorPalette = { local function getColorPalette(depth)
["dark"] = { if depth == 1 then
[0] = 0x171421, return {
[1] = 0xc01c28, ["dark"] = {
[2] = 0x26a269, [0] = 0x000000,
[3] = 0xa2734c, [1] = 0xffffff,
[4] = 0x12488b, [2] = 0xffffff,
[5] = 0xa347ba, [3] = 0xffffff,
[6] = 0x2aa1b3, [4] = 0xffffff,
[7] = 0xd0cfcc [5] = 0xffffff,
}, [6] = 0xffffff,
["bright"] = { [7] = 0xffffff,
[0] = 0x5e5c64, },
[1] = 0xf66151, ["bright"] = {
[2] = 0x33d17a, [0] = 0x000000,
[3] = 0xe9ad0c, [1] = 0xffffff,
[4] = 0x2a7bde, [2] = 0xffffff,
[5] = 0xc061cb, [3] = 0xffffff,
[6] = 0x33c7de, [4] = 0xffffff,
[7] = 0xffffff [5] = 0xffffff,
} [6] = 0xffffff,
} [7] = 0xffffff,
--[[local ANSIColorPalette = { }
["dark"] = { }
[0] = 0x000000, end
[1] = 0x800000, if depth == 4 then
[2] = 0x008000, return {
[3] = 0x808000, ["dark"] = {
[4] = 0x000080, [0] = 0x000000,
[5] = 0x800080, [1] = 0x800000,
[6] = 0x008080, [2] = 0x008000,
[7] = 0xC0C0C0 [3] = 0x808000,
}, [4] = 0x000080,
["bright"] = { [5] = 0x800080,
[0] = 0x808080, [6] = 0x008080,
[1] = 0xFF0000, [7] = 0xC0C0C0
[2] = 0x00FF00, },
[3] = 0xFFFF00, ["bright"] = {
[4] = 0x0000FF, [0] = 0x808080,
[5] = 0xFF00FF, [1] = 0xFF0000,
[6] = 0x00FFFF, [2] = 0x00FF00,
[7] = 0xFFFFFF [3] = 0xFFFF00,
} [4] = 0x0000FF,
}]] [5] = 0xFF00FF,
[6] = 0x00FFFF,
[7] = 0xFFFFFF
}
}
end
if depth == 8 then
return {
["dark"] = {
[0] = 0x171421,
[1] = 0xc01c28,
[2] = 0x26a269,
[3] = 0xa2734c,
[4] = 0x12488b,
[5] = 0xa347ba,
[6] = 0x2aa1b3,
[7] = 0xd0cfcc
},
["bright"] = {
[0] = 0x5e5c64,
[1] = 0xf66151,
[2] = 0x33d17a,
[3] = 0xe9ad0c,
[4] = 0x2a7bde,
[5] = 0xc061cb,
[6] = 0x33c7de,
[7] = 0xffffff
}
}
end
error()
end
local ANSIColorPalette = getColorPalette(gpu.maxDepth())
local expecting_unicode_bytes = 0 local expecting_unicode_bytes = 0
local unicode_bytes_left = 0 local unicode_bytes_left = 0