Benchmarko Logo
Benchmarko Logo
Home
Projects
CPCEMU
Software
Download
Contact
Links

German French Spanish
 
back

CPCEMU - Data Transfer

  1. Data Transfer CPC <-> PC
    5.1 The disk as a media
    5.1.1 The disk transfer program CPCTRANS
    5.1.2 The format- and copy-utility 22DISK by SYDEX
    5.2 The parallel interface
    5.3 The serial interface
    5.4 Other possibilities

 


 

5. Data Transfer CPC <-> PC

What can you do with a good emulator when you do not have any programs for it or if you do not see any possibility to get programs from a CPC across to the PC?
In chapter 6 (Supply, ...) some ftp sources are listed where CPC software can be found.
This chapter deals with the data transfer of CPC software to the PC. Some utilities for the different possible methods of doing this are described (disk, with parallel or serial interface).

 

5.1 Disk as a media

This is the simplest way to get CPC software across to the PC.
You only need a CPC with a second drive of the correct size. Correct size means that the disks must also fit in your PC drive. (If not, you could still try to connect a 3 inch drive to your PC.)

The PC is persuaded to recognize the CPC formatted disk using a utility to read the CPC formatted disks. This utility is called CPCTRANS.

 

5.1.1 The disk transfer program CPCTRANS

I have developed CPCTRANS to create disk images from CPC disks. Standard CPC formats as well as double sided Vortex formats are supported.
CPCTRANS is not intended to transfer copy protected formats! When calling CPCTRANS without parameters you will get a short overview.
CPCTRANS is similar to the DOS COPY-instruction:

CPCTRANS <source> <destination> <options>

Examples:

  • "CPCTRANS B: DISK1.DSK" copies the disk in drive B to the disk image DISK1.DSK. If it does not exist, it is created.
  • "CPCTRANS DISK1.DSK B:" writes the disk image back to the disk in drive B.

The first command only runs for the DATA format. For other formats you have to use an option:

  • /f 0 : DATA format (default)
  • /f 1 : DATA format, double-sided
  • /f 2 : SYSTEM format
  • /f 3 : SYSTEM format, double-sided
  • /f 4 : VORTEX format, double-sided
  • /f 5 : unknown, CPCTRANS tries to detect it
  • /f 6 : +3DOS

Note the space between "/f" and the number.
When using the double sided DATA- or SYSTEM-format, you can select the side A or B in the disk menu (3.2.1).
When writing back a disk image, the disk in the drive must have the same format! For simple formats you can use 22DISK, described in the next section.

  • For copying the B-side of a disk, use the option "/s 1".
    With "CPCTRANS B: DISK1.DSK /s 1" only the B-side of the disk is copied, with "CPCTRANS DISK1.DSK B: /s 1" it is written back.
  • The option /v turns on verify, so CPCTRANS checks if the copy is correct. That is indeed a bit slower but increases security.
  • The option /t <count> sets the number of tracks to copy. Normally it is 40 tracks, only for the VORTEX format it is 80.
  • The option /q (quick format) is a feature with which you can format a disk image, instead of copying data onto it.
    Nevertheless you have to specify a valid drive as first parameter, even if it is not used. Example: "CPCTRANS a: SYSTEM.DSK /f 2 /q" formats SYSTEM.DSK as a disk image with SYSTEM format.

 

5.1.2 The format- and copy-utility 22DISK by SYDEX

This program is available as shareware. With correct definitions you can use nearly all CP/M formats! Unfortunately just the CPC formats are not included with the evaluation copy of 22DISK. Therefore I have defined the formats in the file CPMDISKS.DEF. You will find them in the UTILITY subdirectory.

What can you do with 22DISK?

You can transfer single files back and forth between DOS and non-DOS formats, format disks and so on.

Copy the CPC files into the TAPE directory. Read section 3.2.2 for an explanation how to load them.

 

5.2 The parallel interface

If you own a CPC without a second drive, you can do the data transfer over the parallel interface.
The original idea came from Gilles Molinari, he had also written some Turbo Pascal programs. But maybe you belong to the group of users, who do not have a Turbo Pascal compiler on their CPC, so you could not do much with the Pascal source. Therefore I have rewritten the utilities in Locomotive BASIC, and extended it by adding the direction PC->CPC. Thus it is possible to transfer files back and forth between CPC and PC!
The CPC and PC are coupled together via their parallel interfaces. If you own a CPC 6128 with Centronics connectors and compare them with a printer you will note that CPC and PC fit together excellently when using a standard PC printer cable! But do not do that now, please read further.
It seems that only Schneider CPCs have Centronics connectors. If you have an Amstrad CPC 6128 with simple edge connectors or a CPC 464,664, use the diagram at the end of this section.

