Example #1
0
Y8950* y8950Create(Mixer* mixer)
{
    Y8950* y8950;
    
    y8950 = (Y8950*)calloc(1, sizeof(Y8950));

    y8950->mixer = mixer;
    y8950->timerRunning1 = 0;
    y8950->timerRunning2 = 0;

    y8950->timer1 = boardTimerCreate(onTimeout1, y8950);
    y8950->timer2 = boardTimerCreate(onTimeout2, y8950);
    
    y8950->ykIo = ykIoCreate();

    y8950->handle = mixerRegisterChannel(mixer, MIXER_CHANNEL_MSXAUDIO, 0, y8950Sync, y8950SetSampleRate, y8950);

    y8950->opl = OPLCreate(OPL_TYPE_Y8950, FREQUENCY, SAMPLERATE, 256, y8950);
    OPLSetOversampling(y8950->opl, boardGetY8950Oversampling());
    OPLResetChip(y8950->opl);

    y8950->rate = mixerGetSampleRate(mixer);

    return y8950;
}
Example #2
0
VLM5030* vlm5030Create(Mixer* mixer, UInt8* voiceData, int length)
{
    VLM5030* vlm5030;

    vlm5030 = (VLM5030*)calloc(1, sizeof(VLM5030));

    vlm5030->mixer = mixer;

    vlm5030->handle = mixerRegisterChannel(mixer, MIXER_CHANNEL_PCM, 0, vlm5030Sync, vlm5030);

    vlm5030_start(FREQUENCY);
    VLM5030_set_rom(voiceData, length);

    theVlm5030 = vlm5030;

    return vlm5030;
}
Example #3
0
YM2151* ym2151Create(Mixer* mixer)
{
    YM2151* ym2151;
    
    ym2151 = (YM2151*)calloc(1, sizeof(YM2151));

    ym2151->mixer = mixer;
    ym2151->timerRunning1 = 0;
    ym2151->timerRunning2 = 0;

    ym2151->timer1 = boardTimerCreate(onTimeout1, ym2151);
    ym2151->timer2 = boardTimerCreate(onTimeout2, ym2151);

    ym2151->handle = mixerRegisterChannel(mixer, MIXER_CHANNEL_YAMAHA_SFG, 1, ym2151Sync, ym2151);

    ym2151->opl = YM2151Create(ym2151, FREQUENCY, SAMPLERATE);

    return ym2151;
}
Example #4
0
Moonsound* moonsoundCreate(Mixer* mixer, void* romData, int romSize, int sramSize)
{
    Moonsound* moonsound = new Moonsound;
    UInt32 systemTime = boardSystemTime();

    moonsound->mixer = mixer;
    moonsound->timerStarted1 = 0;
    moonsound->timerStarted2 = 0;

    moonsound->timer1 = boardTimerCreate(onTimeout1, moonsound);
    moonsound->timer2 = boardTimerCreate(onTimeout2, moonsound);

    moonsound->handle = mixerRegisterChannel(mixer, MIXER_CHANNEL_MOONSOUND, 1, moonsoundSync, moonsoundSetSampleRate, moonsound);

    moonsound->ymf262 = new YMF262(0, systemTime, moonsound);
    moonsound->ymf262->setSampleRate(mixerGetSampleRate(mixer), boardGetMoonsoundOversampling());
	moonsound->ymf262->setVolume(32767 * 9 / 10);

    moonsound->ymf278 = new YMF278(0, sramSize, romData, romSize, systemTime);
    moonsound->ymf278->setSampleRate(mixerGetSampleRate(mixer), boardGetMoonsoundOversampling());
    moonsound->ymf278->setVolume(32767 * 9 / 10);

    return moonsound;
}