PET/CBM FAQ - CROSS-PLATFORM AND EMULATION

HOW CAN I GET PET PROGRAMS FROM DISK TO TAPE?

Fortunately there is a wonderful file copy utility available for PET (4.0), VIC (12k+), and Commodore 64/128, called 'Unicopy'.

Unicopy (written by the famous Commodore enthusiast, Jim Butterfield) allows you to copy from disk directly to tape. This of course preserves the loading address and makes things much easier. (also it performs multiple file copies instead of just one program at a time).

HOW CAN I GET PET TAPE PROGRAMS ONTO DISK?

You could load/save programs (which relocates the start address which you have to fix later) or you can use this program I discovered for the 64. This program will automatically LOAD each file off of tape and subsequently SAVE it to disk (device number 8) and continue until you stop it (or a disk error occurs when it attempts to save a file with the same name as one already on disk, disk full, or end of tape.)

Here is the listing (remember this is written for the Commodore 64):

  5 rem tape2disk
  10 for i=53181 to 53247:read a:poke i,a:next i
  20 print "[clr][down][down][down]tape to disk transfer program!"
  30 print"[down]insert formatted disk in drive 8."
  40 print"[down]insert tape, rewind and then press play.[down]"
  50 sys 53181
  100 data 169,1,162,1,160,1,32,186,255,169,0,162,65,160,3,32,189,255
  110 data 169,0,32,213,255,169,8,162,8,160,255,32,186,255,169,20,162
  120 data 65,160,3,32,189,255,173,61,3,141,251,0,173,62,3,141,252,0
  130 data 169,251,174,63,3,172,64,3,32,216,255,76,189,207

