I've started writing a game in Sinclair basic and wanted to compile it to see if the speed increase would make it worth finishing. I was planning on trying Boriel's ZX Basic compiler.
Unfortunately, I wrote it in the Marvin emulator and I've only got a .z80 snapshot to work with. I don't fancy manually copying it into a text file unless it's the only option!
Converting a .z80 snapshot for compiling?
- Ast A. Moore
- Rick Dangerous
- Posts: 2641
- Joined: Mon Nov 13, 2017 3:16 pm
Re: Converting a .z80 snapshot for compiling?
Use Fuse and its emulated ZX Printer feature to LLIST your BASIC to a standard TXT file.
Fuse can open Z80 snapshots. Alternatively, you can save your BASIC listing to a TAP file from Marvin (if it supports this feature).
Fuse can open Z80 snapshots. Alternatively, you can save your BASIC listing to a TAP file from Marvin (if it supports this feature).
Every man should plant a tree, build a house, and write a ZX Spectrum game.
Author of A Yankee in Iraq, a 50 fps shoot-’em-up—the first game to utilize the floating bus on the +2A/+3,
and zasm Z80 Assembler syntax highlighter.
Author of A Yankee in Iraq, a 50 fps shoot-’em-up—the first game to utilize the floating bus on the +2A/+3,
and zasm Z80 Assembler syntax highlighter.
Re: Converting a .z80 snapshot for compiling?
Brilliant, thank you. That sounds like just what I need, I'll give it a try. Marvin only saves to .z80 as far as I can see.
Re: Converting a .z80 snapshot for compiling?
BASIN lets you load a snapshot, then view the BASIC listing in its text editor. I don't know about saving as plain text but you should be able to COPY + PASTE it into Notepad or something.
Re: Converting a .z80 snapshot for compiling?
Thanks Joefish, that's another option and sounds easy.
I managed to get the plain text file from Fuse and fed it to ZX Basic Compiler. My issue now is I get errors on every line except REM lines, to the point where the compiler gives up after line 15
I shall have to look at the documentation I think!
I managed to get the plain text file from Fuse and fed it to ZX Basic Compiler. My issue now is I get errors on every line except REM lines, to the point where the compiler gives up after line 15
I shall have to look at the documentation I think!
- Einar Saukas
- Bugaboo
- Posts: 3147
- Joined: Wed Nov 15, 2017 2:48 pm
Re: Converting a .z80 snapshot for compiling?
In BASIN you can save program as BAS file, then open it in any text editor.
Re: Converting a .z80 snapshot for compiling?
Thanks Einar, I managed to save the .z80 as .bas in BASIN but the file isn't visible except from the BASIN Open dialog. It's icon has a padlock and I can't drag it to Notepad to open it. Thanks anyway.
I managed to get the text file from Fuse though and after deleting extra spaces I managed to get ZX Basic Compiler to read it. Unfortunately I get a lot of errors and the compiler gives up. I don't know where to begin with them and after looking for help on the compiler pages I think it's well above my ability to sort them out
Anyway, thanks for all the help you gave guys.
I managed to get the text file from Fuse though and after deleting extra spaces I managed to get ZX Basic Compiler to read it. Unfortunately I get a lot of errors and the compiler gives up. I don't know where to begin with them and after looking for help on the compiler pages I think it's well above my ability to sort them out
Anyway, thanks for all the help you gave guys.
Re: Converting a .z80 snapshot for compiling?
LLIST doesn't seem the best way to me. Have you tried listbasic from fuse-utils?Jodo wrote: ↑Thu Apr 12, 2018 9:27 pm I managed to get the text file from Fuse though and after deleting extra spaces I managed to get ZX Basic Compiler to read it. Unfortunately I get a lot of errors and the compiler gives up. I don't know where to begin with them and after looking for help on the compiler pages I think it's well above my ability to sort them out
Code: Select all
listbasic snapshot.z80 > source.txt
- Einar Saukas
- Bugaboo
- Posts: 3147
- Joined: Wed Nov 15, 2017 2:48 pm
Re: Converting a .z80 snapshot for compiling?
Boriel's ZX BASIC doesn't have exactly the same syntax as Sinclair BASIC. For instance, every IF requires a corresponding END IF.
You need to read Boriel's documentation, then make the necessary changes before compiling your code.
You need to read Boriel's documentation, then make the necessary changes before compiling your code.
Re: Converting a .z80 snapshot for compiling?
Thanks serbalgi, I've just tried listbasic. It seems to format the text exactly the same way as using llist from Fuse so still have to delete the extra spaces. It's not a huge issue though with only 204 lines of code so far and if I choose to continue I think I'll do it in ZX-Editor from this point! (Doing it on a Kindle Fire using a virtual Spectrum keyboard was a little too masochistic I think )
I've been through what documentation I can find on Boriel's site and wiki, I'm using the latest version of the compiler and I read something yesterday on the forum about ":End If" no longer being required and also tried using the --sinclair tag. Those errors are still there but I got rid of a third of them by changing a variable name which was also an array name - it worked okay in the BASIC but not accepted in the compiler. The BASIC itself runs fine, just a bit too slow to be truly playable and I still have some more collision detection to add! Anyway, going to have another look at the other errors now, I think 3 were about strings - which I haven't used!?
I've been through what documentation I can find on Boriel's site and wiki, I'm using the latest version of the compiler and I read something yesterday on the forum about ":End If" no longer being required and also tried using the --sinclair tag. Those errors are still there but I got rid of a third of them by changing a variable name which was also an array name - it worked okay in the BASIC but not accepted in the compiler. The BASIC itself runs fine, just a bit too slow to be truly playable and I still have some more collision detection to add! Anyway, going to have another look at the other errors now, I think 3 were about strings - which I haven't used!?