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. 90: 100CLOSE#0 110MODE7 120PRINTCHR$(141);" PC => BEEB File Co nversion Program"'CHR$(141);" PC => BEEB File Conversion Program" 130PRINT''" 1) Convert BBC-text to PC -text"'" 2) Convert PC-text to BBC-text "'" 3) Convert BBC-mode0 to PC-bitmap"' " 4) Convert PC-bitmap to BBC-mode0" 140PRINT''" Enter Choice (1-4)"; 150REPEAT:choice=GET-48:UNTIL choice>0 AND choice<5 160INPUT''" Enter Source Filename ";so urce$ 170INPUT'" Enter Destination Filename ";dest$ 180PRINT'" Please Wait... Converting"' " ";source$;" to ";dest$'" ("; 190IFchoice=1PRINT"BBC-text to PC-text )" ELSE IFchoice=2PRINT"PC-text to BBC-t ext)" ELSE IFchoice=3PRINT"BBC-mode0 to PC-bitmap)" ELSE IFchoice=4PRINT"PC-bitm ap to BBC-mode0)" 200FORT=1TO7500:NEXT 210: 220IFchoice=1 MODE3:PROCbbctext`pctext 230IFchoice=2 MODE3:PROCpctext`bbctext 240IFchoice=3 MODE0:PROCbbcgra`pcgra 250IFchoice=4 MODE0:PROCpcgra`bbcgra 260MODE7:PRINTCHR$(141);" Output Compl ete - Press Any Key"'CHR$(141);" Output Complete - Press Any Key" 270A=GET:RUN 280: 290REM" BBC-text to PC-text 300DEFPROCbbctext`pctext 310S=OPENIN(source$) 320D=OPENOUT(dest$) 330REPEAT 340A=BGET#S 350REM * This line is for Interword * 360IF A=137 OR A=141 OR A>159 AND A<25 5 A=A-128 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" PC-text to BBC-text 460DEFPROCpctext`bbctext 470S=OPENIN(source$) 480D=OPENOUT(dest$) 490REPEAT 500A=BGET#S 510IF A=96 A=39 520IF A=156 A=96 530IF A=254 A=42 540IFA>31 AND A<127 OR A=9 THEN BPUT#D ,A:PRINTCHR$(A); 550IFA=10 BPUT#D,13:PRINT 560UNTIL EOF#S 570CLOSE#S 580CLOSE#D 590ENDPROC 600: 610REM" BBC-mode0 to PC-bitmap 620DEFPROCbbcgra`pcgra 630D=OPENOUT(dest$) 640OSCLI "LOAD "+source$+" 3000" 650RESTORE: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 660CLOSE#D 670DATA 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 680ENDPROC 690: 700REM" PC-bitmap to BBC-mode0 710DEFPROCpcgra`bbcgra 720S=OPENIN(source$) 730FORT=1TO62:A=BGET#S:NEXT 740Y=&7D87 750REPEAT:FORZ=1TO8:FORT=1TO80:?(Y)=BG ET#S:Y=Y+8:NEXTT:LETY=Y-641:NEXTZ:Y=Y-63 2:UNTIL Y<&3000 760CLOSE#S 770OSCLI "SAVE "+dest$+" 3000 8000" 780ENDPROC 790: