From a2d8c592a75571edeb393573832c2f6a6baa2802 Mon Sep 17 00:00:00 2001 From: hkc Date: Sun, 15 Oct 2023 04:40:16 +0300 Subject: [PATCH] Seek it properly and offset --- videotape.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/videotape.lua b/videotape.lua index 6283a01..707231a 100644 --- a/videotape.lua +++ b/videotape.lua @@ -1,7 +1,7 @@ local tape = peripheral.find("tape_drive") local mon = peripheral.find("monitor") -tape.seek(0) +tape.seek(-tape.getSize()) mon.setTextScale(1) local w, h = string.byte(tape.read(2), 1, 2) @@ -12,7 +12,7 @@ repeat local buf = string.byte(tape.read(w), 1, -1) local s, f, b = "", "", "" for x = 1, w do - s = s .. string.char(bit32.band(0x7F, buf[x])) + s = s .. string.char(0x80 + bit32.band(0x7F, buf[x])) local inv = bit32.band(0x80, buf[x]) f = f .. (inv and "f" or "0") b = b .. (inv and "0" or "f")