C64-Connect v. 0.98 (C) Copyright Ville Muikkula 1995 With this program and a simple cable between C64's user port and PC's parallel printer port you can load programs to C64 directly from PC's harddisk! Incredibly fast, longest loading time under 3.5 seconds! Nearly 30 times faster than Turbo III-saved cassette! Transfer from C64 to PC is of course possible too. Included are executables for PC and C64, schema- tics for the cable and one demo for C64 from Majic 12: ACT-1. C64-Connect is freeware. This means that you can copy and distribute it freely, and it's actually recommended. There are, however, some restrictions. You are not allowed to make any changes to program files. If you are going to include it on a CD-ROM, use the newest available version. Contact the author to be sure about this. ! YOU ARE USING THIS PROGRAM AND CABLE AT YOUR OWN RISK. ! ! I'M NOT IN ANY WAY RESPONSIBLE FOR POSSIBLE DAMAGES ! ! CAUSED BY THE USE OF C64-CONNECT. IF YOU CAN'T ACCEPT ! ! THIS, THEN DON'T USE THIS PROGRAM/CABLE. ! Hopefully you didn't get scared. There is still a couple of things to remember: - Turn off both computers before connecting the cable. - First turn on PC and then C64. And switch them off in reverse order, first C64 and then PC. CIA2-chip of C64, one that drives user port, doesn't like voltage peaks. General information about C64-Connect As we all know, loading a program from cassette can be really annoying. Even with a cassette turbo loading can take nearly two minutes. And if it ends with a loading error... ARGH! That's why I started programming C64-Connect. Now I have a 1541 diskette drive too, but even it is awfully slow compared to C64-Connect, which transfers about 15700 bytes per second from PC to C64 and about 8800 from C64 to PC. I would like to say that it is the fastest program of its kind in the world, but I'm not sure about this. At least it is much faster than 64NET and 64LAN. C64-Connect doesn't try to emulate 1541 diskette drive. It just trans- fers programs as memory areas. The main purpose of C64-Connect is to load programs to C64 as fast as possible. You can also transfer programs from C64 to PC and if you want, convert them to use with C64-emulators on PC. You can transfer nearly all turbo tape-saved programs, all basic-prgs and again nearly all PRG-files from diskettes. The only restriction is that autostarting programs and multiload programs can't be transferred. There would not be much sense to try to emulate 1541 through user port. It would not work on most programs, as they have their own diskette turbos. There is one program, called 64NET, that tries to do this. It is compatible with some software, but it is awfully slow and unregistered version doesn't even allow saving to PC. 64NET is crippleware and you have to pay for fully functional version. For some unknown reason C64-Connect is not yet as reliable as I would like it to be. Transfer can jam sometimes and I have no idea why. There should not be any timing problems as there is not any kind of timing used. C64-Connect uses a simple handshaking instead. If it jams, press restore on C64 to get back to basic. Type sys 679. PC will then show an error message and you must then press restore again. This has to be done because there is no way to stop transfer from PC. Lame, eh? Turbo Pascal is too slow to check keyboard for Esc key without slowing down the transfer dramatically. I'll have to code some of the most time critical routines in assembly to add this simple feature. Constructing the cable for C64-Connect Parts needed: - 25-pin male D-connector (for PC's LPT-port) - shell to 25-pin D-connector - card edge connector for C64's user port (2*12-pin, raster 3.96 mm) - shell to user port's connector - CMOS 4503 (IC, 6*3-state buffer) - 16-pin socket for IC - 1.5 - 2.0 meters of 16 wire shielded cable If you want to save money, you can use 12 wire cable, but then you must put CMOS 4503 to the shell of 25-pin D-connector. This is trickier to do, but not impossible. If you can't find shell to C64's user port's connector and can't make one yourself, this is the only possibility. Schematics: PC C64 1 STROBE ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ> B FLAG2 Handshake PC->C64 2 DATA0 ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ> C PB0 ; Four data lines 3 DATA1 ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ> D PB1 ; from PC to C64 4 DATA2 ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ> E PB2 ; 5 DATA3 ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ> F PB3 ; 18-25 GND ÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ A,N GND ³ ÚÄÄÄÄÄÄÄ¿ Àij8 16³ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ 2 +5V 6 DATA4 ÄÄÄÄÄÄÄÄÄ>³2 3³ÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄ> H PB4 ; Four 7 DATA5 ÄÄÄÄÄÄÄÄÄ>³4 5³ÄÄÄÄÄÄÄÂijÄÄÄÄÄÄÄ> J PB5 ; bi-directional 8 DATA6 ÄÄÄÄÄÄÄÄÄ>³6 7³ÄÄÄÄÄÂijijÄÄÄÄÄÄÄ> K PB6 ; data lines 9 DATA7 ÄÄÄÄÄÄÄÄÄ>³10 9³ÄÄÄÂijijijÄÄÄÄÄÄÄ> L PB7 ; 14 AUTOF. ÄÄÄÄÄÄÄÄÄij1 ³ ³ ³ ³ ³ ÀÄÄÄÄÄÄÄÙ ³ ³ ³ ³ 10 ACKN. <ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ ³ ³ ³ 12 P.E. <ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ ³ ³ 13 SELECT <ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ ³ 15 ERROR <ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ 11 BUSY <ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ M PA2 Handshake C64->PC ^ ^ 16-nap 12-nap User port of Commodore 64 CMOS 4503: ÚÄÄÄÜÜÄÄÄ¿ 1 2 3 ð³1 16³ð - - - - - - - - - - - - ð³2 15³ð - - - - - - - - - - - - ð³3 14³ð A B C D E F H J K L M N ð³4 13³ð ð³5 12³ð ð³6 11³ð ð³7 10³ð ð³8 9³ð ÀÄÄÄÄÄÄÄÄÙ CMOS 4503 appears as a box in schematics. You can put it to either end of the cable. Under the drawing are ^-characters that show where is two meters of cable depending on the location of the IC. You can easily make a reset switch to C64 at the same time. Just put off-on push button between pins 1 and 3 of user port. Files in archive: C64CON.EXE - C64-Connect program file for PC C64CON.DOC - English documentation for C64-Connect (this file) C64CON.TXT - Documentation in Finnish WHATSNEW.DOC - Version history of C64-Connect TRANSFER.TXT - Basic prg for C64 to transfer PCTOC64 to C64 C64FILES.LST - Filenames and programnames are saved to this file C64TOPC.PRG - C64 program for transferring prgs from C64 to PC PCTOC64.PRG - C64 program for loading programs from PC to C64 ACT1.PRG - Demo for C64 from Majic 12 Installation of programs The tricky part is how to transfer PCTOC64.PRG to C64. For most of you the easiest way is to write a basic program in file TRANSFER.TXT to C64. It's shortened basic-version of PCTOC64. With it you will then transfer machine language version to C64. I guess no one is interested in writing long data lines... When you have written the basic program to C64, save it to diskette or cassette. Turn both computers off, connect the cable to user port of C64 and the other end to one of the LPT-ports on PC. Most PCs have only one LPT-port. C64-Connect will automatically find out in which port the cable is. Turn computers on in right order: PC first, then C64. Load saved basic-program. Run it and start C64CON.EXE on PC. Choose Load to C64 and from loading menu choose PCTOC64 with cursor keys and then press Enter to start transfer. Transfer should now start. On C64's screen appears start and end addresses of PCTOC64. The starting address should be 2049. If it is not for some reason, stop the transfer (PC has to be reseted with Ctrl-Alt-Del) and check the cable and basic-program. During the transfer C64 shows a counter that goes from starting address to end address-1. When transfer is completed and C64 shows READY, write the following commands: POKE 45, PEEK(253) POKE 46, PEEK(254) POKE 47, PEEK(253) POKE 48, PEEK(254) POKE 49, PEEK(253) POKE 50, PEEK(254) O=PEEK(45)+256*PEEK(46)-1 FOR T=2049 TO O: POKE T,PEEK(47103+T):NEXT Now you have PCTOC64 ready to be saved to diskette or cassette. Save it and turn C64 off and then back on. This has to be done because basic's pointers are a bit messed after those commands. If everything went fine you have now PCTOC64 on a diskette or cassette. Load and run it. There will be a command SYS 679 on the screen and cursor blinks over it. Press return. Choose Load to C64 on PC and from load-menu choose ACT-1, which is a demo from Majic 12. Transfer should take under 2.2 seconds. Run the demo. Hopefully everything has gone like this. If not, check the cable, basic-program and those POKE-commands. When everything seems to work fine, make a backup copy of PCTOC64 to another diskette or cassette. If you use cassette, it's a good idea to save it several times on the same cassette. You won't then need to rewind it every time. With this command you can save it several times to a cassette: FOR T=1 TO 20: SAVE"PCTOC64 X.XX": NEXT Use the version number of C64-Connect in the place of "X.XX". The other C64 program, C64TOPC, is for transferring programs from C64 to PC. You don't need to save it on diskette or cassette, as you can transfer it from PC with PCTOC64 every time you need it. Loading from PC to C64 First you need to load PCTOC64 from diskette or cassette. Run it, and press return on SYS 679. On PC choose Load to C64 by pressing L-key on keyboard. Then choose the program to be loaded with cursor keys and press enter to start the transfer. While transferring C64's screen flickers and PC shows a graphical meter. Transfer should not take longer than 3.5 seconds. However, I have not tested C64-Connect on slower machines than 486DX-40. After the transfer is over PC shows how much time it took and the transmission speed in bytes per second. You can now run the loaded program on C64 or save it normally to a diskette or cassette. You can transfer several programs from PC to C64 without need to load PCTOC64 again. Just type SYS 679 and it starts. Transferring from C64 to PC Load PCTOC64 to C64. Transfer C64TOPC from PC with it. Of course you can load C64TOPC directly from a diskette or cassette if you have saved it to one. Run it, and then load the program you want to transfer from C64 to PC. Remember that it can't be autostarting. Cassette turbo can be loaded if you need to use one. I recommend Turbo III-cassette turbo. When the program you want to transfer is loaded, type SYS 679 and on PC choose Transfer from C64. Answer to questionnaire about filename and name of the program. C64TOPC reads program's start and end addresses from basic's pointers at memory locations 43-44 (start address) and 45-46 (end address). Some cassette turbos can load and save programs that are over 50 KB long and are partially loaded to RAM under the IO-area of C64. C64-Connect can't do this, and will show an error message. Using programs converted to .T64- or .D64-format of C64S Because there are several C64 emulators for PC, for example C64S and Personal C64, you can still find C64-programs in many BBSs. Specially programs converted to C64S's .T64- and .D64-formats can be found easily. One can in no time get a collection of hundreds of programs. In a theory even the oldest C64 games from year 1982 or similar are still protected by copyrights and they should not be distributed freely. But practice is a bit different. If you have Internet access, you can get as much C64 programs as you want. C64-Connect stores C64's program files in the standard PRG-format used by 1541. First two bytes of a file contain the start address of the program and everything else is program code. The extension of files on PC must be .PRG. You can convert T64- and D64-files back to PRG- format with internal Export-feature of C64S. (I will maybe write conversion utilities to be included with C64-Connect in the future.) Copy converted .PRG-files to directory where you have C64-Connect. From the main menu of C64-Connect choose Edit load-menu and then Import prgs to menu. C64-Connect asks names for the programs. You can quit importing of programs by pressing Esc. If you don't want to add a certain file to load-menu, just press enter and it will be skipped. Comparison to 64NET and 64LAN As I mentioned earlier, C64-Connect is faster than 64NET and 64LAN. 64NET is the slowest one of these three programs. 64LAN is faster, but C64-Connect is nearly three times faster than it. A program that takes about 3.3 seconds to load with C64-Connect takes nearly 10 seconds to load with 64LAN. I can't measure exact times for 64LAN, so I don't try to make any kind of table with transfer rates. This difference between performance of these programs, 64NET, 64LAN and C64-Connect is caused mainly by different cables. C64-Connect's PCTOC64 and C64TOPC (C64 programs) are also optimized quite well. But the main reason why C64-Connect is as fast as it is is that it uses 8 bits when loading to C64 and 4 bits when transferring from C64 to PC. It is made possible by the use of one IC with the cable. This makes the construction of the cable a bit more complicated, but the increase in transfer speed is certainly worth it. C64-Connect checks the transferred files with a simple checksum. If an error has happened, C64-Connect will automatically transfer the last block of 256 bytes again. Updating to newer version of software If you have Internet access you will find the newest version of C64-Connect in ftp.funet.fi in directory /pub/cbm/transfer. In Finland you can call to BUZZ SBBS (983-425 621), which is a support site for C64-Connect. It's not recommended to use different versions of programs with C64 and PC. For example, C64TOPC distributed with C64-Connect 0.96 is not compatible with C64-Connect 0.97. However, there are not always changes in some programs. Check filesizes and creation dates of C64TOPC.PRG and PCTOC64.PRG when you update to newer version of C64-Connect. If they differ from those of earlier version, you'll have to transfer newer PCTOC64 from PC to C64 with older version of C64-Connect and save it to a diskette or cassette before you delete older version of C64-Connect on PC. Contacting the author If you want to contact me for some reason, you have three ways to do this. You can send e-mail to vmuikku@raahenet.ratol.fi. If you live in Finland you can leave a message to user Ville Muikkula in BUZZ SBBS 983-425 621 or you can send mail to address Ville Muikkula Meht„kyl„ntie 98 86170 Ypp„ri Finland Future plans - It's possible to make the transfer even faster by programming some time critical routines in PC's C64-Connect with assembly language instead of Turbo Pascal. I have calculated that C64 could receive data at nearly 20 KB per second without any changes to PCTOC64. It's PC that slows down the transfer. 486 is not fast enough compared to C64... - Because there is no way to stop the transfer from PC, it may even happen that you must reset PC with Ctrl-Alt-Del. This is lame and ridiculous, but if I fixed it with Turbo Pascal, transfer speed would slow down too much, from 15700 to 12000 bytes per second. I'll try to fix this to next version. - For some unknown reason, transfer jams sometimes. At least this doesn't happen often. I'll try to find out what causes this. - I will maybe write some conversion programs by which one can convert C64S's .T64- and .D64 files to PRG-format. - Better documentations. Hopefully you will find everything you need to know in this text. If you have something to ask, don't hesitate to contact me.