PC Idea: Spectrum Environment and Interpreter

Propose new game/software design concepts or new game/software ideas. They can be as whimsical as you like, just be careful you don't ask someone to make it for you...
Post Reply
FFoulkes
Microbot
Posts: 161
Joined: Thu Feb 07, 2019 2:42 pm

PC Idea: Spectrum Environment and Interpreter

Post by FFoulkes »

Hi,

another idea for a Spectrum related PC program has come to my mind:
Imagine a PC program (written in C using SDL2), that creates a Spectrum-like environment. So a window appears that looks quite like an emulator window.
But it's not an emulator, it doesn't emulate the Z80 processor for example. Nevertheless, you can enter BASIC commands in the way you're used from the Spectrum (no keyword-modes though, so more +2 style), and these BASIC commands are executed in the same window on the PC. So this program also has to be a Sinclair BASIC interpreter, maybe it could use the extended dialect of ZX BASIC.
System related commands such as POKEing UDGs won't make much sense, so there should be different commands to achieve these things.
As a result, you finally would be able to write Sinclair BASIC programs, that run fast. Though not on the original hardware (as this isn't possible, except on a Spectrum Next), but in a window on a PC.
There's also no memory limitation as long as your PC has enough Gigabytes left.
There's also no reason, why you shouldn't have pixel-exact movement in BASIC.
There should also be a way to set the program's global speed. In the window's menu, but maybe even as a BASIC command. Or related to the Spectrum's speed, like in emulators: "Run at 600%" for example, but without risk of overstressing a processor emulation. The interpreter environment should stay calm then, while the executed part would run at increased speed.

Actually, I've already written something in that direction.
My script "vintageinput.py" (download here) opens such a window, and you can write something into it (I'm attaching a screenshot below). It's just not a BASIC interpreter (yet), so unfortunately nothing happens, when you enter something.
The script is written in Python/Pygame. The program I imagine should be in C and use SDL2 directly for additional speed.

Image
User avatar
Evil Genius
Manic Miner
Posts: 374
Joined: Sun Nov 12, 2017 9:45 pm

Re: PC Idea: Spectrum Environment and Interpreter

Post by Evil Genius »

Isn't that what SpecBAS is?
equinox
Dynamite Dan
Posts: 1073
Joined: Mon Oct 08, 2018 1:57 am
Location: SE England

Re: PC Idea: Spectrum Environment and Interpreter

Post by equinox »

As stated, Dunny's SpecBAS already does this. You can see some nice examples here:
https://www.youtube.com/watch?v=TCZhL8bqGVY
https://www.youtube.com/watch?v=_IhpguW18Uk
https://www.youtube.com/watch?v=gXZxyIllC0A

If you don't like Speccy BASIC, there is also R. T. Russell's "BBC BASIC for Windows":
https://www.bbcbasic.co.uk/bbcwin/bbcwin.html
firelord
Manic Miner
Posts: 566
Joined: Wed Nov 03, 2021 10:57 am
Location: Greece - Thessaloniki

Re: PC Idea: Spectrum Environment and Interpreter

Post by firelord »

Your description is very close to SpecBAS . You could also try Basin which is 100% compatible with siclair basic
User avatar
ZXDunny
Manic Miner
Posts: 498
Joined: Tue Nov 14, 2017 3:45 pm

Re: PC Idea: Spectrum Environment and Interpreter

Post by ZXDunny »

This is literally how SpecBAS was born. When I was a kid, I didn't have the brain necessary to code in m/c so I pined for the speed but wanted it in BASIC. Now we have PCs with multi-GHz CPUs I could realise my dream - and made SpecBAS. It runs natively on the PC and interprets Sinclair BASIC with extra bells and whistles. And it's fast. My 3900X runs the BASIC at the same speed as a 12GHz z80 running the ROM would.

The editor is an updated 128k style editor (but still makes use of the 48k command-line for Direct Commands). It's interactive; you can stop the program, modify it and then CONTINUE where it left off. Debugging with breakpoints and stepping is easy.

You can PRINT anywhere, no longer at character grid boundaries. 256 colours (32bit colour is a WIP but works), any resolution. Sprites (which animate and move while your BASIC runs) and UDGs (which don't, but you can have 128 of them). Fonts are full colour, 64 bytes per character. Many new graphics and maths commands. A full file system, file management etc.

And best of all, it's still in development after 10 years. I'm still refining it and adding new stuff.

But don't let that put you off - make a BASIC interpreter and show us what your vision of Sinclair BASIC on a PC would be. I'd love to see it.

https://github.com/ZXDunny is where you can find all my stuff.
Post Reply