Page 1 of 1

That thing with the bottom two lines

Posted: Mon Feb 12, 2024 9:07 pm
by equinox
Was it a good design idea for Spectrum BASIC to separate the upper and lower screen, and treat the "bottom two lines" differently?

Down sides:
• Writing to those lines is a special case. You can't PRINT AT y in a loop from y=0 to 23, for example.
• The lower screen has its own attributes, so INK 2: PRINT #0;"blah" does not honour the choice of red.
• It has no obvious default attributes either, so I can't get around the problem by doing INK #0;2
• I would imagine that it complicates redirection. For example, if I want to spool all output to a disk file, or the printer, I can redirect #2, but what will happen with PRINT #0 and #1? (I've actually never tried using the redirection features...)
• Er, why does #1 accept output anyway? I thought it was an input stream, for INPUT and INKEY$.

Up sides:
• Presumably made it easier for them to implement BASIC editor features, like "pull down a line for editing" in 48 mode, and the "Screen" function on the 128 context menu.
• Handy for "status line" displays, like the score in a game.
• ...?

Re: That thing with the bottom two lines

Posted: Mon Feb 12, 2024 10:14 pm
by AndyC
Not really. I can see why they did it to make BASIC line entry easier, but it's just very messy as an implementation. They really would've been better off with a full screen editor experience like the 128 had, it certainly would have made coding easier IMO. Or made more use of the streams functionality to enable separate text output windows on screen (like on the CPC) and then just had BASIC reset stream #1 for line editing purposes whenever a program ends (or not and let the user define their own weird layout I guess)

Re: That thing with the bottom two lines

Posted: Mon Feb 12, 2024 10:16 pm
by Bedazzle
Do you tried to POKE 23659,0 and then print?
Be careful, your program must not return/break! In that case it will hang.

Re: That thing with the bottom two lines

Posted: Mon Feb 12, 2024 10:26 pm
by 1024MAK
It's a hang over from the ZX80 (which only had a 4K byte ROM). The ZX81 ROM built on the ZX80 ROM (now 8K bytes in size). Then the ZX Spectrum ROM is a development of the ZX81 ROM...

Sinclair wanted maximum features for lowest cost (read keep something that worked, and make everything fit in only 16K bytes of ROM).

Mark

Re: That thing with the bottom two lines

Posted: Mon Feb 12, 2024 10:34 pm
by Ralf
Well, I'm really accustomed to it, like many of us here I guess. It was my first contact with a computer and for some time I couldn't imagine that it could work in another way.

But it isn't the most comfortable way. Full screen editor is simply better. Practically all modern programming environments use full screen editor today, right?

But when Spectrum was created it wasn't a norm. Many 8 bit computers had in their Basic similar solutions to Spectrum - you don't edit whole code but first choose a line and then you edit this line.

It was a way of dealing with limited memory. And it was some historical thing - most very early computers had some limited buffer where you could process your input data in.

So it just a typical solution for 1982 which aged a bit badly.

Re: That thing with the bottom two lines

Posted: Mon Feb 12, 2024 10:55 pm
by AndyC
Yeah, line editors were reasonably common. It's more the weird quirk where running programs can't easily use the full screen for PRINT or PLOT that I find particularly odd. Though it never bothered me that much back in the day I guess.

Re: That thing with the bottom two lines

Posted: Tue Feb 13, 2024 6:34 am
by WhatHoSnorkers
You're right in that INK 2 on its own doesnt' work, but you just need to put the INK in the PRINT statement itself. Same with the PAPER. I believe it gets the default PAPER from the BORDER so you'll need to pad as necessary.

Drawing and plotting in there isn't possible. When I needed nice lines there for a full screen grid, I drew on most of the screen, then copied bytes from screen memory down there. That worked OK.

Re: That thing with the bottom two lines

Posted: Tue Feb 13, 2024 8:05 am
by equinox
WhatHoSnorkers wrote: Tue Feb 13, 2024 6:34 am You're right in that INK 2 on its own doesnt' work, but you just need to put the INK in the PRINT statement itself.
This presupposes that I conveniently know what the current colour is, without peeking. Maybe it was set with VAL, or by a previous program, or manually by the user!

Re: That thing with the bottom two lines

Posted: Tue Feb 13, 2024 8:08 am
by equinox
Ralf wrote: Mon Feb 12, 2024 10:34 pm But it isn't the most comfortable way. Full screen editor is simply better. Practically all modern programming environments use full screen editor today, right?
Yep, I think one of the fairly rare areas where the Speccy scores over the BBC Micro is the BASIC editor, even the 48k one, when you want to edit an existing line. On the Beeb you have that strange double-cursor mechanism where you have to LIST the desired line, cursor your way up there, and then hold down a special Copy key to re-enter it (or just the parts you want to keep). The Amstrad CPC (as far as I recall) involves entering EDIT 100 and then line 100 pops up for editing.

On the other hand, it's annoying that you can only cursor left and right in the 48k editor, as it takes an age to reach the end of a long line (especially since it gets slower as you go along: must be some O(n^2) thing :D ). I saw a utility called $KIPPER that allows you to use the up and down cursors too.

Re: That thing with the bottom two lines

Posted: Tue Feb 13, 2024 8:18 am
by RST#08
equinox wrote: Tue Feb 13, 2024 8:08 am Yep, I think one of the fairly rare areas where the Speccy scores over the BBC Micro is the BASIC editor, even the 48k one, when you want to edit an existing line (...) On the other hand, it's annoying that you can only cursor left and right in the 48k editor, as it takes an age to reach the end of a long line (especially since it gets slower as you go along (...)
^Yes, this. I quite like the 'current line' approach and the re-building of the screen, although I do agree that the implementation could have been a bit neater. But overall I like the approach and, as others have said, it's what you get used to.

Re: That thing with the bottom two lines

Posted: Tue Feb 13, 2024 9:39 am
by Timmy
It's also not really just the bottom two lines. Especially when you're editing BASIC, that could be 6 to 8 lines too, depending on how long your lines are.

I do really like that it really focus you on the line you're editing. It's very useful there.

Re: That thing with the bottom two lines

Posted: Tue Feb 13, 2024 10:54 am
by spider
Without going to check, I don't think there's any reason why the plot/draw routines could not take advantage and draw on the lower two lines...

Its dead easy to set a colour here anyway , 23624 , x , I sometimes set the 'main' screen area with this too using 23693 , x , followed by a CLS or a call to its routine (iirc) , just a bit easier to type in than setting all the permutations manually aka bright/flash etc

Re: That thing with the bottom two lines

Posted: Tue Feb 13, 2024 12:43 pm
by RST#08
spider wrote: Tue Feb 13, 2024 10:54 am Without going to check, I don't think there's any reason why the plot/draw routines could not take advantage and draw on the lower two lines
Alas the ROM routine PLOT-SUB routine calls PIXEL-ADD which checks the upper y-coordinate limit (175d). So you'd need a bespoke routine, see p.19-22 of: this book for an example that allows plotting to lower screen (note coordinate system is changed).

Re: That thing with the bottom two lines

Posted: Wed Feb 21, 2024 11:27 am
by Patrik Rak
BTW, I always found it interesting that many of the early loading screens didn't use those lines, as apparently the tools used to create them couldn't draw there either.

It took several years before programs like The Artist or Art Studio appeared and full-screen loading screens became the norm. What an interesting setback.

Patrik

Re: That thing with the bottom two lines

Posted: Wed Feb 21, 2024 12:30 pm
by equinox
Patrik Rak wrote: Wed Feb 21, 2024 11:27 am BTW, I always found it interesting that many of the early loading screens didn't use those lines, as apparently the tools used to create them couldn't draw there either.
It took several years before programs like The Artist or Art Studio appeared and full-screen loading screens became the norm. What an interesting setback.
Yes, Art Studio required a bit of scrolling, purely because of menu layout. They could have chosen (Speccy-style) to keep the menus in the bottom two lines, but in fact they are in (off the top of my head) I think the top THREE lines.

Re: That thing with the bottom two lines

Posted: Fri Mar 01, 2024 11:58 am
by TMD2003
equinox wrote: Tue Feb 13, 2024 8:08 am Yep, I think one of the fairly rare areas where the Speccy scores over the BBC Micro is the BASIC editor, even the 48k one, when you want to edit an existing line. On the Beeb you have that strange double-cursor mechanism where you have to LIST the desired line, cursor your way up there, and then hold down a special Copy key to re-enter it (or just the parts you want to keep). The Amstrad CPC (as far as I recall) involves entering EDIT 100 and then line 100 pops up for editing.
I see your BBC Micro line editor, and I raise you the Dragon 32. It was quicker to re-type the line every time.

Re: That thing with the bottom two lines

Posted: Fri Mar 01, 2024 12:03 pm
by AndyC
equinox wrote: Tue Feb 13, 2024 8:08 am On the Beeb you have that strange double-cursor mechanism where you have to LIST the desired line, cursor your way up there, and then hold down a special Copy key to re-enter it (or just the parts you want to keep). The Amstrad CPC (as far as I recall) involves entering EDIT 100 and then line 100 pops up for editing.
The CPC does it both ways. You can use EDIT to just call up a line for editing, but you can also use the Copy Cursor to copy all, or part, of a line from elsewhere on screen.

Re: That thing with the bottom two lines

Posted: Tue Mar 05, 2024 4:12 am
by equinox
Patrik Rak wrote: Wed Feb 21, 2024 11:27 am BTW, I always found it interesting that many of the early loading screens didn't use those lines, as apparently the tools used to create them couldn't draw there either.
It took several years before programs like The Artist or Art Studio appeared and full-screen loading screens became the norm. What an interesting setback.
Let's try to ignore Icon Graphix ...

Re: That thing with the bottom two lines

Posted: Tue Mar 05, 2024 7:55 am
by AndyC
equinox wrote: Tue Mar 05, 2024 4:12 am Let's try to ignore Icon Graphix ...
Wait. Was that the one they gave away on an SU covertape at some point? The one where you had to play a music tape in the tape deck while you were using it or the keyboard routines didn't work correctly?

Aside from that glaring bug, I seem to recall it wasn't actually that bad.

Re: That thing with the bottom two lines

Posted: Tue Mar 05, 2024 7:58 am
by equinox
AndyC wrote: Tue Mar 05, 2024 7:55 am Wait. Was that the one they gave away on an SU covertape at some point? The one where you had to play a music tape in the tape deck while you were using it or the keyboard routines didn't work correctly?

Aside from that glaring bug, I seem to recall it wasn't actually that bad.
It was very buggy and would crash from time to time. There was also the "difficult to draw in the icon menu space" thing -- umm, I think there may have been a way to get around this but it's too long ago to remember. At least it was much less good than Art Studio which politely let you push the menu aside and scroll 2 lines. Spectrum owners are used to ignoring 2 lines (PRINT #0).