void ym2203_device::device_start() { ay8910_device::device_start(); m_irq_handler.resolve(); /* Timer Handler set */ m_timer[0] = timer_alloc(0); m_timer[1] = timer_alloc(1); /* stream system initialize */ calculate_rates(); /* Initialize FM emurator */ int rate = clock()/72; /* ??? */ m_chip = ym2203_init(this,this,clock(),rate,timer_handler,IRQHandler,&psgintf); assert_always(m_chip != nullptr, "Error creating YM2203 chip"); }
void ym3812_device::device_start() { int rate = clock() / 72; m_irq_handler.resolve(); /* stream system initialize */ m_chip = ym3812_init(this, clock(), rate); assert_always(m_chip != nullptr, "Error creating YM3812 chip"); calculate_rates(); /* YM3812 setup */ ym3812_set_timer_handler (m_chip, timer_handler, this); ym3812_set_irq_handler (m_chip, IRQHandler, this); ym3812_set_update_handler(m_chip, ym3812_update_request, this); m_timer[0] = timer_alloc(0); m_timer[1] = timer_alloc(1); }
void nesapu_device::device_start() { // resolve callbacks m_irq_handler.resolve_safe(); m_mem_read_cb.resolve_safe(0x00); create_noise(m_noise_lut, 13, apu_t::NOISE_LONG); calculate_rates(); /* register for save */ for (int i = 0; i < 2; i++) { save_item(NAME(m_APU.squ[i].regs), i); save_item(NAME(m_APU.squ[i].vbl_length), i); save_item(NAME(m_APU.squ[i].freq), i); save_item(NAME(m_APU.squ[i].phaseacc), i); save_item(NAME(m_APU.squ[i].output_vol), i); save_item(NAME(m_APU.squ[i].env_phase), i); save_item(NAME(m_APU.squ[i].sweep_phase), i); save_item(NAME(m_APU.squ[i].adder), i); save_item(NAME(m_APU.squ[i].env_vol), i); save_item(NAME(m_APU.squ[i].enabled), i); } save_item(NAME(m_APU.tri.regs)); save_item(NAME(m_APU.tri.linear_length)); save_item(NAME(m_APU.tri.vbl_length)); save_item(NAME(m_APU.tri.write_latency)); save_item(NAME(m_APU.tri.phaseacc)); save_item(NAME(m_APU.tri.output_vol)); save_item(NAME(m_APU.tri.adder)); save_item(NAME(m_APU.tri.counter_started)); save_item(NAME(m_APU.tri.enabled)); save_item(NAME(m_APU.noi.regs)); save_item(NAME(m_APU.noi.cur_pos)); save_item(NAME(m_APU.noi.vbl_length)); save_item(NAME(m_APU.noi.phaseacc)); save_item(NAME(m_APU.noi.output_vol)); save_item(NAME(m_APU.noi.env_phase)); save_item(NAME(m_APU.noi.env_vol)); save_item(NAME(m_APU.noi.enabled)); save_item(NAME(m_APU.dpcm.regs)); save_item(NAME(m_APU.dpcm.address)); save_item(NAME(m_APU.dpcm.length)); save_item(NAME(m_APU.dpcm.bits_left)); save_item(NAME(m_APU.dpcm.phaseacc)); save_item(NAME(m_APU.dpcm.output_vol)); save_item(NAME(m_APU.dpcm.cur_byte)); save_item(NAME(m_APU.dpcm.enabled)); save_item(NAME(m_APU.dpcm.irq_occurred)); save_item(NAME(m_APU.dpcm.vol)); save_item(NAME(m_APU.regs)); #ifdef USE_QUEUE save_item(NAME(m_APU.queue)); save_item(NAME(m_APU.head)); save_item(NAME(m_APU.tail)); #else save_item(NAME(m_APU.buf_pos)); save_item(NAME(m_APU.step_mode)); #endif }
void nesapu_device::device_clock_changed() { calculate_rates(); }
void ym3812_device::device_clock_changed() { calculate_rates(); ym3812_clock_changed(m_chip, clock(), clock() / 72); }