PRG2WAV for Linux
By Fabrizio Gennari, 1999

This programs converts PC emulator files (.PRG, .P00 or .T64) into a sound or
a WAV file, which can be recorded on a tape and loaded on a Commodore 64
using Turbo Tape 64 or another suitable loader. This is done in three
steps.

1. CREATING THE SOUND
This is done by PRG2WAV.

For a full description of PRG2WAV's usage, see the man page.
Here is the basic usage:

prg2wav -l file [file...]                     to list files' contents
prg2wav [-i] [-s|-k] [-o output_file] file [file...]  to actually convert files

If the -o option is used. all the files given in the command line will be
converted to a single .WAV file, whose name is set by the argument of the -o
option. If one of the input files is a multi-entry .T64 file, you will also be
asked for the numbers of the entries you want to convert (the numbers can be
read with the -l option). If the -o option is not used, the sound will be
played through the sound card.

The -i option is used to generate inverted waveforms: it is needed by those
soundcards which invert waveforms when playing back. If your C64 will not
load the files generated by PRG2WAV, try using this option.

The -s and -k options are used to generate stand-alone files. Without them,
a C64 file in Turbo Tape 64 format will be written. You need Turbo Tape 64 or 
another suitable loader to load such files back. With -s, a Turbo Tape loader
and the actual Turbo Tape 64 file will be written. With -k, the output file
will not use any turbo loaders. In both cases, the file can be loaded
on a C64 with a plain LOAD or SHIFT+RUN STOP. WARNING: the files created with
-k tend to be VERY long, so use it only for very short programs, or for VIC20
programs.

2. RECORDING THE SOUND ON A TAPE
You need:
- a sound card
- a tape recorder with a sound input (generally marked with AUX, CD or
  PHONO)
- a suitable cable
- a program which allows you to play .WAV files

Connect the input of your recorder to the output of your sound card (on a
Sound Blaster, there are two outputs, LINE OUT and SPK OUT: the latter is
better because of the louder output). Now you should hear the sounds
emitted by the sound card from the speakers of your tape recorder. Set the
output volume of the sound card as high as possible, disable all the
playback sources but the Wave output (these can be done with aumix or xmixer),
keep the output volume of your tape recorder low (the
sounds created by WAV-PRG aren't nice to be heard), press RECORD on the
recorder and play the .WAV file (if you created a .WAV file with prg2wav) or
run prg2wav without the -o option.

3. PLAYING THE GAME
If a stand-alone file was created (i.e. the -s option was used), you will just
need to load the game with SHIFT+RUN STOP.

To disable the autostart feature, just load the game with LOAD (not SHIFT+RUN
STOP) and, at the READY. prompt, type
POKE2191,13
RUN

If the -s option -s was not used, Turbo Tape 64 is needed. Load it, then load the
game with (left arrow)L. If you don't own Turbo Tape 64 you can download it at
WAV-PRG's homepage.

Some games interfere with Turbo Tape 64 (e.g. the ones from the Blast from
the Past disks): to get around this, load the game, type
POKE 50001,228
POKE 50006,167
SYS50000
then RUN as usual.

If the end address exceeds 40960, a fake ?LOAD  ERROR message appears, but
the game should run fine. If it still doesn't, you have two alternatives:
- load the game, type

  POKE 46,<end-address>/256
  POKE 45,<end-address>-PEEK(46)*256

  then RUN as usual.

- load Turbo Tape, then, before loading the game, turn off the fake message
  by typing

  POKE 50566,234
  POKE 50567,234

If the end address exceeds 50400, the program which is being loaded
overwrites the loader, and the C64 will crash. You will need to use Loader
Generator (downloadable at WAV-PRG's homepage). NOTE: if you use Loader
Generator, you will need to create a loader for each Commodore 64 program.
Thus, it is better to put one single Commodore 64 program into each sound.

4. LICENSE AND (NON)WARRANTY
This program is distributed under the GNU General Public License. See the
file LICENSE for details.

5. LATEST VERSION
The latest version of the program is available at
http://www.geocities.Com/SiliconValley/Platform/8224/wavprg.html .

6. CONTACTING THE AUTHOR
If you have suggestions, bug reports etc., you can send mail to the author
at: fabrizio.ge@tiscalinet.it

Enjoy!
