Page 1 of 1

Plus one, minus one

Posted: Sun Jan 13, 2019 9:15 am
by equinox
You, YES YOU, just got hired to improve Spectrum BASIC by removing one stupid sucky keyword, and adding a new cool one. What will you remove, and what will you add (and why)?

Hints:
* You will be tempted to remove important stuff that you personally don't use, like SIN/COS/TAN, or CLOSE #, but you have to make a convincing argument about why. And you better believe that some graph-drawing, microdrive-owning Ba**ards will be sitting here judging you.
* Your new keyword should be realistic. Like, not, adding the keyword GTA that turns the Speccy into a console game. You jerk.
* We're doing 48 BASIC. Anyone who wants to remove SPECTRUM or PLAY will get my boot up their scrawny arse, that's too easy (also PLAY is really good!).

Here's my vote: (DO NOT READ UNTIL YOU MADE YOUR OWN DECISION)

* I remove <> (yes, that's technically a keyword, f*** you) because it doesn't reduce the expressibility of the language and you can just write NOT(a=b).
* I add: INSTR, because every cool BASIC has got that, and if you ever tried to find one string in another string in Spectrum BASIC, Jesus Christ, you'll be bleeding in a bathtub before you're four characters deep.

Re: Plus one, minus one

Posted: Sun Jan 13, 2019 9:38 am
by R-Tape
Hehe, good thread.

I'd remove GO TO* because I consider it harmful, and I'd replace it with a command that allows you to LDIR data. I guess it'd have to be called SPUNKDAT. So SPUNKDAT 32768 SCREEN$ would LDIR 6912 bytes from 32768 to the display file.

*or INVERSE, because not once has it been used for the purposes of good. I defy you to prove me wrong.

Re: Plus one, minus one

Posted: Sun Jan 13, 2019 9:42 am
by equinox
The Sam Coupé had a graphics copy command in BASIC, I think it was called BLITZ. Sam BASIC is ****ing amazing, pity it was stillborn.

BTW, GOTO may be harmful, but what are the alternatives? We don't even have scoped functions. Ouch -- oh wait, I've just remembered you can GOTO line *and* statement with some POKE trick. That's not allowed! NO! Can I edit my... ughhh too late.

INVERSE is a good call because you can fake it with INK and PAPER (and maybe some dirty PEEKing if you can't remember what colours you already had). In fact you could ask why there isn't an UNBRIGHT or UNFLASH command. I think they were just trying to stay relevant with the hip modern teletext. lol. kill me

Re: Plus one, minus one

Posted: Sun Jan 13, 2019 9:58 am
by R-Tape
Aye, dropping GO TO may be too radical, so I'll lose INVERSE. Having said that—without GO TO, SQIJ would never have been possible.

BLITZ? Ridiculous name.

Re: Plus one, minus one

Posted: Sun Jan 13, 2019 10:18 am
by MatGubbins
Get rid of Continue.

Add a Plot Graphic style command that would place a character at pixel position. This could be used with the OVER command so that it would merge with whatever was on the screen at the time.

Would a FAST command work for the Spectrum? Turn the screen off, but allow printing to the screen area, Spectrum runs a bit quicker, then switch fast off and the screen appears again, with all the text/graphics etc drawn, back to normal screen. A bit like Fairlight...

Re: Plus one, minus one

Posted: Sun Jan 13, 2019 10:25 am
by equinox
Haha. I like it! But dude you would miss CONTINUE when you are debugging. You've been spoiled with emulators and snapshots.

I am intrigued by your char-at-pixel thing (PRINT AT # ??). Pretty cool but it seems rather specialised, how is this useful to a typical programmer?

The FAST/SLOW as you remember was a ZX81 thing, but frankly if you're trying to scrape a few dirty cycles off the screen that way then you should probably be using Z80. Were you really thinking about BASIC? hmmm? hmm? huh? huh? were you? ahhh? oh?

Re: Plus one, minus one

Posted: Sun Jan 13, 2019 10:45 am
by R-Tape
MatGubbins wrote: Sun Jan 13, 2019 10:18 am Add a Plot Graphic style command that would place a character at pixel position. This could be used with the OVER command so that it would merge with whatever was on the screen at the time.
Good call. You're thinking sprites in BASIC? Even better would be PLOTSPRITE, that does it with a 16x16 graphic. But then we are fully into 'it's not a games machine' territory.

The downside is that it could have robbed us many a naff UDG game.

Re: Plus one, minus one

Posted: Sun Jan 13, 2019 10:59 am
by equinox
lol. You're supposed to be adding a BASIC command, not some secret hack for game making. I forgot that anyone even thinking about Spectrum BASIC in 2019 is a leeto haxor (maybe we should add a special keyword to access the dirty machine code we hid in a REM in line 9998, huh?) You sluts.

Q: what feature do you really want in visual basic?
A: we want it to be C#.

The "spirit" of my original question was more like: if you were a naive, "hey i just got a computer!" guy in 1982, what command would you... ah f*** it. Happy new year to all.

Re: Plus one, minus one

Posted: Sun Jan 13, 2019 11:04 am
by PROSM
I would remove COS, since there would be no loss in functionality - any code that called for "COS x" could just be rewritten as "SIN 90+x".

In its place, I would agree with [mention]MatGubbins[/mention] for a "plot graphic" command, but instead of making it a separate command altogether, I would just make it a pixel-precise version of the AT keyword (maybe called ATP). Then you could have not only UDGs anywhere on the screen, but also be able to centre strings with odd numbers of characters exactly in the middle - strings being slightly off-centre really gets up my nose, but I don't really know why! :lol:

Re: Plus one, minus one

Posted: Sun Jan 13, 2019 11:54 am
by Ralf
I would throw away all stuff supposed to work with microdrives: OPEN#, CLOSE#, MOVE, ERASE,CAT etc. Microdrives turned out to be crap, 95% of people didn't have them, so the commands were useless.

And my new command would be SPRITE spriteNr,X,Y ;) Drawing sprites directly from Basic would be really great, probably a lot of software would use it.

Re: Plus one, minus one

Posted: Sun Jan 13, 2019 3:11 pm
by Gazzapper
Agree that INVERSE could be removed

Would add:
MID$(str$,start, length)
or
SPRITE command for UDG placement at pixel coords

(sprite being my pref!)

Re: Plus one, minus one

Posted: Sun Jan 13, 2019 6:14 pm
by equinox
Ralf: hmmm, you realise that good disk systems used those commands too? Not just the microdrive. (Like Opus, Disciple, Plus D, +3 disk, etc.)

SPRITE sounds very sweet but it really needs hardware support... Speccy can't do sprites very well.

Hmm, I increasingly think I should have called this thread "let's reinvent Andy Wright's Beta BASIC".

Re: Plus one, minus one

Posted: Mon Jan 14, 2019 11:51 am
by Joefish
Get rid of VAL$ and have RENUMBER.
Get rid of FLASH and let us have separate BRIGHT bits for INK and PAPER (although that takes some ULA changes too).
Also need the PRINT command to actually move the print position one character up/down/left/right when you print a cursor character. Or at least a code that will move to the next line but at the last specified horizontal position, for printing 2x2 and 3x3 UDG sprites.
Make DRAW absolute, not relative.
Get rid of DEF FN and have a command to scroll the screen one character up/down/left/right.
Get rid of FN and have a command to copy a block of data from one memory location to another.
Have a system variable that lets you divert printing, drawing, etc. to another address in memory.

Re: Plus one, minus one

Posted: Mon Jan 14, 2019 5:49 pm
by AndyC
Remove FLASH because it's horrific, add in a FILL for flood filling regions of the screen.

Re: Plus one, minus one

Posted: Mon Jan 14, 2019 7:22 pm
by R-Tape
AndyC wrote: Mon Jan 14, 2019 5:49 pm Remove FLASH because it's horrific,
Do you mean the command only, or the property as well?
add in a FILL for flood filling regions of the screen.
Good call, as long as it's not painfully slow.

Re: Plus one, minus one

Posted: Mon Jan 14, 2019 7:35 pm
by Morkin
+1 for getting rid of FLASH, the most you'd probably miss out on would be animated loading screens.

Not sure what extra I might have wanted in BASIC in the 80s (except more memory and speed).

A few people have mentioned sprite related commands, maybe some sort of PRINT MASK command to allow you to print characters, UDGs over restorable backgrounds?

Code: Select all

PRINT MASK AT 10,10;"X"
...a bit like OVER 1, but on PRINTing it'd store the original 8 bits in that character square somewhere, and restore them at next PRINT MASK command.

Re: Plus one, minus one

Posted: Mon Jan 14, 2019 11:55 pm
by AndyC
R-Tape wrote: Mon Jan 14, 2019 7:22 pm
AndyC wrote: Mon Jan 14, 2019 5:49 pm Remove FLASH because it's horrific,
Do you mean the command only, or the property as well?
I'd happily lose both.

Re: Plus one, minus one

Posted: Tue Jan 15, 2019 9:15 am
by ZXDunny
Remove FLASH gets my vote, but not only is there a new keyword available - now you also have another bit in your attrs to be used for summats else.

New keyword would be COMPILE addr,n$ which dumps a compiled BASIC statement to an address in memory. Would be handy for so many things to speed up those slow bits of BASIC a touch.

Re: Plus one, minus one

Posted: Tue Jan 22, 2019 1:02 am
by equinox
Oh god, for a while I didn't dare to check on this thread again, but I'm glad I did.

Joefish: this wasn't "let's sneakily fix every bug in the ROM"!
Dunny: this wasn't "can we slowly turn ZX BASIC into LISP before anyone notices" (but nice try)!
AndyC wins the big prize for "remove FLASH because it's horrific" because, haha, it really is, and the way he phrased it made me laugh. Are you Andy Cadley from css?

Re: Plus one, minus one

Posted: Tue Jan 22, 2019 2:50 am
by AndyC
equinox wrote: Tue Jan 22, 2019 1:02 am Oh god, for a while I didn't dare to check on this thread again, but I'm glad I did.

Joefish: this wasn't "let's sneakily fix every bug in the ROM"!
Dunny: this wasn't "can we slowly turn ZX BASIC into LISP before anyone notices" (but nice try)!
AndyC wins the big prize for "remove FLASH because it's horrific" because, haha, it really is, and the way he phrased it made me laugh. Are you Andy Cadley from css?
Guilty as charged. And it is horrific.

Re: Plus one, minus one

Posted: Tue Jan 22, 2019 2:54 am
by equinox
A little-known crime committed by the Bas**rd FLASH was: let's design the entire font to fit in 6x6 instead of 8x8, so that it won't be weird and asymmetrical when we flash it.

As a result, the Spectrum font has @ ~ $ that even a mother couldn't love.