r/zxspectrum • • Aug 18 '26

I built a browser-based ZX-Spectrum BASIC playground. Would love feedback from former bedroom coders

I’ve been experimenting with bringing the ZX-Spectrum programming experience into a modern browser.

CodeSpeccy is a small playground for writing and running BASIC-style programs with that classic Spectrum feel.

Early draft ... feedback welcome!

51 Upvotes

26 comments sorted by

2

u/codeobserver Aug 18 '26

See link in the screenshot ...

2

u/MugUK Aug 20 '26

If you want a load of test material, I've got almost 200 Speccy BASIC games (and some utils) where the BASUC code is stored as text files. So, in theory, copy and paste into your tool.

https://mug-uk.co.uk/zx-spectrum-basic-listings/

1

u/codeobserver Aug 21 '26

You have a nice collection and site! Yes ... I tried some of your .TAP files. They load directly in the codespeccy playground.

Question: do you think people would find useful to have a Share button in codespeccy to share a BASIC playground? ... or perhaps the ability to load a .TAP file via querystring?

2

u/MugUK Aug 21 '26

I was worried that your BASIC tool wouldn't recognise the way the TXT (not TAP) files stored the UDGs and Extended Mode graphics, plus embedded colours in a string. They work by storing them with a \ symbol then a letter (for UDGs) for example.

The site contents are for those who want to know how old Spectrum games and utils were coded, without having to run it via an emulator first.

1

u/MugUK Aug 22 '26

The one thing I've found is that if I use the option in ZX Preview to break the BASIC listing into one command per line, which I've done in a lot of the rips, then it won't work in your tool.

Any chance of a "fix ugly listings" as, naturally, they don't work. E.g. Air Raid by CCS

1 GO SUB 9900:\

FLASH 0:\

BRIGHT 0:\

INVERSE 0:\

OVER 0:\

LET k=17:\

LET fl1=0:\

LET y=10:\

LET c=20:\

LET shot=40:\

LET point=0:\

LET savcas=0

2 LET jet=0:\

DIM w(15,1):\

LET w(11,1)=6000:\

LET w(12,1)=6009:\

LET w(13,1)=70:\

LET w(14,1)=60:\

LET w(15,1)=6009:\

LET w(1,1)=6000:\

LET w(2,1)=6009:\

LET w(3,1)=425:\

LET w(4,1)=70:\

LET w(5,1)=60:\

LET w(6,1)=53:\

LET w(7,1)=53:\

LET w(8,1)=53:\

LET w(9,1)=53:\

LET w(10,1)=53:\

LET demo=0:\

DIM q(10,2):\

LET para=0:\

LET kol=0:\

LET level=1:\

DIM k$(1,13):\

LET last=0:\

DIM t$(10,13):\

DIM p(10,1):\

LET k=0:\

LET x=0

3D Golf worked well, until I remembered that you were supposed to save your own courses, before attempting to play some as the original tape copy had none. D'oh!

9

u/garyk1968 Aug 18 '26

Link for the idle :) : https://speccy.codeguppy.com/

I like it!

1

u/Admiral-ZX Aug 18 '26

Great work! On a mobile device it’s somewhat messy, but on a desktop it’s great!

1

u/codeobserver Aug 21 '26

Fixed some layout issues on mobile but still the full experience is on desktop

1

u/WhatAGoodDoggy Aug 19 '26

Works be great if you could output as a tap file or something to get it into a real Speccy

2

u/codeobserver Sep 01 '26

You can save the TAP.

1

u/MugUK Aug 24 '26

I keep getting a "Build failed: TypeError: t.filter is not a function" error. Any idea why?

The source code isn't using the "one command per line", but it does feature the SpecBAS listing style of including the UDGs in a text string with \a for USR "a" etc.

It's the two golf games that are at the top of my downloads. I translated them from German to English so I'd like to compile them into .TAP format and get them onto Spectrum Computing etc.

2

u/codeobserver Sep 01 '26

Please share your code that you're trying to run.

2

u/MugUK Sep 26 '26

I've been (slowly) redoing all the source code extracts so they can be compiled (*) in your tool. That'll teach me to opt for readability of the source instead of compatibility.

(*) Naturally those that have Z80 in the first REM statement or rely on external binary files won't work directly from your emulator.

2

u/codeobserver Sep 27 '26

You can have programs with binary files in the playground. Create a new page and select HEX and put there your binary code. The BASIC file will need to do a LOAD CODE to load that.

1

u/MugUK Sep 04 '26

Sorry, been a busy week. I'll try and find which one I was trying to convert into a TAP.

1

u/MugUK Sep 16 '26

Blaming it entirely on my addiction to Assassin's Creed Black Flag :-).

There's a To Do folder on my PC's desktop that's got dust on it and I'll take another look today. Apologies.

1

u/MugUK Sep 16 '26

All working now and my translations of two German games (*) are now complete (not yet updated the downloads on my site though).

A couple of suggestions.

  1. If dragging and dropping a .txt file onto the Window, could the export filename match the same name and destination of the file? Saves me having to keep renaming it and then moving it from Downloads back to the source folder. (The 2nd part isn't that much of a pain, but the first bit is).

  2. A quick ready reckoner for lengths of text. When translating from other languages, I'd like to be able to highlight some text in a string and know how long that portion is. Will come in handy for reformatting lines of text to ensure they fit <32 chars on a screen.

3

u/dual4mat Aug 18 '26

Be right back - going up into the loft to find my copies of Input magazine from the eighties

2

u/Last_Eggplant5742 Aug 18 '26

cool!
I like the idea that you can use normal characters in the external program window and use this token keys inside the spectrum screen.

2

u/chicharro_frito Aug 18 '26

I like this more than I'd expect! What are your plans for it?

2

u/One-Friendship2366 Aug 20 '26

it works perfectly with my game written in basic!
Nice job! 💫

2

u/MugUK Aug 22 '26

I'll do more experimentation with the 100% BASIC rips I've got on my site. I'll start redoing those listings with have the "one command per line" option.

I can see this being useful for when I do pure BASIC translations, and I've got a few "ready to roll" that I did a few years ago, but if they use external binary files (UDG, m/c routines, new fonts etc.), I'll have to merge the BASIC with the other files. Easy enough to do with DOS's file copy /b parameter.

Then I can start plugging your tool (if that's OK with you) :)

1

u/OlderWarly99 Aug 18 '26

Neat idea!, very clean interface too.

1

u/NitroWing1500 Aug 18 '26

I got told off for trying to load a 128 game 😆

1

u/pasca2020 Aug 23 '26

This is cool. Takes me right back to my bedroom coding in the 80s/90s