Programs on tape

User avatar
XavSnap
Posts: 1940
Joined: Sat May 10, 2008 4:23 pm
Location: 'Zx81 France' Fb group.

Re: Programs on tape

Post by XavSnap »

JSZeddy emulator which print to ASCII does neither support printning in Lambda 8300 mode.
viewtopic.php?f=18&t=3055&p=32750#p32750

Have fun.
:D
Xavier ...on the Facebook groupe : "Zx81 France"(fr)
User avatar
mrtinb
Posts: 1906
Joined: Fri Nov 06, 2015 5:44 pm
Location: Denmark
Contact:

Re: Programs on tape

Post by mrtinb »

Hi XavSnap :)

I'm trying to show a Lambda P-file as source. I'm not trying to get source to P-file.

I've made my own tool over the weekend in Lua.

In this state it does not support VARS-section and crashes, but it's great to see the content of a P-file. It supports both ZX81 and Lambda 8300 files.

Code: Select all

f = assert(io.open(arg[2], "rb"))
linelen = 0
dfile = 0
pointer = 16393
version = 0
zxChar = {	" ", "▘", "▝",  "▀", "▖", "▌", "▞", "▛",
			"▤", "◤", "◥", '"', "£", "$", ":", "?",
			"(", ")", ">",  "<", "=", "+", "-", "*",
			"/", ";", ",",  ".", "0", "1", "2", "3",
			"4", "5", "6",  "7", "8", "9", "A", "B",
			"C", "D", "E",  "F", "G", "H", "I", "J",
			"K", "L", "M",  "N", "O", "P", "Q", "R",
			"S", "T", "U",  "V", "W", "X", "Y", "Z",
			     "RND",   "INKEY$",   "PI",   "[43]",
			    "[44]",     "[45]", "[46]",   "[47]",
			    "[48]",     "[49]", "[4A]",   "[4B]",
			    "[4C]",     "[4D]", "[4E]",   "[4F]",
			    "[50]",     "[51]", "[52]",   "[53]",
			    "[54]",     "[55]", "[56]",   "[57]",
			    "[58]",     "[59]", "[5A]",   "[5B]",
			    "[5C]",     "[5D]", "[5E]",   "[5F]",
			    "[60]",     "[61]", "[62]",   "[63]",
			    "[64]",     "[65]", "[66]",   "[67]",
			    "[68]",     "[69]", "[6A]",   "[6B]",
			    "[6C]",     "[6D]", "[6E]",   "[6F]",
			       "↑",        "↓",    "←",      "→",
			"GRAPHICS",     "EDIT",    "⏎",      "⌫",
			    "[KL]", "FUNCTION", "[7A]",   "[7B]",
			    "[7C]",     "[7D]", "[7E]", "CURSOR",
			  "â–ˆ",   "â–Ÿ",   "â–™",    "â–„",
			  "▜",   "▐",   "▚",    "▛",
			  "â–¥",   "â—¢",   "â—£",  '["]',
			"[£]", "[$]", "[:]",  "[?]",
			"[(]", "[)]", "[>]",  "[<]",
			"[=]", "[+]", "[-]",  "[*]",
			"[/]", "[;]", "[,]",  "[.]",
			"[0]", "[1]", "[2]",  "[3]",
			"[4]", "[5]", "[6]",  "[7]",
			"[8]", "[9]", "[A]",  "[B]",
			"[C]", "[D]", "[E]",  "[F]",
			"[G]", "[H]", "[I]",  "[J]",
			"[K]", "[L]", "[M]",  "[N]",
			"[O]", "[P]", "[Q]",  "[R]",
			"[S]", "[T]", "[U]",  "[V]",
			"[W]", "[X]", "[Y]",  "[Z]",
			    '""',     "AT",    "TAB",   "[C3]",
			  "CODE",    "VAL",    "LEN",    "SIN",
			   "COS",    "TAN",    "ASN",    "ACS",
			   "ATN",     "LN",    "EXP",    "INT",
			   "SQR",    "SGN",    "ABS",   "PEEK",
			   "USR",   "STR$",   "CHR$",    "NOT",
			    "**",     "OR",    "AND",     "<=",
			    ">=",     "<>",   "THEN",     "TO",
			  "STEP", "LPRINT ",  "LLIST ",   "STOP ",
			  "SLOW ",   "FAST ",    "NEW ", "SCROLL ",
			  "CONT ",    "DIM ",    "REM ",    "FOR ",
			  "GOTO ",  "GOSUB ",  "INPUT ",   "LOAD ",
			  "LIST ",    "LET ",  "PAUSE ",   "NEXT ",
			  "POKE ",  "PRINT ",   "PLOT ",    "RUN ",
			  "SAVE ",   "RAND ",     "IF ",    "CLS ",
			"UNPLOT ",  "CLEAR ", "RETURN ",   "COPY " }

