Using Just Basic or Liberty Basic to test a zx spectrum program

The place for codemasters or beginners to talk about programming any language for the Spectrum.
llewelyn
Manic Miner
Posts: 205
Joined: Thu Feb 22, 2018 3:27 pm
Location: virginias eastern shore
Contact:

Re: Using Just Basic or Liberty Basic to test a zx spectrum program

Post by llewelyn »

Hikoki are you asking me that question?

Because if so I don't understand it. All I can say is that I save my files without extensions EG:- Save "tank4' and then open that with Notepad set to Allfiles and then I can paste the code here or wherever.

Also- ONLY if its Sinclair Basic commands not any of the extended functions - I can load it into an emulator such as BASin and then save it as a snapshot. Import the snapshot into an emulator that will save to tape! A rather convoluted process and I'm sure you'll get a better answer from someone more knowledgeable!

However the really important point is that SpecBAS output really isn't meant to be run on any Spectrum or clone, its solely for PC use only. That doesnt mean that its impossible to use strictly Sinclair Basic commands to create a program to be used on a Speccy or emulator thereof but its kind of pointless.

Better is the other way round. You can take a Sinclair Basic program thats dreadfully slow and import it into SpecBAS and see it fly. Bear in mind the obvious pitfalls though, such as the different PLOT and PRINT positions, a few similar differences and addresses if you're POKEing or PEEKing, stuff like that but theoretically it can be done. I'd wait for Dunny or ASH-II to comment though because I'm not sure about what I've said.
hikoki
Manic Miner
Posts: 576
Joined: Thu Nov 16, 2017 10:54 am

Re: Using Just Basic or Liberty Basic to test a zx spectrum program

Post by hikoki »

I mean most of us are more interested in the original machine so it would be great to translate SpecBas code to machine code. Anyways I'll play with SpecBas eventually.
User avatar
ZXDunny
Manic Miner
Posts: 498
Joined: Tue Nov 14, 2017 3:45 pm

Re: Using Just Basic or Liberty Basic to test a zx spectrum program

Post by ZXDunny »

Yeah, taking SpecBAS code and translating it to z80 won't happen. Unless your BASIC code strictly only uses commands and functions from Sinclair BASIC would that work and tbh you'd be better off pasting it into BASin. If you use any of SpecBAS's other strengths - sprites, 256 colour graphics, updated commands and functions then I'm afraid that even tightly coded z80 won't run at any acceptable speed.

llewelyn is correct - it's great for running slow Sinclair BASIC code blisteringly fast, but nothing more speccy-related than that.

(unless you're in it for the nostalgia of coding in BASIC like the 80s, but with modern speeds).
hikoki
Manic Miner
Posts: 576
Joined: Thu Nov 16, 2017 10:54 am

Re: Using Just Basic or Liberty Basic to test a zx spectrum program

Post by hikoki »

well one idea would be to create a subset of different Basic commands : Sinclair Basic, Boriel, compilable SpecBas, full SpecBas. So the IDE could be set to work only on either of these modes. The ultimate tool for all the Speccy Basic dialects.
Who knows if this could be useful to code in fast Basic right from some bare emulator for the Pi.. perhaps using two Pis communicating with each other.. I know, these things probably won't happen..
User avatar
ZXDunny
Manic Miner
Posts: 498
Joined: Tue Nov 14, 2017 3:45 pm

Re: Using Just Basic or Liberty Basic to test a zx spectrum program

Post by ZXDunny »

hikoki wrote: Thu May 24, 2018 8:24 pmI know, these things probably won't happen..
And you'd be right!
hikoki
Manic Miner
Posts: 576
Joined: Thu Nov 16, 2017 10:54 am

Re: Using Just Basic or Liberty Basic to test a zx spectrum program

Post by hikoki »

ZXDunny wrote: Fri May 25, 2018 12:12 am
hikoki wrote: Thu May 24, 2018 8:24 pmI know, these things probably won't happen..
And you'd be right!
No worries! :) if the IDE is as good as Basin it'll be useful to throw any Sinclair Basic program to see how could be expanded in a feasible compiled version. Trying to find a SpecBas <-> ZXBasic workflow looks like fun to me.
Post Reply