Previous 199869 Revisions Next

r22766 Saturday 11th May, 2013 at 13:23:33 UTC by smf
a few changes for consistency (nw)
[src/emu/sound]2608intf.c 2608intf.h

trunk/src/emu/sound/2608intf.c
r22765r22766
1212***************************************************************************/
1313
1414#include "emu.h"
15#include "ay8910.h"
1615#include "2608intf.h"
1716#include "fm.h"
1817
r22765r22766
136135
137136void ym2608_device::device_start()
138137{
139   static const ay8910_interface generic_ay8910 =
138   static const ay8910_interface default_ay8910_config =
140139   {
141140      AY8910_LEGACY_OUTPUT | AY8910_SINGLE_OUTPUT,
142141      AY8910_DEFAULT_LOADS,
r22765r22766
147146   void *pcmbufa;
148147   int  pcmsizea;
149148
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;
151150
152151   m_irq_handler.resolve();
153152   /* 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);
155154   assert_always(m_psg != NULL, "Error creating YM2608/AY8910 chip");
156155
157156   /* Timer Handler set */
trunk/src/emu/sound/2608intf.h
r22765r22766
1111#define MCFG_YM2608_IRQ_HANDLER(_devcb) \
1212   devcb = &ym2608_device::set_irq_handler(*device, DEVCB2_##_devcb);
1313
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);
1616
1717class ym2608_device : public device_t,
1818                           public device_sound_interface
r22765r22766
2222
2323   // static configuration helpers
2424   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; }
2626
2727   DECLARE_READ8_MEMBER( read );
2828   DECLARE_WRITE8_MEMBER( write );
r22765r22766
5252   void *          m_chip;
5353   void *          m_psg;
5454   devcb2_write_line m_irq_handler;
55   const ay8910_interface *m_ay8910_intf;
55   const ay8910_interface *m_ay8910_config;
5656};
5757
5858extern const device_type YM2608;

Previous 199869 Revisions Next


© 1997-2024 The MAME Team