BeebMaster - BeebHelp - Formatting a Disc on a BBC Model B

Formatting a disc on
a BBC Model B

OK. You've just bought a BeebMaster Disc Upgrade Kit, you've put it in the Beeb and put your lovely Beeb back together. All appears well and you've tried out a few discs of games and now you want to format your first disc.

You type *FORM80 0 and all you get is "Disk fault 18 at 00/00". Disaster!

Don't worry - this is quite normal! The reason is that the format utility was not built into the original 8271 DFS software. You will need a special formatting utility and if you can't find one, just type in the programme below and all your problems will be solved!

100REM Format - 80 Track
200REM 8271 Disc Formatter
300REM (C) Ian Wolstenholme 2007
400REM Version 3.1 26/vi/2011
500REM Allow repeat formatting
600DIM osblock 20,sector 50,track0 512
700PRINT'"BeebMaster Disc Formatter Version 3.1";
800REPEATREPEAT
900PRINT'"Which drive? ";:INPUT""D%
1000UNTILD%=0ORD%=1ORD%=2ORD%=3
1100PRINT"Formatting track ";
1200FORT%=0TO79
1300IFT%<10PRINT"0";
1400PRINT;T%;
1500PROCsector
1600A%=&7F
1700X%=osblock MOD256
1800Y%=osblock DIV256
1900?osblock=D%
2000osblock!1=sector
2100osblock?5=5:REM 5 params
2200osblock?6=&63:REM Format
2300osblock?7=T%:REM track
2400osblock?8=21:REM gap3
2500osblock?9=32+10:REM 256 bps; 10 spt
2600osblock?10=0:REM gap5
2700osblock?11=16:REM gap1
2800osblock?12=0
2900CALL&FFF1
3000IFosblock?12<>0 PRINT"?"'"Error ";~osblock?12;" at track ";T%:END
3100IFT%<79VDU8,8
3200NEXT
3300PROCcat
3400IFosblock?10=0PRINT'"Disc formatted"ELSEPRINT'"Error writing disc catalogue"
3500PRINT"Format another disc? ";
3600B%=GET:VDUB%
3700UNTILB%<>89ANDB%<>121
3800PRINT:END
3900DEFPROCsector
4000FORB%=0TO36STEP4
4100sector?B%=T%:REM track
4200sector?(B%+1)=0:REM head no
4300sector?(B%+2)=B%/4:REM sec no
4400sector?(B%+3)=1:REM 256 bps
4500NEXT
4600ENDPROC
4700DEFPROCcat
4800FORB%=0TO512STEP4
4900track0!B%=0
5000NEXT
5100track0?262=3:REM 1 for 40 track
5200track0?263=32:REM 144 for 40 track
5300X%=osblock MOD256
5400Y%=osblock DIV256
5500?osblock=D%
5600osblock!1=track0
5700osblock?5=3:osblock?6=&4B
5800osblock?7=0:osblock?8=0
5900osblock?9=34
6000osblock?10=0
6100CALL&FFF1
6200CALL&FFF1
6300ENDPROC

When RUN, this programme asks you for the drive to format and then formatting begins without any further warning so make sure you have the correct disc in the drive! At the end, there is the option to format another disc.

The routine here is an update from the version originally posted, with a number of improvements. Firstly, I've optimised the code, so at 63 lines, it's quite a bit shorter for typing in than the previous 96-line version. Secondly, I've corrected some previous errors in the format parameters to make them match the Acorn DFS specification. Thirdly, I've deleted the seek track immediately prior to each format track call, because the format track call does this anyway, so it's quite a bit quicker.

Fourthly, I've set it to write the disc map and catalogue twice, because sometimes the first time, the drive head hasn't quite caught up and so it fails. This appears to be a particular problem with modern 3" drives. I could have used a seek track 0 command to ensure the head was in the right place before writing, but since I'd deleted the seek track code, it was easier to call the write map bit twice. Finally, there is a repeat loop to allow multiple discs to be formatted.

If it's too much to type (and remember that any line or section of line from "REM" onwards can be omitted to save time) then there is a download archive file here which contains a text file of the code as well as a tokenised BASIC version. It's up to you how you get it from here to your Beeb though!



Click here to go back