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.
MrPixel
Microbot
Posts: 170
Joined: Sat Mar 24, 2018 7:42 pm

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

Post by MrPixel »

would it work?

or what about Bloodshed dev C++ :?:
Nomad
Manic Miner
Posts: 600
Joined: Thu Dec 28, 2017 12:38 pm

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

Post by Nomad »

Image

How do you mean? Like a unit test? Or prototype?
AndyC
Dynamite Dan
Posts: 1387
Joined: Mon Nov 13, 2017 5:12 am

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

Post by AndyC »

You wouldn't be able to take a program written in Just Basic or Liberty Basic and have the source code work as-is on a Speccy, with the exception of very trivial programs. BASIC isn't a standardised language and there are far too many subtle differences between the various versions. You might be able to prototype something in a Windows based version and then port it across by translating the lines.

As for C++, I don't think there is a compiler for the Spectrum. You'd be better of with a pure C variant, which is more likely to be portable (or at least as portable as C can be).
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 »

ZXBasic is a modern Basic language.
http://boriel.com/wiki/en/index.php/ZXBasic
Besides I think the latest version is compatible with most of Sinclair Basic dialect.
User avatar
PeterJ
Site Admin
Posts: 6854
Joined: Thu Nov 09, 2017 7:19 pm
Location: Surrey, UK

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

Post by PeterJ »

I'm unsure of what you are now trying to achieve, but if you want to program in a version of BASIC similar to Spectrum BASIC on a OC then go for Specbas from Paul Dunn:

https://sites.google.com/site/pauldunn/

Do you have experience of using C? If so try Z88DK.
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 »

Indeed, SpecBAS will run pretty much 90% of BASIC code from a speccy without issues. Aside from having a bigger screen, more colours etc.
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 »

ZXDunny wrote: Thu May 17, 2018 8:28 pm Indeed, SpecBAS will run pretty much 90% of BASIC code from a speccy without issues. Aside from having a bigger screen, more colours etc.
Edit: Hmm, that URL above won't work. I must get a version up.

Ah yes, here you go:

https://drive.google.com/open?id=0B6gXs ... WhUZ1Rxc0k

Should you decide to have a play with it. If you want to see the demos, extract them to C:\Users\<username>\specbas\ and you're good to go. The doc file is pretty much complete, with some new commands and features yet to be added.
MrPixel
Microbot
Posts: 170
Joined: Sat Mar 24, 2018 7:42 pm

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

Post by MrPixel »

No luck. the site gives me a 404 error for the windows version.
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 »

MrPixel wrote: Fri May 18, 2018 10:56 pm No luck. the site gives me a 404 error for the windows version.
Is that for Boriel's ZXBASIC or my SpecBAS?
User avatar
PeterJ
Site Admin
Posts: 6854
Joined: Thu Nov 09, 2017 7:19 pm
Location: Surrey, UK

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

Post by PeterJ »

Use the Goggle drive link that was provided for SpecBAS. That works fine.
MrPixel
Microbot
Posts: 170
Joined: Sat Mar 24, 2018 7:42 pm

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

Post by MrPixel »

PeterJ wrote: Sat May 19, 2018 11:36 am Use the Goggle drive link that was provided for SpecBAS. That works fine.
it works but i can't open anything other than the main folders, even when double clicking
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 »

Go to Dunnys message on Page 1 where you'll see a box saying 'Whoops there was a problem with the preview' and click on the Download button. It does work, I just tested it. You'll be presented with a file called SpecBas .zip
MrPixel
Microbot
Posts: 170
Joined: Sat Mar 24, 2018 7:42 pm

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

Post by MrPixel »

ZXDunny wrote: Sat May 19, 2018 9:59 am
MrPixel wrote: Fri May 18, 2018 10:56 pm No luck. the site gives me a 404 error for the windows version.
Is that for Boriel's ZXBASIC or my SpecBAS?
your specbas
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, I'm not seeing the problem tbh. It's right there in the post. As said, you need to download the zip file, if the embedded gdrive plugin confuses you.
MrPixel
Microbot
Posts: 170
Joined: Sat Mar 24, 2018 7:42 pm

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

Post by MrPixel »

ZXDunny wrote: Sun May 20, 2018 9:01 am Yeah, I'm not seeing the problem tbh. It's right there in the post. As said, you need to download the zip file, if the embedded gdrive plugin confuses you.
i got it from a different site. works great
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 »

MrPixel wrote: Tue May 22, 2018 2:19 am
ZXDunny wrote: Sun May 20, 2018 9:01 am Yeah, I'm not seeing the problem tbh. It's right there in the post. As said, you need to download the zip file, if the embedded gdrive plugin confuses you.
i got it from a different site. works great
Then yours is out of date :)
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 »

MrPixel wrote: Fri May 18, 2018 10:56 pm No luck. the site gives me a 404 error for the windows version.
Try this link:
drive.google.com/uc?export=download&id=0B6gXsz43xir_eV9JbWhUZ1Rxc0k
MrPixel
Microbot
Posts: 170
Joined: Sat Mar 24, 2018 7:42 pm

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

Post by MrPixel »

got it. i don;t see the point though.
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 »

What point is it that you don't see? This is a polite enquiry NOT a sarcastic remark!

The point of not using an out of date version?
Because if so, you should realize that SpecBAS is under development, it keeps getting better and the more people try it and ask questions about 'how do I do this' or 'why is this happening?' then the better it will get.

The point of using it at all?
Well I'm doing my best to come to grips with it because it resembles Sinclair Basic which is a huge relief if you're used to using that Basic. Want to find out how bloody awful a Basic dialect can be? Try VisualBasic if its even still around and hasnt been burnt at the stake.

If you do have some familiarity with Sinclair Basic, if perhaps you always wanted to get more out of it without having to resort to learning machine code, SpecBAS gives you that sort of power and speed.

If you go to the SpecBAS website:-
http://www.zxspectrum4.net/forum/viewforum.php?f=6
you can see various tutorials and examples which are, in my opinion, pretty convincing demonstrations of what can be done with it.

I'd be the first to admit that I'm having a wee bit of a struggle getting to grips with it but I've gotten lots of help from Paul Dunn who created it and ASH-II who seems to be involved with getting BASin to work with it - I might not be right about the details but he's been very helpful to me. It would be great if more people got involved as we can all help each other. Cheers Mike.
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 »

Could there be an export to tape?
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!
Post Reply