Double carriage return?

discussion of beeb/electron applications, languages, utils and educational s/w
User avatar
spark001uk
Posts: 18
Joined: Thu Oct 12, 2017 11:44 am

Double carriage return?

Postby spark001uk » Wed Oct 18, 2017 12:22 am

Quick one, been bugging me ever since I was on the beebs at school in fact.

On the BBC's "The Computer Programme", I remember when I first watched it I liked the "ruled" blue background they had on their beeb displays, and soon found out that was done in mode 6, with a simple VDU19 command to set the background colour.

What they also did though, which I never discovered how, was the double carriage return they seemed to have set up, so that when they typed in lines of a program, it was easier to read for the viewer I suppose. Every time they hit return, or ran a program, every carriage return was doubled. But, how did they do it?? I went through all the VDU commands, *FX, etc, and never did find out! Just curious to know how it was done?

crj
Posts: 320
Joined: Thu May 02, 2013 4:58 pm

Re: Double carriage return?

Postby crj » Wed Oct 18, 2017 1:09 am

I've never seen any suggestion of such a feature as standard.

On the other hand...

Code: Select all

OURCODE = &900
WRCHV = &20E
OSBYTE = &FFF4

FOR opt = 0 TO 3 STEP 3
P%=OURCODE
[
  OPT opt

  \ Add ourselves to WRCHV
  LDA WRCHV : STA oldvec
  LDA WRCHV+1 : STA oldvec+1
  LDA #new MOD 256 : STA WRCHV
  LDA #new DIV 256 : STA WRCHV+1
  RTS
 
.new
  \ Do nothing unless we're trying to output LF
  CMP #10
  BNE jmptoold
  \ Push X,Y (we know A=10; no need to push it)
  TXA:PHA
  TYA:PHA
  \ Look at whether we're in the middle of a multi-byte VDU sequence
  LDA #218
  LDX #0
  LDY #255
  JSR OSBYTE
  CMP #0
  \ If we are, skip
  BNE skip
  \ If we're not, output an extra LF
  JSR outputLF
.skip
  \ Restore X,Y
  PLA:TAY
  PLA:TAX
.outputLF
  LDA #10
.jmptoold
  JMP (oldvec)
.oldvec
  EQUW 0
]
NEXT
CALL OURCODE

