maybe just print less for now............
This commit is contained in:
parent
a3c25f1442
commit
8175c31733
|
@ -18,14 +18,6 @@ local function read32()
|
||||||
return v
|
return v
|
||||||
end
|
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 function bytes2time(b)
|
||||||
local s = math.floor(b / 6000)
|
local s = math.floor(b / 6000)
|
||||||
if s < 60 then return string.format("%ds", s) end
|
if s < 60 then return string.format("%ds", s) end
|
||||||
|
@ -36,10 +28,6 @@ end
|
||||||
parallel.waitForAll(
|
parallel.waitForAll(
|
||||||
function()
|
function()
|
||||||
while running do
|
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)
|
os.sleep(0.1)
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
@ -53,13 +41,14 @@ function()
|
||||||
elseif ev == "tape_present" then
|
elseif ev == "tape_present" then
|
||||||
table_of_contents = {}
|
table_of_contents = {}
|
||||||
if evd[1] then
|
if evd[1] then
|
||||||
|
drive.stop()
|
||||||
drive.seek(-drive.getSize())
|
drive.seek(-drive.getSize())
|
||||||
for i = 1, 48 do
|
for i = 1, 48 do
|
||||||
local offset = read32()
|
local offset = read32()
|
||||||
local length = read32()
|
local length = read32()
|
||||||
local title = readstr(117)
|
print(string.format("%d: %d + %d", i, offset, length))
|
||||||
table.insert(table_of_contents, {
|
table.insert(table_of_contents, {
|
||||||
title = title,
|
title = "", -- TODO
|
||||||
offset = offset,
|
offset = offset,
|
||||||
length = length,
|
length = length,
|
||||||
ending = offset + length
|
ending = offset + length
|
||||||
|
|
Loading…
Reference in New Issue