Recording to tape on C64 for use with VIC-20

Basic and Machine Language

Moderator: Moderators

jdxpolygon
Vic 20 Amateur
Posts: 43
Joined: Sat Mar 07, 2009 12:32 pm

Recording to tape on C64 for use with VIC-20

Post by jdxpolygon »

Hi,

This is probably an easy question - VIC-20 and C64 kernal tape load and save, are they compatible? And if they are, is it 100% compatibility?

The reason I ask is I'd like to use a C64 to record tapes for the VIC-20, as the memory layout (and vastness) would make it a lot easier and quicker than doing it on my unexpanded VIC.

Thanks for your help :)

J
carlsson
Class of '6502
Posts: 5516
Joined: Wed Mar 10, 2004 1:41 am

Post by carlsson »

If you're using NTSC computers (i.e. you live in the USA, Canada, Japan etc) the answer is pretty much yes.

However if you're using PAL computers (Europe, Australia etc), the answer is rather "probably not". This is due to very small differences in timing, bigger difference in PAL than NTSC. I think you may be able to read a tape recorded from a C64 on a VIC-20 but not vice versa.

What kind of tapes are you recording? Perhaps there are alternative methods that will yield better results than the one you're planning to use.
Anders Carlsson

Image Image Image Image Image
jdxpolygon
Vic 20 Amateur
Posts: 43
Joined: Sat Mar 07, 2009 12:32 pm

Post by jdxpolygon »

carlsson wrote:If you're using NTSC computers (i.e. you live in the USA, Canada, Japan etc) the answer is pretty much yes.

However if you're using PAL computers (Europe, Australia etc), the answer is rather "probably not". This is due to very small differences in timing, bigger difference in PAL than NTSC. I think you may be able to read a tape recorded from a C64 on a VIC-20 but not vice versa.

What kind of tapes are you recording? Perhaps there are alternative methods that will yield better results than the one you're planning to use.
Thats interesting. I've had a go at doing the recording on the VIC-20 itself, and got it wrong. But out of curiosity I put the tape in my stereo and listened to it, and while I thought it sounded similar in structure to the C64's kernal recordings, it was possibly a little higher pitched (i.e. faster)? Is that the difference?


What I'm trying to do is this - I want to record a copy of a VIC-20 game I've made to tape. In it's current form, it consists of 4 seperate 'files' - the first loads at $1001 and is just a BASIC SYS to machine code that loads the next 3 parts. The next part is a text screen that loads in from $1E00 to $1FFFF. This is followed by the main code block, which runs from ~$1035 to $1DFF. And finally, some game data is loaded into $1E00 to $1FFF, which is then copied to various spaces between $0000 and $3FFF (once all loading and kernal involvement is complete). The problem I have with saving all this data on the VIC itself is mainly saving data from the screen memory, because as you'd expect, it gets corrupted by the RECORD & PLAY message. I was using 4 separate programs for the mastering, and the 2 that need to save from $1E00 move the data there from somewhere else, like $1400. One of the benefits of mastering on C64 is that it would only require one program to be run to record all 4 parts. I'm not that used to using the kernal load/save functions so if there's anything obvious I'm missing, I'd appreciate if someone can point it out :)

Thanks
Boray
Musical Smurf
Posts: 4064
Joined: Mon May 03, 2004 10:47 am

Post by Boray »

I have read tapes on a PAL C64 recorded on a PAL Vic-20... I used the same tape recorder.
PRG Starter - a VICE helper / Vic Software (Boray Gammon, SD2IEC music player, Vic Disk Menu, Tribbles, Mega Omega, How Many 8K etc.)
Boray
Musical Smurf
Posts: 4064
Joined: Mon May 03, 2004 10:47 am

Post by Boray »

I could remember incorrectly, but I'm sure I converted a vic-20 program to c64.
PRG Starter - a VICE helper / Vic Software (Boray Gammon, SD2IEC music player, Vic Disk Menu, Tribbles, Mega Omega, How Many 8K etc.)
User avatar
ral-clan
plays wooden flutes
Posts: 3702
Joined: Thu Jan 26, 2006 2:01 pm
Location: Canada

Post by ral-clan »

There's also a pretty simple cable you can make to hook a datasette to a PC. Then you can use software on the PC (MS-DOS command line stuff mostly) to transfer almost anything to the datasette in either "PAL or NTSC format" (although I'm sure those aren't the right terms when talking about data tapes.
carlsson
Class of '6502
Posts: 5516
Joined: Wed Mar 10, 2004 1:41 am

Post by carlsson »

Let's get this straight. In what form is your game right now? On a tape, a disk, a battery-backed up RAM memory? :-D

If you own a regular tape recorder - even a compact stereo with headphone output should probably be fine - you can connect it to your PC's sound card and sample the tape. Then you use a program like AudioTAP to get a TAP file. From there, you could load it into an emulator, extract files, do whatever work you need to be done etc. If you want to master real tape copies, you can convert a TAP back to a WAV and play it back onto a tape recorder with MIC input. While this may not appear as pure as using a C2N all the way, you would not have to worry about different frequencies.

Ral-Clan's advice about a X1531/mtap cable is also good although I've never used one. I believe you can even connect a C2N to your VIC, using the computer as a slave device to transfer software further via an X*1541 cable to a PC, if that is a road you want to travel at all.

The PAL C64 runs at about 0.98 MHz, the PAL VIC-20 at 1.01 or 1.02 MHz. Nominally they should both run at 1.00 MHz.
Anders Carlsson

