// device-level overrides //------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- protected override void device_start() { m_disound = GetClassInterface <device_sound_interface_ay8910>(); int master_clock = (int)clock(); if (m_ioports < 1 && !(m_port_a_read_cb.isnull() && m_port_a_write_cb.isnull())) { fatalerror("Device '{0}' is a {1} and has no port A!", tag(), name()); } if (m_ioports < 2 && !(m_port_b_read_cb.isnull() && m_port_b_write_cb.isnull())) { fatalerror("Device '{0}' is a {1} and has no port B!", tag(), name()); } m_port_a_read_cb.resolve(); m_port_b_read_cb.resolve(); m_port_a_write_cb.resolve(); m_port_b_write_cb.resolve(); if ((m_flags & AY8910_SINGLE_OUTPUT) != 0) { logerror("{0} device using single output!\n", name()); m_streams = 1; } m_vol3d_table = new int[8 * 32 * 32 * 32]; // make_unique_clear<int32_t[]>(8*32*32*32); build_mixer_table(); /* 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. */ m_channel = machine().sound().stream_alloc(this, 0, m_streams, master_clock / 8); ay_set_clock(master_clock); ay8910_statesave(); }
//DECLARE_WRITE_LINE_MEMBER(clear_w); // device-level overrides //------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- protected override void device_start() { // resolve callbacks foreach (devcb_write_line cb in m_q_out_cb) { cb.resolve(); } m_parallel_out_cb.resolve(); // initial input state m_address = 0; m_data = false; m_enable = false; m_clear = false; // arbitrary initial output state m_q = 0xff; save_item(m_address, "m_address"); save_item(m_data, "m_data"); save_item(m_enable, "m_enable"); save_item(m_q, "m_q"); save_item(m_clear, "m_clear"); }