lambdaChar = {	" ", "▘", "▝",  "▀", "▖", "▌", "▞", "▛",
			"⧱", "◤", "◥", '"', "⨳", "$", "⋈", "∩",
			"(", ")", ">",  "<", "=", "+", "-", "*",
			"/", ";", ",",  ".", "0", "1", "2", "3",
			"4", "5", "6",  "7", "8", "9", "A", "B",
			"C", "D", "E",  "F", "G", "H", "I", "J",
			"K", "L", "M",  "N", "O", "P", "Q", "R",
			"S", "T", "U",  "V", "W", "X", "Y", "Z",
			     "THEN",   "TO",   "STEP",   "RND",
			    "INKEY$",     "PI", "[46]",   "[47]",
			    "[48]",     "[49]", "[4A]",   "[4B]",
			    "[4C]",     "[4D]", "[4E]",   "[4F]",
			    "[50]",     "[51]", "[52]",   "[53]",
			    "[54]",     "[55]", "[56]",   "[57]",
			    "[58]",     "[59]", "[5A]",   "[5B]",
			    "[5C]",     "[5D]", "[5E]",   "[5F]",
			    "[60]",     "[61]", "[62]",   "[63]",
			    "[64]",     "[65]", "[66]",   "[67]",
			    "[68]",     "[69]", "[6A]",   "[6B]",
			    "[6C]",     "[6D]", "[6E]",   "[6F]",
			       "↑",        "↓",    "←",      "→",
			"GRAPHICS",     "EDIT",    "⏎",      "⌫",
			    "[KL]", "FUNCTION", "[7A]",   "[7B]",
			    "[7C]",     "[7D]", "[7E]", "CURSOR",
			  "â–ˆ",   "â–Ÿ",   "â–™",    "â–„",
			  "▜",   "▐",   "▚",    "▛",
			  "â–¥",   "â—¢",   "â—£",  '["]',
			"[⨳]", "[$]", "[⋈]",  "[∩]",
			"[(]", "[)]", "[>]",  "[<]",
			"[=]", "[+]", "[-]",  "[*]",
			"[/]", "[;]", "[,]",  "[.]",
			"[0]", "[1]", "[2]",  "[3]",
			"[4]", "[5]", "[6]",  "[7]",
			"[8]", "[9]", "[A]",  "[B]",
			"[C]", "[D]", "[E]",  "[F]",
			"[G]", "[H]", "[I]",  "[J]",
			"[K]", "[L]", "[M]",  "[N]",
			"[O]", "[P]", "[Q]",  "[R]",
			"[S]", "[T]", "[U]",  "[V]",
			"[W]", "[X]", "[Y]",  "[Z]",
			  "CODE",     "VAL",    "LEN",   "SIN",
			   "COS",    "TAN",    "ASN",    "ACS",
			   "ATN",     "LOG",    "EXP",    "INT",
			   "SQR",    "SGN",    "ABS",   "PEEK",
			   "USR",   "STR$",   "CHR$",    "NOT",
			   "AT",      "TAB",
			    "**",     "OR",    "AND",     "<=",
			    ">=",     "<>",   "TEMPO ",     "MUSIC ",
			   "SOUND ", "BEEP ", "NOBEEP ",
			   "LPRINT ",  "LLIST ",   "STOP ",
			  "SLOW ",   "FAST ",    "NEW ", "SCROLL ",
			  "CONT ",    "DIM ",    "REM ",    "FOR ",
			  "GOTO ",  "GOSUB ",  "INPUT ",   "LOAD ",
			  "LIST ",    "LET ",  "PAUSE ",   "NEXT ",
			  "POKE ",  "PRINT ",   "PLOT ",    "RUN ",
			  "SAVE ",   "RAND ",     "IF ",    "CLS ",
			"UNPLOT ",  "CLEAR ", "RETURN ",   "COPY " }

function love.draw()
    love.graphics.print("Hello World", 400, 300)
end

function nextByte(name, bytes)
	pointer = pointer + string.len(bytes)
	number = string.byte(bytes, 1, -1)
	io.write(string.format("%-6s %5u   %02X", name, number, number))
	if name == "VERSN" then
		version = number
		if number == 0 then
			io.write(" ZX81 file format")
		else
			io.write(" Lambda 8300 file format")
		end
	end
	io.write("\n");
end

function nextWord(name, bytes)
	pointer = pointer + string.len(bytes)
	local number = string.byte(bytes, 1)
		+ string.byte(bytes, 2) * 256
	io.write(string.format("%-6s %5u %04X\n", name, number, number))
	if name == "D-FILE" then dfile = number end
end

