The Tower of Babel

The Tower of Babel

Back in the 1990s, the BBC World Service had a newsroom computer system called EDiT. This was the World Service version of a system called BASYS which had a bit of an interesting past. It was widely used in TV and radio newsrooms all over the world, used by domestic BBC TV and radio as well as CNN and ITN and I think maybe the ABC in Australia as well. Indeed, ITN actually owned BASYS / Newsfury. [See ITN staff magazine The Lens, issue 7, January 1994, page 7, 'ITN steps in to buy share of 'Newsfury' potential] As I recall this was because they’d invested heavily in BASYS equipment and the company got into financial difficulty and they bought it out to protect their investment. This new technology was controversial at the time, as this article from 2013 by Rory Cellan-Jones attests, but journalists and PAs would regard it with nostalgia when it was later replaced by ENPS, the Associated Press’s ‘Electronic News Production System’ or ‘Every News Programme Suffers’ as it was briefly known.

DEC VT420 terminal, by Jacek Rużyczka - Self-photographed, CC BY-SA 3.0, https://commons.wikimedia.org/w/index.php?curid=6762692


It’s very hard to find anything about BASYS on the internet, not helped by the fact that the name is now used by an FPGA board and most BASYS systems were probably taken out of service before the world wide web became popular. I’ve asked on Twitter if any old BBC or ITN hacks still have any training manuals for it, but to no avail. Part of me would love to rescue the system software and get it running on an emulator.

As I recall it ran on a mainframe, or maybe a VAX mini-computer, and the users had dumb serial terminals on their newsroom desks. In Bush House we had lovely DEC terminals, possibly VT-420s with paper white CRT monitors. I recall a sneaky trick was to type SCREEN and press enter and run away. This scrolled the current script in huge letters in an autocue style. Another hack was to gain access to the training system with CONNECT TRAIN, though I think that was disabled once it was realised this was getting abused.

To encourage people to get to know this new-fangled technology, the enlightened engineers set up an area called bush.graffiti – a kind of bulletin board where users could type anything pretty much anonymously. This was well before social media had been invented or anyone had any kind of internet access on BBC computers, so it proved very popular. Indeed I met my wife in bush.graffiti before an announcer by the name of Neil Sleat introduced us in real life by the fish tank in the Bush House Club. The file would show the user name and time of the last edit, which may or may not be the last person to comment in a document. My user name was boo1opr – first 3 letters of my surname, a number, then department code, opr for ‘operational resources’, the studio managers’ department. How we laughed at our Portuguese colleague whose username was pis1por. Many graffiti users adopted pseudonyms like Cottonmouth, United by Yucca and Yeboah’s Witness.

bush.graffiti had two long-running threads that stuck in my mind. One was ‘Strange Fridges’, a long Derek and Clive style riff on surreal objects and people that the authors claimed to have discovered at the backs of their fridges.

bush.graffiti

Another was The Tower of Babel. Bush House, broadcast in 42 languages, geddit? In this thread, people imagined that this building that was strange and labyrinthine enough in real life, was the basis of a text-based computer adventure game.

the ZX Spectrum Secret of St Bride's game

In lockdown, I got a bit obsessed with a couple of real adventure games. I’ve never got on with them in the past, always getting stuck and losing patience with, say, The Hobbit on the ZX Spectrum and the Hitch-Hiker’s Guide to the Galaxy PC game. Even now I gave up on the original Colossal Cave Adventure when I tried mapping it and realised that the geography was inconsistent and even changes during the game, which seems just maddeningly unfair. I went down a rabbit hole researching the, frankly quite astonishing, story of The Secret of St Bride’s and the enigmatic Games Mistresses who were behind it. They made well-regarded computer games but also ran a ‘school’ in Ireland which you could visit and stay at, where the staff all stayed in character, and yes that was probably every bit as weird and dodgy as it sounds. The main public face of the group may have been played by different people at different times, and any attempts to discover the truth about them seem to end in failure, madness or both. You can read more about the game and the people behind it here, but I warn you now, it won’t end well for you.

my map of St Bride's

I tried mapping out the world of St Bride’s School in a spreadsheet, and even here was exasperated that going east from one space to another doesn’t necessarily mean you can return by going west. There’s also an infuriating point I would never have been able to get past back in the 80s without the internet’s help: assuming you know what to do and have gathered the right objects, you have to use precisely the right phrases USE NEWSPAPER, UNDER DOOR, USE PENCIL, IN KEYHOLE to progress. 1985 me would have given up in frustration at that point.

So, a mere thirty years after contributing to bush.graffiti, I decided to right those wrongs and make The Tower of Babel into a real text-based adventure, or ‘interactive fiction’ as I think they’re now called. You can play it online here, read a short intro here and the cribsheet may be useful.

Your character is a trainee SM (studio manager) doing a nightshift in the year 1991. You’re woken in the dorm (yes Bush House used to have a dormitory) at 4am and have until 5am to get to a studio to put a programme on air. I’ve taken some liberties with geography, but it’s broadly as I remember it. Move around with n, s, e, w, use ‘get’ or ‘take’ to pick things up, ‘i’ for listing your inventory and examining things may be useful. You can even examine yourself, if that’s your bag. You’ll need to find a studio key as you’ve left yours at home and some rooms have gatekeepers who may be prone to bribery.

B-type studio

The game isn’t finished yet, but you can regard getting into the studio before the PTT (pre-transmission test) alarm goes off a success. I’ll add some stuff about getting the show on air next so you can actually use some of the things I’ve packed into the studio’s control cubicle.

I was going to create it as an old-school, authentic ZX Spectrum game using the Quill software many 1980s games were written in, but instead I decided to write it using Inform which means you can also download the game to play in the IF platform of your choice as well as playing in your web browser. Learning Inform has been almost as frustrating as playing an adventure game in its own right, and I warn you if you’re tempted to follow suit: it will MESS WITH YOUR MIND. If you decide to drink the drink and eat the mushroom, don’t come running to me for sympathy. Actually you can. I’ll even provide the tea.

screenshot of The Tower of Babel game

I think the game is playable as far as it goes if you know nothing about working in Bush House in the BBC World Service era, but if you were there you’ll find some in-jokes and you may be able to find some familiar parts of the building.

Whilst I appreciate this is incredibly niche to make an adventure game, sorry interactive fiction, about a job I did 30 years ago in a building the BBC doesn’t even occupy any more, it was a fun, if maddening, experience. I now have more respect for the authors of adventure games and understand some of the reasons for design decisions they made that seemed odd to me as a player. Though I do think my geography is consistent and I hope the game is playable without too much convoluted, unguessable syntax. Getting past the canteen is a pig, I admit, but I have left some clues.

If you’re an old BASYS sysadmin or trainer and have some documentation or, heaven forbid, some actual software, get in touch.

If you worked in Bush, or even of you didn’t, let me know if you like the game or where you get stuck. I may be bribable.

Postscript

In October 2022, BBC Northern Ireland produced a radio series called Assume Nothing which covered the real story behind St Bride’s. Warning: it’s much darker than I was expecting and not an easy listen, but essential if your interest has at any time been piqued by the Games Mistresses: https://www.bbc.co.uk/sounds/brand/m001dd9t


You can browse some, but by no means all, of my photos of Bush House by clicking on the photo below:

Bush House

Posted in BBC, gaming, nostalgia, radio | Tagged , , , , , | Leave a comment

Video from a BBC micro:bit with IchigonQuest

Back in 2017 I played with projects to get composite video from an Arduino – huge fun and very satisfying in a retro way. After trying TinyBASIC on a BBC micro:bit, I fell down a bit of an internet search rabbit hole and discovered the world of IchigonJam (strawberry jam!), a Japanese computer the size of a Raspberry Pi that you program in BASIC. It uses a PS/2 keyboard and produces low-resolution composite video to be viewed on a TV with an AV input. A very cute and intriguing machine.

It had been bugging me for years that it must be possible to get composite video out of a BBC micro:bit the same way as on the Arduino and IchigonJam. And it is, and someone has already done it. Welcome, IchigonQuest! It’s a very quirky, very Japanese way of coding microcontrollers in something a bit like BASIC. There’s a whole ecosystem around it, and as they’re not shipping to the UK at the moment I put it out of my mind.

Then I found there’s a micro:bit port of it. And I got it working. I have no idea what I’m doing, but it works! The micro:bit becomes a self-contained computer with its own keyboard and screen that you can program on its own.

Here’s what I used:

- A V1 BBC micro:bit
- A micro:bit breakout board
- Various jumper wires
- A small breadboard
- A 100 ohm and a 470 ohm resistor
- An RCA / phono plug to get video into the TV
- A TV set. I used a cheap fairly modern Chinese one, bought in the UK but still apparently happy to display NTSC video
- A PS/2 keyboard. (Found on the street with the plug helpfully already chopped off – as used in my previous micro:bit PS/2 keyboard projects).
- Downloaded microDakeOS.20180925.zip from https://p.na-s.jp/, extracted ichigonquest.ubit.dj.en.hex and flashed it to the micro:bit

Here’s how I wired it up:

micro:bit pin connect to
15 100 ohm resistor to video out phono inner PIN
14 470 ohm resistor to video out (same as above)
GND video GND (outer ring of RCA / phono plug)
16 PS/2 keyboard clock wire
8 PS/2 keyboard data wire
3v PS/2 keyboard 5v power in wire
GND PS/2 keyboard ground wire

wiring micro:bit into TV

I very much was not expecting to see anything. I’d bodged together these wires from web pages in Japanese I barely understood even with Google Translate, and filled in some gaps from my own experience connecting PS/2 keyboards to micro:bits. I connected it all up, turned the TV on, switched it to the AV input… and a picture appeared!

I’m still puzzling out how it all works, but I managed to draw my own icons on the micro:bit display and even wrote my first proper program!

IchigonQuest program running on BBC micro:bit

And here’s a bit of a longer walkthrough of how it works:

Sound update

I’ve now figured out that the piezo speaker goes on micro:bit pin 12! Alas it only beeps, you can’t seem to play tunes on it. But it’s a nice addition.

And yes, that’s forbidden pin 12, reserved for accessibility. So if you want to hook up a buzzer, you’ll need a breakout board that allows access to this pin. The Kitronik one I have does, but the Pimoroni pin:bit doesn’t. (Not a criticism of Pimoroni, you’re really not supposed to use pin 12 for anything!)

New video update

Here’s another video talking about how much coding IchigonQuest is like assembly language. And I demonstrate my inability to remember its name:

Button update

These two programs make things happen when you push a button – so you could use this to start making a game by moving a character round the screen in different directions depending on the arrow key pressed.

program to scan micro:bit button

The code above checks to see if a micro:bit button has been pressed, either A or B, and if it has, it sends a signal out on pin 0 (connected to an LED in my set-up).

polling the PS/2 keyboard

This program checks the PS/2 keyboard to see if the up arrow / cursor key has been pressed. If it has, it also sends a signal out on pin 0, lighting my LED. You can check all 4 arrows, and enter.

Posted in computers, microbit | Tagged , , , | 2 Comments

Run BASIC on a BBC micro:bit

It was recently BASIC’s 57th birthday, the programming language many of us first used to do any computer programming on computers from the 1970s and 1980s like the Commodore PET, Sinclair ZX Spectrum or Apple 2. Worth remembering too that part of the team that created BASIC was Sister Mary Kenneth Keller, the first woman and one of the first people in the US to get a PhD in computer science.

I’d known for a while that there was a Japanese port of TinyBASIC for the BBC micro:bit. To be honest I thought it was a bit of a novelty as you need a computer to connect to it that will be more powerful than the micro:bit and able itself to run proper BASIC, but it’s actually very, very clever. It will allow you to access features of the micro:bit itself, like the LED display, the buttons, GPIO pins and so on, meaning you can do real physical computing with the micro:bit in BASIC. You don’t need any special hardware, just a micro:bit and some sort of serial terminal on a computer connected to the micro:bit by USB.

To get it running go to https://github.com/Tamakichi/ttbasic_microbit – I used Google translate to help me navigate the page. Download the ZIP file and unpack the hex file and flash it to a V1 micro:bit. (It looks like it’s not yet been updated to work on the newer micro:bit with sound).

You can use terminal software to communicate with it, but it’s simpler to use Chrome and a web-based alternative. You can use the online micro:bit Python editor, but this is probably better as it handles scrolling well: https://googlechromelabs.github.io/serial-terminal/. The video at the top of this page shows how to set it up.

A very cool feature is that you can save files to flash memory, just as you’d save programs to cassette or disk on an 8-bit computer like the ZX Spectrum. There are 16 slots for programs, accessed with the SAVE and LOAD commands. FILES lists everything in the file system.

The program in slot 0 can be made to run automatically at start up – press button B at reset or, if on batteries, Press and hold Button A and Button B for 5 seconds, then release only Button A

You can play music out of piezo speaker attached to pin 8. It also supports NeoPixel 8×8 matrix displays, for example for displaying Japanese characters.

It also has a real time clock, though it’ll lose its time when you power off. Use
SETDATE Year, month, day, hour, minute, second
eg
SETDATE 2021,5,3,12,0,0

There’s a lot more you can do with TinyBASIC on the micro:bit. There’s a comprehensive PDF manual in Japanese which you can translate using Google Translate to discover more.

Here are some sample programs featured in the video:

Blinking LED

1 'blink
5 MATRIX OFF
10 GPIO 3,OUTPUT
20 OUT 3,LOW
30 GPIO 26,OUTPUT
35 "@loop"
40 OUT 26,HIGH
50 WAIT 300
60 OUT 26,LOW
70 WAIT 300
80 GOTO "@loop"

Button input

10 CLS
20 IF !IN(BTNA) ?"Button A"
30 IF !IN(BTNB) ?"Button B"
40 WAIT 200
50 GOTO 20

Fill all the LEDs

10 CLS 1
20 D=1
30 FOR Y=0 TO 4
40 FOR X=0 TO 4
50 PSET X,Y,D
60 WAIT 100
70 NEXT X
80 NEXT Y
90 IF D D=0 ELSE D=1
100 GOTO 30

LED matrix message display

10 CLS 1
20 MSG LEFT,200,"Hello world! "
30 FOR I=O TO 30
40 MSG DOWN,50,I/10
50 WAIT 50
60 MSG LEFT,100,I%10
70 NEXT I
80 WAIT 500
90 GOTO 20
Posted in computers | Tagged , , | 2 Comments

Drive 4 digit 7-segment LED displays direct from a micro:bit

I bought a bag of random 7-segment LED displays to play around with, originally with the idea of adding them to the address and data busses on my 6502 breadboard computer. That became a bit tricky, but I got thinking about adding them to a BBC micro:bit. You can buy excellent displays for the micro:bit, like this one from Monk Makes, but I decided to to build and code my own from scratch, and like building and coding my own keypads, I learned a lot about an electronic component we take for granted.

It turns out that single-digit displays work pretty much as I expected. Each segment has a pin, and you send some volts to the pins and they light up, so a display that shows one digit and a decimal point will have nine pins, one for each segment and a common anode or cathode.

Multi-digit displays work rather differently, however. A 4 digit display does not use 4 x 8 pins. Instead it uses the same 8 pins to choose which segments to light plus 4 extra pins to chose which digit is going to light up at any given time. This means you have to multiplex the display: set the pins for the first digit, light it up by selecting it, change the segments and select the second digit, and so on. So each number is flashed on in turn. The video at the top of the page shows it working slowly. Normally you flash the digits so quickly, persistence of vision means that to the human eye it looks like they’re all on at the same time. This article on Raspi.TV explains it really well.

My display is a common cathode type. This means that you have to ground each digit selection pin in turn to make that digit light up.

If you want to try this, as well as the 4 digit LED display you’ll need a micro:bit, a breakout board, a breadboard, some jumper wires and around 7 or 8 resistors. I used 330 ohm resistors, but you may be able to use lower values depending on your display. I didn’t wire up the decimal point, just the 7 segments. I connected them like this:

micro:bit pin   Resistor?   LED pin
--------------------------------------------------
0               yes         1
1               yes         2
8               yes         4
9               yes         7
12              yes         11
2		yes         10
13              yes         5
14              no          Digit 1 select (pin 12)
15              no          Digit 2 select (pin 9)
16              no          Digit 3 select (pin 8)
10              no          Digit 4 select (pin 6)

I decided to write the program to drive the display using MakeCode blocks. You can see the project here: https://makecode.microbit.org/_HxbLuUWob6Rs

It’s a simple counter that goes up and down when you press button B or button A. A forever loop keeps scanning the display, grounding each digit pin in turn to show the correct number. Timing is pretty crucial here, so I put the main program loop inside a ‘while true’ block inside the ‘forever’ block to remove the small delay that MakeCode adds to forever loops. It seems to work! I did occasionally see some ghosting artefacts, though I think it’s pretty amazing it works at all.

So, next time you look at a numerical LED display on a clock, cooker, or fridge, spare a thought for the design effort that went in to making it work.

Posted in computers | Tagged , , | 1 Comment

6502 breadboard computer part 8 – next steps

6502 breadboard computer

I recently achieved my goal of making a 1970s-style 6502 breadboard computer that I can use to practice machine code programming. It has a hexadecimal keypad for entering instructions, a 16×2 alphanumeric LCD display and a very basic monitor program that allows me to enter programs up to 256 bytes in length and run them.

So it’s time to take stock and consider what next…

Practice my coding
There’s a lot I can do with this computer to learn more about 6502 machine code. There are stacks of books and websites to mine, from classics like Programming the 6502 by Rodnay Zaks, to helpful blogs like this one and this interactive one.

Improve the monitor
- The Apple 1 computer had an amazingly compact monitor program written by Steve Wozniak, usually called ‘wozmon’ – the source code is available and it’ll be instructional to dig into it and see how it works. Straight away, for example, I saw he’d used logical shifts instead of rotates – if I’d done that I’d never have had the carry bug that was corrupting my display of hexadecimal numbers.
- I could also make improvements to the ROM to make displaying text easier. At the moment you have to load the ASCII value of the character you want to show into the accumulator and call a subroutine. There’s almost certainly a better way of doing this. I could make it easier to write text across two lines, for example.
- I don’t want a full assembler or typewrite keyboard, but I do have a lot of spare shift-keys, so it might be fun to put frequently used opcodes as shortcuts on some spare keys, Sinclair ZX81/Spectrum-style.
- It might be useful to use the second line of the monitor display to show the contents of key registers and status flags.
- Add some way of making it easier to include keypad input in user-entered programs. This needs some thought and maybe a fundamental redesign of my monitor. At the moment the monitor sits in the ROM and pressing a key triggers an IRQ which updates the monitor display. Pressing GO (shift-A) jumps to memory location $0300 and starts executing any user-entered program. You can drop out of the user-entered program and back to the monitor with an RTI instruction. I guess looking at wozmon or even the Kim-1 monitor program might be instructive.
- Allow longer programs perhaps, but will I ever really want to type more than 256 opcodes by hand? (See note below on adding, or not adding, storage).

You know nothing of future time, and yet in my teeming circuitry I can navigate the infinite delta streams of future possibility and see that there must one day come a computer whose merest operational parameters I am not worthy to calculate, but which it will be my destiny eventually to design.
The Deep Thought computer in The Hitch-Hiker’s Guide to the Galaxy by Douglas Adams, Series 1, Fit the Fourth.

Improve the hardware
I could rewire the LCD and redesign the monitor code to drive it in 4-bit mode to free up 4 more I/O pins on the VIA, but I’m not sure what I’d actually use them for. I think I’m going to keep this machine pretty much as it is, so no video output, no storage device, no serial access, no BASIC interpreter… but perhaps design and build a second machine. This will have a full keyboard, BASIC and rather than a video output, a wide LCD display and maybe even a thermal printer in an Aim-65 style. I’d decided this and then discovered this amazing project, which is very close to what I want to build.

I’m keen to keep it broadly sympathetic to 70s/80s tech, so I’d like to avoid any microcontrollers that are more powerful than the 6502 itself… but what do you think I should do next?

Posted in computers | Tagged , | 3 Comments