Previous 199869 Revisions Next

r29521 Friday 11th April, 2014 at 04:52:34 UTC by Fabio Priuli
c6280: converted to use inline config. nw.
[src/emu/sound]c6280.c c6280.h
[src/mame/drivers]battlera.c ggconnie.c paranoia.c tourvis.c uapce.c
[src/mess/drivers]pce.c x1twin.c

trunk/src/emu/sound/c6280.c
r29520r29521
248248
249249c6280_device::c6280_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
250250   : device_t(mconfig, C6280, "HuC6280", tag, owner, clock, "c6280", __FILE__),
251      device_sound_interface(mconfig, *this)
251      device_sound_interface(mconfig, *this),
252      m_cpudevice(*this)
252253{
253254}
254255
255256//-------------------------------------------------
256//  device_config_complete - perform any
257//  operations now that the configuration is
258//  complete
259//-------------------------------------------------
260
261void c6280_device::device_config_complete()
262{
263}
264
265//-------------------------------------------------
266257//  device_start - device-specific startup
267258//-------------------------------------------------
268259
r29520r29521
273264   /* Create stereo stream */
274265   m_stream = machine().sound().stream_alloc(*this, 0, 2, rate, this);
275266
276   const c6280_interface *intf = (const c6280_interface *)static_config();
277
278267   /* Loudest volume level for table */
279268   double level = 65535.0 / 6.0 / 32.0;
280269
r29520r29521
285274   m_lfo_control = 0;
286275   memset(m_channel, 0, sizeof(channel) * 8);
287276
288   m_cpudevice = machine().device<h6280_device>(intf->cpu);
289   if (m_cpudevice == NULL)
290   {
291      fatalerror("c6280_init: no CPU found with tag of '%s'\n", tag());
292   }
293
294277   /* Make waveform frequency table */
295278   for (int i = 0; i < 4096; i += 1)
296279   {
r29520r29521
321304   save_item(NAME(m_lfo_control));
322305   for (int chan = 0; chan < 8; chan++)
323306   {
324      state_save_register_item(machine(), "c6280", NULL, chan, m_channel[chan].m_frequency);
325      state_save_register_item(machine(), "c6280", NULL, chan, m_channel[chan].m_control);
326      state_save_register_item(machine(), "c6280", NULL, chan, m_channel[chan].m_balance);
327      state_save_register_item(machine(), "c6280", NULL, chan, m_channel[chan].m_waveform);
328      state_save_register_item(machine(), "c6280", NULL, chan, m_channel[chan].m_index);
329      state_save_register_item(machine(), "c6280", NULL, chan, m_channel[chan].m_dda);
330      state_save_register_item(machine(), "c6280", NULL, chan, m_channel[chan].m_noise_control);
331      state_save_register_item(machine(), "c6280", NULL, chan, m_channel[chan].m_noise_counter);
332      state_save_register_item(machine(), "c6280", NULL, chan, m_channel[chan].m_counter);
307      save_item(NAME(m_channel[chan].m_frequency), chan);
308      save_item(NAME(m_channel[chan].m_control), chan);
309      save_item(NAME(m_channel[chan].m_balance), chan);
310      save_item(NAME(m_channel[chan].m_waveform), chan);
311      save_item(NAME(m_channel[chan].m_index), chan);
312      save_item(NAME(m_channel[chan].m_dda), chan);
313      save_item(NAME(m_channel[chan].m_noise_control), chan);
314      save_item(NAME(m_channel[chan].m_noise_counter), chan);
315      save_item(NAME(m_channel[chan].m_counter), chan);
333316   }
334317}
trunk/src/emu/sound/c6280.h
r29520r29521
55
66#include "cpu/h6280/h6280.h"
77
8struct c6280_interface
9{
10   const char *    cpu;
11};
12
138class c6280_device : public device_t,
149                  public device_sound_interface
1510{
1611public:
1712   c6280_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
1813
14   static void set_devicecpu_tag(device_t &device, const char *tag) { downcast<c6280_device &>(device).m_cpudevice.set_tag(tag); }
15
1916   // read/write
2017   DECLARE_READ8_MEMBER( c6280_r );
2118   DECLARE_WRITE8_MEMBER( c6280_w );
2219
2320protected:
2421   // device-level overrides
25   virtual void device_config_complete();
2622   virtual void device_start();
2723
2824   // sound stream update overrides
r29520r29521
4339
4440   // internal state
4541   sound_stream *m_stream;
46   h6280_device *m_cpudevice;
42   required_device<h6280_device> m_cpudevice;
4743   UINT8 m_select;
4844   UINT8 m_balance;
4945   UINT8 m_lfo_frequency;
r29520r29521
5652
5753extern const device_type C6280;
5854
55#define MCFG_C6280_CPU(_tag) \
56   c6280_device::set_devicecpu_tag(*device, "^"_tag);
5957
58
6059#endif /* __C6280_H__ */
trunk/src/mess/drivers/pce.c
r29520r29521
284284ADDRESS_MAP_END
285285
286286
287static const c6280_interface c6280_config =
288{
289   "maincpu"
290};
291
292287UINT32 pce_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
293288{
294289   m_huc6260->video_update( bitmap, cliprect );
r29520r29521
337332
338333   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
339334   MCFG_SOUND_ADD(C6280_TAG, C6280, MAIN_CLOCK/6)
340   MCFG_SOUND_CONFIG(c6280_config)
335   MCFG_C6280_CPU("maincpu")
341336   MCFG_SOUND_ROUTE( 0, "lspeaker", 1.00 )
342337   MCFG_SOUND_ROUTE( 1, "rspeaker", 1.00 )
343338
r29520r29521
402397
403398   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
404399   MCFG_SOUND_ADD(C6280_TAG, C6280, MAIN_CLOCK/6)
405   MCFG_SOUND_CONFIG(c6280_config)
400   MCFG_C6280_CPU("maincpu")
406401   MCFG_SOUND_ROUTE(0, "lspeaker", 1.00)
407402   MCFG_SOUND_ROUTE(1, "rspeaker", 1.00)
408403
trunk/src/mess/drivers/x1twin.c
r29520r29521
514514};
515515
516516
517#if 0
518static const c6280_interface c6280_config =
519{
520   "pce_cpu"
521};
522#endif
523517
524518static MACHINE_CONFIG_START( x1twin, x1twin_state )
525519   /* basic machine hardware */
r29520r29521
599593
600594#if 0
601595   MCFG_SOUND_ADD("c6280", C6280, PCE_MAIN_CLOCK/6)
602//  MCFG_SOUND_CONFIG(c6280_config)
596   MCFG_C6280_CPU("pce_cpu")
603597   MCFG_SOUND_ROUTE(0, "pce_l", 0.5)
604598   MCFG_SOUND_ROUTE(1, "pce_r", 0.5)
605599#endif
trunk/src/mame/drivers/paranoia.c
r29520r29521
169169   DEVCB_DRIVER_LINE_MEMBER(paranoia_state,paranoia_i8155_timer_out)
170170};
171171
172static const c6280_interface c6280_config =
173{
174   "maincpu"
175};
176
177172static MACHINE_CONFIG_START( paranoia, paranoia_state )
178173   /* basic machine hardware */
179174   MCFG_CPU_ADD("maincpu", H6280, PCE_MAIN_CLOCK/3)
r29520r29521
208203
209204   MCFG_SPEAKER_STANDARD_STEREO("lspeaker","rspeaker")
210205   MCFG_SOUND_ADD("c6280", C6280, PCE_MAIN_CLOCK/6)
211   MCFG_SOUND_CONFIG(c6280_config)
206   MCFG_C6280_CPU("maincpu")
212207   MCFG_SOUND_ROUTE(0, "lspeaker", 1.00)
213208   MCFG_SOUND_ROUTE(1, "rspeaker", 1.00)
214209
trunk/src/mame/drivers/tourvis.c
r29520r29521
361361   DEVCB_DRIVER_LINE_MEMBER(tourvision_state,tourvision_timer_out)
362362};
363363
364static const c6280_interface c6280_config =
365{
366   "maincpu"
367};
368
369364WRITE_LINE_MEMBER(tourvision_state::pce_irq_changed)
370365{
371366   m_maincpu->set_input_line(0, state);
r29520r29521
401396
402397   MCFG_SPEAKER_STANDARD_STEREO("lspeaker","rspeaker")
403398   MCFG_SOUND_ADD("c6280", C6280, PCE_MAIN_CLOCK/6)
404   MCFG_SOUND_CONFIG(c6280_config)
399   MCFG_C6280_CPU("maincpu")
405400   MCFG_SOUND_ROUTE(0, "lspeaker", 1.00)
406401   MCFG_SOUND_ROUTE(1, "rspeaker", 1.00)
407402
trunk/src/mame/drivers/uapce.c
r29520r29521
300300   AM_RANGE( 0x00, 0x03) AM_DEVREADWRITE( "huc6270", huc6270_device, read, write )
301301ADDRESS_MAP_END
302302
303static const c6280_interface c6280_config =
304{
305   "maincpu"
306};
307
308303WRITE_LINE_MEMBER(uapce_state::pce_irq_changed)
309304{
310305   m_maincpu->set_input_line(0, state);
r29520r29521
339334
340335   MCFG_SPEAKER_STANDARD_STEREO("lspeaker","rspeaker")
341336   MCFG_SOUND_ADD("c6280", C6280, PCE_MAIN_CLOCK/6)
342   MCFG_SOUND_CONFIG(c6280_config)
337   MCFG_C6280_CPU("maincpu")
343338   MCFG_SOUND_ROUTE(0, "lspeaker", 0.5)
344339   MCFG_SOUND_ROUTE(1, "rspeaker", 0.5)
345340
trunk/src/mame/drivers/battlera.c
r29520r29521
212212
213213/******************************************************************************/
214214
215static const c6280_interface c6280_config =
216{
217   "audiocpu"
218};
219
220215static MACHINE_CONFIG_START( battlera, battlera_state )
221216
222217   /* basic machine hardware */
r29520r29521
255250   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.85)
256251
257252   MCFG_SOUND_ADD("c6280", C6280, 21477270/6)
258   MCFG_SOUND_CONFIG(c6280_config)
253   MCFG_C6280_CPU("audiocpu")
259254   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.60)
260255   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.60)
261256MACHINE_CONFIG_END
trunk/src/mame/drivers/ggconnie.c
r29520r29521
175175   PORT_DIPSETTING(0x00, DEF_STR(On) )
176176INPUT_PORTS_END
177177
178static const c6280_interface c6280_config =
179{
180   "maincpu"
181};
182
183178static MACHINE_CONFIG_START( ggconnie, ggconnie_state )
184179   /* basic machine hardware */
185180   MCFG_CPU_ADD("maincpu", H6280, PCE_MAIN_CLOCK/3)
r29520r29521
221216
222217   MCFG_SPEAKER_STANDARD_STEREO("lspeaker","rspeaker")
223218   MCFG_SOUND_ADD("c6280", C6280, PCE_MAIN_CLOCK/6)
224   MCFG_SOUND_CONFIG(c6280_config)
219   MCFG_C6280_CPU("maincpu")
225220   MCFG_SOUND_ROUTE(0, "lspeaker", 1.00)
226221   MCFG_SOUND_ROUTE(1, "rspeaker", 1.00)
227222

Previous 199869 Revisions Next


© 1997-2024 The MAME Team