• Please review our updated Terms and Rules here

PET file transfer

cosam

Veteran Member
Joined
Dec 21, 2008
Messages
594
Location
Netherlands
I'd be interested to hear other members' experiences with transferring data from a PC to a PET. I'd like to be able to transfer individual files (such as a .PRG) as well as disk images.

CBM-HD looks nice, but seems to require more work hardware-wise than something like cbmlink, which looks like it just needs a cable.
 
There is a new cable called XS-1541 that has both IEC and IEEE connectors, meant to interface to an IEEE floppy drive. I haven't tried it but it sounds promising.

Otherwise, I haven't transferred much software. The cbmlink probably is your best bet for an inexpensive solution. Using a double density drive (2031, 2040, 3040, 4040) together with a 1541 and regular X-cable is another approach. I also own a C2N232I interface which is very handy for downloading individual programs to any Commodore computer, not just PET. It is related to the cbmlink, just much faster.
 
Using a double density drive (2031, 2040, 3040, 4040) together with a 1541 and regular X-cable is another approach.
I only just got a 8050 so I'm hoping to get going without needing even more drives ;-)

I also own a C2N232I interface which is very handy for downloading individual programs to any Commodore computer, not just PET. It is related to the cbmlink, just much faster.
I can see how a C2N232 (-I or otherwise) would be very useful. I was however looking at the parallel port connection for cbmlink, which I'd have thought would be faster than bitbanging over the cassette interface.
 
Cosam,

I'd be interested to hear other members' experiences with transferring data from a PC to a PET. I'd like to be able to transfer individual files (such as a .PRG) as well as disk images.

CBM-HD looks nice, but seems to require more work hardware-wise than something like cbmlink, which looks like it just needs a cable.

since I don't own any PET-compatible disk drive (yet), but happen to own a datasette (which works with both C64 and PET), I would take a diversion via a 1541 drive and a C64 to copy PET PRG files to tape. I already successfully used a program called Star Commander and one of the standard cable types (X1541 or so -- don't remember exactly) to copy C64 PRG files from a PC to a 1541. In principle, this should be possible with PET PRG files, too, which can then be loaded into a C64 and saved to tape. However, different measures have to be taken depending on whether we're talking about a BASIC file or a machine language binary.

The problem with BASIC files is the following: The PET's BASIC RAM starts at $0401 -- and that's also what the first two bytes of a PET BASIC PRG file should state. When loading such a BASIC program into a C64, it gets nevertheless loaded to $0801 (the C64's BASIC RAM) and automatically re-linked so that all "next line" pointers point to the appropriate addresses. The PET, however, seems incapable of relocating BASIC programs so that a program thus saved to tape does get loaded to $0401, but its "next line" pointers keep pointing to their C64-based $08something targets.

Fortunately, the C64's memory model can be adusted in a very flexible manner. The following program will re-configure a C64 to use $0401 as BASIC start (rather than $0801). In addition, it re-locates the video RAM from $0400 to $8000, which is the PET's video RAM location. Apart from ensuring correct $0401-based line linking, this allows PET BASIC programs which POKE directly to video RAM (many games, for instance) to be run on the C64. :)

Code:
100 CIA = 56576:VIC = 53248:VRAM = 648:BSTART = 43:BTERM = 55:NMIVEC = 792
110 POKE CIA, PEEK(CIA) AND 252 OR 1:REM SELECT VIC MEMORY BANK #2 ($8000 - $BFFF) 
120 POKE VIC+24, PEEK(VIC+24) AND 15:REM SET VIDEO RAM TO START OF BANK
130 POKE VRAM,128
140 POKE NMIVEC,193:REM POINT VECTOR TO RTI (DISABLE STOP/RESTORE)
150 POKE BSTART+1,4:REM SET START OF BASIC RAM TO $0401
160 POKE 1024,0:REM ENSURE BYTE AT NEW BASIC START - 1 IS NULL
170 POKE BTERM+1,128:SET END OF BASIC RAM TO $8000
200 POKE VIC+32,0:POKE VIC+33,0:REM SET BORDER/BACKGROUND COLOR TO BLACK
210 PRINT "{green}{clr}### COMMODORE BASIC ###"
220 PRINT " 31743 BYTES FREE."
230 NEW

As for PET machine language binaries, you can load and save them using a C64 without any problem, provided they don't load to the $0400 - $7fff area (which is the the C64's video RAM). In this case, you should re-configre the C64 as described above.

For saving machine language binaries a monitor program is a very handy tool. Unfortunately, the C64 doesn't have a built in one (as opposed to the PET), so you'll first have to load one. Alternatively, one could write a BASIC program that in turn PEEKs all relevant memory locations and writes their contents directly to a PRG file.
 
Interesting stuff - I was wondering how that would work with machine code programs. I have a C64 but it needs some work, and I've no 1541 for it either.

I have been able to transfer BASIC programs in a round-about way using a different process, namely: PRG -> D64 -> VICE PET Emulator -> tape image -> audiotap -> WAV -> real tape -> PET (write-up here). Sounds a lot more long-winded than it is, honest ;-)

Tapes (when I can get them to work) are fine for one-off transfers, but I'm really looking for something a bit quicker.
 
I used a similar method to track18, to get PET files from the Internet to my real PET. I've written it up here. It worked just fine, even with m/l programs. Using the c-64 and it's cassette deck as an intermediary was very reliable. Tapes made on the C-64 always loaded first time on the PET.

They had to be loaded in to the PET then resaved of course, to fix the memory pointer issue. But they always loaded first time. :)

Tez
 
