PDA

View Full Version : PET file transfer



cosam
March 25th, 2009, 04:53 AM
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 (http://www.baltissen.org/newhtm/cbmhd.htm) looks nice, but seems to require more work hardware-wise than something like cbmlink (http://zimmers.net/anonftp/pub/cbm/crossplatform/transfer/C2N232/cbmlink.html), which looks like it just needs a cable.

carlsson
March 25th, 2009, 05:02 AM
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.

cosam
March 25th, 2009, 05:42 AM
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.

track18
March 25th, 2009, 07:28 AM
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 (http://www.baltissen.org/newhtm/cbmhd.htm) looks nice, but seems to require more work hardware-wise than something like cbmlink (http://zimmers.net/anonftp/pub/cbm/crossplatform/transfer/C2N232/cbmlink.html), 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. :-)



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.

cosam
March 25th, 2009, 07:58 AM
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 (http://www.cosam.org/computers/cbm/pet/20090309.html)). 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.

tezza
March 25th, 2009, 09:24 AM
I used a similar method to track18, to get PET files from the Internet to my real PET. I've written it up here (http://classic-computers.org.nz/blog/2009-02-20-getting-programs-for-a-pet.htm). 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

carlsson
March 25th, 2009, 01:58 PM
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.

cosam
March 25th, 2009, 02:55 PM
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.

cosam
March 25th, 2009, 03:01 PM
I used a similar method to track18, to get PET files from the Internet to my real PET. I've written it up here (http://classic-computers.org.nz/blog/2009-02-20-getting-programs-for-a-pet.htm). 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 ;-)

Fallo
March 25th, 2009, 04:45 PM
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.

carlsson
March 26th, 2009, 06:24 AM
Can you still get C2N232 adapters though?
The answer to that question is a combination of yes, no and maybe. I could explain a bit more in a private message.

MikeS
March 26th, 2009, 08:13 AM
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

carlsson
March 26th, 2009, 08:19 AM
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.

MikeS
March 26th, 2009, 08:24 AM
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.

carlsson
March 26th, 2009, 09:51 AM
PET or C64 tapes?

MikeS
March 26th, 2009, 11:06 AM
PET or C64 tapes?
PET mostly, although there might be some VIC-20 stuff somewhere. Never used the cassette with a C64, always used disks.

track18
March 26th, 2009, 11:30 AM
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...

cosam
March 28th, 2009, 11:30 AM
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 (http://ist.uwaterloo.ca/~schepers/personal.html) 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.

MikeS
March 28th, 2009, 04:48 PM
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...

cosam
March 29th, 2009, 01:15 PM
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!

MikeS
March 30th, 2009, 07:01 AM
Haven't really looked; figured I might as well wait until I was ready to archive them.

There are about 20 "Cursor" tapes, but I think they're all on the web somewhere; every month you would get a tape with some interesting programs along with a covering page or two of news etc. and describing the programs. The other 30 or 40 tapes and boxes of disks are mostly stuff that I or fellow club members fooled around with. That's how it was in the old pre-internet days: we'd all tinker on our PETs at home alone or with a buddy and then proudly share our discoveries or programming masterpieces at the next club meeting.

Actually the club (TPUG) is still around and we do still have monthly meetings like that, but there are certainly a lot fewer members. Still, remarkable, since it's the second oldest PET user group, started in 1979.

But assuming I do actually get around to converting this stuff to a more useful format I'll let you know if I find anything interesting that isn't already out there. What are you looking for? Planning to run your mega-corporation's books on your 3032? As a matter of fact I did have a contract to write an accounting system for an 8032/8250, but it was cancelled before it was completed when better solutions appeared on the market; I can send you the work in progress and you can finish it and make your fortune.

carlsson
March 30th, 2009, 07:43 AM
The source from where I've picked up my PET stuff has floppies with customer data from 1991 or so, i.e. book-keeping and other tasks handled by PET or CBM-II machines a bit into the 1990's.

cosam
April 2nd, 2009, 12:43 AM
@MikeS: I'm not looking for anything in particular really, just thought it'd be nice to have it running something other than games. The Cursor stuff I'm familiar with, yeah - every other program I run starts up with their little intro screen.

Hope you manage to save at least some of your old programs. I wish I could find the tapes I saved my programs to when I was a kid, but I think they're long gone. Would be fun to see what I was up to then...

tezza
April 2nd, 2009, 01:47 AM
Out of interest, was there ever a popular word processor for the Pet? Similar to Scripsit or Electric Pencil for the TRS-80?

Tez

carlsson
April 2nd, 2009, 02:22 AM
I think that would be SpeedScript? Handic Software also sold a package called Word Result (coined from their big hit Calc Result) but it was quite late, 1982-83 or so.

dave_m
April 2nd, 2009, 11:53 AM
Out of interest, was there ever a popular word processor for the Pet? Similar to Scripsit or Electric Pencil for the TRS-80?

Tez

Tez, when the 80 column PET came out (8032), we used something called WordPro. It must have seemed great at the time, but for the life of me I do not know how useful it could have been without a mouse for cut and paste.

It was a full screen editor with good scrolling and used embedded control characters for formatting like underline and bold.