Superform and the Acorn Winchester Utilities Disk

bbc/electron apps, languages, utils, educational progs, demos + more
Post Reply
User avatar
DocBanzai
Posts: 17
Joined: Thu Dec 12, 2019 2:40 pm
Location: Sunny South Devon
Contact:

Superform and the Acorn Winchester Utilities Disk

Post by DocBanzai »

Hi all,
First off I apologsise if this a stupid question and please be kind. If I'm being an Idiot then be gentle with me... :oops:
I'm going to be getting a BeebSCSI for my Master and I've been doing a little reading (I know, a little knowledge is a dangerous thing).
On the Domesday86 BeebSCSI user guide page (https://www.domesday86.com/?page_id=400) it mentions using "Superform on ADFS floppy (either 5.25” or 3.5” depending on your floppy drive)" and I've also noticed that the orignal "Acorn Winchester Disc Filing System User Guide" mentions superform along with some other filing system utilities (The filing system utilities; CATALL, EXALL, WEDITOR, COPYF, BACKUP, SUPERFORM).
I've been hunting high and low for an image of this disk (presumably an .adl file) but have had no luck. I've come across plenty of mentions of Superform but haven't found it (except for the Z80 CPM disk version).
Does it exist? Would any kind soul take pity on me and point me in the right direction? Or am I being incredibly thick? (most likely).
I promise I have searched the forums and the interwebs (well Duck Duck Go at least).
Anway, thanks in advance for any help or advice.
Cheers!
Matt.
Master 128 with Internal PiTube Direct, Multi OS, Turbo MMC, Gotek, RAM/ROM Cartridge, Midwich (Misubishi) 5 1/4" FDD and soon a BeebSCSI.
#-o Oh, how I wish I'd kept that Osborne One/Epson/Pet/Amiga/ST/Z88/ZX81/Speccy/Mattel/BBC B #-o
User avatar
BeebMaster
Posts: 4546
Joined: Sun Aug 02, 2009 5:59 pm
Location: Lost in the BeebVault!
Contact:

Re: Superform and the Acorn Winchester Utilities Disk

Post by BeebMaster »

Here's SuperForm:

Code: Select all

   10Dealer%=TRUE
   20REM SuperForm
   30REM a really super formatter for hard disc drives
   40REM which uses the manufacturers defect list
   50REM or a file called $.Format.Defects which contains
   60REM the same info in the correct format for an Adaptec
   70REM format command.
   80REM Started by Huge, 26/6/84, and it's too Hot, 27C!
   90:
  100MODE 7
  110:
  120V$="V1.06"
  130:
  140PRINT
  150VDU 132,157,131,141
  160PRINT"Super Winchester Formatter  "+V$
  170:
  180VDU 132,157,131,141
  190PRINT"Super Winchester Formatter  "+V$
  200:
  210VDU 132,157,136,131
  220PRINT"Warning - formatting destroys data."
  230VDU 132,157,131
  240PRINT" Escape then Q to quit."
  250PROCinit
  260F%=TRUE
  270*FADFS
  280ON ERROR F%=FALSE:VDU 132,157,136,131:PRINT"Disc error when reading drive shape":IF Dealer% GOTO480 ELSE PRINT"Formatting impossible - ended":END
  290$X%="MOUNT "+STR$(drive%)
  300CALL &FFF7
  310:
  320?X%=0
  330X%!1=data%
  340X%!5=&1A :REM Mode Sense
  350X%!9=22
  360A%=&72
  370CALL &FFF1
  380IF ?X% THEN Cause an error!
  390:
  400heads%=data%?15
  410cyl%=(data%?13)*256+data%?14
  420step%=data%?21
  430rwcc%=(data%?16)*256+data%?17
  440lz%=data%?20
  450!data%=0
  460ON ERROR PRINT"Error - ";:REPORT:PRINT'"while searching for '$.Format.Defects'":GOTO580
  470IF OPENIN"$.Format.Defects" THEN CLOSE#0 ELSE VDU 132,157,136,131:PRINT"File '$.Format.Defects' not found.":GOTO580
  480ON ERROR OFF
  490:
  500IF F% ELSE GOTO580
  510$buffer%="$.Format.Defects"
  520!X%=buffer%
  530X%!2=data%
  540X%!6=0
  550A%=-1
  560CALL &FFDD
  570:
  580VDU 28,0,23,39,5
  590:
  600ON ERROR PROCerror
  610REPEAT
  620:
  630PRINT'CHR$(134)+"Action"+CHR$(135)+":";
  640Z%=GET AND &5F
  650:
  660IF Z%=13    :PROCmenu
  670IF Z%=0     :PROCmenu
  680IF Z%=ASC"A":PROCadd_sector_numbers
  690IF Z%=ASC"B":PROCadd_cyl_head_bytes
  700:
  710IF Z%=ASC"F":PROCformat_the_disc
  720IF Z%=ASC"Q":PROCquit
  730IF Z%=ASC"S":PROCsave_defect_list
  740IF Z%=ASC"T":PROCtype_defect_list
  750IF Z%=ASC"C":PROCchange_attributes:UNTILTRUE:F%=TRUE:GOTO280
  760:
  770UNTIL FALSE
  780:
  790DEF PROCmenu
  800PRINT''"Q - Quit"
  810PRINT
  820PRINT"F - Format (destroy all data - beware)!"
  830PRINT
  840PRINT"A - Add defects as sector numbers"
  850PRINT"B - Add defects as Cyl, Head, Bytes"
  860PRINT"C - Change the drive parameters"
  870PRINT
  880PRINT"S - Save an updated defect list"
  890PRINT"T - Type the defect list"
  900ENDPROC
  910:
  920DEF PROCinit
  930:
  940@%=4
  950:
  960heads%=4
  970cyl%=306
  980step%=1
  990rwcc%=128
 1000lz%=0
 1010drive%=0
 1020:
 1030DIM X% 20
 1040Y%=X% DIV 256
 1050:
 1060DIM data% 1044
 1070!data%=0
 1080:
 1090DIM buffer% 1280
 1100buffer0%=buffer%
 1110buffer1%=buffer%+1
 1120buffer2%=buffer%+2
 1130buffer3%=buffer%+3
 1140buffer4%=buffer%+4
 1150buffer5%=buffer%+5
 1160buffer6%=buffer%+6
 1170buffer7%=buffer%+7
 1180:
 1190:
 1200ENDPROC
 1210:
 1220DEF PROCadd_sector_numbers
 1230PRINT"Add sectors"'
 1240:
 1250K%=-8
 1260:
 1270REPEAT
 1280K%=K%+8
 1290INPUT"Sector ? "A$
 1300IF A$=""ELSEbuffer%!K%=EVALA$
 1310IF K%>1023 PRINT"Buffer full":A$=""
 1320UNTILA$=""
 1330:
 1340IF K% ELSE ENDPROC
 1350PRINT'"Bad sectors are -"
 1360VDU14
 1370FORJ%=0 TO K%-8 STEP 8
 1380PRINT" &"~buffer%!J%," = "buffer%!J%
 1390NEXT
 1400VDU15
 1410REPEAT
 1420PRINT'"Correct (Y/N) ? ";
 1430Z%=GET AND &5F
 1440UNTILZ%=ASC"Y" OR Z%=ASC "N"
 1450:
 1460IF Z%=ASC"N":PRINT"No":ENDPROC
 1470PRINT"Yes"'"Adding new defects to list"
 1480:
 1490PROCtranslate_buffer(K%)
 1500:
 1510PROCinsert_buffer(K%)
 1520:
 1530PRINTK%/8" new defects added to list."'
 1540ENDPROC
 1550:
 1560DEF PROCadd_cyl_head_bytes
 1570PRINT"Add defects"'
 1580:
 1590K%=-8
 1600:
 1610REPEAT
 1620K%=K%+8
 1630INPUTLINE "Head, Cyl, Bytes ? "A$
 1640IF A$=""GOTO1820
 1650A$=A$+","
 1660:
 1670buffer3%?K%=EVALLEFT$(A$,INSTR(A$,","))
 1680:
 1690B$=MID$(A$,INSTR(A$,",")+1)
 1700IF B$="":INPUTLINE"      Cyl, Bytes ? "B$:B$=B$+","
 1710buffer0%!K%=EVALLEFT$(B$,INSTR(B$,","))ORbuffer0%!K%AND&FF000000
 1720:
 1730B$=MID$(B$,INSTR(B$,",")+1)
 1740IF B$="":INPUTLINE"           Bytes ? "B$:B$=B$+","
 1750:
 1760buffer4%!K%=EVALLEFT$(B$,INSTR(B$,","))
 1770:
 1780IF buffer3%?K%>=heads%:PRINT"Head number too big - entry rejected.":GOTO1630
 1790:
 1800   IF (buffer0%!K% AND &FFFFFF) >=cyl%:PRINT"Cylinder too big - entry rejected.":GOTO1630
 1810:
 1820UNTIL A$=""
 1830IF K% ELSE ENDPROC
 1840VDU14
 1850PRINT'"Bad areas are -"'"Head  Cylinder   Bytes"
 1860FORJ%=0 TO K%-8 STEP 8
 1870PRINTbuffer3%?J%TAB(10)buffer0%!J%AND&FFFFFFTAB(18)buffer4%!J%
 1880NEXT
 1890VDU15
 1900REPEAT
 1910PRINT'"Correct (Y/N) ? ";
 1920Z%=GET AND &5F
 1930UNTILZ%=ASC"Y" OR Z%=ASC "N"
 1940:
 1950IF Z%=ASC"N":PRINT"No":ENDPROC
 1960PRINT"Yes"'"Adding new defects to list"
 1970:
 1980FORJ%=0TOK%-8 STEP8
 1990Z%=buffer2%?J%:buffer2%?J%=buffer0%?J%:buffer0%?J%=Z%
 2000Z%=buffer4%?J%:buffer4%?J%=buffer7%?J%:buffer7%?J%=Z%
 2010Z%=buffer6%?J%:buffer6%?J%=buffer5%?J%:buffer5%?J%=Z%
 2020NEXT
 2030:
 2040PROCinsert_buffer(K%)
 2050:
 2060PRINTK%/8" new defects added to list."'
 2070ENDPROC
 2080:
 2090DEF PROCsave_defect_list
 2100PRINT"Save defect list"'
 2110IF F% ELSE PRINT"Disc not formatted - save impossible":ENDPROC
 2120*dir $.Format
 2130IF OPENIN"Defects":CLOSE#0:*rename Defects OldDefects
 2140$buffer%="Defects"
 2150!X%=buffer%
 2160X%!2=-1
 2170X%!6=0
 2180X%!10=data%
 2190X%!14=data%+1024
 2200A%=0
 2210CALL &FFDD
 2220PRINT"New Defects file saved."
 2230IF OPENIN"OldDefects":CLOSE#0:PRINT"Old Defects file renamed."
 2240*back
 2250ENDPROC
 2260:
 2270DEF PROCtype_defect_list
 2280PRINT"Type defect list"'
 2290VDU 14
 2300PRINT'"Defect list"
 2310PRINT"Head   Cylinder    Bytes"
 2320:
 2330N%=data%?2*256+data%?3
 2340IF N% ELSEPRINT"No defects in list"':VDU15:ENDPROC
 2350FORI%=data%+4 TO data%+N%-4 STEP8
 2360PRINTI%?3TAB(10)?I%*&10000+I%?1*256+I%?2TAB(20);
 2370PRINT((I%?4*256+I%?5)*256+I%?6)*256+I%?7
 2380NEXT
 2390PRINTN%/8" defects in list."'
 2400VDU15
 2410ENDPROC
 2420:
 2430DEF PROCerror
 2440VDU15
 2450IF ERR=17:ENDPROC
 2460REPORT
 2470PRINT" at line "ERL
 2480ENDPROC
 2490:
 2500DEF PROCquit
 2510VDU 12,26,10,10,10,10,10,10,10,10,13
 2520PRINT"Quit"
 2530END
 2540:
 2550DEF PROCchange_attributes
 2560PRINT"Change attributes"'
 2570PRINT
 2580PRINT"Current attributes are"
 2590PRINT"Heads =        "heads%
 2600PRINT"Cylinders =    "cyl%
 2610PRINT"Step rate code "step%
 2620PRINT"RWCC =         "rwcc%
 2630PRINT"Landing zone = "lz%
 2640PRINT
 2650PRINT"Format drive  :"drive%
 2660PRINT
 2670INPUT"Change drive number only (Y/N) ? "A$
 2680ON INSTR("YyNn",LEFT$(A$,1))GOTO 2690,2690,2720,2720 ELSE GOTO 2670
 2690INPUT"Format drive number : "drive%
 2700ENDPROC
 2710:
 2720PRINT"New attributes -"
 2730INPUT"Heads =        "heads%
 2740INPUT"Cylinders =    "cyl%
 2750INPUT"Step rate code "step%
 2760INPUT"RWCC =         "rwcc%
 2770INPUT"Landing zone = "lz%
 2780PRINT
 2790REM Now set the escape condition, back to the prompt.
 2800*fx 125
 2810::::::EndProc
 2820:
 2830:
 2840DEF PROCtranslate_buffer(K%)
 2850:
 2860FORI%=0 TO K%-8 STEP8
 2870Q%=buffer%!I%
 2880IF FNtranslate(Q%,buffer%+I%) ELSE NEXT:ENDPROC
 2890IF FNtranslate(Q%+1,buffer%+I%) THEN GOTO3000
 2900R%=((buffer4%?I%*256+buffer5%?I%)*256+buffer6%?I%)*256+buffer7%?I%
 2910R%=R%-&618
 2920IF R%<0 GOTO3000
 2930buffer4%?I%=R%DIV&1000000
 2940buffer5%?I%=R%DIV&10000
 2950buffer6%?I%=R%DIV&100
 2960buffer7%?I%=R%
 2970NEXT
 2980ENDPROC
 2990:
 3000IF FNtranslate(Q%-1,buffer%+I%) THEN PRINT"***Translation impossible ",~Q%:STOP
 3010R%=((buffer4%?I%*256+buffer5%?I%)*256+buffer6%?I%)*256+buffer7%?I%
 3020R%=R%+&618
 3030GOTO2930
 3040:
 3050DEF FNtranslate(sector%,address%)
 3060?X%=0
 3070X%!1=address%
 3080X%?5=&F
 3090X%?6=drive%*&20+sector%DIV&10000
 3100X%?7=sector%DIV&100
 3110X%?8=sector%
 3120X%!9=0
 3130A%=&72
 3140CALL &FFF1
 3150=?X%
 3160:
 3170:
 3180DEF PROCinsert_buffer(K%)
 3190IF K% ELSE ENDPROC
 3200N%=data%?3+data%?2*256
 3210:
 3220FORJ%=buffer% TO buffer%+K%-8 STEP8
 3230:
 3240fpos%=data%+4
 3250lpos%=data%+4+N%
 3260:
 3270FORbyte%=0TO7
 3280IF fpos%>=lpos%:byte%=8:NEXT:GOTO3410
 3290fpos%=fpos%-8
 3300REPEAT
 3310fpos%=fpos%+8
 3320UNTIL fpos%?byte%>=J%?byte% OR lpos%=fpos%
 3330:
 3340REPEAT
 3350lpos%=lpos%-8
 3360UNTIL lpos%?byte%<=J%?byte% OR lpos%=fpos%-8
 3370lpos%=lpos%+8
 3380:
 3390NEXTbyte%
 3400:
 3410FORI%=data%+N% TO fpos% STEP-4
 3420I%!8=!I%
 3430NEXT I%
 3440N%=N%+8
 3450data%?2=N%DIV&100
 3460data%?3=N%
 3470!fpos%=!J%
 3480fpos%!4=J%!4
 3490NEXT J%
 3500ENDPROC
 3510:
 3520DEF PROCformat_the_disc
 3530PRINT"Format"
 3540VDU129,157,131,141,136
 3550PRINT"Formatting destroys all data"
 3560VDU129,157,131,141,136
 3570PRINT"Formatting destroys all data"
 3580PRINT
 3590@%=0
 3600PRINT"You really want to format drive "drive%" ? ";
 3610IF (GET AND &5F)=ASC"Y":PRINT"Y";ELSEPRINT'"Aborted"':ENDPROC
 3620IF (GET AND &5F)=ASC"E":PRINT"e";ELSEPRINT'"Aborted"':ENDPROC
 3630IF (GET AND &5F)=ASC"S":PRINT"s";ELSEPRINT'"Aborted"':ENDPROC
 3640IF  GET         =13    :PRINT    ELSEPRINT'"Aborted"':ENDPROC
 3650:
 3660INPUT"Fill byte (RETURN for default) ? "A$
 3670IF A$="":fill%=&6C ELSE fill%=EVALA$
 3680:
 3690REPEAT
 3700PROCmode_select
 3710:
 3720PRINT"Formatting ..."
 3730PROCformat
 3740:
 3750I%=0
 3760K%=0
 3770PRINT"Verifying ..."
 3780PROCverify(I%)
 3790PROCget_error
 3800IF error%=&21 OR error%=&23 OR sector%>heads%*cyl%*33-(K%+data%?3+data%?2*256)DIV8 GOTO 3870
 3810PRINT"Defect "~error%" at "~sector%
 3820buffer%!K%=sector%
 3830K%=K%+8
 3840I%=sector%+1
 3850GOTO 3780
 3860:
 3870PROCtranslate_buffer(K%)
 3880:
 3890PROCinsert_buffer(K%)
 3900:
 3910IF K% PRINTK%DIV8" defects found."'"Re";ELSEPRINT"No defects found."
 3920UNTILK%=0
 3930:
 3940FORI%=buffer% TO buffer%+1279 STEP4
 3950!I%=0
 3960NEXT
 3970:
 3980!buffer%=7
 3990buffer%!252=heads%*cyl%*33-128
 4000buffer%!256=heads%*cyl%*33-135
 4010buffer%!507=RND
 4020buffer%!509=&300
 4030:
 4040P%=buffer%+1000
 4050[ OPT2
 4060CLC:LDY#&FF:TYA
 4070.L1% ADC buffer%+255,Y
 4080DEY:BNE L1%
 4090TAX:DEY:CLC:TYA
 4100.L2% ADC buffer%-1,Y
 4110DEY:BNE L2%
 4120STX buffer%+511
 4130STA buffer%+255
 4140RTS
 4150]
 4160CALL buffer%+1000
 4170:
 4180PRINT"Writing map"
 4190PROCwrite_map
 4200:
 4210FORI%=buffer% TO buffer%+1279 STEP4
 4220!I%=0
 4230NEXT
 4240buffer%!1=&6F677548
 4250buffer%!&4FB=&6F677548
 4260$(buffer%+&4CC)="$"
 4270$(buffer%+&4D9)="$"
 4280buffer%?&4D6=2
 4290PROCwrite_dir
 4300$X%="MOUNT "+STR$(drive%)
 4310CALL &FFF7
 4320PRINT"Writing root"
 4330F%=TRUE
 4340*DIR $
 4350*LIB $
 4360*CDIR Format
 4370PROCsave_defect_list
 4380:
 4390$buffer%="$.Format.SuperForm"
 4400!X%=buffer%
 4410X%!2=PAGE
 4420X%!6=&8023
 4430X%!10=PAGE
 4440X%!14=TOP
 4450A%=0
 4460CALL &FFDD
 4470PRINT"SuperForm saved."
 4480:
 4490$buffer%="$.Format.SuperForm1"
 4500X%!10=PAGE
 4510X%!14=TOP
 4520A%=0
 4530CALL &FFDD
 4540PRINT"SuperForm1 saved."
 4550:
 4560ENDPROC
 4570:
 4580:
 4590DEF PROCmode_select
 4600:
 4610?X%=0
 4620X%!1=buffer%
 4630X%?5=&15
 4640X%?6=drive%*&20
 4650X%!7=&160000
 4660:
 4670!buffer%=&8000000
 4680buffer%!4=0
 4690buffer%!8=&10000
 4700buffer%?12=1
 4710buffer%?13=cyl%DIV256
 4720buffer%?14=cyl%
 4730buffer%?15=heads%
 4740buffer%?16=rwcc%DIV256
 4750buffer%?17=rwcc%
 4760buffer%?18=rwcc%DIV256
 4770buffer%?19=rwcc%
 4780buffer%?20=lz%
 4790buffer%?21=step%
 4800:
 4810A%=&72
 4820CALL &FFF1
 4830:
 4840IF ?X% PRINT"Error "~?X%" during ModeSel":STOP
 4850ENDPROC
 4860:
 4870DEF PROCformat
 4880:
 4890?X%=0
 4900X%!1=data%
 4910X%?5=4
 4920X%?6=drive%*&20+&1E
 4930X%?7=fill%
 4940X%?8=0
 4950X%?9=5
 4960X%?10=0
 4970:
 4980A%=&72
 4990CALL &FFF1
 5000IF ?X% PRINT"Error "~?X%" in Format":STOP
 5010ENDPROC
 5020:
 5030DEF PROCverify(I%)
 5040:
 5050?X%=0
 5060X%!1=0
 5070X%?5=&2F
 5080X%?6=drive%*&20
 5090X%?7=I% DIV &1000000
 5100X%?8=I% DIV &10000
 5110X%?9=I% DIV &100
 5120X%?10=I%
 5130X%!11=0
 5140:
 5150A%=&72
 5160CALL &FFF1
 5170IF ?X% ELSE I%=I%+&10000:GOTO5060
 5180ENDPROC
 5190:
 5200DEF PROCget_error
 5210:
 5220A%=&73
 5230CALL &FFF1
 5240:
 5250error%=X%?3
 5260sector%=(!X%)AND&1FFFFF
 5270ENDPROC
 5280:
 5290DEF PROCwrite_map
 5300?X%=0
 5310X%!1=buffer%
 5320X%?5=10
 5330X%?6=drive%*&20
 5340X%!7=0
 5350X%!9=2
 5360:
 5370CALL &FFF1
 5380IF ?X% PRINT"Error "~?X%" in write_map":STOP
 5390ENDPROC
 5400:
 5410DEF PROCwrite_dir
 5420?X%=0
 5430X%!1=buffer%
 5440X%?5=10
 5450X%?6=drive%*&20
 5460X%!7=&50200
 5470:
 5480CALL &FFF1
 5490IF ?X% PRINT"Error "~?X%" in write_dir":STOP
 5500ENDPROC
 5510:
Also UltraForm, my own take on it:

Code: Select all

  100REM UltraForm2 (Combined Version)
  120REM Winchester Disc formatter for Adaptec Controllers
  140REM Uses Acorn's Superform as a shell with improvements:
  160REM (1) Selectable interleave
  180REM (2) Option to format first with no interleave then with selected interleave
  200REM (3) Better defect sector translation using values in Adaptec manual
  220REM (4) Can cope with discs with more than 128 defects
  240REM (5) Maximise disc space by better calculation of available sectors (i.e. doesn't just reserve 128 sectors for defects like Superform)
  260REM (6) Continue after errors - helps to cope with SCSI-SD card
  280REM Ultraform amendments (C) Ian Wolstenholme 2006-2020
  300REM Version 2.8 4/v/2020
  320REM If BeebSCSI, option to manually
  330REM fill drive with fill byte
  340REM Replace OSCLI call with OSCLI keyword
  350REM Restore A,X,Y before all original OSWORD calls (corrupted by other routines and not reset)
  460PROCinit
  480MODE7
  500FORB%=1TO2
  520VDU131,157,132,141
  540PRINT"UltraForm Winchester Formatter v2.8"
  560NEXT
  580VDU131,157,136,132
  600PRINT"BEWARE formatting destroys ALL data"
  620VDU131,157,132
  640PRINT" Escape then Q to quit."
  660F%=TRUE
  680*DISMOUNT
  700*FADFS
  720ON ERROR F%=FALSE:VDU 132,157,136,131:PRINT"Disc error when reading drive shape":GOTO1080
  740OSCLI"MOUNT "+STR$(drive%)
  750X%=x%:Y%=X% DIV256:REM //ISW 4/v/2020 - corrupted by other calls
  780?X%=0
  800X%!1=data%
  820X%!5=&1A
  840X%!9=22
  860A%=&72
  880CALL&FFF1
  900IF ?X% THEN Cause an error!
  920heads%=data%?15
  940cyl%=(data%?13)*256+data%?14
  960step%=data%?21
  980rwcc%=(data%?16)*256+data%?17
 1000lz%=data%?20
 1020!data%=0
 1040ON ERROR PRINT"Error - ";:REPORT:PRINT'"while searching for '$.Format.Defects'":GOTO1260
 1060IF OPENIN"$.Format.Defects" THEN CLOSE#0 ELSE VDU 132,157,136,131:PRINT"File '$.Format.Defects' not found.":GOTO1260
 1080ON ERROR OFF
 1100IFF% ELSE GOTO1260
 1120$buffer%="$.Format.Defects"
 1140!X%=buffer%
 1160X%!2=data%
 1180X%!6=0
 1200A%=-1
 1220CALL&FFDD
 1240A%=&72:REM restore for OSWORD calls after OSFILE call //ISW 9/ii/2020
 1260VDU28,0,23,39,4
 1280PROCmenu
 1300ONERRORPROCerror
 1320REPEAT
 1340PRINT'CHR$(134)+"Action"+CHR$(135)+":";
 1360*FX15,0
 1380Z%=GET AND &5F
 1400IFZ%=13    :PROCmenu
 1420IFZ%=0     :PROCmenu
 1440IFZ%=ASC"A":PROCadd_sector_numbers
 1460IFZ%=ASC"B":PROCadd_cyl_head_bytes
 1480IFZ%=ASC"F":PROCformat_the_disc:Z%=INKEY(100):Z%=0:*FX15,0
 1500IFZ%=ASC"L":PRINT"List current parameters":PROClistparams
 1520IFZ%=ASC"Q":PROCquit
 1540IFZ%=ASC"S":PROCsave_defect_list
 1560IFZ%=ASC"T":PROCtype_defect_list
 1580IFZ%=ASC"C":PROCchange_attributes:F%=TRUE:REM Jump to mode sense removed 'cos overrides new settings just entered! //ISW 15/i/2011
 1590IFZ%=ASC"D":PROCchange_drive:GOTO740
 1600IFZ%=ASC"V":PRINT"Verify disc":PROCdoverify
 1620IFZ%=ASC"I":PROCdoinit
 1640IFZ%=ASC"M"PROCmfm
 1660IFZ%=ASC"R"PROCrll
 1670IFZ%=ASC"X"PROCtogglefill
 1680UNTILFALSE
 1700DEFPROCmenu
 1720PRINT'"ƒOptions are:"'
 1740PRINT"A - Add defects as sector numbers"
 1760PRINT"B - Add defects as Cyl, Head, Bytes"
 1780PRINT"C - Change the format parameters"
 1790PRINT"D - Change drive number"
 1800PRINT"L - List current format parameters"
 1820PRINT"M - Select MFM controller"'"R - Select RLL controller"
 1840PRINT"F - Formatˆ(destroy all data - beware)!"
 1860PRINT"V - Verify disc"
 1880PRINT"I - Initialise disc"
 1900PRINT"S - Save an updated defect list"
 1920PRINT"T - Type the defect list"
 1930IFFNBeebSCSI PRINT"X - Toggle manual fill after format"
 1940PRINT'"Q - Quit"
 1960ENDPROC
 1980DEFPROCinit
 2000@%=4
 2020heads%=4
 2040cyl%=615
 2060step%=2:REM amended to 2 for fastest rate //ISW 16/i/2011
 2080rwcc%=128
 2100lz%=0
 2120drive%=0
 2140IFM%<>TRUE AND M%<>0 M%=FALSE:REM MFM Flag; keep previous value if valid //ISW 10/iii/12
 2160IFM% spt%=33 ELSEspt%=47
 2180vblocks%=&2000:REM number of blocks per verify op
 2200IFT%<1ORT%>spt% T%=5:REM interleave; keep previous value if valid //ISW 10/iii/2012
 2220PROCinterleave(T%)
 2240V%=1:REM counter for number of formats.  Set V=0 to format with interleave=1 on first format (recommended in Adaptec manual) then with i/leave=T% on reformats, or V%>0 for format always with i/leave of T% //ISW 6/i/07
 2260fpos%=0:lpos%=0:byte%=0:REM Declare earlier than DIMs to stop DIM overflow deleting variables  //ISW 9/ii/2014
 2270dofill%=FALSE
 2280DIM X% 20:x%=X%:REM //ISW Keep track of OS block X% 4/v/2020
 2300Y%=X% DIV256
 2320DIM data% 2048:REM only 1044 needed
 2340FORB%=0TO2044STEP4:data%!B%=0:NEXT
 2360DIM buffer% 8200:REM 8K for fill drive with fill byte, otherwise only 1280
 2380buffer0%=buffer%
 2400buffer1%=buffer%+1
 2420buffer2%=buffer%+2
 2440buffer3%=buffer%+3
 2460buffer4%=buffer%+4
 2480buffer5%=buffer%+5
 2500buffer6%=buffer%+6
 2520buffer7%=buffer%+7
 2540DIM osblock 16,result 16:REM for BSCSI detect
 2560IFFNBeebSCSI E%=0 ELSE E%=8:REM no of error sectors to reserve
 2580ENDPROC
 2600DEFPROCadd_sector_numbers
 2620PRINT"Add sectors"'
 2640K%=-8
 2660REPEAT
 2680K%=K%+8
 2700INPUT"Sector ? "A$
 2720IFA$=""ELSEbuffer%!K%=EVALA$
 2740IFK%>1023 PRINT"Buffer full":A$=""
 2760UNTILA$=""
 2780IFK% ELSE ENDPROC
 2800PRINT'"Bad sectors are -"
 2820VDU14
 2840FORJ%=0 TO K%-8 STEP 8
 2860PRINT" &"~buffer%!J%," = "buffer%!J%
 2880NEXT
 2900VDU15
 2920REPEAT
 2940PRINT'"Correct (Y/N) ? ";
 2960Z%=GET AND &5F
 2980UNTILZ%=ASC"Y" OR Z%=ASC "N"
 3000IFZ%=ASC"N":PRINT"No":ENDPROC
 3020PRINT"Yes"'"Adding new defects to list"
 3040PROCtranslate_buffer(K%)
 3060PROCinsert_buffer(K%)
 3080PRINTK%/8" new defects added to list."'
 3100ENDPROC
 3120DEFPROCadd_cyl_head_bytes
 3140PRINT"Add defects"'
 3160K%=-8
 3180REPEAT
 3200K%=K%+8
 3220INPUTLINE "Head, Cyl, Bytes ? "A$
 3240IFA$=""GOTO3460
 3260A$=A$+","
 3280buffer3%?K%=EVALLEFT$(A$,INSTR(A$,","))
 3300B$=MID$(A$,INSTR(A$,",")+1)
 3320IFB$="":INPUTLINE"      Cyl, Bytes ? "B$:B$=B$+","
 3340buffer0%!K%=EVALLEFT$(B$,INSTR(B$,","))ORbuffer0%!K%AND&FF000000
 3360B$=MID$(B$,INSTR(B$,",")+1)
 3380IFB$="":INPUTLINE"           Bytes ? "B$:B$=B$+","
 3400buffer4%!K%=EVALLEFT$(B$,INSTR(B$,","))
 3420IF buffer3%?K%>=heads%:PRINT"Head number too big - entry rejected.":GOTO3220
 3440IF(buffer0%!K% AND &FFFFFF)>=cyl%:PRINT"Cylinder too big - entry rejected.":GOTO3220
 3460UNTILA$=""
 3480IFK% ELSE ENDPROC
 3500VDU14
 3520PRINT'"Bad areas are -"'"Head  Cylinder   Bytes"
 3540FORJ%=0 TO K%-8 STEP 8
 3560PRINTbuffer3%?J%TAB(10)buffer0%!J%AND&FFFFFFTAB(18)buffer4%!J%
 3580NEXT
 3600VDU15
 3620REPEAT
 3640PRINT'"Correct (Y/N) ? ";
 3660Z%=GET AND &5F
 3680UNTILZ%=ASC"Y" OR Z%=ASC "N"
 3700IFZ%=ASC"N":PRINT"No":ENDPROC
 3720PRINT"Yes"'"Adding new defects to list"
 3740FORJ%=0TOK%-8 STEP8
 3760Z%=buffer2%?J%:buffer2%?J%=buffer0%?J%:buffer0%?J%=Z%
 3780Z%=buffer4%?J%:buffer4%?J%=buffer7%?J%:buffer7%?J%=Z%
 3800Z%=buffer6%?J%:buffer6%?J%=buffer5%?J%:buffer5%?J%=Z%
 3820NEXT
 3840PROCinsert_buffer(K%)
 3860PRINTK%/8" new defects added to list."'
 3880ENDPROC
 3900DEFPROCsave_defect_list
 3920PRINT"Save defect list"'
 3940IFF% ELSE PRINT"Disc not formatted - save impossible":ENDPROC
 3960*dir $.Format
 3980IF OPENIN"Defects":CLOSE#0:*rename Defects OldDefects
 4000$buffer%="Defects"
 4020!X%=buffer%
 4040X%!2=-1
 4060X%!6=0
 4080X%!10=data%
 4100X%!14=data%+1024
 4120A%=0
 4140CALL&FFDD
 4160PRINT"New Defects file saved."
 4180IF OPENIN"OldDefects":CLOSE#0:PRINT"Old Defects file renamed."
 4200*back
 4220ENDPROC
 4240DEFPROCtype_defect_list
 4260PRINT"Type defect list"'
 4280VDU14
 4300PRINT'"Defect list"
 4320PRINT"Head   Cylinder    Bytes"
 4340N%=data%?2*256+data%?3
 4360IFN% ELSEPRINT"No defects in list"':VDU15:ENDPROC
 4380FORI%=data%+4 TO data%+N%-4 STEP8
 4400PRINTI%?3TAB(10)?I%*&10000+I%?1*256+I%?2TAB(20);
 4420PRINT((I%?4*256+I%?5)*256+I%?6)*256+I%?7
 4440NEXT
 4460PRINTN%/8" defects in list."'
 4480VDU15
 4500ENDPROC
 4520DEFPROCerror
 4540VDU15
 4560IFERR=17:ENDPROC
 4580REPORT
 4600PRINT" at line "ERL
 4620ENDPROC
 4640DEFPROCquit
 4660VDU12,26,10,10,10,10,10,10,10,10,13
 4680PRINT"Quit"
 4700END
 4720DEFPROClistparams
 4740PRINT
 4760PRINT"Current attributes are"
 4780PRINT"Drive                 "drive%
 4800PRINT"Heads =               "heads%
 4820PRINT"Cylinders =           "cyl%
 4840PRINT"Step rate code        "step%
 4860PRINT"RWCC =                "rwcc%
 4880PRINT"Landing zone offset = "lz%
 4900PRINT"Interleave =          "T%
 4920PRINT"Sectors per track =   "spt%
 4940IFM%PRINT"MFM";ELSEPRINT"RLL";
 4960PRINT" Controller"
 4970IFFNBeebSCSI PRINT"Manual byte fill       ";:IFdofill% PRINT"On" ELSEPRINT"Off"
 4980PRINT
 5000ENDPROC
 5020DEFPROCchange_attributes
 5040PRINT"Change Format Parameters"
 5060PROClistparams
 5160PRINT"New attributes -"
 5180INPUT"Heads =               "heads%
 5200INPUT"Cylinders =           "cyl%
 5220INPUT"Step rate code        "step%
 5240INPUT"RWCC =                "rwcc%
 5260INPUT"Landing zone =        "lz%
 5280INPUT"Interleave =          "T%
 5300PROCmfmrll
 5320PROCinterleave(T%):REM //ISW 9/i/2011
 5340PRINT'"Sectors per track will be : "spt%
 5360PRINT
 5380PROCmode_select
 5400ENDPROC
 5420DEFPROCtranslate_buffer(K%)
 5440IFK%<>0PRINT"Translating defects..." ELSE ENDPROC:REM //ISW 4/v/2020 ELSE added
 5460FORI%=0 TO K%-8 STEP8
 5480Q%=buffer%!I%
 5500C%=0
 5520IF FNtranslate(Q%,buffer%+I%) GOTO5580
 5540IFC%>10PRINT"Too many retries - skipping":NEXT:ENDPROC
 5560IF((buffer4%?I%*256+buffer5%?I%)*256+buffer6%?I%)*256+buffer7%?I%>maxbfi% OR (buffer%?I%*65536+buffer1%?I%*256+buffer2%?I%)>cyl% PRINT"Translation error - retrying":C%=C%+1:GOTO 5520 ELSENEXT:ENDPROC:REM //ISW 16/iii/11
 5580IF FNtranslate(Q%+1,buffer%+I%) THEN GOTO5800
 5600R%=((buffer4%?I%*256+buffer5%?I%)*256+buffer6%?I%)*256+buffer7%?I%
 5620R%=R%-(U%*W%):REM translate using next sector, add bytes per record (U%) * interleave (W%) for correct calculation of offset //ISW 5/i/07
 5640IFR%>maxbfi% OR(buffer%?I%*65536+buffer1%?I%*256+buffer2%?I%)>cyl% ANDC%<10 PRINT"Translation error - retrying":GOTO5580 ELSEPRINT"Too many retries - skipping"
 5660IF R%<0 GOTO5800
 5680buffer4%?I%=R%DIV&1000000
 5700buffer5%?I%=R%DIV&10000
 5720buffer6%?I%=R%DIV&100
 5740buffer7%?I%=R%
 5760NEXT
 5780ENDPROC
 5800C%=C%+1:IF FNtranslate(Q%-1,buffer%+I%) THEN PRINT"***Translation impossible ",~Q%:STOP
 5820R%=((buffer4%?I%*256+buffer5%?I%)*256+buffer6%?I%)*256+buffer7%?I%
 5840R%=R%+(U%*W%):REM translate using previous sector, see line 4910 //ISW 5/i/07
 5860IFR%>maxbfi% OR(buffer%?I%*65536+buffer1%?I%*256+buffer2%?I%)>cyl% ANDC%<10 PRINT"Translation error - retrying":GOTO5800
 5880GOTO5680
 5900DEFFNtranslate(sector%,address%)
 5910X%=x%:Y%=X% DIV256:REM //ISW 4/v/2020 - corrupted by other calls
 5920?X%=0
 5940X%!1=address%
 5960X%?5=&F
 5980X%?6=drive%*&20+sector%DIV&10000
 6000X%?7=sector%DIV&100
 6020X%?8=sector%
 6040X%!9=0
 6060A%=&72
 6080CALL&FFF1
 6100IFK%<>0PRINT"Sec &";~sector%;" =";TAB(13)"Cyl ";(?address%*65536+address%?1*256+address%?2);TAB(21)"Head ";address%?3;" BFI ";address%?4*16777216+address%?5*65536+address%?6*256+address%?7:REM //ISW 9/i/2011
 6120=?X%
 6140DEFPROCinsert_buffer(K%)
 6160IFK% ELSE ENDPROC
 6180N%=data%?3+data%?2*256
 6200FORJ%=buffer% TO buffer%+K%-8 STEP8
 6220fpos%=data%+4
 6240lpos%=data%+4+N%
 6260FORbyte%=0TO7
 6280IF fpos%>=lpos%:byte%=8:NEXT:GOTO6480
 6300fpos%=fpos%-8
 6320REPEAT
 6340fpos%=fpos%+8
 6360UNTIL fpos%?byte%>=J%?byte% OR lpos%=fpos%
 6380REPEAT
 6400lpos%=lpos%-8
 6420UNTIL lpos%?byte%<=J%?byte% OR lpos%=fpos%-8
 6440lpos%=lpos%+8
 6460NEXTbyte%
 6480FORI%=data%+N% TO fpos% STEP-4
 6500I%!8=!I%
 6520NEXT I%
 6540N%=N%+8
 6560data%?2=N%DIV&100
 6580data%?3=N%
 6600!fpos%=!J%
 6620fpos%!4=J%!4
 6640NEXT J%
 6660ENDPROC
 6680DEFPROCformat_the_disc
 6700PRINT"Format"
 6720VDU129,157,131,141,136
 6740PRINT"Formatting destroys all data"
 6760VDU129,157,131,141,136
 6780PRINT"Formatting destroys all data"
 6800PRINT
 6820@%=0
 6840IFV%>1 V%=1:REM reset format counter in case more than one drive formatted in same run //ISW 6/x/2018
 6860PRINT"You really want to format drive "drive%" ? ";
 6880IF(GET AND &5F)=ASC"Y":PRINT"Y";ELSEPRINT'"Aborted"':ENDPROC
 6900IF(GET AND &5F)=ASC"E":PRINT"e";ELSEPRINT'"Aborted"':ENDPROC
 6920IF(GET AND &5F)=ASC"S":PRINT"s";ELSEPRINT'"Aborted"':ENDPROC
 6940IF GET=13 PRINT ELSEPRINT'"Aborted"':ENDPROC
 6960INPUT"Fill byte (RETURN for default) ? "A$
 6980IF A$="":fill%=&6C ELSE fill%=EVALA$
 7000REPEAT
 7020PROCmode_select
 7040PRINT"Formatting attempt number ";V%;" ...";
 7060PROCformat
 7070IFFNBeebSCSI PROCfilldisc(fill%):REM //ISW 4/v/2020
 7080PRINT
 7100V%=V%+1:REM increment format counter //ISW 5/i/07
 7120PROCdoverify
 7140PROCtranslate_buffer(K%):PROCinsert_buffer(K%)
 7160IF L% PRINTL%DIV8" defects found."ELSEPRINT"No defects found."
 7180UNTILK%=0
 7200PROCinitialise
 7220ENDPROC
 7240DEFPROCinitialise
 7260FORI%=buffer% TO buffer%+1279 STEP4
 7280!I%=0
 7300NEXT
 7320N%=data%?2*256+data%?3:REM size of defect list //ISW 29/iii/07
 7340!buffer%=7
 7360buffer%!252=heads%*cyl%*spt%-E%-(N% DIV8):REM calculate total available sectors by drive geometry less number of bad sectors in defect list less margin of error in E%  //ISW 9/ii/2020
 7380buffer%!256=heads%*cyl%*spt%-E%-7-(N% DIV8):REM length of first free space, i.e. as above less 7 sectors for space used by FS map & root //ISW 9/ii/2020
 7400buffer%!507=RND
 7420buffer%!509=&300
 7440P%=buffer%+1000
 7460[ OPT2
 7480CLC:LDY#&FF:TYA
 7500.L1% ADC buffer%+255,Y
 7520DEY:BNE L1%
 7540TAX:DEY:CLC:TYA
 7560.L2% ADC buffer%-1,Y
 7580DEY:BNE L2%
 7600STX buffer%+511
 7620STA buffer%+255
 7640RTS
 7660]
 7680CALLbuffer%+1000
 7700PRINT"Writing map"
 7720PROCwrite_map
 7740FORI%=buffer% TO buffer%+1279 STEP4
 7760!I%=0
 7780NEXT
 7800buffer%!1=&6F677548
 7820buffer%!&4FB=&6F677548
 7840$(buffer%+&4CC)="$"
 7860$(buffer%+&4D9)="$"
 7880buffer%?&4D6=2
 7900PROCwrite_dir
 7920OSCLI"MOUNT "+STR$(drive%)
 7960PRINT"Writing root"
 7980F%=TRUE
 8000*DIR $
 8020*LIB $
 8040*CDIR Format
 8060IFE%=0 ORN%=0 PRINT"No defects...not saving a defect list" ELSEPROCsave_defect_list:REM Skip if BeebSCSI or no defects //ISW 9/ii/2020
 8080$buffer%="$.Format.UltraForm"
 8100!X%=buffer%
 8120X%!2=PAGE
 8140X%!6=&8023
 8160X%!10=PAGE
 8180X%!14=TOP
 8200A%=0
 8220CALL&FFDD
 8240PRINT"UltraForm saved."
 8260$buffer%="$.Format.UltraForm1"
 8280X%!10=PAGE
 8300X%!14=TOP
 8320A%=0
 8340CALL&FFDD
 8360PRINT"UltraForm1 saved."
 8380ENDPROC
 8400DEFPROCmode_select
 8410X%=x%:Y%=X% DIV256:REM //ISW 4/v/2020 - corrupted by other calls
 8420?X%=0
 8440X%!1=buffer%
 8460X%?5=&15
 8480X%?6=drive%*&20
 8500X%!7=&160000
 8520!buffer%=&8000000
 8540buffer%!4=0
 8560buffer%!8=&10000
 8580buffer%?12=1
 8600buffer%?13=cyl%DIV256
 8620buffer%?14=cyl%
 8640buffer%?15=heads%
 8660buffer%?16=rwcc%DIV256
 8680buffer%?17=rwcc%
 8700buffer%?18=rwcc%DIV256
 8720buffer%?19=rwcc%
 8740buffer%?20=lz%
 8760buffer%?21=step%
 8780A%=&72
 8800CALL&FFF1
 8820IF ?X% PROCCont
 8840ENDPROC
 8860DEFPROCformat
 8880IFV%=0 W%=1 ELSE W%=T%:REM interleave of 1 (i.e. no sector skew) on first format, otherwise use T% //ISW 5/i/07
 8900PROCinterleave(W%)
 8910X%=x%:Y%=X% DIV256:REM //ISW 4/v/2020 - corrupted by other calls
 8920?X%=0
 8940X%!1=data%
 8960X%?5=4
 8980X%?6=drive%*&20+&1E
 9000X%?7=fill%
 9020X%?8=0
 9040X%?9=W%:REM interleave //ISW 5/i/07
 9060X%?10=0
 9080A%=&72
 9100CALL&FFF1
 9120IF ?X% PROCCont
 9140ENDPROC
 9160DEFPROCverify(I%)
 9180PRINT"Verifying sectors &";~I%;" to &";~I%+vblocks%-1;
 9190X%=x%:Y%=X% DIV256:REM //ISW 4/v/2020 - corrupted by other calls
 9200?X%=0
 9220X%!1=0
 9240X%?5=&2F
 9260X%?6=drive%*&20
 9280X%?7=I% DIV &1000000
 9300X%?8=I% DIV &10000
 9320X%?9=I% DIV &100
 9340X%?10=I%
 9360X%?11=0:X%?12=vblocks% DIV256:X%?13=vblocks% MOD256:X%?14=0:REM //ISW 9/i/2011
 9380A%=&72
 9400CALL&FFF1
 9420VDU13
 9440IF ?X% ELSE I%=I%+vblocks%:GOTO9180
 9460ENDPROC
 9480DEFPROCget_error
 9500A%=&73
 9520CALL&FFF1
 9540error%=X%?3
 9560sector%=(!X%)AND&1FFFFF
 9580error%=error% MOD128:REM mask off top bit for correct error number (BeebSCSI sets top bit) // ISW 6/x/18
 9600ENDPROC
 9620DEFPROCwrite_map
 9630A%=&72:X%=x%:Y%=X% DIV256:REM //ISW 4/v/2020 - corrupted by other calls
 9640?X%=0
 9660X%!1=buffer%
 9680X%?5=10
 9700X%?6=drive%*&20
 9720X%!7=0
 9740X%!9=2
 9760CALL&FFF1
 9780IF ?X% PROCCont
 9800ENDPROC
 9820DEFPROCwrite_dir
 9830A%=&72:X%=x%:Y%=X% DIV256:REM //ISW 4/v/2020 - corrupted by other calls
 9840?X%=0
 9860X%!1=buffer%
 9880X%?5=10
 9900X%?6=drive%*&20
 9920X%!7=&50200
 9940CALL&FFF1
 9960IF ?X% PROCCont
 9980ENDPROC
10000DEFPROCinterleave(B%)
10020IFM% U%=310:spt%=33 ELSE U%=323:spt%=47:REM record size and spt depending on MFM flag //ISW 16/i/11
10040IFB%=1U%=U%+10:spt%=spt%-1:REM record size is 10 more and spt 1 less if no interleave //ISW 30/viii/09
10060maxbfi%=(U%*(spt%-1))+150:REM Bytes from index in Translate cannot be larger than this //ISW 9/i/11
10080ENDPROC
10100DEFPROCmfmrll
10120PRINT"MFM or RLL? (M/R)     ";
10140REPEAT
10160REPEAT
10180B%=GET
10200UNTILB%=ASC"M"ORB%=ASC"m"ORB%=ASC"R"ORB%=ASC"r"
10220VDUB%
10240IFB%=ASC"M"ORB%=ASC"m"M%=TRUE ELSEM%=FALSE
10260REPEAT
10280B%=GET
10300UNTILB%=13ORB%=127
10320VDUB%
10340UNTILB%=13
10360PRINT
10380ENDPROC
10400DEFPROCdoverify
10420I%=0
10440K%=0:L%=0:REM L% is total defects, K% will only go up to 1024 //ISW 11/i/07
10460PRINT"Verifying ..."
10480PROCverify(I%)
10500PROCget_error
10520IF error%=&21 OR error%=&23 OR sector%>heads%*cyl%*spt%-(K%+data%?3+data%?2*256)DIV8 GOTO 10680
10540PRINT"Defect &";~error% MOD128" at &";~sector%;:IFL%>1016 PRINT" - DEFECT LIST FULL"ELSEPRINT"                 "
10560IFsector%<spt% PRINT"Defect in Cyl 0, Head 0 - ignoring":GOTO10640:REM //ISW 9/i/2011
10580IFL%<1016 buffer%!K%=sector%
10600L%=L%+8
10620IFL%<1016 K%=K%+8
10640I%=sector%+1
10660GOTO 10480
10680PRINT"Disc verified                         "
10700ENDPROC
10720DEFPROCdoinit
10740PRINT"Initialise"'"Disc will be initialised using current  parameters"
10760PROClistparams
10780VDU129,157,131,141,136
10800PRINT"Initialising destroys all data"
10820VDU129,157,131,141,136
10840PRINT"Initialising destroys all data"
10860PRINT
10880PRINT"Proceed? ";
10900IF(GET AND &5F)=ASC"Y":PRINT"Y";ELSEPRINT'"Aborted"':ENDPROC
10920IF(GET AND &5F)=ASC"E":PRINT"e";ELSEPRINT'"Aborted"':ENDPROC
10940IF(GET AND &5F)=ASC"S":PRINT"s";ELSEPRINT'"Aborted"':ENDPROC
10960IF GET=13 PRINT ELSEPRINT'"Aborted"':ENDPROC
10980OSCLI"MOUNT "+STR$drive%
11000REMPROCmode_select
11020PROCinitialise
11040ENDPROC
11060DEFPROCmfm
11080PRINT'"MFM controller selected"
11100M%=TRUE:IFT%=1 spt%=32 ELSE spt%=33
11120ENDPROC
11140DEFPROCrll
11160PRINT'"RLL controller selected"
11180M%=FALSE:IFT%=1 spt%=46 ELSE spt%=47
11200ENDPROC
11220DEFPROCCont
11240PRINT"Error "~?X%
11260PRINT"Continue?";
11280REPEATD%=GET AND&5F:UNTILD%=89ORD%=78
11300VDUD%:PRINT
11320IFD%=89ENDPROC
11340STOP
11360DEFFNBeebSCSI
11380LOCAL A%,X%,Y%
11400A%=&72
11420X%=osblock MOD 256
11440Y%=osblock DIV 256
11460?osblock=0
11480osblock!1=result
11500osblock?5=&D0:REM BeebSCSI Sense
11520osblock!6=0:REM reserved
11540osblock?9=8:REM 8 bytes returned
11560osblock!10=0:REM reserved
11580CALL&FFF1
11600IF?osblock=0 =TRUE ELSE =FALSE
12000DEFPROCchange_drive
12100PRINT"Change drive number"
12110PRINT'"Current drive: ";drive%'
12120REPEAT
12150PRINT"New drive: ";:INPUT""drive%
12180UNTILdrive%<8ANDdrive%>-1
12200ENDPROC
13000DEFPROCfilldisc(G%)
13010IFdofill% PRINTELSE ENDPROC
13020H%=EVAL("&"+STRING$(4,STR$~G%))
13040FORB%=0TO8188STEP4
13060buffer%!B%=H%
13080NEXT
13090B%=0
13100A%=&72
13120X%=osblock MOD256
13140Y%=osblock DIV256
13160?osblock=0
13170osblock!1=buffer%
13180osblock?5=&A:REM write
13185REPEAT
13190osblock?6=B%DIV 65536:REM MSB of start sector in low 5 bits
13200osblock?6=osblock?6+32*drive%:REM drive number is in top 3 bits
13210osblock?7=B% DIV 256 MOD 256:REM middle byte of start sector
13220osblock?8=B% MOD 256:REM LSB of start sector
13230osblock?9=32:REM 32blocks=8K of buffer
13240osblock?10=0:REM reserved
13250VDU13:PRINT"Filling sector &";~B%;" (";B%;")";
13260CALL&FFF1
13270B%=B%+32
13280UNTIL?osblock=&21 OR ?osblock=&23  OR B%>heads%*cyl%*spt%
13300ENDPROC
14000DEFPROCtogglefill
14010dofill%=NOTdofill%
14020PRINT"Manual fill ";
14030IFdofill% PRINT"On" ELSE PRINT"Off"
14040ENDPROC
Also a couple of ready-made SCSI0.dat files for dropping onto a BeebSCSI SD card. The -6C one has authentic fill byte of &6C throughout all the blank space, which BeebSCSI doesn't do if you use a formatter.
Attachments
BeebSCSIBlank512-6C.7z
(84.06 KiB) Downloaded 5 times
BeebSCSI-Blank512-0.7z
(84.13 KiB) Downloaded 7 times
Image
User avatar
BeebMaster
Posts: 4546
Joined: Sun Aug 02, 2009 5:59 pm
Location: Lost in the BeebVault!
Contact:

Re: Superform and the Acorn Winchester Utilities Disk

Post by BeebMaster »

P.S. the ADFS utils disc is about somewhere I'm sure, but all the other utils except WEditor are on the Master 128 Welcome disc.
Image
User avatar
daveejhitchins
Posts: 6791
Joined: Wed Jun 13, 2012 6:23 pm
Location: Newton Aycliffe, County Durham
Contact:

Re: Superform and the Acorn Winchester Utilities Disk

Post by daveejhitchins »

DocBanzai wrote:
Mon Oct 11, 2021 4:28 pm
Hi all,
First off I apologsise if this a stupid question and please be kind. If I'm being an Idiot then be gentle with me... :oops:
I'm going to be getting a BeebSCSI for my Master and I've been doing a little reading (I know, a little knowledge is a dangerous thing).
On the Domesday86 BeebSCSI user guide page (https://www.domesday86.com/?page_id=400) it mentions using "Superform on ADFS floppy (either 5.25” or 3.5” depending on your floppy drive)" and I've also noticed that the orignal "Acorn Winchester Disc Filing System User Guide" mentions superform along with some other filing system utilities (The filing system utilities; CATALL, EXALL, WEDITOR, COPYF, BACKUP, SUPERFORM).
I've been hunting high and low for an image of this disk (presumably an .adl file) but have had no luck. I've come across plenty of mentions of Superform but haven't found it (except for the Z80 CPM disk version).
Does it exist? Would any kind soul take pity on me and point me in the right direction? Or am I being incredibly thick? (most likely).
I promise I have searched the forums and the interwebs (well Duck Duck Go at least).
Anway, thanks in advance for any help or advice.
Cheers!
Matt.
You can find a ready made LUN here. No need for any formatting!

Dave H.
User avatar
DocBanzai
Posts: 17
Joined: Thu Dec 12, 2019 2:40 pm
Location: Sunny South Devon
Contact:

Re: Superform and the Acorn Winchester Utilities Disk

Post by DocBanzai »

Thank you all for the information it's hugely appreciated!

BeebMaster - I look forward to trying your version out, i've stuck them into an .adl and will certainly have a play with they when my Beeb SCSI arrives, thank you. It never even occured to me to look on the welcome disk. I had a hell of a time getting that to work, I can tell you (my Beeb was poorly) but it's ship shape now!

Hi Dave, thanks for the info. Yes I have already downloaded the pre-built image and I will be using it at some point. But I'm a bit of a completionist and I wouldn't learn anything if I didn't at least try it once or twice. What's the worst that could happen, I'll just have to flash the SD card again. I like to get into the guts of these things and have a poke around!
P.S. Thanks again for the disks, they've certainly been put through their paces and have worked flawlessly. I've been attempting to revive a box of 3 1/2" inch disks for no good reason. I was just digging around in my loft to see if one of my old PC's had an IDE 3 1/2" in so, again I could tinker it up to the beeb. Unfortunately all I found was magneto-optical drives which I'm not messing with but there was a couple of boxes of floppies so I thought I try them out on a USB floppy drive I have. Man, I think they've had it. Althought the disk surfaces look fine (no mould) they spun like an asthmatic donkey on a treadmill, not good. They're currently residing in the airing cupboard for a few weeks. We'll see lol.

Again, thanks all for the info, I'm very excited to try it all out!

Cheers, Matt.
Master 128 with Internal PiTube Direct, Multi OS, Turbo MMC, Gotek, RAM/ROM Cartridge, Midwich (Misubishi) 5 1/4" FDD and soon a BeebSCSI.
#-o Oh, how I wish I'd kept that Osborne One/Epson/Pet/Amiga/ST/Z88/ZX81/Speccy/Mattel/BBC B #-o
Ukwebb
Posts: 34
Joined: Sat Apr 10, 2021 12:38 pm
Contact:

Re: Superform and the Acorn Winchester Utilities Disk

Post by Ukwebb »

the easiest way - is as per the guide :) https://github.com/dp111/Pi1MHz

Copy the contents of the firmware directory to the root of your SDCARD.
If you want a prepared ADFS Harddisc you can copy (the contents of) https://www.domesday86.com/wp-content/u ... UN_2_5.zip to the root of the SD-CARD

when you do that , the hdd image also includes superform etc :)
User avatar
BeebMaster
Posts: 4546
Joined: Sun Aug 02, 2009 5:59 pm
Location: Lost in the BeebVault!
Contact:

Re: Superform and the Acorn Winchester Utilities Disk

Post by BeebMaster »

DocBanzai wrote:
Tue Oct 12, 2021 12:43 am

BeebMaster - I look forward to trying your version out, i've stuck them into an .adl and will certainly have a play with they when my Beeb SCSI arrives, thank you. It never even occured to me to look on the welcome disk. I had a hell of a time getting that to work, I can tell you (my Beeb was poorly) but it's ship shape now!


Cheers, Matt.
I wouldn't necessarily try out the "manual fill" option I put in there - I added it only for devilment really to see if I could force it to produce an authentic image. I can't remember whether FAT fast-seeking has been properly fixed in BeebSCSI, it certainly has in Pi1MHzSCSI, so it would be extremely slow as it writes every sector of the disc image.

The good thing about BeebSCSI/Pi1MHzSCSI is that you can put sequential ADFS floppy disc images on it just by renaming them to SCSI0.dat etc. without having to do anything else. If they are interleaved though they would have to be uninterleaved first, which is yet another reason not to interleave them since anyway

Code: Select all

REPEATPRINT"There is no such thing as an interleaved 8-bit Acorn floppy disc":UNTILCowsComeHome
Image
User avatar
DocBanzai
Posts: 17
Joined: Thu Dec 12, 2019 2:40 pm
Location: Sunny South Devon
Contact:

Re: Superform and the Acorn Winchester Utilities Disk

Post by DocBanzai »

Ukwebb wrote:
Tue Oct 12, 2021 7:50 am
the easiest way - is as per the guide :) https://github.com/dp111/Pi1MHz