First you have to jump over two hurdles:

  1. constructing a simple adapter
  2. input a short program into the CPC

Wait! Do not skip the rest!

Both steps are really simple, because

  1. is possible without soldering and
  2. is indeed very short (about 30 lines BASIC)

To step 2.

The program you need calls CPCREC.BAS and is in the UTILITY directory. It is saved in ASCII, so you can send it to your printer without problems and type it into your CPC. It does its job like a thin rope sent through a pipe in order to get a thick cable through it.
Here, the thin rope is CPCREC.BAS which receives files from the PC. With this little utility you get CPCPARA.BAS (the thick cable) over to the CPC. With CPCPARA.BAS you can receive and transmit. Then you will not need CPCREC.BAS any more.
On the PC side you use PCPARA.EXE, also included in the UTILITY directory.

But before you input CPCREC.BAS, have a look at step 1..

 

The parallel adapter

You need an adapter between the PC printer cable and the PC printer connector.

This goes easiest with a RS-232 wiring box, which has a 25pin D-Sub male (plug) and a 25pin D-Sub female (socket) connector. By plugging short wires into the box you can realize any possible connection between both sides. Usually such a box is used - as its name already says - for adapting RS-232 interfaces. Serial connections do not function at the first, you know. We use the adapter the other way round, that is, the plug is for the PC side and the socket for the printer cable.

Plug it together now:


Plug for the PC printer-      Socket for the printer cable
 connector (left side)             (right side)
       Pin 2     ---------------       Pin 11
       Pin 10    ---------------       Pin 8
       Pin 11    ---------------       Pin 1
       Pin 12    ---------------       Pin 7
       Pin 13    ---------------       Pin 6
       Pin 15    ---------------       Pin 5
       Pin 19    ---------------       Pin 19

As you see, you do not need all the 25 wires, only 7 of them.
Although the wiring box is cheap if you buy it from a electronic mail-order company, you can get it even cheaper by using a jumper box. Then you have to solder the wires.
The cheapest way is to buy a 25pin D-Sub plug, a 25pin D-Sub socket, a box and some wires.

Now I presume you have connected the computers with the adapter and CPCREC.BAS on your CPC. What now?

  1. On the CPC : Run CPCREC.BAS (after you have saved it)
  2. On the PC : Run PCPARA /s CPCPARA.BAS

Now it gets exciting, if no error messages appear on the PC screen, all is OK, the file is on the CPC.

  • If the PC does not send anything and reports an error message the connection may be incorrect.
  • If it is sending (Sending block xx), but some error messages appear occasionally, your PC may be too fast or too slow. The direction PC->CPC is very time crucial, you know.

On my 386/33 I must not have EMS memory installed, otherwise it is too slow. On a very fast computer it could be necessary to use the turbo switch. Use the program under plain DOS, not OS/2 or Windows.

If it does not run at all, send me a note. In the meantime you can type in the program CPCPARA.BAS which is a little longer. The direction CPC->PC runs always, also under OS/2, because it is nearly the same as printing. The PC behaves like a printer.

I assume that you have CPCPARA.BAS on your CPC now.

Transfer files from CPC to PC in the following way:

  1. On the PC: Run PCPARA /r.
  2. On the CPC: Run CPCPARA, select S)end and input every file you want to transmit. (Run PCPARA /r for every file you want to transmit, CPCPARA runs in an endless loop.)

Thus, use PCPARA in the following way:

  • PCPARA /r : start PCPARA in receiving mode
  • PCPARA /s <file> : sends <file> to the CPC, if you use TRM: as file, you will get a terminal.

All programs in the UTILITY directory display an overview about its options if you call them without any parameters.

WARNING:

Even if the construction is very simple, I cannot guarantee that you do not damage anything. If your CPC printer-port is damaged afterwards, it is a pity and rather an unfortunate accident. Perhaps it would be also damaged if you had simply connected a printer.

For example, I know a former CPC user whose keyboard did not work properly any more one day. After the repair he was told that he should not plug the joystick in while the computer is switched on!
(Well, I do so always ?!?)

To come back:

I have built the adapter successfully. And have even sometimes forgotten to insert the adapter in the connection and have had no problems.

 