(Disclaimer: I'm not sitting at a Beeb and I've not done this kind of thing in literally decades so I'm a little rusty. I wouldn't be in the least surprised if that contained bugs. (-8 )

User avatar
tricky
Posts: 1917
Joined: Tue Jun 21, 2011 8:25 am
Contact:

Re: Double carriage return?

Postby tricky » Wed Oct 18, 2017 12:15 pm

I seem to remember that for program listings, the code was already therea and typing just made it display, but I can't remember the details.
I may be imagining the whole thing.

User avatar
spark001uk
Posts: 18
Joined: Thu Oct 12, 2017 11:44 am

Re: Double carriage return?

Postby spark001uk » Wed Oct 18, 2017 3:38 pm

crj wrote:I've never seen any suggestion of such a feature as standard.

On the other hand...

Code: Select all

OURCODE = &900
WRCHV = &20E
OSBYTE = &FFF4

FOR opt = 0 TO 3 STEP 3
P%=OURCODE
[
  OPT opt

  \ Add ourselves to WRCHV
  LDA WRCHV : STA oldvec
  LDA WRCHV+1 : STA oldvec+1
  LDA #new MOD 256 : STA WRCHV
  LDA #new DIV 256 : STA WRCHV+1
  RTS
 
.new
  \ Do nothing unless we're trying to output LF
  CMP #10
  BNE jmptoold
  \ Push X,Y (we know A=10; no need to push it)
  TXA:PHA
  TYA:PHA
  \ Look at whether we're in the middle of a multi-byte VDU sequence
  LDA #218
  LDX #0
  LDY #255
  JSR OSBYTE
  CMP #0
  \ If we are, skip
  BNE skip
  \ If we're not, output an extra LF
  JSR outputLF
.skip
  \ Restore X,Y
  PLA:TAY
  PLA:TAX
.outputLF
  LDA #10
.jmptoold
  JMP (oldvec)
.oldvec
  EQUW 0
]
NEXT
CALL OURCODE

(Disclaimer: I'm not sitting at a Beeb and I've not done this kind of thing in literally decades so I'm a little rusty. I wouldn't be in the least surprised if that contained bugs. (-8 )


Unless it was just a bit of trickery and they were writing a program within a program? Wouldn't be hard to do, just echoing GET$ to the screen perhaps.
I did notice on one occasion he typed LIST and it cleared the screen and listed. That's not normal behaviour.

User avatar
spark001uk
Posts: 18
Joined: Thu Oct 12, 2017 11:44 am

Re: Double carriage return?

Postby spark001uk » Wed Oct 18, 2017 3:43 pm

tricky wrote:I seem to remember that for program listings, the code was already therea and typing just made it display, but I can't remember the details.
I may be imagining the whole thing.

No you weren't imagining it.!

Pic below. (©BBC 1982, "The Computer Programme")
Attachments
beebcompprog.jpg

User avatar
Rich Talbot-Watkins
Posts: 1117
Joined: Thu Jan 13, 2005 5:20 pm
Location: Palma, Mallorca

Re: Double carriage return?

Postby Rich Talbot-Watkins » Wed Oct 18, 2017 4:13 pm

Well, one way to kind of do it is like this:

Code: Select all

MODE 6
VDU 19,0,4;0;
?&356=1

That adds the double spacing (basically makes the VDU drivers think that it's a 16k MODE with 640 bytes per character row), but don't let it scroll or it'll all go awry.

But they're obviously doing something more sneaky than that. Note the lack of leading spaces on the line numbers - either the whole thing is fake, or they intercepted WRCHV to provide custom printing (don't print spaces directly after a newline). Also there's presumably a hidden line which clears the screen when RUN (and also contains the control code to clear it when LISTed).

Quite honestly, I have no idea why they didn't just use MODE 7. It's clearer, and wouldn't have required any of this fakery. I wonder how many people were perplexed when trying this on their BBCs at home, and failed to get their listings double-spaced with stripey lines and auto screen clearing?

crj
Posts: 320
Joined: Thu May 02, 2013 4:58 pm

Re: Double carriage return?

Postby crj » Wed Oct 18, 2017 4:15 pm

spark001uk wrote:Unless it was just a bit of trickery and they were writing a program within a program? Wouldn't be hard to do, just echoing GET$ to the screen perhaps.
I did notice on one occasion he typed LIST and it cleared the screen and listed. That's not normal behaviour.


Fair point, well made.

Though if I were setting up an utterly rigged demo, I think I'd print the correct thing when the presenter hit a key, not the key they actually pressed. (-8<

crj
Posts: 320
Joined: Thu May 02, 2013 4:58 pm

Re: Double carriage return?

Postby crj » Wed Oct 18, 2017 4:30 pm

Rich Talbot-Watkins wrote:Quite honestly, I have no idea why they didn't just use MODE 7. It's clearer, and wouldn't have required any of this fakery.

(a) Maybe they thought it looked too much like Ceefax.
(b) Acorn had trouble getting video ready in time for the show's launch, and video was the culprit. Did MODE 7 even work at that point?

User avatar
1024MAK
Posts: 6791
Joined: Mon Apr 18, 2011 4:46 pm
Location: Looking forward to summer in Somerset, UK...

Re: Double carriage return?

Postby 1024MAK » Wed Oct 18, 2017 4:44 pm

Maybe the OS that was fitted was a development version?

That may explain some of the differences.

Mark
For a "Complete BBC Games Archive" visit www.bbcmicro.co.uk NOW!
BeebWiki‬ - for answers to many questions...

User avatar
1024MAK
Posts: 6791
Joined: Mon Apr 18, 2011 4:46 pm
Location: Looking forward to summer in Somerset, UK...

Re: Double carriage return?

Postby 1024MAK » Wed Oct 18, 2017 4:49 pm

Also, in the TV production, the producer may not have liked the "real" output, so instead, the whole lot was faked in order to keep the producer happy.

What we need, is someone who worked in the Beeb or Acorn to let the cat out of the bag...

Mark
For a "Complete BBC Games Archive" visit www.bbcmicro.co.uk NOW!
BeebWiki‬ - for answers to many questions...

User avatar
BeebMaster
Posts: 2475
Joined: Sun Aug 02, 2009 4:59 pm
Location: Lost in the BeebVault!
Contact:

Re: Double carriage return?

Postby BeebMaster » Wed Oct 18, 2017 7:23 pm

This is a bit of a 35-year old puzzle!

I tried a few things with WIDTH, LISTO, VDU 28 and VDU23,16 but I couldn't get anywhere near. I even tried keying in a load of trailing spaces, but these are discarded by the interpreter. Unless there are undocumented calls for these keywords which produce the desired effect, or there were bugs or discontinued features in BASIC I which we've all forgotten.

Then a remembered a very distant recollection of a utility ROM which has its own BASIC editor with a similar screen output. Sure enough "The BASIC Editor" looks very similar when set to mode 6, but the line numbers are indented and there isn't the double line spacing. However when in the editor pressing SHIFT-F4 produces a new line under the current line, but doesn't space out every line. I have version 1.32, it's unlikely anything in the Beeb world had reached 1.32 by 1982, so maybe it was an early release of this utility they were using.
Image

User avatar
spark001uk
Posts: 18
Joined: Thu Oct 12, 2017 11:44 am

Re: Double carriage return?

Postby spark001uk » Wed Oct 18, 2017 10:49 pm

Yes I'm starting to think it was faked tbh, a mix of PRIINTing what they wanted on screen with shots of them typing. However - they did do the "bbc micro live" shows too didn't they? In which obviously they couldn't do that I assume.

Just checked one of the youtube vids of a computer programme episode and he definitely types LIST, and it clears the screen before listing. So they're definitely up to something!

User avatar
Rich Talbot-Watkins
Posts: 1117
Joined: Thu Jan 13, 2005 5:20 pm
Location: Palma, Mallorca

Re: Double carriage return?

Postby Rich Talbot-Watkins » Thu Oct 19, 2017 8:19 am

Well, this is the closest I can get:

Screen.PNG


Shift+Break the disc image to set up the stripey double-spaced mode, then LOAD "VATICAN"

Note the line numbers have leading spaces as per normal, so this isn't exactly like the demo. I can only assume that was done with a custom VDU handler, or else it must've been really faked. As per my previous warning, don't let the screen scroll, it'll be messy!
Attachments
doublespace.zip
(585 Bytes) Downloaded 7 times

User avatar
spark001uk
Posts: 18
Joined: Thu Oct 12, 2017 11:44 am

Re: Double carriage return?

Postby spark001uk » Fri Nov 03, 2017 12:05 pm

Just got me wondering on the VDU command. How is it that VDU19,0,4,0,0,0 / VDU19,0,4; / VDU19;4;0; / VDU 19;4;0;0;0; (note those last two have the 0 and the 4 reversed) all do exactly the same thing? Is the various usage of commas or semicolons relevant in some way?

User avatar
jgharston
Posts: 2756
Joined: Thu Sep 24, 2009 11:22 am
Location: Whitby/Sheffield

Re: Double carriage return?

Postby jgharston » Fri Nov 03, 2017 12:16 pm

spark001uk wrote:Just got me wondering on the VDU command. How is it that VDU19,0,4,0,0,0 / VDU19,0,4; / VDU19;4;0; / VDU 19;4;0;0;0; (note those last two have the 0 and the 4 reversed) all do exactly the same thing? Is the various usage of commas or semicolons relevant in some way?

Comma means "previous value is single 8-bit byte", semicolon means "previous value is 16-bit 2-byte low/high value". So VDU 19;4 is sending low(19), high(19), 4 which is 19,0,4. ;0; is a common way of sending the last three zeros of a VDU 19 command as it gives high(last number which will usually end up as 0), low(0), high(0). So, VDU 19;4;0; is a compressed form of VDU 19,0,4,0,0,0. Similarly, VDU 23;r,d;0;0 expands to VDU 23,0,r,d,0,0,0,0,0,0 to program the CRTC.

Code: Select all

$ bbcbasic
PDP11 BBC BASIC IV Version 0.25
(C) Copyright J.G.Harston 1989,2005-2015
>_

User avatar
jms2
Posts: 1840
Joined: Mon Jan 08, 2007 6:38 am
Location: Derby, UK

Re: Double carriage return?

Postby jms2 » Sat Nov 04, 2017 8:12 am

...and in Basic IV and later, there is also the bar character which I don't seem to be able to type on this tablet, which sends several zeroes. I can't remember how many, is it 8?

crj
Posts: 320
Joined: Thu May 02, 2013 4:58 pm

Re: Double carriage return?

Postby crj » Sun Nov 05, 2017 4:10 am

Yes, eight. So it's useful for the VDU 23 variants you need to finish off with a pile of zeros.

e.g.

Code: Select all

VDU 23,1,0| : REM Cursor off
VDU 23,1,1| : REM Cursor on


Return to “software: other”

Who is online

Users browsing this forum: No registered users and 3 guests