8-Bit Software Online Conversion
BBC-PC File Conversion - Listing
10REM" PC => BEEB File Conversion
20REM" Submitted to 8BS magazine
30REM" (C) SJG February 1995
40REM" See textfile 'ConvTxt' for
50REM" further information...
60REM" Permission is granted to
70REM" copy/distribute this program
80REM" as PublicDomain.
90REM" Version 1.2 - 29.6.95
100:
110CLOSE#0
120MODE7
130PRINTCHR$(141);" PC => BEEB File Co
nversion Program"'CHR$(141);" PC => BEEB
File Conversion Program"
140PRINT''" 1) Convert BBC-text to PC
-text"'" 2) Convert InterWord to PC-tex
t"'" 3) Convert PC-text to BBC-text"'"
4) Convert BBC-mode0 to PC-bitmap"'" 5
) Convert PC-bitmap to BBC-mode0"
150PRINT''" Enter Choice (1-5)";
160REPEAT:choice=GET-48:UNTIL choice>0
AND choice<6
170INPUT''" Enter Source Filename ";so
urce$
180INPUT'" Enter Destination Filename
";dest$
190PRINT'" Please Wait... Converting"'
" ";source$;" to ";dest$'" (";
200IFchoice=1PRINT"BBC-text to PC-text
)" ELSE IFchoice=2PRINT"InterWord to PC-
text)" ELSE IFchoice=3PRINT"PC-text to B
BC-text)" ELSE IFchoice=4PRINT"BBC-mode0
to PC-bitmap)" ELSE IFchoice=5PRINT"PC-
bitmap to BBC-mode0)"
210FORT=1TO7500:NEXT
220:
230IFchoice=1 MODE3:PROCbbctext`pctext
240IFchoice=2 MODE3:PROCinter`pctext
250IFchoice=3 MODE3:PROCpctext`bbctext
260IFchoice=4 MODE0:PROCbbcgra`pcgra
270IFchoice=5 MODE0:PROCpcgra`bbcgra
280MODE7:PRINTCHR$(141);" Output Compl
ete - Press Any Key"'CHR$(141);" Output
Complete - Press Any Key"
290A=GET:RUN
300:
310REM" BBC-text to PC-text
320DEFPROCbbctext`pctext
330S=OPENIN(source$)
340D=OPENOUT(dest$)
350REPEAT
360A=BGET#S
370IF A=96 A=156
380IFA>31 AND A<127 OR A=9 OR A=156 BP
UT#D,A:PRINTCHR$(A);
390IFA=13 BPUT#D,13:BPUT#D,10:PRINT
400UNTIL EOF#S
410CLOSE#S
420CLOSE#D
430ENDPROC
440:
450REM" InterWord to PC-text
460DEFPROCinter`pctext
470S=OPENIN(source$)
480D=OPENOUT(dest$)
490PTR#S=833
500REPEAT
510A=BGET#S
520IF A=137 OR A=141 OR A>159 AND A<25
5 A=A-128
530IF A=96 A=156
540IFA>31 AND A<127 OR A=9 OR A=156 BP
UT#D,A:PRINTCHR$(A);
550IFA=13 BPUT#D,13:BPUT#D,10:PRINT
560UNTIL EOF#S
570CLOSE#S
580CLOSE#D
590ENDPROC
600:
610REM" PC-text to BBC-text
620DEFPROCpctext`bbctext
630S=OPENIN(source$)
640D=OPENOUT(dest$)
650REPEAT
660A=BGET#S
670IF A=96 A=39
680IF A=156 A=96
690IF A=254 A=42
700IFA>31 AND A<127 OR A=9 THEN BPUT#D
,A:PRINTCHR$(A);
710IFA=10 BPUT#D,13:PRINT
720UNTIL EOF#S
730CLOSE#S
740CLOSE#D
750ENDPROC
760:
770REM" BBC-mode0 to PC-bitmap
780DEFPROCbbcgra`pcgra
790D=OPENOUT(dest$)
800OSCLI "LOAD "+source$+" 3000"
810RESTORE:FORT=1TO62:READ A:BPUT#D,A:
NEXT:LET Y=&7D87:REPEAT:FORZ=1TO8:FORT=1
TO80:BPUT#D,?Y:Y=Y+8:NEXTT:LETY=Y-641:NE
XTZ:Y=Y-632:UNTIL Y<&3000
820CLOSE#D
830DATA 66,77,62,80,0,0,0,0,0,0,62,0,0
,0,40,0,0,0,128,2,0,0,0,1,0,0,1,0,1,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,255,255,255,0
840ENDPROC
850:
860REM" PC-bitmap to BBC-mode0
870DEFPROCpcgra`bbcgra
880S=OPENIN(source$)
890FORT=1TO62:A=BGET#S:NEXT
900Y=&7D87
910REPEAT:FORZ=1TO8:FORT=1TO80:?(Y)=BG
ET#S:Y=Y+8:NEXTT:LETY=Y-641:NEXTZ:Y=Y-63
2:UNTIL Y<&3000
920CLOSE#S
930OSCLI "SAVE "+dest$+" 3000 8000"
940ENDPROC
950: