forked from hkc/cc-stuff
1
0
Fork 0
cc-stuff/videotape.lua

24 lines
630 B
Lua
Raw Normal View History

2023-10-15 04:26:23 +03:00
local tape = peripheral.find("tape_drive")
local mon = peripheral.find("monitor")
2023-10-15 04:40:16 +03:00
tape.seek(-tape.getSize())
2023-10-15 04:26:23 +03:00
mon.setTextScale(1)
local w, h = string.byte(tape.read(2), 1, 2)
repeat
for y = 1, h do
mon.setCursorPos(1, y)
local buf = string.byte(tape.read(w), 1, -1)
local s, f, b = "", "", ""
for x = 1, w do
2023-10-15 04:40:16 +03:00
s = s .. string.char(0x80 + bit32.band(0x7F, buf[x]))
2023-10-15 04:26:23 +03:00
local inv = bit32.band(0x80, buf[x])
f = f .. (inv and "f" or "0")
b = b .. (inv and "0" or "f")
end
mon.blit(s, f, b)
end
os.sleep(0.01)
until tape.isEnd()