I was however looking at the parallel port connection for cbmlink, which I'd have thought would be faster than bitbanging over the cassette interface.
Well, I believe Marko et.al. manage to squeeze 38Kbps through the cassette port. I don't know if it can be compared to USB devices and SATA, both being serial protocols reaching higher speeds than parallel ones did.

By the way, in order to save programs from disk to tape I would look up some copying program like Copy 190 or what else is available. Those would allow you to save any file no matter the load address.
 
Well, I believe Marko et.al. manage to squeeze 38Kbps through the cassette port. I don't know if it can be compared to USB devices and SATA, both being serial protocols reaching higher speeds than parallel ones did.
Quite impressive, yes. As far as I understand it, the software first sends over a speedloader program which then transfers the actual data at the higher speed. Clever stuff. Then again, an ECP parallel port can operate in the order of megabytes per second and should be faster, although cbmlink only sends a nibble at a time an presumably needs to do handshaking in software. I suspect when transferring a disk image that the PET's drives will be the bottleneck anyway, so it probably wouldn't make much difference.

Can you still get C2N232 adapters though? I've not found a supplier as yet. Maybe I should just shoot off an e-mail to the developers.

By the way, in order to save programs from disk to tape I would look up some copying program like Copy 190 or what else is available. Those would allow you to save any file no matter the load address.
I don't think I'll be doing a lot of that, but good to know - thanks.
 
I used a similar method to track18, to get PET files from the Internet to my real PET. I've written it up here. It worked just fine, even with m/l programs. Using the c-64 and it's cassette deck as an intermediary was very reliable. Tapes made on the C-64 always loaded first time on the PET.

They had to be loaded in to the PET then resaved of course, to fix the memory pointer issue. But they always loaded first time. :)
Yeah, I think the reliability problems in my set-up are just down to the inevitable differences between a proper Commodore-written tape and a home-grown one. Variables like alignment, frequency and signal amplitude are all pretty critical when it comes to analogue tapes, and it would appear the PET is particularly picky ;-)
 
The problem with BASIC files is the following: The PET's BASIC RAM starts at $0401 -- and that's also what the first two bytes of a PET BASIC PRG file should state. When loading such a BASIC program into a C64, it gets nevertheless loaded to $0801 (the C64's BASIC RAM) and automatically re-linked so that all "next line" pointers point to the appropriate addresses. The PET, however, seems incapable of relocating BASIC programs so that a program thus saved to tape does get loaded to $0401, but its "next line" pointers keep pointing to their C64-based $08something targets.

To load C64 BASIC files on the PET, do the following:

Type 0 REM

Load the BASIC file

Type SYS 1024 to get into the PET's monitor

Type M 0400-0410 to dump the first few bytes of BASIC memory. You should see an 01 04. Change this to 01 08 and exit the monitor. When you type LIST, you'll now see your BASIC program. The 0 REM line will be at the top of it; just type 0 and hit Return to get rid of it.
 
The answer to that question is a combination of yes, no and maybe. I could explain a bit more in a private message.
Can you CC me as well, please? I'm also interested.

Also, you mentioned Copy 190; AFAIK this is for a C64 and IEC drives, do you know offhand if it works on a PET? Alternately, I seem to recall that our friend Jim Butterfield wrote a Tape > Disk copy program for a PET; have you ever run across that or an equivalent?

TIA,

mike
 
The idea about Copy 190 or similar program is to use a C64 to save from floppy disk to tape, then cross your fingers that the PET can load those tapes.
 
The idea about Copy 190 or similar program is to use a C64 to save from floppy disk to tape, then cross your fingers that the PET can load those tapes.
I think it also goes in the other direction, i.e. tape > disk, which is what I'm interested in at the moment; have I got it wrong?

I've got a hundred or so tapes that I'd like to organize on disks and save some space while I'm at it.
 
To load C64 BASIC files on the PET, do the following:

Type 0 REM

Load the BASIC file

Type SYS 1024 to get into the PET's monitor

Type M 0400-0410 to dump the first few bytes of BASIC memory. You should see an 01 04. Change this to 01 08 and exit the monitor. When you type LIST, you'll now see your BASIC program. The 0 REM line will be at the top of it; just type 0 and hit Return to get rid of it.

Now, *that* is a really smart way...! Deleting line 0 should also drag the rest of the BASIC lines down to $0401, shouldn't it? Cool...
 
Have been playing with cbmlink today and it works great. I found a 13-pin single-sided edge connector which, despite having an extra pin, fits the user port fine. With this and a DB25 I made myself a PC64 cable as per the cbmlink release notes.

I couldn't find a PRG of the bootstrap program and neither of the text-to-PRG conversion tools I tried wanted to know. Luckily I discovered that you can simply copy-paste the provided basic code straight into VICE. Anything to avoid having to type that all in! The old tape image -> audiotap -> WAV combo got it on a tape for me, then I saved it to a disk with the 8050.

Transferring individual programs didn't seem to work 100%. Not sure if it's just down to the programs themselves, but the few I tried all started OK but hung part-way through. No matter, though - I whipped up a D80 disk image using 64Copy and cbmlink copied it straight to a real disk for me. Took about 15 minutes though, so I'll have to experiment with interleaving and see if I can't speed that up a bit.
 
I've been meaning for some time to try to archive my 8050 disks (and tapes), but the number of different formats, converters, transfer programs and cables always made my head spin, so I've been waiting for someone just like you to tell me what worked (and to pester when it doesn't). Time to plug in the iron and make that cable...
 
Good luck - do you have anything interesting (for others) on those disks? I've not found much other than games. Where did all that business software go?

I did need to tinker with cbmlink a bit, but I think that's because I was running it from a 64-bit box. It's no rocket surgery, but I'm here for the grillin' if need be!
 
Back
Top