Type this in, SAVE it (don't want to type it in again, right?), put a blank formatted disk in drive 8, type RUN. If everything is working the message will display and the computer will now ask you to press PLAY on tape, put in a cassette, rewind if necessary, and press PLAY. Let it run through the tape (this could take an hour or more if it is a long tape). Reset the computer and load the disk directory. You should now have the tape programs on the disk, note that they are all padded with extra spaces, you will need to use a disk or directory editor to “fix” the file names.

CAN I RUN VIC-20, 64, 128, PLUS/4, OR C-16 SOFTWARE ON MY PET?

Maybe. Any program that is all BASIC that does not use hi-res graphics or sound and contains no POKES should work readily on a PET. Of course if it contains POKEs, sound commands, and Machine Language, conversion will be necessary. If it relies on more than one voice of sound, hi-res graphics, programmable character sets or color, it may not be worth converting because those features aren't present on the PETs.

NOTE: Many of the early VIC, 64, Plus/4 (and IBM!) BASIC games and programs were converted PET games.

HOW DO I GET 64 (VIC, PLUS/4, ETC.) BASIC PROGRAMS ON MY PET?

Unlike the later 8-bit Commodores,the PET always loads programs into the memory address they were saved at (i.e. no loading ,8 and ,8,1 as on the later machines), which means BASIC programs saved on VICs, 64s, 128s, etc, will not load in the right location on the PET to be seen by the BASIC interpreter. PET BASIC starts at location 1025 ($0401 in hex) and the later Commodore machines have different, higher starting locations. (see table x)

There are a couple ways to get a BASIC program to load properly into memory,

Disk Track/Sector Editors:

My preferred method of conversion is using a disk track/sector editing utility to change the 'load address bytes' of the file directly on the disk. This is not an easy process to 'explain' and I hope to write it up at a later time.

BASIC Line Relocation Method:

Here is a way to get the BASIC editor to do it for you; of course you will need to have an upgrade ROM or later PET (which has a ML monitor) or load in a monitor for your original ROM PET first. It involves 'linking' the higher located BASIC program to a line starting in regular BASIC, when you delete that line, the editor will move your program to where it belongs in memory.

1. Enter NEW to erase any programs already in memory.

2. Enter:

0 REM

3. LOAD the program you want converted (i.e. LOAD“program name”,1 for tape)

4. When loaded, enter the machine language monitor by entering

SYS 1024

5. display the first part of the BASIC you first typed:

M 0401 0408

6. Change the line-link to the memory location of the program to be moved; use cursor keys to move up and change the first two two-digit numbers to read:

:0401 01 08 00 00 8F 00 00 00
      ^^ ^^   (for a program from a 64, otherwise, see table x)

7. Press return to change the bytes then enter X to exit the monitor.

8. Type LIST, you should see the 0 REM followed by the program.

9. Enter 0 to delete line 0 which will move the BASIC to its proper place.

0. Save the program.

Load Addresses for BASIC files:

Start of BASIC
Saved Using
Computer Model/configuration
load addr. dec. load addr. hex. change bytes to:
PET/CBM 1025 $0401 N/A
VIC-20 unex. 4097 $1001 01 10
VIC-20 +3k 1025 $0401 N/A
VIC-20 8k+ 4609 $1201 01 12
Commodore 64 2049 $0801 01 08
B-128 0003 $0003 +
Plus/4-C16 4097 $1001 01 10
Plus/4-C16++ 8193 $2001 01 20
C128 mode 7169 $1C01 01 1C
C128 mode++ 16385 $4001 01 40

+ The BASIC RAM of the B128 is located in a separate bank of RAM memory, which starts at a VERY low address and will be difficult to convert without a track/sector editor or saving it special on a B-128 itself.

++ When hi-res GRAPHICS mode space has been allocated.

I GOT SOME PROGRAMS OFF THE INTERNET AND NEED TO GET THEM TO MY PET, HOW DO I DO THAT?

When you get files off the internet they will be in one of several file formats, usually they will come as a D64 “disk image” file, or individual program files (see below for information on the archive file types). Once you have the file the bigger trick is getting the data to the PET - with the PET being without a standard serial port (and disk formats incompatible with PC drives) that makes transferring files a quite a bit more difficult. Fortunately many PET enthusiasts have been working on solving the problem and there are a few methods which could be used.

PET<->PC Connection

This cable links the PC's parallel printer port with the parallel port of the PET/CBM. It requires building an interface consisting of a parallel port connector for the PC, a multi-conductor wire and an edge card connector to plug into the PET's Parallel port. Software for the interface is available for the PC running DOS, Windows or Linux. (succeeded by c2n232) If interested in PRlink, see the Cross-platform CBM to PC section of fu.fi's archive.

C2N232 Interface [pictured center of image]

Much more advanced the C2N232 interface (a more complex hardware project) connect the cassette port of the Commodore (not just the PET, can also be the 64 or VIC-20) to a PC's RS-232 serial port. Communication on the PET side is more automated with a 'server' program for the PET loaded from the PC with a simple LOAD command. Once loaded the PC side can direct the PET to download or load files, transfer disks to images, or create diskettes from images sent from the PC.

Andre's IEEE-488 Interfaces

Plans for various IEEE-488 interfaces including one which will let you hook a 1541 to a PET (IEEE-488 to IEC serial). If you can't find an IEEE-488 drive and want a disk drive, this is a viable alternative.

PC<->1541 Connection

X1541 Cables [pictured right in image]

This process assumes you have a 4040 compatible disk drive for the PET (such as a 2040, 4040, 2031, or MSD SD drive) and a commodore 1541 drive (much easier to get then the PET drive!). The X1541 type cables allow the PC's parallel printer port to interface to the 1541 diskette drive. With a transfer program (like the excellent Star Commander) you can decode D64 disk images into diskettes, save individual files to disk, or visa-versa.

PC<->Datasette Connection

MTAP and PTAP

are similar to star commander but they use the X1531 Cable or C64S tape Adapter to connect to a Commodore tape drive to load and save software directly to cassette.

Also check out the Cross-platform CBM to PC section for other tape utilities which include creating and reading audio tapes using a PC with a sound card!

PC<->C64<->1541 Connection

This connection method isn't the easiest as you need a lot of hardware, but sometimes it works better with some people than the other methods. It is similar to the X1541 connection above but with a 64 as an intermediary. This may be necessary if you do not have a disk drive for the PET and want to get the files to the 64 in order to get them to tape for the PET to use.

64HDD

This process also uses the X1541 style cables but gives a 64 or 128 the use of a IBMish PC's hard drive as if it were a Commodore disk drive.

Null-Modem/Serial Transfer

Using a 64 with an RS-232 interface you could connect to a PC and transfer files via terminal programs using the standard file transfer protocols (like X-Modem). It may be primitive, but I have used it many times. For the Mac I did write up a more direct Mac-64 connection without the need of a special RS-232 interface, though if you have a modern Mac you may have to get the Mac a USB to RS-232 converter.

There are various file types that archived data from commodore esist in. Many of the transfer programs (above) amd emulators (below) use one or many of the listed formats. Of the formats listed the most popular are .d64 and compressed .d64 formats, followed by .prg/.bin then the others.

filename.D64 (also D80,, D82)

.D64 files are an archive of a 1541/4040 diskettes. The entire contents of the disk's data are recorded from the first sector on the first track to the end of the disk (including unused space). There are many programs that will help you get a disk into a D64 and back. D80 and D82 are similar to the D64 format except they are archives of 8050 and 8250 format disks. If you don't have the drives to uncompress the disk to there are utilities also out there to 'extract' the individual files from the images or to copy them to other image files.

filename.TAP

.TAP is an archive of a cassette tape image, which usually can have one or more files intended to be loaded in a sequential order. There are also utilities available to create tapes from the TAP files or to extract the individual files though I've never used them.

filename.PRG or filename.BIN

.PRG, .BIN indicate the program is not archived but in it's original binary format. Some emulators cannot use programs 'outside' of a .D64 image file, while others can.

filename.P00

.P00 Is like .PRG and .BIN except there is a header which gives the (up to) 16 character file name as it would have been on a Commodore Disk

1!filename, 2!filename,3!filename,4!filename

Similar to D64 but also compressed with the Commodore Disk archive utility ZipCode. Some emulators support these files and there are converters to turn the Zipcode archives into and out of .D64 image files.

filename.ZIP, GZIP, ARC

These are compressed file of any of the above formats. Mainly compressed to store .D64 and other archives more compactly on the internet. Some emulators can read these 'packages' without decompression. Also multi-disk 'sets' of .D64 images are usually zipped together to ensure they are not partially transferred.

HOW COME MY PET CAN'T READ A TAPE FROM MY PLUS/4 OR COMMODORE 16 OR VISA-VERSA?

You are quite a collector, aren't you? When Commodore designed the Plus/4 and Commodore 16 they broke a lot of standards they had previously established for their 8-bits (and fortunately went back to in the C128); besides the plug designs, they changed the sound-frequency of the signals used to record on tape. Though the the format is identical to the PET and the other C= 8-bits, the sound is only readable on the Plus/4 and Commodore 16. My suggestion would be to record the program on disk (1541) and then read it on a 4040 or 2031, or copy them to tape using a 64, 128. or VIC-20.

ARE THERE ANY PET COMPUTER EMULATOR PROGRAMS AVAILABLE?

There are only a few, the first popular one was produced by Commodore for the Commodore 64, it is able to run many PET BASIC games with POKE commands properly converted and a little M/L. It's intent was to help those PET owners who upgraded to a 64 back in the early 80s…

For non-Commodore platforms there are two I know of that include PET emulation:

VICE, the Versatile Commodore Emulator

which runs under Unix or MS-DOS/Windows 95 machines and can emulate:

  • C128
  • C64
  • VIC-20
  • C16/Plus/4
  • PET 2001
  • PET/CBM 3032
  • PET/CBM 4032
  • CBM 8032
  • CBM 8296

A lot of work has gone into VICE to make it as exact as possible when emulating the different machines, including emulating disk drives (in case of specific programs requiring to “talk” to the disk drive) as well as some cool debugging tools for Commodore 8-bit developers.

MESS, the Multiple Emulator Super System

is another multi-platform emulator but also supports Mac OS8+ (classic)

  • Commodore 128
  • Commodore VIC-20
  • Commodore 16/116/232/264, Plus/4
  • Commodore 2001,30xx (Basic 2)
  • Commodore 364 (Prototype)
  • Commodore 40xx FATForty
  • Commodore 64
  • Commodore 80xx
  • Commodore B128-40/Pet-II/P500
  • Commodore B128-80, B256-80HP/720
  • Commodore Max (Ultimax/VC10)
  • Commodore SP9000/MMF9000 (50Hz)
  • Commodore C65
  • Plus many other non-commodore computers and platforms

Unlike VICE, MESS is not as refined as it emulates many systems and is not as exacting or as encompassing in emulating Commodore 8-bit features.

Last modified:: 2020/11/22 09:26
   
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International