Copy the contents of the firmware directory to the root of your SDCARD.
If you want a prepared ADFS Harddisc you can copy (the contents of) https://www.domesday86.com/wp-content/u ... UN_2_5.zip to the root of the SD-CARD

when you do that , the hdd image also includes superform etc :)
Yup, that is going to be the first thing I do. I’ll tinker with that until I’m comfortable and then move on to more involved stuff. I’d really like to get CPM fully working (it’ll bring back fond memories).
At this rate I’ll never get any of my creative projects finished. I keep being shown all these wonderful toys to play with and I’m easily distracted lol.
Master 128 with Internal PiTube Direct, Multi OS, Turbo MMC, Gotek, RAM/ROM Cartridge, Midwich (Misubishi) 5 1/4" FDD and soon a BeebSCSI.
#-o Oh, how I wish I'd kept that Osborne One/Epson/Pet/Amiga/ST/Z88/ZX81/Speccy/Mattel/BBC B #-o
User avatar
DocBanzai
Posts: 17
Joined: Thu Dec 12, 2019 2:40 pm
Location: Sunny South Devon
Contact:

Re: Superform and the Acorn Winchester Utilities Disk

Post by DocBanzai »

BeebMaster wrote:
Tue Oct 12, 2021 1:50 pm
DocBanzai wrote:
Tue Oct 12, 2021 12:43 am

