SEQ2PRG

Basic and Machine Language

Moderator: Moderators

Post Reply
Boray
Musical Smurf
Posts: 4064
Joined: Mon May 03, 2004 10:47 am

SEQ2PRG

Post by Boray »

I had a problem to copy SEQ files to my Amiga, so
I made a little program:

5 printchr$(14);"SEQ to PRG - By Anders Persson 2004"
10 input"Input SEQ file";a$:ifa$="$"thendirectory:goto10
15 open2,8,2,"0:"+a$+",s,r"
20 input"Output PRG file";a$
25 open3,8,3,"0:"+a$+",p,w"
30 get#2,a$:ifst<>0thenclose2:close3:end
40 print#3,a$;:goto30

/Anders
PRG Starter - a VICE helper / Vic Software (Boray Gammon, SD2IEC music player, Vic Disk Menu, Tribbles, Mega Omega, How Many 8K etc.)
carlsson
Class of '6502
Posts: 5516
Joined: Wed Mar 10, 2004 1:41 am

Post by carlsson »

Single line version: OPEN 1,8,15,"C0:OUTPUT,P=INPUT,S" :wink:

BTW, the "directory" command either requires Basic 3.5 or higher or some kind of Basic expansion.
Anders Carlsson

Image Image Image Image Image
User avatar
Mike
Herr VC
Posts: 4830
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Post by Mike »

Of course Boray's solution still makes sense, if I were about to extract certain parts of a file. But apart from Carlsson's one-liner for the whole-file copy, I'd also like to point out, that zero-valued bytes are read as empty strings by GET#!

Thus, line 40 should be replaced by:

40 PRINT#3,LEFT$(A$+N$,1);:GOTO30

with:

27 N$=CHR$(0)

Michael
tlr
Vic 20 Nerd
Posts: 567
Joined: Mon Oct 04, 2004 10:53 am

Post by tlr »

carlsson wrote:Single line version: OPEN 1,8,15,"C0:OUTPUT,P=INPUT,S" :wink:
:) Really nice tip there! I never saw any real use for the DOS copy stuff on single drives, but here it is perfect. Should be alot faster aswell, and it will not block the computer while doing it!

/Daniel
Boray
Musical Smurf
Posts: 4064
Joined: Mon May 03, 2004 10:47 am

Post by Boray »

How cool! Thanks Anders! I had no idea that could be done.

And also thanks to Mike! I didn't know that either... ;)

/Anders
PRG Starter - a VICE helper / Vic Software (Boray Gammon, SD2IEC music player, Vic Disk Menu, Tribbles, Mega Omega, How Many 8K etc.)
carlsson
Class of '6502
Posts: 5516
Joined: Wed Mar 10, 2004 1:41 am

Post by carlsson »

Actually, the transfer program on the Amiga side should somehow be able to load SEQ files too, probably by specifying file type to the file name, but there may be other situations when you wish to copy or rename a file with a different file type.
Anders Carlsson

Image Image Image Image Image
Post Reply