Does anyone have a great idea about how to read a tape byty by byte into the VIC's memory? (and write to tape similarly). Just any random bytes from the tape. I'm trying to rescue some old programs but I haven't found a method that wouldn't kill me with frustration.. maybe there isn't one, but at least it could make things easier
I don't exactly understand what is the purpose of all those tape-related memory locations in the Reference Guide. "Tape timing constants" - what does that do?? There are other confusing ones to me too.
A quick tape question
Moderator: Moderators
First you need to know that bits on the tape are encoded as pulse width modulation, meaning that bit 0 is a pulse with a certain duration and bit 1 is a pulse 3 times long. Reading bits and assembling them into bytes is a quite complex task involving VIC timers to precisely count the duration of a single pulse.
If you goal is rescuing a tape, then you might sample it with PC's soundcard into a .wav file and then convert into a .TAP file.
A .tap file is a raw image of pulses and their durations as seen by the datasette reading head. Tap files can be feed into VICE emulator in place of real tapes.
Try different tape recordings, with different filtering, stereo/mono and so on. Keep also in mind that a standard vic-20 tape recording is repeated twice for checking purposes (?load error) so you might want to rescue the second image of the saved program.
If you goal is rescuing a tape, then you might sample it with PC's soundcard into a .wav file and then convert into a .TAP file.
A .tap file is a raw image of pulses and their durations as seen by the datasette reading head. Tap files can be feed into VICE emulator in place of real tapes.
Try different tape recordings, with different filtering, stereo/mono and so on. Keep also in mind that a standard vic-20 tape recording is repeated twice for checking purposes (?load error) so you might want to rescue the second image of the saved program.
If anyone's interested, I found this:
"Each byte of data or program is encoded by the operating system using pulses of three distinct audio frequencies, these are long pulses with a frequency of 1488 Hz, medium pulses at 1953 Hz and short pulses at 2840 Hz. All these pulses are square waves with a mark space ratio of 1:1, one cycle os a medium frequency is 256 microseconds in the high state and 256 microseconds in the low state. The operating system takes 8.96 milliseconds to record a byte of data consisting of the eight data bits, a word marker bit and an odd parity bit. The data bits are either ones or zeros and are encoded by a sequence of medium and short pulses: a "1" is one cycle of a medium lenght pulse followed by one cycle of a short lenght pulse and "0" is one cycle of a short lenght pulse followed by one cycle of a medium lenght pulse. Each bit consists of two square wave pulse cycles, one short and one medium with a total duration of 864 microseconds."
That was from "VIC Revealed" by Nick Hampshire, a book I got yesterday.
"Each byte of data or program is encoded by the operating system using pulses of three distinct audio frequencies, these are long pulses with a frequency of 1488 Hz, medium pulses at 1953 Hz and short pulses at 2840 Hz. All these pulses are square waves with a mark space ratio of 1:1, one cycle os a medium frequency is 256 microseconds in the high state and 256 microseconds in the low state. The operating system takes 8.96 milliseconds to record a byte of data consisting of the eight data bits, a word marker bit and an odd parity bit. The data bits are either ones or zeros and are encoded by a sequence of medium and short pulses: a "1" is one cycle of a medium lenght pulse followed by one cycle of a short lenght pulse and "0" is one cycle of a short lenght pulse followed by one cycle of a medium lenght pulse. Each bit consists of two square wave pulse cycles, one short and one medium with a total duration of 864 microseconds."
That was from "VIC Revealed" by Nick Hampshire, a book I got yesterday.
Check out this for info on tape pulses and loaders:
http://c64tapes.org/dokuwiki/doku.php?i ... a_encoding
http://c64tapes.org/dokuwiki/doku.php?i ... a_encoding