BeebMaster - I look forward to trying your version out, i've stuck them into an .adl and will certainly have a play with they when my Beeb SCSI arrives, thank you. It never even occured to me to look on the welcome disk. I had a hell of a time getting that to work, I can tell you (my Beeb was poorly) but it's ship shape now!


Cheers, Matt.
I wouldn't necessarily try out the "manual fill" option I put in there - I added it only for devilment really to see if I could force it to produce an authentic image. I can't remember whether FAT fast-seeking has been properly fixed in BeebSCSI, it certainly has in Pi1MHzSCSI, so it would be extremely slow as it writes every sector of the disc image.

The good thing about BeebSCSI/Pi1MHzSCSI is that you can put sequential ADFS floppy disc images on it just by renaming them to SCSI0.dat etc. without having to do anything else. If they are interleaved though they would have to be uninterleaved first, which is yet another reason not to interleave them since anyway

Code: Select all

REPEATPRINT"There is no such thing as an interleaved 8-bit Acorn floppy disc":UNTILCowsComeHome
Noted, and thanks for the tip. Didn’t know about the sequential ADFS disk trick. When you say name them SCSI0.dat etc, I’m assuming that’d be SCSI0.dat, SCSI1.dat, SCSI2.dat, and so on. I’ll have to check my existing disks for the interleaved status, shouldn’t take long (not). I really need to get properly organised. I do some stuff on my Master, some on my Windows PC and the remainder on my Linux laptop. I’m old and easily confused so trying to remember where I put stuff is a nightmare. Then it usually turns out it’s on Onedrive or Google Drive. Oh my brain hurts #-o
Master 128 with Internal PiTube Direct, Multi OS, Turbo MMC, Gotek, RAM/ROM Cartridge, Midwich (Misubishi) 5 1/4" FDD and soon a BeebSCSI.
#-o Oh, how I wish I'd kept that Osborne One/Epson/Pet/Amiga/ST/Z88/ZX81/Speccy/Mattel/BBC B #-o
Post Reply

Return to “8-bit acorn software: other”