IDEUtilsWEDITOR$HDInit THDInit $AForm $ADFS153$ (MP4PPV/Y//jBP@LΚSAcorn ADFS153(C)1984$&ˆ@ͩ `$P @ͭ4`Z4 j4 4z`G̭G(``` )`G` LJ`…`Lɂ ( /+'  ߀$08@ޠ S) ! KH Íȱȱh` 0֠ȱȱȱȱ  )I`i HHH  ($Pڢ'©*I (  )!_$p@(@!@@ H :h)`Ч恭G)!()*ƈЁhhh 2@BCJJ  gNx   ` 2B)?iCD mQ)Q d)HIJJh (G`***)F`H)?Eh****` m])] dhŭG)! Ajl`LԁLԁ `/L%eo ~ kEscape kDrive not ready@ ؉ tDisc error NDisc protected $К` >`)`` o)@(` 2p@`hhL/. Ù,ˆÍ/ ؉͢hh͠ȱO 0 QL: mȽ@ *** bș/ș) Qȩ0 Eș mZƍ Ą( ӄz ԧ :: ĄZ ˄h ˄ L: ta lennahc no HJJJJ Zh bș`) 0:i`,d } }/8峰e(HP0șh` + `E. SP. L0:頄L SEYHugo7 8 9`2膲ʽ4°ʆ(4y7(L(b(}4hL((y7(}ʎ`4(y7(`4(}4( ((y7(` NMap fullʽ47i`]Ž^Ž_(y]™](L=|: 28]= NDisc full NCompaction requiredʽ:ˆȦ(y=(8(=(`膲ʽ=;0򦲠ʽ:ˆ`L`` y±)." ` C kBad name )bˆȢ Ab!: +  C*8# + ` Cа C#*` C*`Ƚb)! Z |z`hh8` !."* ̓  Vi`0"8 ai:H) h)Hh)Jjjj`L` 8 8:q 1/Í/ C G 1) )é͢1 ͭ. Ù,ˆ< éÍ C.$ 1 C)$ F V(Ȍ C."L$b© c©Ӆ©` `©` C!". 0 d`i淠 V` ) kBad rename8e浭. Ù,ˆ <™ LH/é/¢1 ., <ˆÎ­-Í­,Í©. ͍ DÑÑ ah` JL  !"#¢©­# "C Pm©m­!8!°­"#"€!  `­!m­!m ( †­ S 3å) # Í­­ 欝ŠJJiLN30 ~…… ª© $P ڢ'©  20@$P pL p d0`^L`@ kNot found ݠ kAccess violation о ˆ  ˆ©© ˆ B mLՉ  ˆ ‘+  .+ˆ+jjjJ(j+JJJJ + `ȱ L؉ pLՉȱ ȍ  V` Ԍ) Ԍ.LӋ!"`L kLocked A)7/' kCan't - File open` C.b`: CV.L )$ ^@ C7.-Ȁ C$ y)*#.` CL` kWild cards^@:$& !ȩq$4ˆ` kDir full'¥(©ȅ3Ŷŷ ƵƴLT'…(…` )!"  `ˆ8 ‘ ‘HHą' i淰i؍ȍLÎhhȑ¢ ©© q*LȑȑL z [:‘:™` W BL W Lg   < ­Í­Í­Í  ŵ"íD!Í ez ͩ` pH h(`` e NBad FS map۩)׮}Hhг0hʈH`yy` # `#!ˆ ‘#L ˆ‘#,+  N+N+N+  N+j LΌ ɩ` @¥A©@… ԌL؉ =,™0ˆ./  ؉0™,ˆ( kDir not emptyȩq$4ˆ~/"4, kCan't delete CSD&4 kCan't delete Library4éÍà0 p淥ɻ LՉ 0rHqHZȱh`~ & )  ˒` 6`hh0 ˒) ˒eeHZ`HHHH <*Ob Spec*>() (L)(W)(R)(E)�09` ͘L؉ F)L kBad opt�  ZHǠ� Ƅ0 : �hH Ǡ hz`  Free ꡠ8™  Used` Address : Length�Ơʽ� " : Ơʽ� " :ƀͮаᐩ Compaction recommended`H `â* 8 ðh`������� o �  Go` 5 )o i0� o?Íâ� 0 �` "tesnU" 5oâߠ ꅴ FoÍío Íâ `�������' 2]` " " " Sectors =3©� @...¢� @*  @3ڠ ,@, ,i0 < < Bytes` F �)"  L �!* 0`©8`aLw kBad compact�ȱȱ ,ȱ ȱ! ©0ˆȱ 0:80)_AG6 0`¢ Lۢa`maɀLۢ  ( ` ` HH � #h@hA` ؉ LL kBad command�  ؉ к ¥ 1@ 2âL 11 kNo!�¢† �0L  l$ 2©L ș ÈÙÈL؉Ù0¹Ù,ˆ00™,ˆ` ۓL؉ =L؉Ù,¹ÙÈ ؉ ș�È`� C.e浠�  " (L`8(e`�):LHH 4 ȍ LӋ ؉"hHڠ�)}$ C^. 4@…  ( 4¹È. Ù,ˆ ؉hH 4VÈhh �. )}!Ȁe )+±)"! +‘ L؉L7 8JœKœLœM¢<�*.] :ˆ ؉@… z n]j c ؉hh 菢4 L؉0`Ùpˆ )tˆt… t™Ȉp™ȈL+ rNo directory� �� ܄` NBroken directory� �` Dqq` P` PѺ rBad sum�HZڭ )! ɧHHӝzh(`x}`HZ ɧœœœzh(`………… ;l™�L ;p™� 1L…t© LӋ¥¥¥ Ùlˆ ؉Ù,ˆ CL` Ùpˆ 짠$L̂ dL؉¥ mȱȱ Í¢�™Šˆ )tˆ ~ ! z ]:™¹=™ˆ `© 8`a©ͭo ­s ­H� h L ؉��*` Èé�`  ( H hϪ ùzÕ�pÕfÕ\Õ �ä`|4õ�µµµ häϵ�zõpõfõ\LЩä8R�H>4�zõpõfõ\LЩ kOutside file�ùRÕ�HÕ>Õ4ÕLЩAù0L�µµµ häϵ�RõHõ>õ4 %L⩢J) )LH ( 2B)?iCD3Ly�L xJJiɅ�))j 0½½½ l )  Q/L ٪� 2 `PeH@͈`` Å3é``Z�Cͭ@ 2 @1L1-�1î tData lost, channel�JJiɅ�`¨)½u͖m͗e͘] ثJ)@j)*(4 ~8>�J*  ~8>L0L­­­ ث l )  T L ٪ 2�@ রL)5Ln kChannel�`Œ:80܅Ϫ`Ͻ4\>fHp Rz` j  %�ʤ`)ȝ kEOF� j") % Ͻ) ä¦8`}pͽ}fͽ}\Í©@ 竦ϼzé� ¦`Ù0ˆÍ3¦Ͻ)/½Í,½Í-½Í. ؉0™,ˆ3/ ߴϽÍ4½Í5½)6©ąϠ�Ln`i湰Щ�­/¢,./¦Ͻ͚͛͜͝(4͝>͜H͛ R͚LڰL ԭi�7½i�8½i�9 ᄜ=œ>œ?®?!> ==ʈТ<ݚ­¬L? > ?>œ= [�ϑȭ=‘í>ȑí?ȑí:ȑí;ȑí<ȑ Ý ͩč`© a¢�4™::™¹7™ˆ LH}ͽ>}ͽ4}Í© 竦ϼRé�}Í4­}Í5­}Í6­4 5654­4͖5͗ 6͘L (©@ 章�© 456LϭRíHí>í4 ؉/¢,`H �¨0 kNot open for update�)2.z8i�½pi�½fi�½\i�h H h}pͽ}fͽ}\Í© 竦ϼzhH h¦`z,0 pf\ H8pHýf>ý\4Ð)zRh H8Hý>ý4Ðhh h 0)`ϽH)zÝRýpÝHýfÝ>ý\Ý4h)թ� @†ńČA„)�¨L೭2�2ä`  kToo many open files�ό˜L> �L6 .)$ L^ʠ�0LϱRȱHȱ>ȱ4àϱȱȱȱȱȱȱ ÝȱíÝíÝíÝé�zÝpÝfÝ\íÊi0H h ؉Ť`,P �( ,0LLu ȍ Lͳ�B�OOOP©FGHI¢@„ ؉ W Չ@…A… 菩�ϝRÝHÝ>Ý4LѲ"  (�Ũ`i0  鱼ÞØ Rݢ%Hݘ>ݎ4݄ ؉�Ħ` ԭR4}HÍ4­5}>Í5­6}4Í6½HÍ7½>Í8½4Í9½R 789½RàHȑ>ȑ4ȑ L5 ) ŵ!í"  ŵ!" `` kDisc changed�Ƞ �8Hh `  ŵ `M1 *-`)Z  ŵ `M>ªHͬ//ŒŽ FŒ /Ì/h1 z`JJJJ` „džƠƙLڸ`�ƨ  鱦Ͻ l(0 L) ƕȈ¢ y� m ϭzÑȭpÑȭfÑȭ\Ñƭƙ;©�L %圵¦8Rȍ@½HɍA½>ʍB½4ˍC¢8;‘ϽR͝zÑȽH͝pÑȽ>͝fÑȽ4͝\ÑƠ?qƑLeɍ½eʍ½eˍ©ʹ©j 童ȍœ¢ ʹ ؉ �͵¦Ƥ` ʹ�8m 8@@°@�@°A B CL+ ™ˆʹ©**¦ϥeɍ½eʍ½eˍ Ù+ˆÌŒŒ A™!y™ B/é/.­LXm½m½m©ʹ©j 竜­ ʹLX$)® Sx 2@ͩ (d……`$P`泤` 8 Ȑ )! ` Ij=Lj kȹ)  ȹ)    *** :L^ k  F�Å 0 ***i0L k  F Å 0 k�­ȑƠƅ ƅ/0i� iưƠ L%ͷ`$,® S@ 2�* 8…�($p ̷(L:LFLWL]La`@ŠH ޻ $0   H)hLohH)@h) ^  ½Hªh 8P0 @^ $j …,0 …,P U L F� ; ; ;ţ © \ ( 弥jL$p  LF))`© r ̍º©… r nL ȱȱȱ$   gL ޻ L \ dd …͍] `V ¢ H)h)V ` `© LD�  ȱ $0_ $P ) T0 _ 2 `*�*¢' )$0  ` `$0 �  ȱ `H()+  h@)X h@$PH�0 wh0h@j`] )$$oL+  ++$0  V  b(L弩^ ` ^ ````� \ (Ln .`  H……�…$P� ˆh` @X ȱqY X X Y � 88复X 8X � W Y  X W Y Z W X  ;$0 V  F( 弥) F PT \ (奢). F K @� \ ( F ` P b(`X bW Y �eY LZ C ­)O^ )�L @^ $  W Z � Z LX 椥**` Å)Lo$PeO) ^  ^^ $j …,0 …,P U` )ȱ�aB) qc(ȱ 8P0L@8Ȱi`š) '^ j .n° ­)¥  : @¤)` /ɒ / / / /�//L�uF///`{///`N� ZZ�N� GN+� ZZN� GN+� ZZN� GN+� ZZN� GN+� ZZN� GN+� ZZN� GN+� ZZN� GN+� ZZN� GN+� ZZN� GN+� ZZ N� GN+� ZZ N� GN+� ZZ N� GN+� ZZ N� GN+� ZZ N� GN+� ZZN� GN+� ZZN� GN~NNN001020h���a����`��Hugo�ƒ����$���$� Hugo�膀� `LbR` TLT� WR WR WRţ ` \ ( /TjLV$p  LT))``�` sR T̜`ȱȱȱ�  `, `�  g`LV �` R RLU S `V `\ dd�` �` `] aS` `` H)`h) `` ``` L, `_ ` @ ` `, `P  `) ``DS�  ȱ $0_ , `P ) S0 S_ 2 `*�*_ )$0 XT ``T `$0 JT  ȱ `H()+  h@)X h@$PH�0 cUh0h@j`] )$$oLV+  ++$0  V  T T(`^ ` ^ ````� \ (L/Tn` .`` R@X ȱqY X X Y V� 88复X 8X � VW Y  X W Y Z W X  WR hT /T) T TT \ (奢)+ T T T�( T }U` T T(`X bW Y �dY LUZ C `)O^ )�LU T^ $  W Z � Z LUX 椊H WRh`)LWV$PeO) ^  ` FV^ $j `,`0 `,`P T` #ȱ�a<) q�ȱ V8P0LT8Ȱi``�`) '^ j `.`n` ``)`` %S�`` @`)`�=����``�(`Q(`"`LX )&`` ``` L�` `&``'fX� � 0 `H()_+  h@)\f8&L~X(j$0 (j(`�$ LMZ X 'X >X PX [`` ZLMZ`$ Z()d ]Disc not blank press ESCAPE to abort or SPACE BAR to continue �  LMZ Z ]Formatting.. ( ) Z Z`!``,(``!` !`!`$@` \ Zj8``L.Z` \ Z [X`�** ( Z XjH)@ ] Write protected disc LMZ ] Formatting error ꥠH \h LMZ ZX( Z X`LY,(``LnY�( X`LX Z ` 4X"``DLDDLLq�pqpqpL` ]�` ]�` ]`�`( Z X`HHhh``f&�` 4X ] Verifying... ( ) Z Z�%``J [�JJJJ`J`a`%` \ ]J �RJ1o LMZH` ] Verification Error h \ `JiJJ%`Џ ] Verification complete ]Z oZKJ J�JJJJ �R``ɠ `�`P`$P`�`P```(``,` a\ \` \ ]`JF\JG\``iF\mJF\G\mJG\``Jv\Jw\``v\mJv\w\mJw\``J\\J\\`i \mJ\\\\\mJ\\``$`` $`iP$`$`J ]$`) ]` i0i6 `hphqp ep�eqHH`qHH`the future to determine whether there is a 1770 or a 1772 in the machine. SWITCH [ GILBRT = NO LDAIM &FF ;OSBYTE call to read the switches. LDXIM &00 TAY JSR OSBYTE TXA ANDIM &30 ;Mask off the stepping speed. LSRA LSRA LSRA LSRA STA DILS | LDXIM &B ;OSBYTE call to read the special byte LDAIM &A1 JSR OSBYTE TYA ANDIM &3 ;Mask off the stepping speed. STA DILS ] NOCOMP RTS ;*8 NMICLM LDAIM &8F LDXIM &0C LDYIM &FF JSR OSBYTE STY NMIUSE ;PREVIOUS HOLDER OF NMIS RTS NMIREL LDY NMIUSE LDAIM &8F LDXIM &0B JMP OSBYTE ;*8 WKSCOP 5 _Copyright Acorn Computers plc 1985 _Copyright Acorn Computers plc 1985 {� ( {This is the wrong type of machine. `� �//1/0/7/p�  0/p��qurst u1/ @�@7/ { ADFS Floppy Formatter Ver. 1.31/C RETURN for Help, Q for Quit �'� w,//PLv` 'v� vPLv 4/3/ �X$ owLu { �`4/ɠ:/0 P9/08/�{vK|vZ{m{v{vZ{m|v|v,8/j{Lzv,9/r{Lzvz{` xw { Formatting drive 5/ 6/L {, Large8M {, Medium8 {, Small {, OK ? �/{u0{/{�  ow2��u)_={�`��u)_@{�` �u q,{` { Aborted - Respond 'YES' to format `~ ` { Please insert the blank disc now `�8/9/:/(x/ /0�//� x-/././+/*//�/0,/*/ /�/ Wx./Lhy�+/  +/�,/`/Lx+/ȱ �  /LAx,/`*/LtxLxLx��`��/E{0Lgy,-/0`4/L6/9�/0"�/4S6/,-/0`(8M6/Lgy,-/0`P4/.-/n-/`�/H)0h)_HhQ//`L{!7/R{*7/V{>KO{,-/0`4/L{6/Х3/HR{5/H,-/phh`hh-/)-/`3/HV{5/H,-/phh``-/�// Uz,//p z`ɀ Uz` { Refer to drives as 7/ {0,1,A or B ` {4,5,E or F ` { Refer to 80 T double sided as: 160 or L(arge) 80 T single sided as: 80 or M(edium) 40 T as: 40 or S(mall) Q to Quit. ` { Format which drive? z Wx,//P`,-/P �/* yLUz` { Size of disc? z Wx,//P`,-/٭�/* yLz�*/�/{u0{/{� ~ 8`*/H�u* �u �*/h�u�/`hphqp ep�eqHH`�� �MOUNT X YESYAHNO1608040SML(P04AE15BF������y~� ��  @�eqHH`�� �MOUNT X YESYAHNO1608040SML(P04AE15BF������y~� ��  @AAY BUFF2 DEY BPL INTERY BMI S /ɒ / / / /�//L�uF///`{///`N� ZZ�N� GN+� ZZN� GN+� ZZ �  > HDInit 1.12 � Initialise IDE hard drive �$ v1.02 - Drives 0-7 all allowed �(; v1.03 - Drive reversably initialised, selects drive 0 �24 v1.04 - Allows drive size to be set explicitly �<. v1.05 - Displays sizes in M as well as K �F2 v1.06 - Wipes full root if 'safe' turned off �P& v1.07 - Full drive investigation �Z v1.08 - Partitions �d v1.09 - New FNsum routine �n9 v1.10 - Displays full firmware info and device type �x* v1.11 - Allows ADFS/HADFS partitions �? v1.12 - Display full info by default, Randomise made safe �: �&87:init:ver$="1.12" �Ffx(0,1)<6:fx(130,0)=&FFFF "Must run on BBC I/O processor": �adfs%=: adfs%= �#adfs%:fs%=fs:fs%<>8:"FADFS" �adfs%:"MOUNT 0" �%adfs%:fs%<>8:"FX143,18,"+ fs% �hadfs%=: hadfs%= �%hadfs%:fs%=fs:fs%<>16:"HADFS" �'hadfs%:fs%<>16:"FX143,18,"+ fs% �fs%=16 adfs%:hd%=4 � err:end: &87: menu:end: :  end:: ": ,ݤerr:::A%=(100):=-1 6: @ init J1 ctrl%31,mem%511,info%512:X%=ctrl%:Y%=X%256 T4hdsize%=0:big%=0:hd%=0:scsz%=256:safe%=:full%= ^*A%=05114:info%!A%=0::asm:*FX219,9 h r: | ݤmenu 6:" BBC IDE Hard Drive Initialiser "ver$'38,"=") DriveInfo .'"D: Select drive I: Investigate drive" + "S: Scan for size Z: Set drive size" H "F: Format drive W: Wipe data (";"on",safe%);"off",safe%);")" 6full%:safe%:17; full%:"R: Randomise data"; !full%:" <TAB> Toggle width" $'6"Press a key or X to exit:"; ] A$=: 9+"*DdIiFfWwRrSsXxZz",A$):13;32;13;: A$="*" "*"A$: A$: A$="":A$="*" A$=( A$&DF)  A$="D":Drive:=0  A$="F":Format:=0  A$="I":Invest:=0  A$="S":Scan:=0  A$="W":safe%=safe%:=0  A$="R":safe%:Random:=0 & A$="Z":SetSize:=0 0! A$=9:符-1:scsz%=768-scsz% : A$=9:-1:full%=full% D =A$="X" N: XDriveInfo b " Current drive: ";~hd%; l0hd%<4:dev%=hd%2:" (IDE device ";dev%;")"; v0hd%>3:dev%=hd%8:" (IDE device ";dev%;")"; 7 IFadfs%:IF(hd%AND6)=4:PRINT" (Floppy ";hd%-4;")"; 8 IFadfs%:IF(hd%AND6)=6:PRINT" (Unknown ";hd%-6;")"; )'" Device width: ";scsz%32;" bits" Afull%: " Model: "str(info%+54,20)'12;str(info%+74,20) *full%: " Firmware: "str(info%+46,8) +full%: " Serial: "str(info%+20,20) E'" Total sectors: &";h0(hdsize%,8)" (";(hdsize%/204.8)/10;"M)" R " Physical size: C:&";h0(info%!&02,4);" H:";d(info%?&06,2);" S:";info%?&0C R " Logical size: C:&";h0(info%!&6C,4);" H:";d(info%?&6E,2);" S:";info%?&70 G " 8-bit Size: ";d(hdsize%4,8);"K (";(hdsize%/409.6)/10;"M)" 'hd%<4:Info(hd%,14,&200000,"ADFS") 'hd%>3:Info(hd%,12,&10000,"HADFS") 38,"="): :  "Info(d%,m%,sz%,fs$):d%=d%m% ( " ";fs$;" drives:";:hsz%=hdsize%:  A%=sz%:hsz%<A%:A%=hsz% *316);~d%;": ";(A%/409.6)/10;"M";:hsz%=hsz%-A% 4A%=sz%:hsz%<A%:A%=hsz% >427);~d%+1;": ";(A%/409.6)/10;"M":hsz%=hsz%-A% H'd%=d%+2:d%=2 d%=4 d%=8 d%=12 R \: f Drive p9"Enter logical drive (0-B) :"A$:A$>"`":A$=(A$-32) zQ "0123456789AB",A$):hd%=("&"+A$):big%=0:hdsize%=0:A%=05114:info%!A%=0:  :  Invest A%=05114:mem%!A%=0: 0 IFadfs%:IFhd%>3:scsz%=256:PROCScan:ENDPROC 2!addr%=mem%:A%=dev%*16:nm%?1=scsz%256-1: id% CA%=0 255:info%?(A%*2)=mem%?A%:info%?(A%*2+1)=mem%?(A%+256): ʣinfo%?3+info%?109+info%?115=0:info%?109=info%?116:info%?115=info%?108:A%=(256*info%?109+info%?108)*info%?110*info%?112:info%?3=(A%((info%?6)*(info%?12)))256 >big%=:info%?&74=0:big%=:info%?&74=info%?&72:info%?&72=0 9hdsize%=(256*info%?&6D+info%?&6C)*info%?&6E*info%?&70  :  Scan +"Scanning drive ";hd%:big%=0:sec%=&800 4 sec%=sec%+sec%: scan(sec%)<>0 sec%>&1FFFFF step%=sec%2:dir%=-1: $'sec%=sec%+step%*dir%:A%=scan(sec%) .)step%=step%2: A%=0:dir%=1 dir%=-1 8 step%<1:hdsize%=sec%-1: B L: V3ݤscan(sec%): 13;"Drive size: ";sec%4;"K "; `1adfs%:=scsi(&08,mem%,&100,sec%-1,hd%) =-1 j: t SetSize ~F"Enter drive size, use <size>, &<size>, <size>K or <size>M :"A$ $big%=0:A$,1)="&":hdsize%=A$: ,A$,1)="K" A$,1)="k":hdsize%=A$*4: /A$,1)="M" A$,1)="m":hdsize%=A$*4096: hdsize%=A$256: :  Format: hdsize%<1:Invest #max%=&200000:hd%>3:max%=&10000 -size%=hdsize%:(hd%5)=1:size%=size%-max% size%>max%:size%=max% 9size%<0:"No space on for drive ";hd%;:delay(200): /size%<&1000:"This appears to be a floppy" Q"Format ";"H",hd%>3);"ADFS drive ";hd%;" to ";size%4;"K (";size%4096;"M)" �SA$="":(hd%3)=0 hd%=2:"Leave space for ";"H",hd%<4);"ADFS system? ";:""A$  !part%=A$,1)="Y" A$,1)="y" S"Format? Enter YES to confirm: "A$: A$<>"YES":"Not formatted";:delay(200): hd%<4:InitADFS (hd%>3:InitHADFS 2 <: FInitHADFS P)!X%=1:A%=14:&FFF1: Get today's date Z;A%=0 6:X%?A%=~X%?A%: : Convert BCD to binary d=?X%<81:?X%=19+?X% ?X%=?X%-81 : Offset from 1981 n5today%=(?X% 16)+8*X%?2+256*X%?1+4096*(?X% 15) xEstart%=2:part%:start%=7 : Start free space after ADFS root dskID%=(65535) : /clear : Clear sector 1safe%:read(&46,hd%) : Read sector &46 0$mem%="IDEDISK"+hd%+" ": Disk title .$(mem%+16)=0+"(C)JGH"+0: Disk ID string 4mem%!24=dskID% : Disk ID number 6mem%!26=today% : Disk format date 9mem%!28=&411DFFFC : Disk size and flags ?mem%!32=start%:mem%!34=&46-start% : First free space entry =mem%!36=&4A:mem%!38=&FFFC-&4A : Second free space entry ;mem%!40=0 : End of free space map 3write(&46,hd%) : Write sector &46 : /clear : Clear sector 1safe%:read(&47,hd%) : Read sector &47 "4$mem%="$ " : Directory name ,6mem%!10=&47:mem%!14=0 : Parent directory 64mem%!16=dskID%:mem%!20=0 : Disk ID number @3write(&47,hd%) : Write sector &47 J: T/clear : Clear sector ^0safe%:write(&48,hd%) : Write sector &48 h0safe%:write(&49,hd%) : Write sector &49 r: |<"Drive ";hd%;" initialised to 16383K (16M)":delay(200)  : InitADFS Astart%=7:part%:start%=&40000 : Start free space after HADFS : *clear : Clear sector :mem%!0=start% : Start of first free space @mem%!252=size% : Total number of sectors on disk ,mem%?255=0:mem%?255=sum : FSM checksum ,write(0,hd%) : Write sector 0 : *clear : Clear sector ;mem%!0=size%-start% : Length of first free space &mem%!251=(65535) : Disk ID 1mem%?253=0 : Disk boot option Amem%?254=3 : Pointer to end of free space map &,mem%?255=1:mem%?255=sum : FSM checksum 0,write(1,hd%) : Write sector 1 :: D8 S%=2 6:clear : Clear sector NEsafe%:read(S%,hd%):clrdir(S%*4-3): Read sector, clear entries XBS%=2:$mem%=0+"Hugo":mem%?5=0 : Directory identifier bAS%=6:$(mem%+204)="$":mem%!214=2 : Dir name, parent l@S%=6:$(mem%+217)="$":$(mem%+227)="" : Directory title vBS%=6:$(mem%+250)=0+"Hugo":mem%?255=0 : Directory identifier 8write(S%,hd%): : Write sector : B"Drive ";hd%;" initialised to ";size%4;"K (";size%4096;"M)" F"**WARNING** You *MUST* reset ADFS to"'"prevent disk corruption." delay(200): : )clear: A%=0 255 4:mem%!A%=0:: 1clrdir(O%): A%=O% 255 26:mem%?A%=0:: : ݤsum: sum%:sum%=255 . A%=254 0 -1:sum%=(sum%+sum%256)255 !sum%=sum%+mem%?A%::=sum%255 :  Random  +"Randomise contents of drive ";hd%;"?" L"Enter YES to confirm: "A$: A$<>"YES":"Not randomised";:delay(200):  ("Press ESCAPE to terminate "; * sec%=0:6,8);h0(sec%,6); 4/A%=0255:mem%?A%=(255)::write(sec%,hd%) >sec%=sec%+1:0: H: RCwrite(sec%,drv%):cmd%=wr%: IFdrv%>3:PROCwriteX(sec%,drv%):E. \Aread(sec%,drv%):cmd%=rd%: IFdrv%>3:PROCreadX(sec%,drv%):E. f@!addr%=mem%:sc%?2=sec%:sc%?1=(sec%&FF00)256:?nm%=1:nm%?1=0 p2drv%<4:sc%?0=((sec%&FF0000)65536)(drv%*32) z'drv%>3:sc%?0=(drv%3)((drv%8)*8) A%=cmd%:A%=0 : 9writeX(sec%,drv%):A%=scsi(&0A,mem%,&100,sec%,drv%) 8readX(sec%,drv%):A%=scsi(&08,mem%,&100,sec%,drv%) ) A%:"Disk error &";~A%;:delay(200)  : "delay(T%):T%=+T%: >T%: : ,ݤscsi(cmd%,addr%,num%,sect%,drv%): fs% fs%=fs: fs%<>8:"FADFS" DX%?0=0:X%!1=addr%:X%?5=cmd%:X%?6=drv%*32+((sect%&1F0000)65536) @X%?7=((sect%&FF00)256):X%?8=sect%:X%!9=num%256:X%!11=num% 4A%=114:&FFF1:A%=?X%: fs%<>8:"FX143,18,"+ fs% =A% : $!ݤfs: A%,Y%,E%:=(&FFDA)&FF .6ݤfx(A%,X%): Y%:Y%=X%256:=((&FFF4)&FFFF00)256 8: B#ݤh0(A%,N%)="0000000"+~A%,N%) L"ݤd(A%,N%)=" "+A%,N%) Vݤstr(A%,N%): A$: `$A%?1>31:A$=A$+A%?1 A$=A$+"." j"?A%>31:A$=A$+?A% A$=A$+"." tA%=A%+2:N%=N%-2:N%<1:=A$ ~: asm:mc%=mc%:mc%: &mc% 511:addr%=&80:sc%=&85:nm%=&88 ?IDEdata=&FC40:IDEerror=&FC41:IDEcount=&FC42:IDEsector=&FC43 DIDEcylinder=&FC44:IDEhead=&FC46:IDEstatus=&FC47:IDEcommand=&FC47 "!IDEdata<>IDEdata!8:scsz%=512 P=0 1 P%=mc%:[OPT P*2 .id% TAY .idlp LDA &FF:BMI idescape LDA IDEstatus:BMI idlp �&TYA: #16:STA IDEhead :\ Device .LDA #&EC :STA IDEcommand :\ &EC=Identify LDY #0:LDX #1:STX nm% CLC:JMP TransferLoop ( .idescape 2RTS <: F.WaitForData P"LDA &FC47: #8:BEQ WaitForData ZLDA &FC47:RTS d: n.WaitNotBusy x6PHP:JSR L806F :\ Get IDE status ; #&80:BNE WaitNotBusy+1:PLP :\ Wait for IDE not busy BIT &CC:RTS : .L806F PHP:LDA &FC47:STA &8D !LDA &FC47:CMP &8D:BNE L806F+1 PLP:RTS : ..rd%:LDA #&08:STA &84:CLC:BCC CommandStart ..wr%:LDA #&0A:STA &84:SEC:BCS CommandStart : ;.CommandStart :\ C=R/W, &8E/F=>block 4LDA #&7F:STA &8E:LDA #0:STA &8F :\ &8E/F=>block PHP:JSR SetGeometry:PLP .CommandLoop LDX #2:.Twice "BJSR SetSector:LDY #0 :\ Set sector, count, command ,.TransferLoop 6)JSR WaitForData: #&21:BNE TransError @\.TransferLoop J%BIT &CD:\BVS TransTube:BCC IORead T .IOWrite ^4LDA (&80),Y:STA &FC40:LDA nm%+1:BEQ TransferByte h:INC &81:LDA (&80),Y:STA &FC48:DEC &81:JMP TransferByte r .IORead |4LDA &FC40:STA (&80),Y:LDA nm%+1:BEQ TransferByte :INC &81:LDA &FC48:STA (&80),Y:DEC &81:JMP TransferByte : .TransferByte 5LDA &FC47: #8:BEQ TransError :\ Run out of data :INY:BNE TransferLoop:\INC &81 :\ Loop for 256 bytes 3LDA &FC47: #&21:BNE TransError:\ Error occured DEX:BNE Twice 8INC &87:BNE TransCount :\ Increment sector "INC &86:BNE TransCount:INC &85 .TransCount <DEC &88:BNE CommandLoop :\ Loop for all sectors LDA #0:TAX:RTS .TransError LDA &FC47:LDX &FC41:RTS : .SetGeometry &;JSR WaitNotBusy :\ Should check device 0<LDA #64:STA &FC42:STA &FC43 :\ 64 sectors per track :$LDA sc%:LSR A:LSR A:A #3: #&13 D<STA &FC46:LDA #&91:STA &FC47 :\ 4 heads per cylinder NRTS X: b.SetSector lEPHP:JSR WaitNotBusy :\ Save CC/CS Read/Write v:LDY #8:LDA #1:STA &FC42 :\ One sector >CLC:LDA (&8E),Y: #63:ADC #1:STA &FC43 :\ Set sector b0-b5 ADEY:LDA (&8E),Y:STA &FC44 :\ Set sector b8-b15 @DEY:LDA (&8E),Y:PHA: #&3F:STA &FC45 :\ Set sector b16-b20 =PLA:ROL A:ROL A:ROL A:ROL A :\ Get Drive 0/1 >INY:INY: (&8E),Y: #&02: (&8E),Y :\ Merge Drive and Head FJSR SetDrive:DEY:DEY:DEY:LDA (&8E),Y :\ Get command &08 or &0A .SetCommand < #2:PHA: #2:LSR A:LSR A :\ Copy ~b1 into Cy KPLA:ASL A:ASL A:ASL A:A #&20 :\ Translate CS->&20 or CC->&30 FSTA &FC47:PLP:RTS :\ Set command &08 or &0A : .SetDrive GROL A:ROL A:ROL A: #&13:STA &FC46:RTS :\ Set device + sector b6-b7 : ]: : 3 :\ Set sector b0-b5 ADEY:LDA (&8E),Y:STA &FC44 :\ Set sector b8-b15 @DEY:LDA (&8E),Y:PHA: #&3F:STA &FC45 :\ Set sector b16-b20 =PLA:ROL A:ROL A: HDInit - BBC Hard Drive Initialiser =================================== HDInit is used to initialise BBC IDE hard drives. It must be run on the BBC I/O processor as it does low leval hardware access to manipulate the IDE devices. When run you get a menu similar to the following: BBC IDE Hard Drive Initialiser 1.12 =================================== Current drive: 0 (IDE device 0) Device width: 8 bits Model: .U.N.U. .I.F.O.1.8.A. . . Firmware: .0...3. Serial: .3.6.6.4.0.3. . . . Total sectors: &00265400 (613.0M) Physical size: C:&09BC H:16 S:63 Logical size: C:&2654 H: 4 S:64 8-bit Size: 313984K (306.5M) ADFS drives: 0: 306.5M 1: 0M =================================== D: Select drive I: Investigate drive S: Scan for size Z: Set drive size F: Format drive W: Wipe data (off) R: Randomise data <TAB> Toggle width Press a key or X to exit: D: Select drive --------------- This option allows you to select the logical drive to use. The drive information is cleared until the drive is investigated or scanned. If you select drive 0 to 3, then the ADFS partition information is displayed. If you select drive 4 to B then the HADFS partition information is displayed. On startup a suitable drive for the currently selected filing system is selected. I: Investigate drive -------------------- This option interrogates the drive using the IDE_Identify command (&EC). With an 8-bit interface only part of the drive information is readable, but enough is readable to find the drive size. The parts of the drive information that cannot be read is displayed as '.'s. S: Scan for size ---------------- Sometimes drives do not respond properly to the IDE_Identify command. This option manually scans the drive to find the maximum sector that can be accessed. Z: Set drive size ----------------- Very occasionally, all attempts to interrogate a drive to find its size fails or returns incorrect information. This option allows you to manually specify the drive size to use. You are prompted to enter a drive size to use. You can enter the maximum sector number as a hexadecimal number prefixed with &, or a drive size as a decimal number in bytes, kilobytes with a 'K' suffix or megabytes with an 'M' suffix. F: Format drive --------------- This options initialises a blank hard drive. It will also blank a previously formatted floppy disk. If the drive size hasn't been found or set manually, the drive will be investigated as with the 'I' option. If initialising an ADFS drive you are asked if you want to reserve space for an HADFS partition. If initialising an HADFS drive you are asked if you want to reserve space for an ADFS partition. With this you can have an ADFS and an HADFS partition on the same drive. The drive size will then be displayed and you will be prompted to confirm the initialisation before continuing. Enter YES to confirm - all upper case. W: Wipe data ------------ By default, the format option just blanks out enough of the drive's root directory and free space map to create a blank disk. This means that, with care, a drive that has been accidently formatted can be recovered. Setting Wipe Data On makes future format operations completely wipe the root directory and free space map. Only the root directory is blanked, so any data in file not in the root directory may be recoverable, but recovering the root directory is no longer possible. R: Randomise data ----------------- This option becomes available if Wipe Data is set on. IMPORTANT ALL DATA ON THE SELECTED DRIVE WILL BE IRRETRIEVABLE AFTER THIS OPERATION! This fills all sectors on the drive with random data until Escape is pressed. This can be used for testing purposes or to thoroughly overwrite all data on a drive. <TAB>: Toggle data width ------------------------ Pressing <TAB> toggles between accessing 8-bit IDE data and 16-bit IDE data. With a 16-bit IDE interface and using 16-bit access you can find the full drive information with the Investigate option. BBC filing systems are 8-bit filing systems, they store 256 8-bit bytes in each disk sector. IDE devices store 256 16-bit words in each sector, the BBC discards half of each 16-bit word, so the usable drive space is half the actual drive size. Using a 16-bit IDE interface does not change this. You still have to transfer a whole sector of 256 16-bit words, you can't just stop transfering data halfway through a 512-byte sector or start transfering data halfway through. To use all 512 bytes (256 16-bit words) in an IDE sector you'd have to load all 512 bytes into a buffer, modify the 256 bytes you want to modify and then write all 512 bytes back out again. IDE devices tend to be so large that throwing away half the storage space is irrelavent for BBC computers anyway. The maximum that ADFS can access is 512M, so throwing away half the capacity of a 2G IDE drive doesn't make any difference as ADFS can only see two paritions of 512M anyway. However, if you want to write software or a filing system to access CD-ROMs or hard drives with a DOS file system on them then a 16-bit interface will be needed. Shift <TAB>: Display full information ------------------------------------- Pressing Shift <TAB> will toggle between displaying full information about the selected drive. Version History =============== v1.02 - Drives 0-7 all allowed v1.03 - Drive reversably initialised, selects drive 0 v1.04 - Allows drive size to be set explicitly v1.05 - Displays sizes in M as well as K v1.06 - Wipes full root if 'safe' turned off v1.07 - Full drive investigation v1.08 - Partitions v1.09 - New FNsum routine v1.10 - Displays full firmware info and device type v1.11 - Allows ADFS/HADFS partitions v1.12 - Display full info by default, Randomise made safe HDInit - BBC Hard Drive Initialiser =================================== HDInit is used to initialise BBC IDE hard drives. It must be run on the BBC I/O processor as it does low leval hardware a � tjJ �<J@%=0:23,255,255,255,255,255,255,255,255,255:3:V$="V0.90":H%=:*FX4,2 �xI%=1215:"KEY"+I%+" "+(&BC+I%)::B%=:M%=&FF:X%20:Y%=X%256:A%=&72:L%=&FFF1:Q%255,U%255:K:?X%=0:X%!1=Q%:X%!9=1:X%!11=0:I%=Q%Q%+2554:!I%=0::I%=U%U%+2554:!I%=0::V%=-1:S%=-1:X%!5=0 A %C$=:C%=C$:&C7<C%C%<&CC:H:0 6&8B<C%C%<&90:D:0 @B%:V(C$):0 J"0"<=C$C$<="9":B:0 T"A"<=C$C$<="F":B:0 ^"a"<=C$C$<="f":B:0 hC$="*":L:0 rC$=(C$&DF):C$="H"M:0 C$="S"T:0 C$="W"I:0 C$="R"N:0 C$="N"E:0 C$="X"X:0 C$="P"O:0 C$="L"P:0 C$="G"Q:0 C$="M"R:0 0  A:H% Z%=S%:C:30:'6)"W i n c h e s t e r D i s c E d i t o r "+V$+" H = Help":N%:''"Current Sector ";:F(S%):D%=5:E%=4:D%,E%);:F%=0:G%=0: N!F(S%):"&";~S%;" = ";S%;18 X b"S(R%):R%<16:"0";~R%;~R%; l vU(R%):R%&80:0:129 +R%=R%&7F:R%=&7F:255R%<32:".";R%  1:128: C:0,22);239;4,22);: 7B:W%=Q%+F%*16+G%:C%=C$:C$<"A":C%=C%-48C%=C%-55 C%>15:C%=C%-32 ?W%=?W%*16+C% <J:D%-1,E%);:S(?W%):60+G%,E%);:U(?W%):D%,E%);: 4,V(C$):W%=Q%+F%*16+G%:?W%=C$:J:C%=&C9 fH:B%:tvC zC%=&C8:G%:G%=G%-1:D%=D%-3 *C%<>&C9:G%<15:G%=G%+1:D%=D%+3tlC "C%=&CA:F%<15:F%=F%+1:E%=E%+1 C%=&CB:F%:F%=F%-1:E%=E%-1 D%,E%);: B%=:D%=5:G%=0:60,E%);: 'C%<>&C8:G%:G%=G%-1:D%=D%-3dhC FC%<>&C9:G%<15:G%=G%+1:D%=D%+3:F%<15:F%=F%+1:E%=E%+1:D%=5:G%=0 "C%=&CA:F%<15:F%=F%+1:E%=E%+1 C%=&CB:F%:F%=F%-1:E%=E%-1 60+G%,E%);:  B%=:D%=50:G%=15:D%,E%);: D:C%=&8C:G%=0:D%=5 C%=&8D:G%=15:D%=50 C%=&8E:F%=15:E%=19 C%=&8F:F%=0:E%=4 $B%=:D%,E%);: .5T:C:"Set "C$:C%=C$:I%=0255:Q%?I%=C%::A: jL:C:"*"C$::"*";C$:C$ G .'"Press space to continue";:=32::A: +I:C:"Write "C$:C$="":C%=S%:C%=C$ ""Writing to ";:F(C%):X%?5=10 '"OK ?";:C$=:C$<>"Y"C$<>"y":A: �sX%?6=(C%&FF0000)&10000:X%?7=(C%&FF00)&100:X%?8=C%:L%:S%=C%:A:?X%:C:"**** Disc fault "~?X%:G:D%,E%); ( ?X%=0: 2*N:C:"Read "C$:C$="":C%=S%:C%=C$ Z$"Reading ";:F(C%):X%?5=8:T@E xM::'"W i n c h e s t e r D i s c E d i t o r"''"0-9,A-F overtype when in the data area. All keys overtype in the text area":"Cursor Keys - Move the cursor in the data and text areas" "Shifted Cursor Keys - Move the cursor to row/column ends in the data area":'"R - Read a sector from the disc. Read <Optional new address>":"N - Read the Next sector from the disc":"P - Read the Previous sector from the disc" "W - Write a sector to the disc. Write <Optional new address>":"S - Set the sector buffer to a value. Set <value>":"X - Exchange all value1 bytes to value2. Exchange /<value1>/<value2>" "L - Look for a pattern starting at the current sector. Exits by found or Escape":"G - Go on Looking, using the same pattern as was last used":"M - Mask. Set the Mask used in comparisons when Looking." "* - Star command to the BBC machine OS":"Escape - leave the current operation with the option of leaving the program":"H - Help, this command":'"All numbers are in Hex if preceded by '&', else in decimal":t\D 6E:C%=S%+1:X%?5=8:T@E TO:C%=S%-1:C%<0: hX%?5=8:T@E r_X:C:"Exchange /"C$:C%=C$,C$,"/")-1):O%=C$,C$,"/")+1):I%=Q%Q%+255:?I%=C%:?I%=O%  :A: P::I%=0:''"Type in the pattern to search for as a list of :"'"<Decimal number> or &<Hex number> or '<Character> [RETURN]"'"or as $<Character string>"'"Terminate the list with a null entry"''"Look for :":"&";~I%;:" ? "C$ 1I%=0C$,1)="$":$U%=C$,2):V%=C$-2::TzG C$="":TpG (C$,1)="'"U%?I%=C$,2,1)U%?I%=C$ I%=I%+1:I%>255 0 V%=I%-1 :"Now specify the search limits within each sector, ie the range of positions"'"where the found string may start, from 0 to 255":"Start search byte ? "C$:T%=C$:"End search byte ? "C$:K%=C$:255-V%<K%:K%=255-V% b:A lFQ:H%=:C:13:"Looking in Sector "~S%10;:I%=T%K%:V%<0dZG 9J%=0V%:(Q%?(J%+I%)M%)<>(U%?J%M%):J%=V%:::E: :H%=:Z%<>S%::A ڌG%=I%16:F%=I%16:D%=5+G%*3:E%=F%+4:D%-2,E%);"*";:C:"Found at &"~I%;". Continue ?";:C$=:C$<>"Y"C$<>"y":C$;D%,E%);:I%=256::: H%=::E: R::''"The Mask is used to ignore bits in Looking for a pattern"'"E.g. to ignore the top bit, &7F. To ignore case, &DF. To ignore both, &5F"'"Type [RETURN] for the default, &FF"':"Mask ? "C$:C$="":M%=&FF:M%=C$ > :A: HK:N%500:I%=033:P%=N%:[OPT0:LDA#Q%256:STA&80:LDA#Q%256:STA&81:LDX#4:.I:LDA#31:JSR&FFEE:LDA#3:JSR&FFEE:TXA:JSR&FFEE:LDA#32:JSR&FFEE:LDY#0:.J:LDA(&80),Y:JSRD:INY:CPY#16:BCCJ:LDA#31:JSR&FFEE:LDA#60:JSR&FFEE:TXA:JSR&FFEE:LDY#0:.K LDA(&80),Y:BPLG:PHA:LDA#17:JSR&FFEE:LDA#0:JSR&FFEE:LDA#17:JSR&FFEE:LDA#129:JSR&FFEE:PLA:.G:#&7F:CMP#32:BCSE:LDA#&2E:.E CMP#&7F:BNEF:LDA#&FF:.F JSR&FFEE:LDA#17:JSR&FFEE:LDA#1:JSR&FFEE:LDA#17:JSR&FFEE:LDA#128:JSR&FFEE:INY:CPY#16:BCCK:LDA&80 ADC#15:STA&80:BCCL:INC&81:.L:INX:CPX#20:BCSH:JMPI:.H:RTS:.D:PHA:LSRA:LSRA:LSRA:LSRA:JSRB:PLA:#15:JSRB:LDA#32:JMP&FFEE:.BA#&30:CMP#&3A:BCCC:ADC#6:.C:JMP&FFEE:]:: XH%=:<>17:C:"Exit ?";:C$=:C$:C$="Y"C$="y"C$="Q"C$="q":"FX4,0":::TDA 0:''"***** ERROR"::" at line ";:G:TNA � tjJ �<J@%=0:23,255,255,255,255,255,255,255,255,255: