Quantcast
Channel: stardot.org.uk
Viewing all articles
Browse latest Browse all 3098

8-bit acorn software: other • Combined 40/80 track formatter

$
0
0
Someone requested details on how to create a combined 40/80 track disc on the Facebook group. It's detailed in Section 17 of the Advanced Disc User Guide, along with a listing of a special formatter. Below is a copy of that formatter extracted from the pdf document, along with a couple of OCR fixes. I've tested it, and it seems to work. You should be able to copy this directly into BeebEm:

Code:

10 REM---------------------------------------------------20 REM F4080: Combined 40/80 track formatter30 REM---------------------------------------------------40 DIM param 12, sectab 39, cat 51150 osword = &FFF160 MODE 770 PROCbegin :REM get drive80 PROCinitsec(0) :REM create sectab for track 090 PROCformat(0) :REM format track 0100 FORT%= 20 TO 39110 PROCinitsec(T%) :REM create sectab120 PROCformat(T%) :REM format130 NEXT140 FORT%= 40 TO 78 STEP 2150 PROCinitsec(T% DIV 2) :REM create sectab160 PROCformat(T%) :REM format170 NEXT180 PROCcreatecat :REM set up catalogue190 PROCwritecat :REM write catalogue200 PRINT TAB(6,22);CHR$133;"formatting complete"210 END220 230 DEF PROCbegin240 REPEAT250 PROCwhichdrive260 UNTIL ans$ = "Y" OR ans$ = "y"270 PROCinsert280 ENDPROC290 300 DEF PROCcreatecat310 FOR I%= 0 TO 511320 cat?I% = 0 :REM initialise330 NEXT340 $(cat+8) = "dummy  $" :REM dummy filename350 cat?&10 = 0 : REM knock off &OD360 cat?&105 = 8 :REM no. files * 8370 cat?&106 = 3 :REM sectors on disk= &320380 cat?&107 = &20390 cat?&10D = 198 :REM dummy is 198 sectors400 cat?&10F = 2 :REM starting at sector 2410 ENDPROC420 430 DEF PROCformat(track%)440 ?param = drive% :REM drive450 param!1 = sectab :REM sector table460 param?5 = &05 :REM no. of parameters470 param?6 = &63 :REM command code480 param?7 = track% :REM physical track490 param?8 = 21 :REM gap3500 param?9 = &2A :REM 10 sectors510 param?10 = 0 :REM gap5520 param?11 = 16 :REM gap1530 A% = &7F540 X% = param MOD 256550 Y% = param DIV 256560 CALL osword570 PRINT TAB(12,12);CHR$130;"track ";track%580 IF param?12 = 0 ENDPROC590 PRINT TAB(0,23);CHR$133;"format: bad result = &";~param?12600 STOP610 ENDPROC620 630 DEF PROChead640 CLS650 PRINT TAB(0,2);CHR$141;CHR$131;"COMBINED 40/80 TRACK FORMATTER"660 PRINT TAB(0,3);CHR$141;CHR$131;"COMBINED 40/80 TRACK FORMATTER"670 ENDPROC 680 690 DEF PROCinitsec(logtrack%)700 FOR I% = 0 TO 9710 sectab?(I%*4) = logtrack%720 sectab?((I%*4)+1) = 0730 sectab?((I%*4)+2) = I%740 sectab?((I%*4)+3) = 1750 NEXT760 ENDPROC770 780 DEF PROCinsert790 PROChead800 PRINT TAB(0,5);CHR$134;"insert diskette in drive ";drive%810 PRINT TAB(0,7);CHR$134;"hit space bar when ready to go"820 REPEAT 830 UNTIL INKEY(100) = 32 840 PROChead 850 ENDPROC 860 870 DEF PROCwhichdrive 880 PROChead 890 REPEAT 900 PRINT TAB(0,5);STRING$(38," ") 910 PRINT TAB(0,5);CHR$134;"enter drive to format (0-3) >";920 INPUT " " drive%930 UNTIL drive% > -1 AND drive% < 4940 PROChead950 PRINT TAB(0,5);CHR$134;"formatting drive ";drive%960 REPEAT970 PRINT TAB(0,7);STRING$(38," ")980 PRINT TAB(0,7);CHR$134;"are you sure (Y/N) >";990 INPUT " " ans$1000 ans$= LEFT$(ans$,1)1010 UNTIL ans$= "Y" OR ans$= "y" OR ans$= "N" OR ans$= "n"1020 ENDPROC1030 1040 DEF PROCwritecat1050 ?param = drive% :REM drive1060 param!1 = cat :REM catalogue data1070 param?5 = &03 :REM no. of parameters1080 param?6 = &4B :REM command code1090 param?7 = 0 :REM logical track1100 param?8 = 0 :REM logical sector1110 param?9 = &22 :REM 2 sectors1120 A% = &7F1130 X% = param MOD 2561140 Y% = param DIV 2561150 CALL osword1160 IF param?10 = 0 ENDPROC 1170 PRINT TAB(0,23);CHR$133;"writecat: bad result = &";~param?101180 STOP 1190 ENDPROC 

Statistics: Posted by KenLowe — Fri Dec 13, 2024 11:54 am



Viewing all articles
Browse latest Browse all 3098

Trending Articles