Esempio n. 1
0
File: ps.cpp Progetto: SiN13/pifba
int PsndExit()
{
	PsmExit();
	PsndZExit();

	return 0;
}
Esempio n. 2
0
int PsmInit()
{
	int nMemLen, nRate, nRet;
	bPsmOkay = 0;										// not OK yet

	if (nBurnSoundRate > 0) {
		nRate = nBurnSoundRate;
	} else {
		nRate = 11025;
	}

	if (BurnYM2151Init(3579540, 50.0)) {				// Init FM sound chip
		return 1;
	}

	// Allocate a buffer for the intermediate sound (between YM2151 and pBurnSoundOut)
	nMemLen = nBurnSoundLen * 2 * sizeof(short);
	WaveBuf = (short*)malloc(nMemLen);
	if (WaveBuf == NULL) {
		PsmExit();
		return 1;
	}
	memset(WaveBuf, 0, nMemLen);						// Init to silence

	// Init ADPCM
	MSM6295ROM = CpsAd;
	if (Forgottn) {
		nRet = MSM6295Init(0, 6061, 21.5, 1);
	} else {
		nRet = MSM6295Init(0, 7576, 21.5, 1);
	}

	if (nRet!=0) {
		PsmExit(); return 1;
	}

	bPsmOkay = 1;										// OK

	return 0;
}