8-Bit Software Online Conversion
ADFS Sector Editor BASIC - Listing
10REM"ADFS Sector Editor
20REM"by Mafia Choirboys
30REM"July '90 at 8:34 pm
40REM"V.2 - R.6
50:
60MODE3:ONERROR PROCe
70DIM cb &F,bk &FF
80PRINTTAB(12)"ADFS Sector Editor by
Mafia Choirboys. Sector :"
90*FX4,1
100*key0|!|L
110*key1|!|M
120*key2|!|N
130*key3|!|O
140*key4|!|P
150*key5|!|Q
160PRINTTAB(5,2)"00 01 02 03 04 05 06
07 08 09 0A 0B 0C 0D 0E 0F"''" 00"'" 1
0"'" 20"'" 30"'" 40"'" 50"'" 60"'"
70"'" 80"'" 90"'" A0"'" B0"'" C0"'
" D0"'" E0"'" F0"
170xh=5::xa=55:y=4:B%=ASC"-"
180PROCs
190:
200REPEAT
210PROCb:G=GET
220IFG=&87:PROCf
230IFG=&88:PROCm(2)
240IFG=&89:PROCm(1)
250IFG=&8A:PROCm(3)
260IFG=&8B:PROCm(4)
270IFG=&8C:PROCdr
280IFG=&8D:PROCs
290IFG=&8E:IFFNy("Read in again?"):PRO
Ca(8)
300IFG=&8F:PROCd
310IFG=&90:IFFNy("Save sector?"):PROCa
(&A)
320IFG=&91:IFFNy("Wipe sector?"):PROCz
330IFG<&86:PROCk
340UNTIL.
350:
360DEFPROCe:*FX 4
370PROCw:REPORT:PRINT" near ";ERL:VDU2
6:END
380DEFPROCdr:PROCw:INPUT"Which drive?"
d$:OSCLI"mount "+d$:VDU26:PROCa(8):ENDPR
OC
390DEFPROCs:PROCw:INPUT"Sector?"s$:s=F
Nh(s$):VDU26:PROCa(8):ENDPROC
400:
410DEFPROCa(V)
420?cb=0:cb!1=bk:cb?5=V:cb?6=0
430cb?7=s DIV256:cb?8=s MOD256
440cb?9=1:cb?&A=0:cb!&B=0
450X%=cb MOD256:Y%=cb DIV256:A%=&72:CA
LL&FFF1
460:
470DEFPROCd
480PRINTTAB(60,0);÷s;" "
490FORB=0TO&F:PRINTTAB(5,4+B);:FORC=0T
O&F:A$=STR$÷(?(bk+(B*16)+C)):IFLENA$<2:A
$="0"+A$
500PRINTA$" ";:NEXT,:FORB=0TO&F:PRINTT
AB(55,4+B);:FORC=0TO&F:D=?(bk+(B*16)+C):
IFD>31ANDD<127 THENPRINTCHR$D; ELSEPRINT
".";
510NEXT,:ENDPROC
520:
530DEFPROCb:PRINTTAB(xh-1,y)CHR$(B%);T
AB(xh+2,y)CHR$(B%):PRINTTAB(xa,y);:ENDPR
OC
540:
550DEFPROCf:IB%=B% EOR16:PROCb:ENDPROC
560:
570DEFFNy(A$):PROCw:PRINTA$'"(Y/N):";:
REPEAT:A$=GET$:UNTILA$="Y"ORA$="N":PRINT
A$:VDU26:IFA$="Y":=TRUE ELSE=FALSE
580:
590DEFPROCk:IFB%=61:GOTO650
600G$=CHR$G:IFINSTR("0123456789ABCDEF"
,G$)=0:ENDPROC
610A=?(bk+((y-4)*16)+(xa-55)):A$=STR$÷
A:A$=RIGHT$(A$,1)+G$:B=FNh(A$):?(bk+((y-
4)*10)+(xa-55))=B
620A$=STR$÷B:IFLENA$=1:A$="0"+A$
630PRINTTAB(xh,y)A$:PRINTTAB(xa,y);:IF
B>31ANDB<127THENPRINTCHR$B ELSEPRINT"."
640IFB%=61:PROCm(1):ENDPROC:ELSEPROCb:
ENDPROC
650?(bk+((y-4)*16)+(xa-55))=G:A$=STR$÷
G:IFLENA$=1:A$="0"+A$
660PRINTTAB(xh,y)A$:PRINTTAB(xa,y);:IF
G>31ANDG<127THENPRINTCHR$G ELSEPRINT"."
670IFB%=61:PROCm(1):ENDPROC:ELSEPROCb:
ENDPROC
680:
690DEFPROCm(V)
700IFINKEY(-2):PROCc:ENDPROC
710PRINTTAB(xh-1,y)" "TAB(xh+2,y)" "
720IFV=1:xa=xa+1:xh=xh+3:IFINKEY(-1):x
a=70:xh=50
730IFV=2:xa=xa-1:xh=xh-3:IFINKEY(-1):x
a=55:xh=5
740IFV=3:y=y+1:IFINKEY(-1):y=19
750IFV=4:y=y-1:IFINKEY(-1):y=4
760IFxa>70:xa=55:xh=5:IFB%=61:y=y+1
770IFy>19:y=4
780IFxa<55:xa=70:xh=50
790IFy<4:y=19
800PROCb:ENDPROC
810:
820DEFPROCc:IFV=1:s=s+1
830IFV=2:s=s-1
840IFV=3:s=s-16
850IFV=4:s=s+16
860IFs<0:s=s+&A00
870IFs>&A00:s=s-&A00
880PROCa(8):ENDPROC
890:
900DEFPROCw:VDU28,9,23,60,21,12:ENDPRO
C
910DEFPROCz:FORA=0TO&FF:?(bk+A)=0:NEXT
:PROCd:ENDPROC
920DEFFNh(H$):E=1:F=0
930REPEAT:F=F+(INSTR("0123456789ABCDEF
",RIGHT$(H$,1))-1)*E:E=E*16:H$=LEFT$(H$,
LENH$-1):UNTILH$="":=F