function nextLine(bytes)
	pointer = pointer + string.len(bytes)
	linelen = string.byte(bytes, 3) + string.byte(bytes, 4) * 256
	io.write(string.format("%5u %04X %04X ",
		string.byte(bytes, 1) * 256 + string.byte(bytes, 2),
		string.byte(bytes, 1) * 256 + string.byte(bytes, 2),
		linelen));
end

function nextLineContent(bytes)
	pointer = pointer + string.len(bytes)
	zx2asc(bytes)
	io.write("\n                ")
	for _, b in pairs{string.byte(bytes, 1, -1)} do
		io.write(string.format("%02X ", b))
	end
end

function nextHex(name, bytes)
	pointer = pointer + string.len(bytes)
	local only2 = ""
	local only2num = 0
	if (string.len(bytes) == 2) then
		only2 = "   "
		only2num = 1
	end
	io.write(string.format("%-9s%s", name, only2))
	for _, b in pairs{string.byte(bytes, 1, -1)} do
		io.write(string.format("%02X ", b))
	end
	io.write(string.rep("   ", 16 - only2num - string.len(bytes)))
	io.write(" ")
	zx2asc(bytes)
	io.write("\n")
end

function zx2asc(bytes)
	for _, b in pairs{string.byte(bytes, 1, -1)} do
		if version == 0
		then io.write(zxChar[b+1])
		else io.write(lambdaChar[b+1]) end
	end
end

function love.load()
    local block = 16
    local bytes = f:read(1)
	nextByte("VERSN", bytes)
    bytes = f:read(2)
	if version == 0
	then nextWord("E-PPC", bytes)
	else nextWord("NXTLIN", bytes) end
    bytes = f:read(2)
	if version == 0
	then nextWord("D-FILE", bytes)
	else nextWord("PROGRM", bytes) end
    bytes = f:read(2)
	nextWord("DF-CC", bytes)
    bytes = f:read(2)
	nextWord("VARS", bytes)
    bytes = f:read(2)
	nextWord("DEST", bytes)
    bytes = f:read(2)
	nextWord("E-LINE", bytes)
    bytes = f:read(2)
	nextWord("CH-ADD", bytes)
    bytes = f:read(2)
	nextWord("X-PTR", bytes)
    bytes = f:read(2)
	nextWord("STKBOT", bytes)
    bytes = f:read(2)
	nextWord("STKEND", bytes)
    bytes = f:read(1)
	if version == 0
	then nextByte("BERG", bytes)
	else nextByte("FLAGS", bytes) end
    bytes = f:read(2)
	nextWord("MEM", bytes)
    bytes = f:read(1)
	if version == 0
	then nextByte("-", bytes)
	else nextByte("MUNIT", bytes) end
    bytes = f:read(1)
	nextByte("DF-SZ", bytes)
    bytes = f:read(2)
	nextWord("S-TOP", bytes)
    bytes = f:read(3)
	nextHex("LAST-K", bytes)
    bytes = f:read(1)
	nextByte("MARGIN", bytes)
    bytes = f:read(2)
	if version == 0
	then nextWord("NXTLIN", bytes)
	else nextWord("E-PPC", bytes) end
    bytes = f:read(2)
	nextWord("OLDPPC", bytes)
    bytes = f:read(1)
	nextByte("FLAGX", bytes)
    bytes = f:read(2)
	nextWord("STRLEN", bytes)
    bytes = f:read(2)
	nextWord("T-ADDR", bytes)
    bytes = f:read(2)
	nextWord("SEED", bytes)
    bytes = f:read(2)
	nextWord("FRAMES", bytes)
    bytes = f:read(2)
	if version == 0
	then nextHex("COORDS", bytes)
	else nextWord("PPC", bytes) end
    bytes = f:read(1)
	nextByte("PR-CC", bytes)
    bytes = f:read(2)
	nextHex("S-POSN", bytes)
    bytes = f:read(1)
	nextByte("CDFLAG", bytes)
    bytes = f:read(16)
	nextHex("PRBUFF", bytes)
    bytes = f:read(16)
	nextHex("", bytes)
    bytes = f:read(1)
	nextHex("", bytes)
    bytes = f:read(16)
	nextHex("MEMBOT", bytes)
    bytes = f:read(14)
	nextHex("", bytes)
    bytes = f:read(2)
	if version == 0
	then nextHex("-", bytes)
	else nextByte("BLINK", bytes) end
    while true do
		if not bytes then break end
		if pointer >= dfile then
