void *ay8910_start_ym(sound_type chip_type, int sndindex, int clock, const struct AY8910interface *intf) { ay8910_context *info; info = auto_malloc(sizeof(*info)); memset(info, 0, sizeof(*info)); info->index = sndindex; info->intf = intf; if ((info->intf->flags & AY8910_SINGLE_OUTPUT) != 0) { logerror("AY-3-8910/YM2149 using single output!\n"); info->streams = 1; } else info->streams = 3; switch (chip_type) { case SOUND_AY8910: case SOUND_AY8930: info->step = 2; info->par = &ay8910_param; info->par_env = &ay8910_param; info->zero_is_off = 1; info->env_step_mask = 0x0F; break; case SOUND_YM2149: case SOUND_YM2203: case SOUND_YM2610: case SOUND_YM2610B: case SOUND_YM2608: case SOUND_YMZ284: case SOUND_YMZ294: case SOUND_YM3439: default: info->step = 1; info->par = &ym2149_param; info->par_env = &ym2149_param_env; info->zero_is_off = 0; info->env_step_mask = 0x1F; break; } build_mixer_table(info); /* The envelope is pacing twice as fast for the YM2149 as for the AY-3-8910, */ /* This handled by the step parameter. Consequently we use a divider of 8 here. */ info->channel = stream_create(0,info->streams,clock / 8 ,info,ay8910_update); ay8910_set_clock_ym(info,clock); ay8910_statesave(info, sndindex); return info; }
static void psg_set_clock(void *param, int clock) { ym2610_state *info = (ym2610_state *)param; if (info->psg != NULL) { switch(info->AY_EMU_CORE) { #ifdef ENABLE_ALL_CORES case EC_MAME: ay8910_set_clock_ym(info->psg, clock); break; #endif case EC_EMU2149: PSG_set_clock((PSG*)info->psg, clock); break; } } }
static void AY8910_init(struct AY8910 *PSG, int streams, int clock,int sample_rate, read8_handler portAread,read8_handler portBread, write8_handler portAwrite,write8_handler portBwrite) { PSG->PortAread = portAread; PSG->PortBread = portBread; PSG->PortAwrite = portAwrite; PSG->PortBwrite = portBwrite; /* the step clock for the tone and noise generators is the chip clock */ /* divided by 8; for the envelope generator of the AY-3-8910, it is half */ /* that much (clock/16), but the envelope of the YM2149 goes twice as */ /* fast, therefore again clock/8. */ PSG->Channel = stream_create(0,streams,clock/8,PSG,AY8910Update); ay8910_set_clock_ym(PSG,clock); }
static void psg_set_clock(void *param, int clock) { struct ym2610_info *info = param; ay8910_set_clock_ym(info->psg, clock); }
static void psg_set_clock(void *param, int clock) { ym2608_device *ym2608 = (ym2608_device *) param; ay8910_set_clock_ym(ym2608->_psg(), clock); }
static void psg_set_clock(void *param, int clock) { ym2610_state *info = (ym2610_state *)param; ay8910_set_clock_ym(info->psg, clock); }