コード例 #1
0
ファイル: nsdplay.c プロジェクト: BouKiCHi/nezplay
static void __fastcall NSDPLAYReset(void)
{
	Uint freq = NESAudioFrequencyGet();
	nsdplayer.cleft = 0;
	nsdplayer.cpfc = 0;
	nsdplayer.remainsyncs = 0;
	nsdplayer.total_cycles = 0;
	nsdplayer.current = nsdplayer.top;
	if (nsdplayer.sync2)
	{
		nsdplayer.cps = DivFix(nsdplayer.sync2, (256 - nsdplayer.sync1) * freq, SHIFT_CPS);
		nsdplayer.cpf = 0;
		nsdplayer.sync0 = 0;
	}
	else
	{
		nsdplayer.cps = DivFix(NES_BASECYCLES, 12 * freq, SHIFT_CPS);
		switch (nsdplayer.sync1)
		{
		default:
			nsdplayer.cpf = 0;
			nsdplayer.sync0 = 0;
			break;
		case 1:
			nsdplayer.cpf = DivFix(NES_BASECYCLES, 12 * 60, 0);
			nsdplayer.sync0 = 1;
			break;
		case 2:
			nsdplayer.cpf = DivFix(NES_BASECYCLES, 12 * 50, 0);
			nsdplayer.sync0 = 1;
			break;
		}
	}
	nsdplayer.isplaying = 1;
}
コード例 #2
0
ファイル: s_fme7.c プロジェクト: wbb1977/modo_android
static void __fastcall FME7SoundReset(void* pNezPlay)
{
	PSGSOUND *psgs = ((NSFNSF*)((NEZ_PLAY*)pNezPlay)->nsf)->psgs;
	psgs->psgp->reset(psgs->psgp->ctx, BASECYCLES_NES / 12, NESAudioFrequencyGet(pNezPlay));
}
コード例 #3
0
ファイル: s_vrc7.c プロジェクト: BouKiCHi/nezplay
static void __fastcall VRC7SoundReset(void)
{
	if (usertone_enable[0]) sndp.kmif->setinst(sndp.kmif->ctx, 0, usertone[0], 16 * 19);
	sndp.kmif->reset(sndp.kmif->ctx, MASTER_CLOCK, NESAudioFrequencyGet());
}