Configuring a BBC Model B
Although the BBC Model B does not have the benefit of the battery-backed CMOS RAM introduced in the Master Series, a limited number of start-up options can be "configured" on this machine.
These are: the priority filing system when using DNFS, the action of BREAK and SHIFT-BREAK, disc drive timings and the default screen mode.
These options can be controlled by hardware or software means. The hardware method is to set the keyboard links. The software method is by using OSBYTE 255.
On every BBC Model B keyboard, there is a set of eight links. On the most common type of BBC keyboard ("type 1"), the keyboard PCB is cream coloured and the set of links is towards the bottom-right of the keyboard, just past the space bar. The left-most link is number 1.
For type 2 keyboards with a purply coloured PCB, the links are on the right-hand side of the circuit board and oriented vertically. Helpfully, these links are numbered 1 to 8.
If you intend to change the link options frequently then I would recommend soldering in an 8-way DIP switch which will allow you to play about at will and without having to turn your BBC off. The picture above is the switch on Station 128.
The default state is that each of the links is unmade. When the BBC reads the keyboard links, it records the result in a single byte in memory with one bit for each link. When a link is unmade or a DIP switch is off, the bit is SET (ie. "1") for that link. Beware of this because logic would dictate that when a link is unmade or off, this would translate into a clear bit ("0") but with the keyboard link system, this is the opposite of what happens.
The value of the keyboard link settings is held in the BBC's memory and this location can be read or written to using Osbyte call 255. Each of the 8 links occupies one bit of a byte of memory, which is shown in the table at the end of this page.
The link setting is updated after a hard reset (ie. CONTROL-BREAK or power-on). Obviously, when soldering links the machine will be off so the new settings will be detected when the BBC is turned back on. With a DIP switch in place, the links can be moved at any time but the settings will not be updated until the next hard break.
The default setting of Osbyte 255 is that all bits are set, ie. 128+64+32+16+8+4+2+1 = 255. The new value assigned to Osbyte 255 takes effect after the next soft reset (ie. BREAK or SHIFT-BREAK) and the default value is restored after a hard reset.
To read the last loaded settings of the keyboard links (which may have changed since the last hard reset), you can read Osbyte 255. From BASIC this would be done as follows:
PRINT ~(USR &FFF4 AND &FF00) DIV &100
This call will return a hexadecimal number, representing the contents of the X register which returns the settings of the links. The number returned can be translated into the link settings using the table below.
Table of Settings
The actions of the 8 links is shown as follows:
|1||7||128||Default filing system: DFS||Default filing system: NFS|
|2||6||64||Not used||Not used|
|3||5||32||Disc drive timings||Disc drive timings|
|4||4||16||Disc drive timings||Disc drive timings|
|5||3||8||SHIFT-BREAK to boot||BREAK to boot|
|6||2||4||+4 to screen mode||+0 to screen mode|
|7||1||2||+2 to screen mode||+0 to screen mode|
|8||0||1||+1 to screen mode||+0 to screen mode|
Links 3 and 4 set the disc drive timings. For the 8271 disc controller, the timings are as follows:
|Link setting||OSBYTE 255 Value||Step Time||Settle time||Head Load||*FX 255 Setting|
|Link 3 made, Link 4 made||0||4 ms||16 ms||0 ms||207|
|Link 3 made, Link 4 unmade||+16||6 ms||16 ms||0 ms||223|
|Link 3 unmade, Link 4 made||+32||6 ms||50 ms||32 ms||239|
|Link 3 unmade, Link 4 unmade||+48||24 ms||20 ms||64 ms||255|
To set the disc drive timings using OSBYTE 255, use the value in the table above, remembering to add any other values required. The default setting that all links are OFF, and therefore all bits SET. The disc drive timings are bits 4 & 5 of the OSBYTE 255 setting, representing values of 32 and 16. Therefore, the basic setting is 255-32-16 = 207, which should be added to the appropriate drive timing setting shown in the table above. The end column of the table above shows the value to be used with *FX255 to change the disc drive timings whilst keeping all the other settings (ie. Mode 7, SHIFT-BREAK to boot, DFS priority) the same.
Links 6, 7 and 8 set the screen mode. In the default state, all links are unmade so the mode is 4+2+1 = 7. To change to mode 0, you would need to make all three links, or reduce the "basic" setting by 7, ie. using *FX255,200 will set the screen mode to 0 whilst keeping DFS priority, SHIFT-BREAK to autoboot and leaving the disc drive timings at the fastest settings. To change to mode 6, you would just need to make link 8, or deduct 1 from the basic setting (*FX 255,206).
If you've found any of the above confusing - don't be shy now, I know I do! - then I've made a table showing all possible settings for *FX 255. There is also the Bit setting for each option, so you can use this to convert into a link or switch setting - just remember that a "1" is the switch OFF, and a "0" is the switch ON!
The table is available for download here. Inside the archive is a text file, and for the enlightened amongst you, an Open Office Spreadsheet version which has the added facility of auto-filters, so you can select what effect you want to achieve using the filters, and it will give you the *FX number and link/bit setting you need! There's also a PDF version and I've even set the print ranges in the spreadsheet so it very nicely prints out on 3 pages.