From a8172db8f9fd06eed06bc04d0492c5d09eee14e3 Mon Sep 17 00:00:00 2001 From: hkc Date: Tue, 17 Oct 2023 16:07:54 +0300 Subject: [PATCH] Forgot to store new state Also printing titles now! --- tape-playlist.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tape-playlist.lua b/tape-playlist.lua index 771a04c..7b894b5 100644 --- a/tape-playlist.lua +++ b/tape-playlist.lua @@ -47,9 +47,11 @@ function() local offset = read32() local length = read32() local title = drive.read(117) - print(string.format("%d: %d + %d", i, offset, length)) + if length > 0 then + print(string.format("%d: %d + %d %s", i, offset, length, title)) + end table.insert(table_of_contents, { - title = length and title or nil, + title = length > 0 and title or nil, offset = offset, length = length, ending = offset + length @@ -66,11 +68,13 @@ function() local tape_present = drive.isReady() if tape_present ~= tape_was_present then os.queueEvent("tape_present", tape_present) + tape_was_present = tape_present end local drive_state = drive.getState() if drive_old_state ~= drive_state then os.queueEvent("drive_state", drive_state) + drive_old_state = drive_state end os.sleep(0.25)