1
0
Fork 0

maybe just print less for now............

This commit is contained in:
Casey 2023-10-17 15:45:22 +03:00
parent a3c25f1442
commit 8175c31733
Signed by: hkc
GPG Key ID: F0F6CFE11CDB0960
1 changed files with 3 additions and 14 deletions

View File

@ -18,14 +18,6 @@ local function read32()
return v
end
local function readstr(len)
local out = ""
for i = 1, len do
out = out .. drive.read()
end
return out
end
local function bytes2time(b)
local s = math.floor(b / 6000)
if s < 60 then return string.format("%ds", s) end
@ -36,10 +28,6 @@ end
parallel.waitForAll(
function()
while running do
for i, track in ipairs(table_of_contents) do
term.setCursorPos(1, i)
term.write(string.format("%s", track.title))
end
os.sleep(0.1)
end
end,
@ -53,13 +41,14 @@ function()
elseif ev == "tape_present" then
table_of_contents = {}
if evd[1] then
drive.stop()
drive.seek(-drive.getSize())
for i = 1, 48 do
local offset = read32()
local length = read32()
local title = readstr(117)
print(string.format("%d: %d + %d", i, offset, length))
table.insert(table_of_contents, {
title = title,
title = "", -- TODO
offset = offset,
length = length,
ending = offset + length