Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
 Welcome to our latest new user Rodrigo Yeowtch ! (Registered 2024-11-24) You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > Simple C64->PC transfer
2012-04-01 06:54
Repose

Registered: Oct 2010
Posts: 225
Simple C64->PC transfer

Hello,
I just wanted to let people know of the simplest way to transfer C64 files to PC. As far as I'm concerned, this is the ONLY way left to transfer files.

1 Intro
2 Proceedure
3 Notes
4 Further directions and question to the community

1 Intro

I just dug out my 25 year old C64 (which still works!!), and was stuck - my modern PC has no serial port, printer/parallel port, floppy disk, or modem, so even though I have an RS232 interface, XA1541 cable, 1581, and modem, these are ALL obsolete. I also have no C2N datassette, nor tape deck!

2 Proceedure
I decided to record the tape output directly to a soundfile. The connection is simple.

Supplies
-3 clip leads (wires with metal clips on each end)
-3.5mm (1/8") male to male stereo audio cable

Preparing the C64 datasette connections
Looking at the Vic20/C64/C128 tape port from behind, from left to right, note that pin 1 is GND, pin 5 is WRITE, and pin 6 is SENSE. You need to clip the leads onto each of these pins. Don't worry, the fingers on both top and bottom are the same signal.

Connecting the audio cable
Plug the audio cable into the BLUE/Line IN of your soundcard. On the other end, connect pin 1 (GND) to the inner most part of the 1/8" plug. Connect pin 5 (WRITE) to the end/tip of the plug. You have now connected the LEFT channel of the soundcard to the tape WRITE.

Preparing for data transfer
-load a program to transfer from disc
-On the Commodore, type SAVE"TEST". It will ask you to press PLAY&RECORD. Next, start recording the line-in from your soundcard, with 44,1KHz sample rate and stereo.
-touch the SENSE (pin 6) to the GND (pin 1) (touch the unconnected lead to the GND that is clipped to the audio plug). This is like pressing the button on the tape. It will save the file header, then ask you to press PLAY&RECORD again. Touch the wires again. You can wait a while for it to finish. Note that I tried leaving SENSE connected, but it didn't work. It may for you.

Saving the audio file
-save the WAV as mono, PCM, 16bit. Ideally, also save only the LEFT channel as the mono wave, however in Audacity I had to use Convert to Mono which averaged the two channels, thus adding some noise from the right channel (anyhow it still worked).

Converting the audio to data
-Download
http://www.retroreview.com/iang/UberCassette/
It has quite a good algorithm for parsing the WAV. I also tried WAV-PRG but it didn't work.
I used the command line:
UberCassette test.wav test.tap -machine c64

Testing the result in an emulator
-attach the test.tap file in VICE and type LOAD, then click Datasette control and Start. Then switch to warp mode, to speed up loading. You can then save the program to a d64 image with SAVE"TEST",8.


3 Notes
-You probably need to see the C64 screen to do this, but you can also do it blind if the keyboard is typing reliably (and you know the filenames). Just listen for the stop of the file header to touch the wires again.
-To save other data files you will have to write a short program. There's probably some poke's you can make to let SAVE work on memory.
-You should let a program save first as a test while you adjust recording levels and make your recording good.

4 Further Directions and Questions
I'd like to see a short program which can save multiple files, or a full disk to tape, and then some unarchiver on the PC side which can extract the files.
The idea is that you have to type it in by hand, so it has to be simple.

Now we need a simple way to upload to c64. Maybe the soundcard is loud enough to trigger the datasette READ pin, or else we can use the PADDLE port to digitize a sound. It will have to be a very simple type-in program, then maybe you could load a more sophisticated program.

I also thought of a way to transfer from c64->PC at 500k/s., and it's dead simple - how do you think I do it? :)
Hint: it uses a TV card to capture a video signal.

Question
What is a short way to transfer more files/disk through this audio method? If you could load a bigger transfer program to C64, how would it work?
I noticed that the short pulses were about 7 samples at 44.1KHz, so you could only go about twice faster in transfer speed.
Since this method actually reads ANY data pin, you can use basic RS232 (at about 1200 baud) to send serial output. This is already twice as fast as the tape protocol. The timing decoding will rely on the start bit.
You can use two bits at a time in a stereo recording. One can even form a clock.
2012-04-01 10:58
chatGPZ

Registered: Dec 2001
Posts: 11352
do you seriosly think this is "simple" compared to just using warpcopy?

the video capture idea has a fundamental problem btw: most (cheap consumer) cards will give you compressed frames and will not work very well with pixelised patterns.
2012-04-01 11:28
Repose

Registered: Oct 2010
Posts: 225
Let me clarify my statement, the ONLY way to cheaply/simply transfer files at home, with a modern PC which has no serial, parallel, floppy, or modem, and you have no datasette or tape deck.

RRNet is currently sold out, besides it costs 49 Euro and I have to order from Europe, which would take a long time for shipping. It's absolutely not an option at this time.

I have been using my method for some hours now, once set up it is really simple to use, however I want to transfer multiple files at once.

Your point about compressed video is well taken, however there's always a way to record uncompressed video (use Virtualdub). Also, I have managed to decode Closed Captions (a US system like Teletext, roughly) (white lines in video) on compressed files with no problem.

I have written this program to transfer multiple PRG files.

-LOAD"$",8
-list only the first 20 filenames
-load my program
-Turn each filename into a data statement; type a line number, followed by dA just before the filename
-You can run my program now

It's a very limited program and very slow.
1 rem enter filenames here, eg data "basic"
99 data"$"
100 restore
108 poke55,0:poke56,16:rem set bastop to $1000
110 readf$
120 iff$="$"thenprint"finished!":end
130 rem copy the file to memory
140 gosub1000
150 rem save the memory section to tape
160 gosub2000
170 goto110
180 close1
1000 rem copy a prg file to memory
1001 print"buffering "+f$
1009 rem set buffer safely beyond this program
1010 ba=16*256
1015 i=0
1020 open1,8,2,f$+",p,r"
1030 get#1,a$
1040 pokeba+i,asc(a$+chr$(0))
1045 i=i+1
1050 ifst=0then1030
1060 print"length was";i
1070 close1
1080 return
2000 rem save buffer to tape
2001 print"saving "+f$
2010 forx=0tolen(f$)
2020 poke49152+x,mid$(f$,x+1,1)
2030 next
2040 poke184,2:poke186,1:poke185,2:rem setlfs
2050 poke187,0:poke188,192:poke183,x:rem setnam
2060 bh=int(ba/256):bl=ba-bh*256
2070 e=ba+i
2080 ch=int(e/256):cl=e-ch*256
2090 poke193,bl:poke194,bh:rem start addr
2100 poke174,cl:poke175,ch:rem end addr
2120 sys62941+13:rem save memory
2130 return
2012-04-01 12:29
chatGPZ

Registered: Dec 2001
Posts: 11352
Quote:
Let me clarify my statement, the ONLY way to cheaply/simply transfer files at home, with a modern PC which has no serial, parallel, floppy, or modem, and you have no datasette or tape deck.

you are mixing up simple and cheap. its not the same thing and usually doesnt come together either.

Quote:
Your point about compressed video is well taken, however there's always a way to record uncompressed video (use Virtualdub).

only if you have a very old capture card - new ones usually give you mpeg2 (mine is 10 years old and it does that already)
2012-04-01 12:48
Bitbreaker

Registered: Oct 2002
Posts: 504
Sounds rather bloated in a world where things like 1541u, network or zoomfloppy exist. The stuff will cost some money, but way less time :-)
Still if you stick to the audio-method: You won't be able to save below basic/kernal/io. Whole disktransfer or such would need selfmade routines.
2012-04-01 14:16
Repose

Registered: Oct 2010
Posts: 225
Yes, I also have an mpeg2 card. Yes, there is a way to record uncompressed. http://forum.videohelp.com/threads/342352-Capture-Lossless-with..

1541u is also sold out! Come on people, it's not fair to compare to unavailable projects. I also have 1571 and little red reader, but it's impossible to find 5.25" drive for PC anymore. I like zoomfloppy :) But I can't tell if it's available. I also don't have credit card ;(

I will have to write a whole disk transfer, but that will be so big that it's better I solve the inverse problem first, a simple program to transfer to c64.

I can connect SD card to C64 directly, it's 4 wires, voltage divider and a driver, but then I have to interpret the filesystem also :(

Meanwhile I've recovered old demos I wrote and enjoying them; started to finish a compiler I was working on...
2012-04-01 14:28
chatGPZ

Registered: Dec 2001
Posts: 11352
Quote:
Is there ANY other way to do this, that I can buy right now?

usb->rs232 adapters are widely available and work fine with the respective transfer solutions (over5, serialslave etc pp)
Quote:
Yes, there is a way to record uncompressed.

uh well. a forum thread and there is exactly one person who thinks its uncompressed. and another who mailed the manufacturer of the card and got a different answer. not convinced =P
2012-04-01 14:41
Repose

