[Coco] Program to convert Orchestra 90 ".ASC" files for use with the Orchestra 90 cartridge
Barry Nelson
barry.nelson at amobiledevice.com
Sat Jun 11 18:31:36 EDT 2016
I noticed this software was missing from the internet so I rewrote it. It converts ".ASC" Orchestra 90 files so that the Orchestra 90 CoCo cartridge can use them.
1 REM PROGRAM TO CONVERT ORCHESTRA "ASC" FILES TO A FORMAT READABLE BY THE ORCHESTRA 90 CARTRIDGE
10 CLEAR 500:CLS
20 INPUT "FILE FOR CONVERSION";F$
25 REM CONSTRUCT OUTPUT FILE NAME, REMOVE .ASC EXTENSION, IF NO EXTENSION ADD -O
30 E$="":P=INSTR(F$,"."):IF P=0 THEN P=LEN(F$)+1:E$="-O"
40 O$=LEFT$(F$,P-1)
45 REM OPEN INPUT AND OUTPUT FILES
50 OPEN "I",1,F$:OPEN "O",2,O$+E$+"."
55 REM CHECK FOR END OF INPUT FILE
60 IF EOF(1) THEN GOTO 140
65 REM GET A LINE OF INPUT
70 LINE INPUT #1,N$
75 REM IF THE LINE IS EMPTY, GET THE NEXT LINE
80 IF LEN(N$)>0 THEN PRINT N$ ELSE 60
85 REM SPLIT UP COMMENT LINES LONGER THAN 31 CHARACTERS
90 LN=LEN(N$):PN=31
100 IF LN-PN>0 AND INSTR(N$,"/")>0 THEN N$=LEFT$(N$,PN)+CHR$(175)+MID$(N$,PN+1):PN=PN+31:LN=LN+1:GOTO 100
105 REM SET BIT 7 HI ON THE FIRST CHARACTER OF EACH LINE
110 N$=CHR$(ASC(LEFT$(N$,1)) OR 128)+MID$(N$,2)
115 REM WRITE OUT 100 CHARACTERS AT A TIME, NO CR OR LF
120 OP$=OP$+N$:IF LEN(OP$)>100 THEN PRINT #2,LEFT$(OP$,100);:OP$=MID$(OP$,101)
125 REM GET NEXT LINE
130 GOTO 60
135 REM CLOSE INPUT FILE
140 CLOSE #1
145 REM WRITE OUT LAST BLOCK OF 100 CHARACTERS, PADDING WITH SPACES
150 OP$=LEFT$(OP$+STRING$(100,32),100):PRINT #2,OP$;
155 REM CLOSE OUTPUT FILE
160 CLOSE #2
170 END
More information about the Coco
mailing list