Previous 199869 Revisions Next

r29524 Friday 11th April, 2014 at 05:36:11 UTC by Fabio Priuli
vrender0: converted to use inline config. nw.
[src/emu/sound]vrender0.c vrender0.h
[src/mame/drivers]crystal.c ddz.c psattack.c

trunk/src/mame/drivers/psattack.c
r29523r29524
167167   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
168168INPUT_PORTS_END
169169
170static const vr0_interface vr0_config =
171{
172   0x04800000
173};
174
175
176170static MACHINE_CONFIG_START( psattack, psattack_state )
177171   MCFG_CPU_ADD("maincpu", SE3208, 43000000)
178172   MCFG_CPU_PROGRAM_MAP(psattack_mem)
r29523r29524
196190   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
197191
198192   MCFG_SOUND_ADD("vrender", VRENDER0, 0)
199   MCFG_SOUND_CONFIG(vr0_config)
193   MCFG_VR0_REGBASE(0x04800000)
200194   MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
201195   MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
202196MACHINE_CONFIG_END
trunk/src/mame/drivers/crystal.c
r29523r29524
894894INPUT_PORTS_END
895895
896896
897
898static const vr0_interface vr0_config =
899{
900   0x04800000
901};
902
903897static MACHINE_CONFIG_START( crystal, crystal_state )
904898
905899   MCFG_CPU_ADD("maincpu", SE3208, 43000000)
r29523r29524
927921   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
928922
929923   MCFG_SOUND_VRENDER0_ADD("vrender", 0)
930   MCFG_SOUND_CONFIG(vr0_config)
924   MCFG_VR0_REGBASE(0x04800000)
931925   MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
932926   MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
933927MACHINE_CONFIG_END
trunk/src/mame/drivers/ddz.c
r29523r29524
5858
5959INPUT_PORTS_END
6060
61
62static const vr0_interface vr0_config =
63{
64   0x04800000
65};
66
67
6861static MACHINE_CONFIG_START( ddz, ddz_state )
6962   MCFG_CPU_ADD("maincpu", SE3208, 43000000)
7063   MCFG_CPU_PROGRAM_MAP(ddz_mem)
r29523r29524
8881   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
8982
9083   MCFG_SOUND_ADD("vrender", VRENDER0, 0)
91   MCFG_SOUND_CONFIG(vr0_config)
84   MCFG_VR0_REGBASE(0x04800000)
9285   MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
9386   MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
9487MACHINE_CONFIG_END
trunk/src/emu/sound/vrender0.c
r29523r29524
5959#define ENVVOL(chan)    (m_SOUNDREGS[(0x20/4)*chan+0x04/4]&0xffffff)
6060
6161/*
62#define GETSOUNDREG16(Chan,Offs) space.read_word(m_Intf.reg_base+0x20*Chan+Offs)
63#define GETSOUNDREG32(Chan,Offs) space.read_dword(m_Intf.reg_base+0x20*Chan+Offs)
62#define GETSOUNDREG16(Chan,Offs) space.read_word(m_reg_base+0x20*Chan+Offs)
63#define GETSOUNDREG32(Chan,Offs) space.read_dword(m_reg_base+0x20*Chan+Offs)
6464
6565#define CURSADDR(chan)  GETSOUNDREG32(chan,0x00)
6666#define DSADDR(chan)    GETSOUNDREG16(chan,0x08)
r29523r29524
8686      device_sound_interface(mconfig, *this),
8787      m_TexBase(NULL),
8888      m_FBBase(NULL),
89      m_stream(NULL)
89      m_stream(NULL),
90      m_reg_base(0)
9091{
9192}
9293
r29523r29524
9798
9899void vrender0_device::device_start()
99100{
100   const vr0_interface *intf = (const vr0_interface *)static_config();
101
102   memcpy(&(m_Intf),intf,sizeof(vr0_interface));
103101   memset(m_SOUNDREGS,0,sizeof(m_SOUNDREGS));
104102
105103   m_stream = stream_alloc(0, 2, 44100);
trunk/src/emu/sound/vrender0.h
r29523r29524
1313#define MCFG_SOUND_VRENDER0_REPLACE(_tag, _clock) \
1414   MCFG_DEVICE_REPLACE(_tag, VRENDER0, _clock)
1515
16#define MCFG_VR0_REGBASE(_base) \
17   vrender0_device::set_reg_base(*device, _base);
1618
1719//**************************************************************************
1820//  TYPE DEFINITIONS
r29523r29524
2123
2224// ======================> vrender0_device
2325
24struct vr0_interface
25{
26   UINT32 RegBase;
27};
28
29void vr0_snd_set_areas(device_t *device, UINT32 *texture, UINT32 *frame);
30
3126class vrender0_device : public device_t,
3227                  public device_sound_interface
3328{
r29523r29524
3530   vrender0_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
3631   ~vrender0_device() { }
3732
38protected:
39   // device-level overrides
40   virtual void device_start();
33   // static configuration
34   static void set_reg_base(device_t &device, int base) { downcast<vrender0_device &>(device).m_reg_base = base; }
4135
42   // sound stream update overrides
43   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
44
45public:
4636   DECLARE_READ32_MEMBER( vr0_snd_read );
4737   DECLARE_WRITE32_MEMBER( vr0_snd_write );
4838
4939   void set_areas(UINT32 *texture, UINT32 *frame);
5040
41protected:
42   // device-level overrides
43   virtual void device_start();
44   
45   // sound stream update overrides
46   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
47
5148private:
5249   UINT32 *m_TexBase;
5350   UINT32 *m_FBBase;
5451   UINT32 m_SOUNDREGS[0x10000/4];
5552   sound_stream *m_stream;
56   vr0_interface m_Intf;
53   UINT32 m_reg_base;
5754
5855   void VR0_RenderAudio(int nsamples, stream_sample_t *l, stream_sample_t *r);
5956};

Previous 199869 Revisions Next


© 1997-2024 The MAME Team