SAMP2CDT
--------

samp2cdt has been created from the source code of voc2tzx. It 
is designed to transfer Amstrad CPC and KC Compact cassette software
into the TZX/CDT file format. 

voc2tzx was written by Tomaz Kac and Martijn van der Heide.
samp2cdt has been updated and enhanced by Kevin Thacker.

samp2cdt will accept a sample file (CSW, VOC, WAV, IFF or AIFF) as
the input and will process it to convert it into a CDT/TZX file.

Features:
- supports CSW, VOC, WAV, IFF and AIFF sample files

- sample file type is autodetected

- supports 8-bit or 16-bit, mono or stereo sample data formats. 
(compressed sample data formats are not supported).

- supports very large sample files (the sample file length is only limited by the
size of your storage media. It is not limited by the size of the ram)

- support for many common CPC cassette loading systems


Thankyou to Jaime Gonzalez Soriano for contributing lots of vocs transfered
from Spanish games. This greatly helped me to refine some more decoders.

Loaders that I consider finished:
/bleepv2,/slock1,/slock2,/slock3,/slock4,/spec

others to be verified.

You can now use CSW, VOC, WAV,IFF and AIFF sample files.
samp2cdt will auto-detect the sample file type used.

/microkey - MICRO-KEY loader. Used by Ranarama and Night Gunner.

/specvar2, /specvar3, /specvar4 - Spectrum ROM variants. (Used by 
Spanish companies). Watch out for the multi-coloured border.
These differ only in their loading speed.
These blocks have a valid checksum; but most loader programs ignore
it!
  
(the default ldrskip is 2. But some programs have more blocks to skip!)


/appleby - APPLEBY ASSOCIATES loader. Used by US.GOLD, KIXX and GO!
  Has a counter. Screen and program in a single block.

Checksum can't be calculated with this loader
as the seed values may be different for each program
which uses the loader.


/bleepv1 - Used by Thrust. (1986)
One version of Firebird's counter loader.
Checksum is calculated for this loader type.


/bleepv2 - Used by Pogostick Olympics. (1988) 

Another version of Firebird's counter loader.

If you are unsure which version to use, try both.

The block numbers will be listed against each of the small blocks. (around 200-300 bytes
for each block).

If you see correct block numbers then you have chosen the correct loader type.

The data is stored differently on cassette so it is not likely the data will
be decoded the same for both types.

Checksum is calculated for this loader type.

/bleepv3 - used by ELITE. Can only be enabled if source is rebuilt using TEST_BLEEPV3 define.
  Not working yet.

/ricochet - Loader used by Ricochet re-release label.
Red and Yellow border stripes.
**** This loader doesn't have a checksum!!! ****

/codem - Loader used by some codemasters releases (e.g. pub trivia)
Red and magenta border stripes.
**** This loader doesn't have a checksum!!! ***

/usgold - Loader used by U.S.Gold for Final Fight and Turrican.
Yellow/Blue stripes in border. No counter. 

Checksum can't be calculated with this loader
as the seed values may be different for each program
which uses the loader.


/spec - Some games use the spectrum ROM timings for their data files.
Use this switch to decode these correctly.

/sldata - Use this to transfer some level files, if the main program loads with 
Speedlock (e.g. Hudson Hawk)

/sldata2 - Use this to transfer some level files, if the main program
is speedlock. (e.g. Rastan)

/ldrskip - Number of blocks to decode before forcing the loader system (e.g. /ldrskip 4 /appleby will
use the default decoding method for 4 blocks, then force appleby decoding)
NOTE: Some loaders will setup a default; so this option may not be necessary
in all cases.

/slmain - number of blocks to process using Speedlock v1 (single block)
before decoding with Speedlock v2 (joined sub-blocks).
Only useful for games like Tarzan which have many v1 type blocks before
the v2 block.

/ldrend - number of blocks to process using defined loader type (e.g. appleby)
before reverting back to default decoding method.
Useful for programs which have more than one loading scheme (e.g. one for main
file + screen and one for level data)

/slock0, /slock1, /slock2, /slock3, /slock4 - used to decode different versions of Speedlock.

Differences:
- /slock1 type has a single block
- /slock2,3,4 has a big block containing lots of smaller blocks (screen often
loads line by line)
- different timings

Checksum is calculated for this loader type.
If you are unsure, try the different /slock types to find one that will
work.

Often, for /slock2,3,4 there will be approx 200 80 byte blocks. These
are for the screen.

Some Speedlock versions will have a single 1 block file (e.g. Basket Master)
use /ldrskip 2 for these.
/slock1 assumes ldrskip 4 (unless /ldrskip is used)
/slock2 assumes ldrskip 4 (unless /ldrskip is used)
/slock3 assumes ldrskip 4 (unless /ldrskip is used)
/slock4 assumes ldrskip 4 (unless /ldrskip is used)



If no loader decoder is defined, then the default decoder is used. This will be the same
as the old voc2tzx decoder and will attempt to calculate the timings.

the following switches have been removed:
/rom - forced Spectrum rom timings; (reason: it forced for *every block* and 
broke the decoding of Amstrad files :o )
/std - this was used to compare the timing against the Spectrum ROM timings.
(reason: the standard block forces the length of the pilot
which may not actually be correct! :( - I may reintroduce this)
/sync - forced sync pulses of custom blocks to Spectrum standard timings.
(reason: not good for Amstrad files :o )

/force - force length of custom pilot to a user defined value.
Can be a problem as all Amstrad blocks are often custom
loader. Useful for Amstrad loaders? 

/fsync - forces syncs of custom block to spectrum standards.
Useful for Amstrad loaders?

/cpc - no longer required. Initial pause calculated correctly.



changes:
* /slock1 and /slock3 *do not* have an additional parameter!
* lots of code changes and lots of code cleaned up
* most decoders now have the correct checksum calculation.

problems:
- timings for many of these loaders (e.g. /appleby, /sldata, /usgold, /bleepv1) are not 
exact; but the programs should load.

checksum codes:
CO - Checksum computed, and passed
CX - Checksum computed, and failed
C- - Checksum not available!!!!! *ARGGHH!!**
C? - Checksum test not implemented, or not possible to test because Checksum calculated differently for each
 instance of this loader. *ARGGGHHH!!! **

If you find any programs that do not transfer:

Please e-mail me! I will try to help if I can.

The ways you can help me:

- The best choice would be to send me the .voc/.wav etc sound file on a CD through the post.
Please do not e-mail me large attachments - I do not have a fast internet connection
and I don't want to wait hours to download a large file!

I can use this sound file to develop new decoders for samp2cdt, or to fix bugs in the 
existing decoders. 

Using this file I can see the loader in action, I can try to make a decoder
(and make my own cdt's to test it), and I can discover the loading speed timings :)

- The next best choice would be a non-working cdt you have made. I can see the loader
in action, and I can discover some details from this file.

- The worst choice is a snapshot. I can only look at the source code to the loader in this case.
I can't see the loader in action, and I can't discover the loading speed timings :(
However, I may find that the loader is new, or maybe I can help you to try alternative command-lines.

Thanks and good luck!!!

Kev
amstrad@aiind.upv.es