Пример #1
0
CYm2149Ex::CYm2149Ex(ymu32 masterClock,ymint prediv,ymu32 playRate)
{
ymint i,env;


		frameCycle = 0;
		if (ymVolumeTable[15]==32767)		// excuse me for that bad trick ;-)
		{
			for (i=0;i<16;i++)
			{
				ymVolumeTable[i] = (ymVolumeTable[i]*2)/6;
			}
		}

	//--------------------------------------------------------
	// build env shapes.
	//--------------------------------------------------------
		ymu8 *pEnv = &envData[0][0][0];
		for (env=0;env<16;env++)
		{
			const ymint *pse = EnvWave[env];
			for (ymint phase=0;phase<4;phase++)
			{
				pEnv = ym2149EnvInit(pEnv,pse[phase*2+0],pse[phase*2+1]);
			}
		}

		internalClock = masterClock/prediv;		// YM at 2Mhz on ATARI ST
		replayFrequency = playRate;				// DAC at 44.1Khz on PC
		cycleSample = 0;

	// Set volume voice pointers.
		pVolA = &volA;
		pVolB = &volB;
		pVolC = &volC;

	// Reset YM2149
		reset();


}
Пример #2
0
CYm2149Ex::CYm2149Ex(ymu32 masterClock,ymint prediv,ymu32 playRate)
{
    ymint i,env;

    frameCycle = 0;
    //--------------------------------------------------------
    // build env shapes.
    //--------------------------------------------------------
    ymu8 *pEnv = &envData[0][0][0];
    for (env=0;env<16;env++)
    {
        const ymint *pse = EnvWave[env];
        for (ymint phase=0;phase<4;phase++)
        {
            pEnv = ym2149EnvInit(pEnv,pse[phase*2+0],pse[phase*2+1]);
        }
    }

    internalClock = masterClock/prediv;		// YM at 2Mhz on ATARI ST
    replayFrequency = playRate;				// DAC at 44.1Khz on PC
    cycleSample = 0;

    // Set volume voice pointers.
    pVolA = &volA;
    pVolB = &volB;
    pVolC = &volC;

//    setProfile(profileAtari);
    setProfile(profileCPC);

    for(ymint i = 0; i < 3; i++)
    {
        filters[i].push_back(new SimpleLowPassFilter());
        filters[i].push_back(new DCRemover());
    }

    // Reset YM2149
    reset();
}
Пример #3
0
CYm2149Ex::CYm2149Ex(ymProfile profile, ymu32 playRate)
{
    ymint i,env;

    frameCycle = 0;
    //--------------------------------------------------------
    // build env shapes.
    //--------------------------------------------------------
    ymu8 *pEnv = &envData[0][0][0];
    for (env=0;env<16;env++)
    {
        const ymint *pse = EnvWave[env];
        for (ymint phase=0;phase<4;phase++)
        {
            pEnv = ym2149EnvInit(pEnv,pse[phase*2+0],pse[phase*2+1]);
        }
    }

    setProfile(profile);

    internalClock = profile.masterClock;
    replayFrequency = playRate;
    cycleSample = 0;

    // Set volume voice pointers.
    pVolA = &volA;
    pVolB = &volB;
    pVolC = &volC;

    for(ymint i = 0; i < 3; i++)
    {
        filters[i].push_back(new SimpleLowPassFilter());
        filters[i].push_back(new DCRemover());
    }

    // Reset YM2149
    reset();
}
Пример #4
0
CYm2149Ex::CYm2149Ex(ymu32 masterClock,ymint prediv,ymu32 playRate)
{
    ymint i,env;

    Index_AL = 255;
    Index_AR = 13;
    Index_BL = 170;
    Index_BR = 170;
    Index_CL = 13;
    Index_CR = 255;

    m_bFilter = true;

    frameCycle = 0;
    if (ymVolumeTable[15]==32767)		// excuse me for that bad trick ;-)
    {
        for (i=0; i<16; i++)
        {
            Level_AL[i * 2] = (int)rint(Index_AL / 255.0 * ((ymVolumeTable[i]*2)/6));
            Level_AL[i * 2 + 1] = (int)rint(Index_AL / 255.0 * ((ymVolumeTable[i]*2)/6));
            Level_AR[i * 2] = (int)rint(Index_AR / 255.0 * ((ymVolumeTable[i]*2)/6));
            Level_AR[i * 2 + 1] = (int)rint(Index_AR / 255.0 * ((ymVolumeTable[i]*2)/6));
            Level_BL[i * 2] = (int)rint(Index_BL / 255.0 * ((ymVolumeTable[i]*2)/6));
            Level_BL[i * 2 + 1] = (int)rint(Index_BL / 255.0 * ((ymVolumeTable[i]*2)/6));
            Level_BR[i * 2] = (int)rint(Index_BR / 255.0 * ((ymVolumeTable[i]*2)/6));
            Level_BR[i * 2 + 1] = (int)rint(Index_BR / 255.0 * ((ymVolumeTable[i]*2)/6));
            Level_CL[i * 2] = (int)rint(Index_CL / 255.0 * ((ymVolumeTable[i]*2)/6));
            Level_CL[i * 2 + 1] = (int)rint(Index_CL / 255.0 * ((ymVolumeTable[i]*2)/6));
            Level_CR[i * 2] = (int)rint(Index_CR / 255.0 * ((ymVolumeTable[i]*2)/6));
            Level_CR[i * 2 + 1] = (int)rint(Index_CR / 255.0 * ((ymVolumeTable[i]*2)/6));
            ymVolumeTable[i] = (ymVolumeTable[i]*2)/6;

        }
    }




    //--------------------------------------------------------
    // build env shapes.
    //--------------------------------------------------------
    ymu8 *pEnv = &envData[0][0][0];
    for (env=0; env<16; env++)
    {
        const ymint *pse = EnvWave[env];
        for (ymint phase=0; phase<4; phase++)
        {
            pEnv = ym2149EnvInit(pEnv,pse[phase*2+0],pse[phase*2+1]);
        }
    }

    internalClock = masterClock/prediv;		// YM at 2Mhz on ATARI ST
    replayFrequency = playRate;				// DAC at 44.1Khz on PC
    cycleSample = 0;

    // Set volume voice pointers.
    pVolA = &volA;
    pVolB = &volB;
    pVolC = &volC;

    pVolAl = &volAl;
    pVolAr = &volAr;
    pVolBl = &volBl;
    pVolBr = &volBr;
    pVolCl = &volCl;
    pVolCr = &volCr;

    // Reset YM2149
    reset();


}