Previous 199869 Revisions Next

r29527 Friday 11th April, 2014 at 06:44:25 UTC by Fabio Priuli
namco_audio: converted to use inline config. nw.
[src/emu/sound]namco.c namco.h
[src/mame/drivers]20pacgal.c baraduke.c galaga.c gaplus.c jrpacman.c mappy.c namcos1.c namcos86.c pacland.c pacman.c pengo.c polepos.c rallyx.c skykid.c tceptor.c toypop.c

trunk/src/emu/sound/namco.c
r29526r29527
4444      m_stream(NULL),
4545      m_namco_clock(0),
4646      m_sample_rate(0),
47      m_f_fracbits(0)
47      m_f_fracbits(0),
48      m_voices(0),
49      m_stereo(0)
4850{
4951}
5052
r29526r29527
6567
6668
6769//-------------------------------------------------
68//  device_config_complete - perform any
69//  operations now that the configuration is
70//  complete
71//-------------------------------------------------
72
73void namco_audio_device::device_config_complete()
74{
75   // inherit a copy of the static data
76   const namco_interface *intf = reinterpret_cast<const namco_interface *>(static_config());
77   if (intf != NULL)
78   *static_cast<namco_interface *>(this) = *intf;
79
80   // or initialize to defaults if none provided
81   else
82   {
83      m_voices = 0;
84      m_stereo = 0;
85   }
86}
87
88//-------------------------------------------------
8970//  device_start - device-specific startup
9071//-------------------------------------------------
9172
trunk/src/emu/sound/namco.h
r29526r29527
88
99#define MAX_VOLUME 16
1010
11struct namco_interface
12{
13   int m_voices;     /* number of voices */
14   int m_stereo;     /* set to 1 to indicate stereo (e.g., System 1) */
15};
1611
12#define MCFG_NAMCO_AUDIO_VOICES(_voices) \
13   namco_audio_device::set_voices(*device, _voices);
14
15#define MCFG_NAMCO_AUDIO_STEREO(_stereo) \
16   namco_audio_device::set_stereo(*device, _stereo);
17
18
1719/* this structure defines the parameters for a channel */
1820struct sound_channel
1921{
r29526r29527
2931};
3032
3133class namco_audio_device : public device_t,
32                           public device_sound_interface,
33                           public namco_interface
34                     public device_sound_interface
3435{
3536public:
3637   namco_audio_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
3738   ~namco_audio_device() {}
3839
39   protected:
40   // static configuration
41   static void set_voices(device_t &device, int voices) { downcast<namco_audio_device &>(device).m_voices = voices; }
42   static void set_stereo(device_t &device, int stereo) { downcast<namco_audio_device &>(device).m_stereo = stereo; }
43   
44protected:
4045   // device-level overrides
41   virtual void device_config_complete();
4246   virtual void device_start();
4347
4448   // internal state
r29526r29527
6165   int m_sample_rate;
6266   int m_f_fracbits;
6367
68   int m_voices;     /* number of voices */
69   int m_stereo;     /* set to 1 to indicate stereo (e.g., System 1) */
70
6471   /* decoded waveform table */
6572   INT16 *m_waveform[MAX_VOLUME];
6673
trunk/src/mame/drivers/20pacgal.c
r29526r29527
121121
122122/*************************************
123123 *
124 *  Audio
125 *
126 *************************************/
127
128static const namco_interface namco_config =
129{
130   3,      /* number of voices */
131   0       /* stereo */
132};
133
134
135
136/*************************************
137 *
138124 *  Coin counter
139125 *
140126 *************************************/
r29526r29527
408394   MCFG_SPEAKER_STANDARD_MONO("mono")
409395
410396   MCFG_SOUND_ADD("namco", NAMCO_CUS30, NAMCO_AUDIO_CLOCK)
411   MCFG_SOUND_CONFIG(namco_config)
397   MCFG_NAMCO_AUDIO_VOICES(3)
412398   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
413399
414400   MCFG_DAC_ADD("dac")
trunk/src/mame/drivers/gaplus.c
r29526r29527
467467   GFXDECODE_ENTRY( "gfx2", 0x0000, spritelayout, 64*4, 64 )
468468GFXDECODE_END
469469
470static const namco_interface namco_config =
471{
472   8,              /* number of voices */
473   0               /* stereo */
474};
475
476470static const char *const gaplus_sample_names[] =
477471{
478472   "*gaplus",
r29526r29527
583577   MCFG_SPEAKER_STANDARD_MONO("mono")
584578
585579   MCFG_SOUND_ADD("namco", NAMCO_15XX, 24576000/1024)
586   MCFG_SOUND_CONFIG(namco_config)
580   MCFG_NAMCO_AUDIO_VOICES(8)
587581   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
588582
589583   MCFG_SAMPLES_ADD("samples", gaplus_samples_interface)
trunk/src/mame/drivers/pengo.c
r29526r29527
346346GFXDECODE_END
347347
348348
349
350349/*************************************
351350 *
352 *  Sound interfaces
353 *
354 *************************************/
355
356static const namco_interface namco_config =
357{
358   3,          /* number of voices */
359   0           /* stereo */
360};
361
362
363
364/*************************************
365 *
366351 *  Machine drivers
367352 *
368353 *************************************/
r29526r29527
398383   MCFG_SPEAKER_STANDARD_MONO("mono")
399384
400385   MCFG_SOUND_ADD("namco", NAMCO, MASTER_CLOCK/6/32)
401   MCFG_SOUND_CONFIG(namco_config)
386   MCFG_NAMCO_AUDIO_VOICES(3)
402387   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
403388MACHINE_CONFIG_END
404389
trunk/src/mame/drivers/tceptor.c
r29526r29527
323323
324324/*******************************************************************/
325325
326static const namco_interface namco_config =
327{
328   8,          /* number of voices */
329   1           /* stereo */
330};
331
332
333/*******************************************************************/
334
335326void tceptor_state::machine_start()
336327{
337328   save_item(NAME(m_m6809_irq_enable));
r29526r29527
424415   MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
425416
426417   MCFG_SOUND_ADD("namco", NAMCO_CUS30, 49152000/2048)
427   MCFG_SOUND_CONFIG(namco_config)
418   MCFG_NAMCO_AUDIO_VOICES(8)
419   MCFG_NAMCO_AUDIO_STEREO(1)
428420   MCFG_SOUND_ROUTE(0, "lspeaker", 0.40)
429421   MCFG_SOUND_ROUTE(1, "rspeaker", 0.40)
430422
trunk/src/mame/drivers/namcos1.c
r29526r29527
10561056
10571057
10581058
1059static const namco_interface namco_config =
1060{
1061   8,          /* number of voices */
1062   1           /* stereo */
1063};
1064
10651059/*
10661060    namcos1 has two 8bit dac channel. But They are mixed before pre-amp.
10671061    And,they are connected with pre-amp through active LPF.
r29526r29527
11151109   MCFG_SOUND_ROUTE(1, "rspeaker", 0.50)
11161110
11171111   MCFG_SOUND_ADD("namco", NAMCO_CUS30, XTAL_49_152MHz/2048/2)
1118   MCFG_SOUND_CONFIG(namco_config)
1112   MCFG_NAMCO_AUDIO_VOICES(8)
1113   MCFG_NAMCO_AUDIO_STEREO(1)
11191114   MCFG_SOUND_ROUTE(0, "lspeaker", 0.50)
11201115   MCFG_SOUND_ROUTE(1, "rspeaker", 0.50)
11211116
trunk/src/mame/drivers/rallyx.c
r29526r29527
797797 *
798798 *************************************/
799799
800static const namco_interface namco_config =
801{
802   3,              /* number of voices */
803   0               /* stereo */
804};
805
806800static const char *const rallyx_sample_names[] =
807801{
808802   "*rallyx",
r29526r29527
880874   MCFG_SPEAKER_STANDARD_MONO("mono")
881875
882876   MCFG_SOUND_ADD("namco", NAMCO, MASTER_CLOCK/6/32) /* 96 KHz */
883   MCFG_SOUND_CONFIG(namco_config)
877   MCFG_NAMCO_AUDIO_VOICES(3)
884878   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
885879
886880   MCFG_SAMPLES_ADD("samples", rallyx_samples_interface)
trunk/src/mame/drivers/toypop.c
r29526r29527
473473   GFXDECODE_ENTRY( "gfx2", 0, spritelayout, 128*4,  64 )
474474GFXDECODE_END
475475
476
477
478static const namco_interface namco_config =
479{
480   8,      /* number of voices */
481   0       /* stereo */
482};
483
484
485476/***************************************************************************
486477
487478  Custom I/O initialization
r29526r29527
563554   MCFG_SPEAKER_STANDARD_MONO("mono")
564555
565556   MCFG_SOUND_ADD("namco", NAMCO_15XX, 24000)
566   MCFG_SOUND_CONFIG(namco_config)
557   MCFG_NAMCO_AUDIO_VOICES(8)
567558   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
568559MACHINE_CONFIG_END
569560
trunk/src/mame/drivers/skykid.c
r29526r29527
415415GFXDECODE_END
416416
417417
418
419static const namco_interface namco_config =
420{
421   8,                  /* number of voices */
422   0                   /* stereo */
423};
424
425418INTERRUPT_GEN_MEMBER(skykid_state::main_vblank_irq)
426419{
427420   if(m_main_irq_mask)
r29526r29527
469462   MCFG_SPEAKER_STANDARD_MONO("mono")
470463
471464   MCFG_SOUND_ADD("namco", NAMCO_CUS30, 49152000/2048)
472   MCFG_SOUND_CONFIG(namco_config)
465   MCFG_NAMCO_AUDIO_VOICES(8)
473466   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
474467MACHINE_CONFIG_END
475468
trunk/src/mame/drivers/mappy.c
r29526r29527
15951595GFXDECODE_END
15961596
15971597
1598
15991598/***************************************************************************
16001599
1601  Sound interface
1602
1603***************************************************************************/
1604
1605static const namco_interface namco_config =
1606{
1607   8,              /* number of voices */
1608   0               /* stereo */
1609};
1610
1611
1612/***************************************************************************
1613
16141600  Custom I/O initialization
16151601
16161602***************************************************************************/
r29526r29527
17091695   MCFG_SPEAKER_STANDARD_MONO("mono")
17101696
17111697   MCFG_SOUND_ADD("namco", NAMCO_15XX, 18432000/768)
1712   MCFG_SOUND_CONFIG(namco_config)
1698   MCFG_NAMCO_AUDIO_VOICES(8)
17131699   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
17141700MACHINE_CONFIG_END
17151701
r29526r29527
18321818   MCFG_SPEAKER_STANDARD_MONO("mono")
18331819
18341820   MCFG_SOUND_ADD("namco", NAMCO_15XX, 18432000/768)
1835   MCFG_SOUND_CONFIG(namco_config)
1821   MCFG_NAMCO_AUDIO_VOICES(8)
18361822   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
18371823MACHINE_CONFIG_END
18381824
r29526r29527
18711857   MCFG_SPEAKER_STANDARD_MONO("mono")
18721858
18731859   MCFG_SOUND_ADD("namco", NAMCO_15XX, 18432000/768)
1874   MCFG_SOUND_CONFIG(namco_config)
1860   MCFG_NAMCO_AUDIO_VOICES(8)
18751861   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
18761862MACHINE_CONFIG_END
18771863
trunk/src/mame/drivers/namcos86.c
r29526r29527
979979
980980/*******************************************************************/
981981
982static const namco_interface namco_config =
983{
984   8,      /* number of voices */
985   0       /* stereo */
986};
987
988
989982static MACHINE_CONFIG_START( hopmappy, namcos86_state )
990983
991984   /* basic machine hardware */
r29526r29527
10241017   MCFG_SOUND_ROUTE(1, "mono", 0.60)   /* only right channel is connected */
10251018
10261019   MCFG_SOUND_ADD("namco", NAMCO_CUS30, XTAL_49_152MHz/2048)
1027   MCFG_SOUND_CONFIG(namco_config)
1020   MCFG_NAMCO_AUDIO_VOICES(8)
10281021   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
10291022MACHINE_CONFIG_END
10301023
trunk/src/mame/drivers/polepos.c
r29526r29527
823823
824824
825825/*********************************************************************
826 * Sound interfaces
827 *********************************************************************/
828
829static const namco_interface namco_config =
830{
831   8,              /* number of voices */
832   1               /* stereo */
833};
834
835
836/*********************************************************************
837826 * Machine driver
838827 *********************************************************************/
839828
r29526r29527
911900   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
912901
913902   MCFG_SOUND_ADD("namco", NAMCO, MASTER_CLOCK/512)
914   MCFG_SOUND_CONFIG(namco_config)
903   MCFG_NAMCO_AUDIO_VOICES(8)
904   MCFG_NAMCO_AUDIO_STEREO(1)
915905   MCFG_SOUND_ROUTE(0, "lspeaker", 0.80)
916906   MCFG_SOUND_ROUTE(1, "rspeaker", 0.80)
917907
r29526r29527
979969   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
980970
981971   MCFG_SOUND_ADD("namco", NAMCO, MASTER_CLOCK/512)
982   MCFG_SOUND_CONFIG(namco_config)
972   MCFG_NAMCO_AUDIO_VOICES(8)
973   MCFG_NAMCO_AUDIO_STEREO(1)
983974   MCFG_SOUND_ROUTE(0, "lspeaker", 0.80)
984975   MCFG_SOUND_ROUTE(1, "rspeaker", 0.80)
985976
trunk/src/mame/drivers/jrpacman.c
r29526r29527
260260
261261/*************************************
262262 *
263 *  Sound interfaces
264 *
265 *************************************/
266
267static const namco_interface namco_config =
268{
269   3,          /* number of voices */
270   0           /* stereo */
271};
272
273
274
275/*************************************
276 *
277263 *  Machine drivers
278264 *
279265 *************************************/
r29526r29527
311297   MCFG_SPEAKER_STANDARD_MONO("mono")
312298
313299   MCFG_SOUND_ADD("namco", NAMCO, 3072000/32)
314   MCFG_SOUND_CONFIG(namco_config)
300   MCFG_NAMCO_AUDIO_VOICES(3)
315301   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
316302MACHINE_CONFIG_END
317303
trunk/src/mame/drivers/pacland.c
r29526r29527
402402GFXDECODE_END
403403
404404
405
406static const namco_interface namco_config =
407{
408   8,      /* number of voices */
409   0       /* stereo */
410};
411
412405INTERRUPT_GEN_MEMBER(pacland_state::main_vblank_irq)
413406{
414407   if(m_main_irq_mask)
r29526r29527
450443   MCFG_SPEAKER_STANDARD_MONO("mono")
451444
452445   MCFG_SOUND_ADD("namco", NAMCO_CUS30, XTAL_49_152MHz/2/1024)
453   MCFG_SOUND_CONFIG(namco_config)
446   MCFG_NAMCO_AUDIO_VOICES(8)
454447   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
455448MACHINE_CONFIG_END
456449
trunk/src/mame/drivers/galaga.c
r29526r29527
15741574/* The resistance path of the namco sound is 16k compared to
15751575 * the 10k of the highest gain 54xx filter. Giving a 10/16 gain.
15761576 */
1577static const namco_interface namco_config =
1578{
1579   3,              /* number of voices */
1580   0               /* stereo */
1581};
15821577
15831578static const char *const battles_sample_names[] =
15841579{
r29526r29527
16821677   MCFG_SPEAKER_STANDARD_MONO("mono")
16831678
16841679   MCFG_SOUND_ADD("namco", NAMCO, MASTER_CLOCK/6/32)
1685   MCFG_SOUND_CONFIG(namco_config)
1680   MCFG_NAMCO_AUDIO_VOICES(3)
16861681   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.90 * 10.0 / 16.0)
16871682
16881683   /* discrete circuit on the 54XX outputs */
r29526r29527
17461741   MCFG_SPEAKER_STANDARD_MONO("mono")
17471742
17481743   MCFG_SOUND_ADD("namco", NAMCO, MASTER_CLOCK/6/32)
1749   MCFG_SOUND_CONFIG(namco_config)
1744   MCFG_NAMCO_AUDIO_VOICES(3)
17501745   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.90 * 10.0 / 16.0)
17511746
17521747   /* discrete circuit on the 54XX outputs */
r29526r29527
18341829   MCFG_SPEAKER_STANDARD_MONO("mono")
18351830
18361831   MCFG_SOUND_ADD("namco", NAMCO, MASTER_CLOCK/6/32)
1837   MCFG_SOUND_CONFIG(namco_config)
1832   MCFG_NAMCO_AUDIO_VOICES(3)
18381833   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.90 * 10.0 / 16.0)
18391834
18401835   /* discrete circuit on the 54XX outputs */
r29526r29527
19351930   MCFG_SPEAKER_STANDARD_MONO("mono")
19361931
19371932   MCFG_SOUND_ADD("namco", NAMCO, MASTER_CLOCK/6/32)
1938   MCFG_SOUND_CONFIG(namco_config)
1933   MCFG_NAMCO_AUDIO_VOICES(3)
19391934   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.90 * 10.0 / 16.0)
19401935MACHINE_CONFIG_END
19411936
trunk/src/mame/drivers/baraduke.c
r29526r29527
364364
365365
366366
367static const namco_interface namco_config =
368{
369   8,                  /* number of voices */
370   0                   /* stereo */
371};
372
373
374
375367static MACHINE_CONFIG_START( baraduke, baraduke_state )
376368
377369   /* basic machine hardware */
r29526r29527
401393   MCFG_SPEAKER_STANDARD_MONO("mono")
402394
403395   MCFG_SOUND_ADD("namco", NAMCO_CUS30, XTAL_49_152MHz/2048)
404   MCFG_SOUND_CONFIG(namco_config)
396   MCFG_NAMCO_AUDIO_VOICES(8)
405397   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
406398MACHINE_CONFIG_END
407399
trunk/src/mame/drivers/pacman.c
r29526r29527
32983298GFXDECODE_END
32993299
33003300
3301
33023301/*************************************
33033302 *
3304 *  Sound interfaces
3305 *
3306 *************************************/
3307
3308static const namco_interface namco_config =
3309{
3310   3,          /* number of voices */
3311   0           /* stereo */
3312};
3313
3314
3315/*************************************
3316 *
33173303 *  Machine drivers
33183304 *
33193305 *************************************/
r29526r29527
33443330   MCFG_SPEAKER_STANDARD_MONO("mono")
33453331
33463332   MCFG_SOUND_ADD("namco", NAMCO, MASTER_CLOCK/6/32)
3347   MCFG_SOUND_CONFIG(namco_config)
3333   MCFG_NAMCO_AUDIO_VOICES(3)
33483334   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
33493335MACHINE_CONFIG_END
33503336

Previous 199869 Revisions Next


© 1997-2024 The MAME Team