Diagrams by David Chapeau, if your CPC has no Centronics connectors:

 34 <- - - - - - - - 18      \
 ______________________      |
|   ________________   |     |
|  |________________|  |   - | ---> Printer Connector (Female)
|______________________|     |         to CPC
                             |
 17 < - - - - - - - - 1      |
                             |
   ||||||||||||||||||        |
   ||||||||||||||||||        \
   ||||||||||||||||||         >   CPC 6128 to DMP 2160 Cable
   ||||||||||||||||||        /
   ||||||||||||||||||        |
                             |
 1 - - - - - - - - > 18      |
________________________     |
\    ______________    /     |
 \  |______________|  /    - | ---> Centronics Connector
  \__________________/       |         (Male)
                             |
 19 - - - - - - - -> 36      /



 18 < - - - - - - - - 1      \
________________________     |
\    ______________    /     |
 \  |______________|  /    - | ---> Centronics Connector
  \__________________/       |         (Female)
                             |

 36 <- - - - - - - - 19      |

                             |
   ||||||||||||||||||        |
   ||||||||||||||||||        \
   ||||||||||||||||||         >   PC Parallel Adapter
   ||||||||||||||||||        /
   ||||||||||||||||||        |
                             |
 1 - - - - - - - - > 13      |
________________________     |
\  ..................  /     |
 \  ................  /    - | ---> Sub-D Connector (Male)
  \__________________/       |         to PC (LPT1)
                             |
 14 - - - - - - - -> 25      /


 13 < - - - - - - - - 1      \
________________________     |
\  ..................  /     |
 \  ................  /    - | ---> Sub-D Connector (Female)
  \__________________/       |
                             |

 25 <- - - - - - - - 14      |

                             |
   ||||||||||||||||||        |
   ||||||||||||||||||        \
   ||||||||||||||||||         >   RS 232 Wired Box
   ||||||||||||||||||        /
   ||||||||||||||||||        |
                             |
 1 - - - - - - - - > 13      |
________________________     |
\  ..................  /     |
 \  ................  /    - | ---> Sub-D Connector (Male)
  \__________________/       |         to PC (LPT1)
                             |
 14 - - - - - - - -> 25      /

 


Printer    Centronics  Centronics      Sub-D      Sub-D        Sub-D
Connector    (Female)     (Male)      Connector  Connector    Connector

    1 ---------  1           1 ---------  1         11 ---------  2
          .                        .                 8 --------- 10
          .                        .                 1 --------- 11
          .                        .                 7 --------- 12
   17 --------- 17          14 --------- 14          6 --------- 13
   18 --------- 19          19 --------- 19          5 --------- 15
          .                 21 --------- 20         19 --------- 19
          .                 23 --------- 21
          .                 25 --------- 22
   34 --------- 35          27 --------- 23
                            29 --------- 24
                            30 --------- 25
                            31 --------- 16
                            32 --------- 15
                            33 --------- 18
                            36 --------- 17

 

CPCPARA -> PCPARA (v1.1) transfer speed:

Times to transfer a block of 0x4000 Bytes from CPC to PC with the parallel adapter:

Source on CPC: bytes/s: bit/s:
File from floppy disk: 1600 12800
Block from memory: 2240 17920
Block from memory, no ints.:
(poke &b941,&c9 on CPC 664 and CPC 6128)
2445 19560

The block sending was controlled in BASIC (inside CPCPARA):

defstr a:a="test.$$$":call sstr,@a
a=string$(&80):for i=1 to &80:call sstr,@a:next
call sbyte,0:stop

You can read further information about the parallel adapter in chapter 7.

 

5.3 The serial interface

If you own a serial interface for the CPC, you can certainly use it for data transfer to the PC.

 

5.4 Other possibilities

There are some more fantastic ways to get the software onto the PC.

  • Connect the 3 inch disk drive to the PC. Some (older) models should fit to a 5.25 connection.
  • With a detour over the the Spectrum+3: read the 3 inch disk on the Spectrum+3, convert it in the Spectrum format and use a utility to read it on the PC. This utility comes with the Spectrum emulator Z80 by Gerton Lunter.
  • When is was necessary to get the ROM yourself, someone told me about his way:
    He took the ROM chip out of the CPC and inserted it instead of the VGA BIOS. With a small program he was able to read the contents.
  • Maybe you will find another way?

 

Chapter 6. Sources of Supply, Support, and Acknowledgments

 

© Marco Vieth, Mai 1998



Marco Vieth, 19.04.2008 14:27:04