Image Image Image Image Image
carlsson
Class of '6502
Posts: 5516
Joined: Wed Mar 10, 2004 1:41 am

Post by carlsson »

Another approach would be to use a memory expansion on the VIC-20. Load files into $2000 but save them to $1000 and thereabouts. Many of the more advanced machine code monitors will let you save a memory block to a different starting address than the area you're saving from.
Anders Carlsson

Image Image Image Image Image
jdxpolygon
Vic 20 Amateur
Posts: 43
Joined: Sat Mar 07, 2009 12:32 pm

Post by jdxpolygon »

What I have is a VIC-20 game that I've developed using a PC/emulator environment. It consists of 2 PRG files, one with all the main game code, and the other with additional game data (loads to $1E00-$1FFF, relocated to the zero page and $0200). At the moment, it's disk based, the main PRG loads the additional PRG using the kernal disk routine, and the game starts.

I need this game to load from tape. An additional 2 PRG files need load first to provide a loading display (this could admittedly be made into 1 PRG).

What I've tried doing is creating 4 'mastering' PRGs, one for each part, which has the sole purpose of saving that part to a tape (these mastering programs are of course loaded from a disk which I've created with an XE1541.) The reason this didn't work when I tried it is the code that needs to be saved from $1E00 to $1FFF was corrupted by screen messages before it could be saved to tape.

This tape mastering solution is needed for producing a batch of game tapes - I'm not sure whether duplicating tapes directly, i.e. not generated from the VIC-20/C64 itself, is an option, I think it's preferable to record each tape from the datasette under control of the computer itself. It won't be me creating/distributing all the tapes so ideally I'd have liked to make the process as straightforward as possible, which is why using the C64 was an idea. Actually I'm not sure there's a VIC-20 available to do it :)

Thanks for all your advice so far.
User avatar
Mayhem
High Bidder
Posts: 3027
Joined: Mon May 24, 2004 7:03 am
Website: http://www.mayhem64.co.uk
Location: London

Post by Mayhem »

Actually the answer might be just below you in this forum. Use Vicmon for instance? Boot up the cartridge, load the programs into memory and then use the cart's save command to write out specific memory areas to tape?
Lie with passion and be forever damned...
jdxpolygon
Vic 20 Amateur
Posts: 43
Joined: Sat Mar 07, 2009 12:32 pm

Post by jdxpolygon »

Mayhem wrote:Actually the answer might be just below you in this forum. Use Vicmon for instance? Boot up the cartridge, load the programs into memory and then use the cart's save command to write out specific memory areas to tape?
An Vicmon ROM image might be handy for producing a TAP file in the VICE emulator, and a real Vicmon obviously would be good for making a real tape. I wouldn't have thought it'd be the easiest way to record a batch of tapes though (unless you were just making one master tape and then doing a straight copy), because there's going to be a bunch of steps you'd have to go through every time to create each tape, a more streamlined approach would be preferable I imagine (as I've mentioned it won't be me doing the production/distribution so I just want to make things as straightforward as possible :) )

If tapes were being reproduced from an audio source rather than direct from a VIC/C64, I expect I could assemble a WAV using WAV-PRG (is that the name? so long since I used it) just using the original PRGs for each loader part.

I might experiment with the PAL VIC/C64 compatibility thing at home. I wouldn't have thought a difference in clock frequency of 1-2% would have caused so much difficulty?
carlsson
Class of '6502
Posts: 5516
Joined: Wed Mar 10, 2004 1:41 am

Post by carlsson »

Your milage may vary, but I clearly remember programs saved on the C64 could be loaded on the VIC-20 but doing otherwise ended up in ?LOAD ERROR.
Anders Carlsson

Image Image Image Image Image
User avatar
Mayhem
High Bidder
Posts: 3027
Joined: Mon May 24, 2004 7:03 am
Website: http://www.mayhem64.co.uk
Location: London

Post by Mayhem »

jdxpolygon wrote:An Vicmon ROM image might be handy for producing a TAP file in the VICE emulator, and a real Vicmon obviously would be good for making a real tape.
Produce a TAP and then use PTAP program to transfer it to a real tape. But that requires having a tape deck connected to the PC probably for Vic20 tapes.
Lie with passion and be forever damned...
carlsson
Class of '6502
Posts: 5516
Joined: Wed Mar 10, 2004 1:41 am

Post by carlsson »

Does Cronosoft etc offer the making of small, custom made batches of tape games?

I'd suggest you make a "bootstrap" copying program that takes a list of files to be recorded, then write each of them to tape. You may even be able to read byte for byte from a floppy disk and write to tape in case you don't have a memory expansion enough to load a whole file at a time. I think that bootstrap program could be an interesting exercise that would involve several Denial members if you need help in creating it.
Anders Carlsson

Image Image Image Image Image
User avatar
ral-clan
plays wooden flutes
Posts: 3702
Joined: Thu Jan 26, 2006 2:01 pm
Location: Canada

Post by ral-clan »

Ward Shrake outlined a simple hack to a datasette that allows you to make byte for byte copies from one to the other (between a pair of datasettes).

Maybe something like that would help in your situation. It's in the Denial Wiki.

http://sleepingelephant.com/denial/wiki ... dification
Last edited by ral-clan on Mon Mar 16, 2009 6:53 am, edited 1 time in total.
Post Reply