trunk/src/emu/sound/2608intf.c
| r22765 | r22766 | |
| 12 | 12 | ***************************************************************************/ |
| 13 | 13 | |
| 14 | 14 | #include "emu.h" |
| 15 | | #include "ay8910.h" |
| 16 | 15 | #include "2608intf.h" |
| 17 | 16 | #include "fm.h" |
| 18 | 17 | |
| r22765 | r22766 | |
| 136 | 135 | |
| 137 | 136 | void ym2608_device::device_start() |
| 138 | 137 | { |
| 139 | | static const ay8910_interface generic_ay8910 = |
| 138 | static const ay8910_interface default_ay8910_config = |
| 140 | 139 | { |
| 141 | 140 | AY8910_LEGACY_OUTPUT | AY8910_SINGLE_OUTPUT, |
| 142 | 141 | AY8910_DEFAULT_LOADS, |
| r22765 | r22766 | |
| 147 | 146 | void *pcmbufa; |
| 148 | 147 | int pcmsizea; |
| 149 | 148 | |
| 150 | | const ay8910_interface *ay8910_intf = m_ay8910_intf != NULL ? m_ay8910_intf : &generic_ay8910; |
| 149 | const ay8910_interface *ay8910_config = m_ay8910_config != NULL ? m_ay8910_config : &default_ay8910_config; |
| 151 | 150 | |
| 152 | 151 | m_irq_handler.resolve(); |
| 153 | 152 | /* FIXME: Force to use simgle output */ |
| 154 | | m_psg = ay8910_start_ym(NULL, type(), this, clock(), ay8910_intf); |
| 153 | m_psg = ay8910_start_ym(NULL, type(), this, clock(), ay8910_config); |
| 155 | 154 | assert_always(m_psg != NULL, "Error creating YM2608/AY8910 chip"); |
| 156 | 155 | |
| 157 | 156 | /* Timer Handler set */ |
trunk/src/emu/sound/2608intf.h
| r22765 | r22766 | |
| 11 | 11 | #define MCFG_YM2608_IRQ_HANDLER(_devcb) \ |
| 12 | 12 | devcb = &ym2608_device::set_irq_handler(*device, DEVCB2_##_devcb); |
| 13 | 13 | |
| 14 | | #define MCFG_YM2608_AY8910_INTF(_ay8910_intf) \ |
| 15 | | ym2608_device::set_ay8910_intf(*device, _ay8910_intf); |
| 14 | #define MCFG_YM2608_AY8910_INTF(_ay8910_config) \ |
| 15 | ym2608_device::set_ay8910_config(*device, _ay8910_config); |
| 16 | 16 | |
| 17 | 17 | class ym2608_device : public device_t, |
| 18 | 18 | public device_sound_interface |
| r22765 | r22766 | |
| 22 | 22 | |
| 23 | 23 | // static configuration helpers |
| 24 | 24 | template<class _Object> static devcb2_base &set_irq_handler(device_t &device, _Object object) { return downcast<ym2608_device &>(device).m_irq_handler.set_callback(object); } |
| 25 | | static void set_ay8910_intf(device_t &device, const ay8910_interface *ay8910_intf) { downcast<ym2608_device &>(device).m_ay8910_intf = ay8910_intf; } |
| 25 | static void set_ay8910_config(device_t &device, const ay8910_interface *ay8910_config) { downcast<ym2608_device &>(device).m_ay8910_config = ay8910_config; } |
| 26 | 26 | |
| 27 | 27 | DECLARE_READ8_MEMBER( read ); |
| 28 | 28 | DECLARE_WRITE8_MEMBER( write ); |
| r22765 | r22766 | |
| 52 | 52 | void * m_chip; |
| 53 | 53 | void * m_psg; |
| 54 | 54 | devcb2_write_line m_irq_handler; |
| 55 | | const ay8910_interface *m_ay8910_intf; |
| 55 | const ay8910_interface *m_ay8910_config; |
| 56 | 56 | }; |
| 57 | 57 | |
| 58 | 58 | extern const device_type YM2608; |