Esempio n. 1
0
INT32 BurnYMF278BInit(INT32 /* nClockFrequency */, UINT8* YMF278BROM, void (*IRQCallback)(INT32, INT32), INT32 (*StreamCallback)(INT32))
{
	DebugSnd_YMF278BInitted = 1;
	BurnYMF278BExit();	
	DebugSnd_YMF278BInitted = 1;

	BurnYMF278BStreamCallback = YMF278BStreamCallbackDummy;
	if (StreamCallback) {
		BurnYMF278BStreamCallback = StreamCallback;
	}

	ymf278b_start(0, YMF278BROM, IRQCallback, BurnYMFTimerCallback, YMF278B_STD_CLOCK, nBurnSoundRate);
	BurnTimerInit(ymf278b_timer_over, NULL);

	pBuffer = (INT16*)malloc(4096 * 2 * sizeof(INT16));
	memset(pBuffer, 0, 4096 * 2 * sizeof(INT16));

	nYMF278BPosition = 0;

	nFractionalPosition = 0;
	
	// default routes
	YMF278BVolumes[BURN_SND_YMF278B_YMF278B_ROUTE_1] = 1.00;
	YMF278BVolumes[BURN_SND_YMF278B_YMF278B_ROUTE_2] = 1.00;
	YMF278BRouteDirs[BURN_SND_YMF278B_YMF278B_ROUTE_1] = BURN_SND_ROUTE_LEFT;
	YMF278BRouteDirs[BURN_SND_YMF278B_YMF278B_ROUTE_2] = BURN_SND_ROUTE_RIGHT;

	return 0;
}
Esempio n. 2
0
int BurnYM2612Init(int num, int nClockFrequency, FM_IRQHANDLER IRQCallback, int (*StreamCallback)(int), double (*GetTimeCallback)(), int bAddSignal)
{
    if (num > MAX_YM2612) num = MAX_YM2612;

    BurnTimerInit(&YM2612TimerOver, GetTimeCallback);

    if (nBurnSoundRate <= 0) {
        BurnYM2612StreamCallback = YM2612StreamCallbackDummy;

        BurnYM2612Update = YM2612UpdateDummy;

        YM2612Init(num, nClockFrequency, 11025, &BurnOPNTimerCallback, IRQCallback);
        return 0;
    }

    BurnYM2612StreamCallback = StreamCallback;

    nBurnYM2612SoundRate = nBurnSoundRate;
    BurnYM2612Update = YM2612UpdateNormal;

    YM2612Init(num, nClockFrequency, nBurnYM2612SoundRate, &BurnOPNTimerCallback, IRQCallback);

    pBuffer = (short*)malloc(4096 * 2 * num * sizeof(short));
    memset(pBuffer, 0, 4096 * 2 * num * sizeof(short));

    nYM2612Position = 0;
    nFractionalPosition = 0;

    nNumChips = num;
    bYM2612AddSignal = bAddSignal;

    return 0;
}
Esempio n. 3
0
INT32 BurnYM2610Init(INT32 nClockFrequency, UINT8* YM2610ADPCMAROM, INT32* nYM2610ADPCMASize, UINT8* YM2610ADPCMBROM, INT32* nYM2610ADPCMBSize, FM_IRQHANDLER IRQCallback, INT32 (*StreamCallback)(INT32), double (*GetTimeCallback)(), INT32 bAddSignal)
{
	DebugSnd_YM2610Initted = 1;
	
	BurnTimerInit(&YM2610TimerOver, GetTimeCallback);

	if (nBurnSoundRate <= 0) {
		BurnYM2610StreamCallback = YM2610StreamCallbackDummy;

		BurnYM2610Update = YM2610UpdateDummy;

		AY8910InitYM(0, nClockFrequency, 11025, NULL, NULL, NULL, NULL, BurnAY8910UpdateRequest);
		YM2610Init(1, nClockFrequency, 11025, (void**)(&YM2610ADPCMAROM), nYM2610ADPCMASize, (void**)(&YM2610ADPCMBROM), nYM2610ADPCMBSize, &BurnOPNTimerCallback, IRQCallback);
		return 0;
	}

	BurnYM2610StreamCallback = StreamCallback;

   nBurnYM2610SoundRate = nBurnSoundRate;

   BurnYM2610Update = YM2610UpdateNormal;

	AY8910InitYM(0, nClockFrequency, nBurnYM2610SoundRate, NULL, NULL, NULL, NULL, BurnAY8910UpdateRequest);
	YM2610Init(1, nClockFrequency, nBurnYM2610SoundRate, (void**)(&YM2610ADPCMAROM), nYM2610ADPCMASize, (void**)(&YM2610ADPCMBROM), nYM2610ADPCMBSize, &BurnOPNTimerCallback, IRQCallback);

	pBuffer = (INT16*)malloc(4096 * 6 * sizeof(INT16));
	memset(pBuffer, 0, 4096 * 6 * sizeof(INT16));

	pAYBuffer = (INT32*)malloc(4096 * sizeof(INT32));
	memset(pAYBuffer, 0, 4096 * sizeof(INT32));
	
	nYM2610Position = 0;
	nAY8910Position = 0;

	nFractionalPosition = 0;
	bYM2610AddSignal = bAddSignal;
	
	// default routes
	YM2610Volumes[BURN_SND_YM2610_YM2610_ROUTE_1] = 1.00;
	YM2610Volumes[BURN_SND_YM2610_YM2610_ROUTE_2] = 1.00;
	YM2610Volumes[BURN_SND_YM2610_AY8910_ROUTE] = 1.00;
	YM2610RouteDirs[BURN_SND_YM2610_YM2610_ROUTE_1] = BURN_SND_ROUTE_LEFT;
	YM2610RouteDirs[BURN_SND_YM2610_YM2610_ROUTE_2] = BURN_SND_ROUTE_RIGHT;
	YM2610RouteDirs[BURN_SND_YM2610_AY8910_ROUTE] = BURN_SND_ROUTE_BOTH;
	
	bYM2610UseSeperateVolumes = 0;
	YM2610LeftVolumes[BURN_SND_YM2610_YM2610_ROUTE_1] = 1.00;
	YM2610LeftVolumes[BURN_SND_YM2610_YM2610_ROUTE_2] = 1.00;
	YM2610LeftVolumes[BURN_SND_YM2610_AY8910_ROUTE] = 1.00;
	YM2610RightVolumes[BURN_SND_YM2610_YM2610_ROUTE_1] = 1.00;
	YM2610RightVolumes[BURN_SND_YM2610_YM2610_ROUTE_2] = 1.00;
	YM2610RightVolumes[BURN_SND_YM2610_AY8910_ROUTE] = 1.00;

	return 0;
}
Esempio n. 4
0
int BurnYMF278BInit(int /* nClockFrequency */, unsigned char* YMF278BROM, void (*IRQCallback)(int, int), int (*StreamCallback)(int))
{
	BurnYMF278BExit();

	BurnYMF278BStreamCallback = YMF278BStreamCallbackDummy;
	if (StreamCallback)
		BurnYMF278BStreamCallback = StreamCallback;

	ymf278b_start(0, YMF278BROM, IRQCallback, BurnYMFTimerCallback, YMF278B_STD_CLOCK, nBurnSoundRate);
	BurnTimerInit(ymf278b_timer_over, NULL);

	pBuffer = (short*)malloc(4096 * 2 * sizeof(short));
	memset(pBuffer, 0, 4096 * 2 * sizeof(short));

	nYMF278BPosition = 0;

	nFractionalPosition = 0;

	return 0;
}
Esempio n. 5
0
int QsndInit()
{
	int nVolumeShift;
	int nRate;

	// Init QSound z80
	if (QsndZInit()) {
		return 1;
	}
	BurnTimerInit(qsndTimerOver, NULL);

	if (Cps1Qs == 1) {
		nCpsZ80Cycles = 6000000 * 100 / nBurnFPS;
		BurnTimerAttachZet(6000000);
	} else {
		nCpsZ80Cycles = 8000000 * 100 / nBurnFPS;
		BurnTimerAttachZet(8000000);
	}

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

	nVolumeShift = 0;

	// These games are too soft at normal volumes
	if (strncmp(BurnDrvGetTextA(DRV_NAME), "csclub", 6) == 0) {
		nVolumeShift = -1;
	}
#if 0
	// These games are loud at normal volumes (no clipping)
	if (strncmp(BurnDrvGetTextA(DRV_NAME), "1944",	  4) == 0 ||
		strcmp( BurnDrvGetTextA(DRV_NAME), "dimahoo"  ) == 0 ||
		strcmp( BurnDrvGetTextA(DRV_NAME), "gmahoo"   ) == 0)
	{
		nVolumeShift = 1;
	}
#endif
	// These games are too loud at normal volumes (no clipping)
	if (strncmp(BurnDrvGetTextA(DRV_NAME), "sgemf",  5) == 0 ||
		strncmp(BurnDrvGetTextA(DRV_NAME), "pfght",  5) == 0 ||
		strncmp(BurnDrvGetTextA(DRV_NAME), "mpang",  5) == 0 ||
		strncmp(BurnDrvGetTextA(DRV_NAME), "spf2",   4) == 0 ||
		strncmp(BurnDrvGetTextA(DRV_NAME), "sfa2",   4) == 0 ||
		strncmp(BurnDrvGetTextA(DRV_NAME), "sfa2",   4) == 0)
	{
		nVolumeShift = 1;
	}
	// These games are too loud at normal volumes (clipping)
	if (strncmp(BurnDrvGetTextA(DRV_NAME), "19xx",   4) == 0 ||
		strncmp(BurnDrvGetTextA(DRV_NAME), "ddtod",  5) == 0)
	{
		nVolumeShift = 2;
	}

	QscInit(nRate, nVolumeShift);		// Init QSound chip

	return 0;
}