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] = {