	SCC Sound Emulator
	------------------

This is a software implementation of Konami's SCC sound chip. This
sound chip was used by Konami in several megaROM cartridges, and in
the Sound Cartridge (SCC+) that came with SD Snatcher and Snatcher
for the MSX. The following games use the SCC:

MegaROM:

	Nemesis 2
	F1 Spirit
	Pennant Race
	Salamander
	Parodius
	King's Valley II (MSX1)
	King's Valley II (MSX2)
	Contra
	Nemesis 3
	Pennant Race 2
	Solid Snake
	Space Manbow
	Quarth

Disk games:

	Snatcher
	Game Collection 1
	Game Collection 2
	Game Collection 3
	Game Collection 4
	Game Collection Special
	Super Deform Snatcher

The cartridge used by the disk games is sligthly better. Both types have
been implementated by this emulator. Also, more than one SCC is supported.
Although no Konami game uses this feature, some music programs can. 

Only the generation of music is implementated. The actual memory and I/O
must be implementated by the MSX emulator. 

How the SCC operates is beyond the scope of this document. You can find
information about this on my homepage:

	http://www.cs.vu.nl/~syoung/

The emulator simply generates the sound in wave buffer, so it can be used
for the wave out device of the OS. The actual opening of that device is
not done by the emulator; you must also implement this. Use WaveOut* 
or DirectSound on Win32 platforms, or /dev/dsp on Unix systems. 


The following parameters must be set to use the emulator in scc.h:

SCC clock frequency. Always 3579545 on MSX systems; even on turbo R or
7 MHz systems. Set in #define SCC_CLOCK

signed / unsigned samples. comment the incorrect AUDIO_CONV and 
AUDIO_CONV16 in scc.h.

Interpolation. If SCC_INTERPOLATE is defined - in scc.h - the emulator
will interpolate the wave samples. Note that the real SCC does not do
this, and it is (a bit) of extra CPU overhead. Interpolation will only
have effect for frequencies more than 32 samples in the output. For
example, sound 200 Hz over a sampling rate of 44100Hz, uses 220 samples.
Here obviously interpolation will make quite a difference. There is no
interpolation for compressed waves; only for stretching waves.

To initialize the emulator, call:

	int SCCInit(int num, int freq, int rate, int bufsiz, ... )

		num = number of SCC devices to emulate

		freq = sampling frequency. 22050 for example.

		rate = sample rate, 16 or 8

		bufsize = no. samples in buffer. If new sound is
			generated 60 per sec and the sampling rate
			is 22050, this must be 22050 / 60.

		... = if you want to supply your own buffers, add a 
			pointer to each buffer for every SCC devices.
			if you do not do this, the emulator will 
			allocate its own buffers.

Note that if choose a sampling rate of 8 bit, information is lost. 
The SCC has 5 channels, with a volume of 0-15 and 8 bit samples.
That's 5*256*5=19200. The conversion to 8 bit is done by dividing
by 75. Not perfect, but there's no chance of truncation of sound.

However, if you choose 16 bit, there won't be any quality degeration.
The values of samples is simply (-9600)/(9525). The real SCC has a
D/A converter of 11 bits, so the emulator has a better quality.

Every Konami game uses the PSG in conjuction with the SCC. I would 
advise the PSG emulator by Micheal Cuddy. The relative volume between
the PSG and the SCC differs between MSX systems. On the Sony for
example, the SCC is less loud than on the Philips systems. 

License
-------

This program is not made by me. It is an adaption of the SCC emulation
in Sound.c in fMSX, made by Ville Hallik (ville@physic.ut.ee) 1996. 

I have made it modular, supporting multiple SCC's and supporting the
SCC+ (Konami's Sound Cartridge). The design is much like what 
Michael Cuddy did with the PSG emulation of the same file

http://www.fensende.com/Users/mcuddy/