--			io.write(
--				string.format("pointer:%u,dfile:%u\n",pointer,dfile))
			break
		end
	    bytes = f:read(4)
		nextLine(bytes)
		while linelen > 0 do
			if linelen > 16 then
				bytes = f:read(16)
				linelen = linelen - 16
				nextLineContent(bytes)
				io.write("\n                ")
			else
				bytes = f:read(linelen)
				nextLineContent(bytes)
				io.write("\n");
				linelen = 0
			end
		end
 	end
    bytes = f:read(1)
	nextHex("D-FILE", bytes)
	for i=1,24,1 do
    	bytes = f:read(16)
		nextHex("", bytes)
    	bytes = f:read(16)
		nextHex("", bytes)
    	bytes = f:read(1)
		nextHex("", bytes)
	end
	if version == 255 then
	    while true do
			if not bytes then break end
	    	bytes = f:read(4)
			nextLine(bytes)
			while linelen > 0 do
				if linelen > 16 then
					bytes = f:read(16)
					linelen = linelen - 16
					nextLineContent(bytes)
					io.write("\n                ")
				else
					bytes = f:read(linelen)
					nextLineContent(bytes)
					io.write("\n");
					linelen = 0
				end
			end
 		end
 	end
    while true do
		if not bytes then break end
        local bytes = f:read(block)
		if not bytes then break end
		for _, b in pairs{string.byte(bytes, 1, -1)} do
			io.write(string.format("%02X ", b))
		end
		io.write(string.rep("   ", block - string.len(bytes)))
		io.write(" ", string.gsub(bytes, "%c", "."), "\n")
	end
    love.event.quit()
end
Martin
https://zx.rtin.be
ZX81, Lambda 8300, Commodore 64, Mac G4 Cube
Power 3000
Posts: 27
Joined: Sat Oct 06, 2018 8:13 am

Re: Programs on tape

Post by Power 3000 »

Playing Kampvogn
Playing Kampvogn
Downloadet Kampvogn P file, it is working.

Merry christmas
User avatar
XavSnap
Posts: 1940
Joined: Sat May 10, 2008 4:23 pm
Location: 'Zx81 France' Fb group.

Re: Programs on tape

Post by XavSnap »

Hi,
mrtinb wrote: Mon Dec 17, 2018 10:46 am I'm trying to show a Lambda P-file as source. I'm not trying to get source to P-file.
I have changed the SNAlist (SPECTRUM) to convert a 'p' file to a text file, with my Text2P converter compatibility...
viewtopic.php?f=18&t=3069
Xavier ...on the Facebook groupe : "Zx81 France"(fr)
User avatar
mrtinb
Posts: 1906
Joined: Fri Nov 06, 2015 5:44 pm
Location: Denmark
Contact:

Re: Programs on tape

Post by mrtinb »

I've made an update to the tool mentions before.

viewtopic.php?f=11&t=3070

Now I'll hopefully find some more errors when looking through the uploaded files.
Martin
https://zx.rtin.be
ZX81, Lambda 8300, Commodore 64, Mac G4 Cube
User avatar
mrtinb
Posts: 1906
Joined: Fri Nov 06, 2015 5:44 pm
Location: Denmark
Contact:

Drive

Post by mrtinb »

English translation for: Drive.

Code: Select all



   INPUT DIFFICULTY (1-5)
          
          

Code: Select all

     [ROUND]
        1

       🕷️

   👻---👻
    👻---👻
     👻---👻
   👻---👻
  👻---👻
    👻---👻
   👻---👻

Code: Select all

[SCORE]
190


[NEW GAME, PRESS "ENTER"]
Martin
https://zx.rtin.be
ZX81, Lambda 8300, Commodore 64, Mac G4 Cube
Power 3000
Posts: 27
Joined: Sat Oct 06, 2018 8:13 am

Re: Programs on tape

Post by Power 3000 »

Hi Martin, do you want me to try and record Drive again, or is the one you have okay?
User avatar
mrtinb
Posts: 1906
Joined: Fri Nov 06, 2015 5:44 pm
Location: Denmark
Contact:

Re: Programs on tape

Post by mrtinb »

Power 3000 wrote: Thu Dec 27, 2018 1:56 pm Hi Martin, do you want me to try and record Drive again, or is the one you have okay?
The version of Drive.p that XavSnap uploaded is fine. I just made a post to show the translation.
Martin
https://zx.rtin.be
ZX81, Lambda 8300, Commodore 64, Mac G4 Cube
User avatar
mrtinb
Posts: 1906
Joined: Fri Nov 06, 2015 5:44 pm
Location: Denmark
Contact:

Re: Programs on tape

Post by mrtinb »

Hi Power 3000 / Jørgen :-)

Does any of the uploaded software use the Colour Packs you have?
Martin
https://zx.rtin.be
ZX81, Lambda 8300, Commodore 64, Mac G4 Cube
Power 3000
Posts: 27
Joined: Sat Oct 06, 2018 8:13 am

Re: Programs on tape

Post by Power 3000 »

I have never tried the color funktion, it was two i got for 2 month ago, it was together with the programs and more. So i dont know if some of the programs have the funktions.
Post Reply