Registered: Oct 2010
Posts: 225
Thanks for the suggestion, however I don't have an RS232 adapter on the C64 side. I thought I had a Swift232 at one point, but I can't find it now.
Good idea though, if I can find a USB printer port that could work, but will it be exactly compatible to DOS parallel port programs ? (at 0x378).

And the HCW2 has a constant data size per pixel, so it can't be compressed, it's an obvious argument. Well, I can't see any blockiness anyhow.

Don't expect tech support at a company to know these details; on the box it says compressed and they just repeated that statement. This is an undocumented feature.
2012-04-01 14:55
chatGPZ

Registered: Dec 2001
Posts: 11352
Quote:
Good idea though, if I can find a USB printer port that could work, but will it be exactly compatible to DOS parallel port programs ? (at 0x378).

no. guess why i said rs232 adapter. it will not work with any software that does bitbanging on a portpin.
Quote:
And the HCW2 has a constant data size per pixel, so it can't be compressed, it's an obvious argument.

it can (and probably will be) still come out of the encoder, just with "maximum quality" settings. its not raw untouched video. and as someone in that thread said, if the card could really actually do it, it would say so on the box. its one of these features that you wont hide from the customer, because it'd set you apart from other cards that can not do it.
2012-04-01 15:13
Repose

Registered: Oct 2010
Posts: 225
Hmm... rs232 it is. I think some rs232 chips can actually handle 0-5v even though the standard is supposed to be +-12v. Or else I'd have to build a translator.

I've been looking around at the projects you mentioned; I'm afraid some of them are dead. I found a message about 1541u-II dated 2009. I think we really need a simple project like mine that someone can put together in an hour unitl they can order something better.

I even have a portable floppy but it's for some older port, not USB.

About HCW2, your reasoning sounds good, however you're saying the uncompressed output came from a compressed source; that means the card has a decompressor in it as well! That's unlikely.
The simplest theory would be that it's an uncompressed stream that taps into the encoder chip in the very earliest stage of compression; at this point it's just a data rearrangement.

If it is just a high bitrate stream, that's fine for our purposes. I'll try a decoding test on a video transfer technique anyhow. Avisynth is my friend :)
2012-04-01 18:05
Bitbreaker

Registered: Oct 2002
Posts: 504
Zoomfloppy works fine, as for what i saw (my boss trasnferred his disks with that these days). Also if pondering about serial/parallel, why not obtaining one of those cheap usb<->serial/parallel adaptors?
If thinking about network, the wiznet module can be easily adapted to work with a c64, all you need is a 74ls139 + 3,3v voltage regulator. I'd even have some selfmade adaptors laying around to mount it directly on a clockport without any extra soldering (for e.g. RetroReplay). That is for what i did the new 64net-stuff.
 
... 29 posts hidden. Click here to view all posts....
 
Previous - 1 | 2 | 3 | 4 - Next
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
RS-232
Firehawk/Hoaxers
Mike
E$G/HF ⭐ 7
Murphy/Exceed
Fresh
Dano/Padua
Epyx/TSA
Gordian
LDX#40
mankeli/Extend
Mibri/ATL^MSL^PRX
Barfly/Extend
Guests online: 114
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Coma Light 13  (9.7)
4 Edge of Disgrace  (9.6)
5 Mojo  (9.6)
6 Uncensored  (9.6)
7 Wonderland XIV  (9.6)
8 Comaland 100%  (9.6)
9 What Is The Matrix 2  (9.6)
10 The Demo Coder  (9.6)
Top onefile Demos
1 Layers  (9.6)
2 Party Elk 2  (9.6)
3 Cubic Dream  (9.6)
4 Copper Booze  (9.6)
5 Libertongo  (9.5)
6 Rainbow Connection  (9.5)
7 Onscreen 5k  (9.5)
8 Morph  (9.5)
9 Dawnfall V1.1  (9.5)
10 It's More Fun to Com..  (9.5)
Top Groups
1 Performers  (9.3)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Nostalgia  (9.3)
5 Censor Design  (9.3)
Top Original Suppliers
1 Derbyshire Ram  (9.7)
2 Fungus  (9.3)
3 Black Beard  (9.2)
4 Baracuda  (9.2)
5 hedning  (9.1)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.233 sec.