Doctor Who has developed a reputation for its low budget special effects. Whilst recently watching some of Peter Davison's 1983 episodes I noticed that the TARDIS console display looked suspiciously like it had been generated by a BBC Micro. Did the BBC use a cheap home computer from 1981 to simulate the advanced computing power of hundreds, even thousands of years into the future?
The Twin Dilemma, broadcast in 1984, was the first storyline of Colin Baker's era as the doctor. Either by accident or design, a brief sequence during this program actually showed the BBC Basic and assembler code used to create the console display. Luckily, I managed to capture a few screenshots with which to remember this momentous occasion.
Here is the doctor, in rather bland garb, and his assistant du jour, Peri. The accompanying shot is of this episode's terrifying aliens, the Gastropods.
(Click on screenshots for larger pictures)
This is the command centre which contains the display of interest. The woman closest to the camera is "operating" the display.
I've transcribed the code below. If you want to have a play with BBC Basic then you can try an online BBC emulator written in Java, but note that the code given here is incomplete, and that you may need to tinker with the key mapping option to produce all of the BBC's keystrokes.
The code we can see is just the final lines of a display program. Up to line 400 it's in assembler, which I would guess is to be the procedure that does the actual printing to screen. Lines 410 to 610 are the definition of a procedure called title. This calls PROCdisplay a number of times, which is presumably the assembler procedure that we see the end of above. You can even see the RUN command at the bottom of the screen, ready for someone to press Return.
TA&7A
360.AP:LDX&78:LDY#0:.AD:LDAM%,X:STA(&76),Y:CLC:
TYA:ADC#8:TAY:DEX:BNEAD
370CLC:LDA&76:ADC#1:STA&76:LDA&77:ADC#0:STA&77
380DEC&7B:BNEAQ:CLC:LDA&74:ADC&82::STA&74:STA&76:LDA&75:
ADC&83:STA&75:STA&77:LDA#8:STA&79:.AQ:DEC&7A:BNEAP
390CLC:LDA&72:ADC#1:STA&72:LDA&73:ADC#0:STA&73
400DEC&7F:BEQAZ;JMPAA:.AZ:RTS:J:NEXT:ENDPROC
410DEF PROCtitle
420REPEAT UNTIL INKEY(0)=32
455Xsize=4:Ysize=4:YOUR$="_______":PRINTTAB(6,7);:
PROCdisplay
460Xsize=4:Ysize=4:YOUR$="X,V,773":PRINTTAB(6,6);:
PROCdisplay
461REPEAT UNTIL INKEY(0)=32
465Xsize=2:Ysize=2:YOUR$="LAST LOCATION: 27:43":
PRINTTAB(0,14);:PROCdisplay
466REPEAT UNTIL INKEY(0)=32
467Xsize=2:Ysize=2:YOUR$="LAST CONTACT: 12-99":
PRINTTAB(0,20);:PROCdisplay
470REPEAT UNTIL INKEY(0)=32
475Xsize=2:Ysize=2:YOUR$="_______":PRINTTAB(2,29);:
PROCdisplay
480Xsize=2:Ysize=2:YOUR$="BELIEVED DESTROYED":
PRINTTAB(2,20);:PROCdisplay
520FORW=0to 463:NEXT:
610ENDPROC
>RUN
If you want to decipher the code, and you are not that familiar with BBC Basic, you should know:
- spaces are usually ignored
- : is a separator
A%is an integer variable named AR$is a string variable&76means hexadecimal number 76DEF PROCexample ... ENDPROCis a procedure declarationPROCexamplecalls the procedureREPEAT UNTIL INKEY(0)=32means pause until space is pressedPRINTTAB(X,Y)sets up where on screen the next text will be written, with (0,0) the top left
Here's the output, which unsurprisingly does what the code specifies. If you look carefully you can see the angled bracket on the end of the bottom line where the computer is waiting for more input. The picture on the right shows the screen in situ, on the far left of shot.
The Cybermen - Thwarted by a BBC Micro
The very next storyline had the exact same occurrence, but with more advanced graphics. Here are the doctor and Peri again, as they appeared in Attack of the Cybermen, and the code itself, which appears for only a couple of frames.
I have copied as much as I can make out below. I have also annoted the parts that involve special BBC Basic commands. In reading the code, note that graphics are always done based on a hypothetical screen which is 1280 pixels wide and 1024 pixels high, with the origin (0,0) at the bottom left. This is distinct from text mode, which has an origin at the top left.
870X%=A%*SINB
880Y%=B%*COSB
890MOVE0,0
- fill a triangle between specifed point (X%,Y%) and last two points used in plotting actions
900PLOT85,X%,Y%
910NEXT
1090
1100ENDPROC
1110
1120
1130DEFPROCGRID
1140
1150
- redefine graphics origin to point (0,0)
1160VDU29,0;0;
- redefine colour 1 (red) to be absolute colour 7 (white)
1170VDU19,1,7,0,0,0
- set graphics colour to 1 (red)
1180X=5:GCOL0,1
1190LOCALX:LOCALY
1200FORX=0TO1275 STEP1275/N
1210FORY=0TO1020 STEP1028/N
1220MOVEX,0:DRAWX,Y:NEXTY:NEXTX
1230FORY=0TO1028 STEP1028/N
1240FORX=0TO1275 STEP1275/N
1250MOVE0,7:DRAWX,Y:NEXTX:NEXTY
1280
1290
1300
1310
1320ENDPROC
1330
1340
1350
1360END
RUN
This is the grid being drawn with its vertical lines first, from left to right. Then come the horizontal lines, from the bottom up.
Finally, you can see a circle being drawn out of triangles, which is probably done by the bit of code before line 1100. In the actual storyline, this denotes the location of the cybermen's transmitter.
I wonder if the BBC's innovation in using a common household microcomputer to produce effects for its leading science fiction program of the day was noted at the time. If not, then it's not too late to redress the balance, and praise their skilful use of meagre resources to produce a memorable program.