From 621a303553c8d4b29eb7f02bf8d5a4d35b62f50a Mon Sep 17 00:00:00 2001 From: hkc Date: Fri, 20 Oct 2023 04:14:07 +0300 Subject: [PATCH] Added handling of normal tapes --- mess/tmpc.lua | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/mess/tmpc.lua b/mess/tmpc.lua index 6d139b2..a2b1f9f 100644 --- a/mess/tmpc.lua +++ b/mess/tmpc.lua @@ -98,6 +98,9 @@ if not drive then isReady = function() return true end, + getLabel = function() + return "Dummy drive tape" + end, _tick = function() if drive._state == "PLAYING" then drive.read(600) @@ -504,6 +507,21 @@ function() local offset = read32() local length = read32() local title = drive.read(117) + if offset > drive.getSize() or length > drive.getSize() then + mplayer.songs = { + { + title = tape.getLabel(), + offset = 0, + length = tape.getSize() - 10 + }, + { + title = "[ !!! ] It's just a regular tape", + offset = tape.getSize() - 10, + length = 10 + } + } + break + end title = title:sub(1, title:find("\x00")) if length > 0 and offset > 0 then mplayer.songs[i] = {