@@ -173,11 +173,11 @@ struct dmx_voice_card_config
173
173
// voices), and the multiplying DAC form a VCA. The gain control circuit sets
174
174
// the reference current into the DAC, and the DAC multiplies that with the
175
175
// digital value to produce and output current.
176
- class dmx_voice_card_vca : public device_t , public device_sound_interface
176
+ class dmx_voice_card_vca_device : public device_t , public device_sound_interface
177
177
{
178
178
public:
179
- dmx_voice_card_vca (const machine_config &mconfig, const char *tag, device_t *owner, const dmx_voice_card_config &config) ATTR_COLD;
180
- dmx_voice_card_vca (const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0 ) ATTR_COLD;
179
+ dmx_voice_card_vca_device (const machine_config &mconfig, const char *tag, device_t *owner, const dmx_voice_card_config &config) ATTR_COLD;
180
+ dmx_voice_card_vca_device (const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0 ) ATTR_COLD;
181
181
182
182
void start (int trigger_mode);
183
183
void decay ();
@@ -209,24 +209,24 @@ class dmx_voice_card_vca : public device_t, public device_sound_interface
209
209
attotime m_decay_start_time;
210
210
};
211
211
212
- DEFINE_DEVICE_TYPE (DMX_VOICE_CARD_VCA, dmx_voice_card_vca , " dmx_voice_card_vca" , " DMX Voice Card VCA" );
212
+ DEFINE_DEVICE_TYPE (DMX_VOICE_CARD_VCA, dmx_voice_card_vca_device , " dmx_voice_card_vca" , " DMX Voice Card VCA" );
213
213
214
- dmx_voice_card_vca::dmx_voice_card_vca (const machine_config &mconfig, const char *tag, device_t *owner, const dmx_voice_card_config &config)
214
+ dmx_voice_card_vca_device::dmx_voice_card_vca_device (const machine_config &mconfig, const char *tag, device_t *owner, const dmx_voice_card_config &config)
215
215
: device_t(mconfig, DMX_VOICE_CARD_VCA, tag, owner, 0 )
216
216
, device_sound_interface(mconfig, *this )
217
217
, m_gain_control(!config.pitch_control)
218
218
{
219
219
init_gain_and_decay_variations (config);
220
220
}
221
221
222
- dmx_voice_card_vca::dmx_voice_card_vca (const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
222
+ dmx_voice_card_vca_device::dmx_voice_card_vca_device (const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
223
223
: device_t(mconfig, DMX_VOICE_CARD_VCA, tag, owner, clock)
224
224
, device_sound_interface(mconfig, *this )
225
225
, m_gain_control(false )
226
226
{
227
227
}
228
228
229
- void dmx_voice_card_vca ::start (int trigger_mode)
229
+ void dmx_voice_card_vca_device ::start (int trigger_mode)
230
230
{
231
231
assert (trigger_mode >= 1 && trigger_mode <= 3 );
232
232
@@ -250,7 +250,7 @@ void dmx_voice_card_vca::start(int trigger_mode)
250
250
m_selected_gain, m_selected_rc_inv);
251
251
}
252
252
253
- void dmx_voice_card_vca ::decay ()
253
+ void dmx_voice_card_vca_device ::decay ()
254
254
{
255
255
assert (has_decay ());
256
256
if (!has_decay ())
@@ -261,7 +261,7 @@ void dmx_voice_card_vca::decay()
261
261
m_decay_start_time = machine ().time ();
262
262
}
263
263
264
- void dmx_voice_card_vca ::device_start ()
264
+ void dmx_voice_card_vca_device ::device_start ()
265
265
{
266
266
m_stream = stream_alloc (1 , 1 , machine ().sample_rate ());
267
267
@@ -272,15 +272,15 @@ void dmx_voice_card_vca::device_start()
272
272
save_item (NAME (m_decay_start_time));
273
273
}
274
274
275
- void dmx_voice_card_vca ::device_reset ()
275
+ void dmx_voice_card_vca_device ::device_reset ()
276
276
{
277
277
m_selected_gain = 1 ;
278
278
m_decaying = false ;
279
279
m_decay_done = false ;
280
280
m_selected_rc_inv = 1 ;
281
281
}
282
282
283
- void dmx_voice_card_vca ::sound_stream_update (sound_stream &stream, const std::vector<read_stream_view> &inputs, std::vector<write_stream_view> &outputs)
283
+ void dmx_voice_card_vca_device ::sound_stream_update (sound_stream &stream, const std::vector<read_stream_view> &inputs, std::vector<write_stream_view> &outputs)
284
284
{
285
285
// Gain lower than MIN_GAIN will be treated as 0.
286
286
static constexpr const float MIN_GAIN = 0 .0001F ;
@@ -324,7 +324,7 @@ void dmx_voice_card_vca::sound_stream_update(sound_stream &stream, const std::ve
324
324
tag (), gain, in.get (0 ), in.get (n - 1 ));
325
325
}
326
326
327
- void dmx_voice_card_vca ::init_gain_and_decay_variations (const dmx_voice_card_config &config)
327
+ void dmx_voice_card_vca_device ::init_gain_and_decay_variations (const dmx_voice_card_config &config)
328
328
{
329
329
static constexpr const float VD = 0.6 ; // Diode drop.
330
330
static constexpr const float R8 = RES_K (2.7 );
@@ -382,14 +382,14 @@ void dmx_voice_card_vca::init_gain_and_decay_variations(const dmx_voice_card_con
382
382
// Emulates the original DMX voice cards, including the cymbal card. Later
383
383
// DMX models shipped with the "Mark II" voice cards for the Tom voices.
384
384
// The Mark II cards are not yet emulated.
385
- class dmx_voice_card : public device_t , public device_sound_interface
385
+ class dmx_voice_card_device : public device_t , public device_sound_interface
386
386
{
387
387
public:
388
388
// Default value of pitch adjustment trimpot.
389
389
static constexpr const s32 T1_DEFAULT_PERCENT = 50 ;
390
390
391
- dmx_voice_card (const machine_config &mconfig, const char *tag, device_t *owner, const dmx_voice_card_config &config, required_memory_region *sample_rom) ATTR_COLD;
392
- dmx_voice_card (const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0 ) ATTR_COLD;
391
+ dmx_voice_card_device (const machine_config &mconfig, const char *tag, device_t *owner, const dmx_voice_card_config &config, required_memory_region *sample_rom) ATTR_COLD;
392
+ dmx_voice_card_device (const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0 ) ATTR_COLD;
393
393
394
394
void trigger (bool tr0, bool tr1);
395
395
void set_pitch_adj (s32 t1_percent); // Valid values: 0-100.
@@ -414,7 +414,7 @@ class dmx_voice_card : public device_t, public device_sound_interface
414
414
415
415
required_device<timer_device> m_timer; // 555, U5.
416
416
required_device<dac76_device> m_dac; // AM6070, U8. Compatible with DAC76.
417
- required_device<dmx_voice_card_vca > m_vca;
417
+ required_device<dmx_voice_card_vca_device > m_vca;
418
418
required_device_array<filter_biquad_device, 3 > m_filters;
419
419
420
420
// Configuration. Do not include in save state.
@@ -430,9 +430,9 @@ class dmx_voice_card : public device_t, public device_sound_interface
430
430
u8 m_trigger_mode = 0 ; // Valid modes: 1-3. 0 OK after reset.
431
431
};
432
432
433
- DEFINE_DEVICE_TYPE (DMX_VOICE_CARD, dmx_voice_card , " dmx_voice_card" , " DMX Voice Card" );
433
+ DEFINE_DEVICE_TYPE (DMX_VOICE_CARD, dmx_voice_card_device , " dmx_voice_card" , " DMX Voice Card" );
434
434
435
- dmx_voice_card::dmx_voice_card (const machine_config &mconfig, const char *tag, device_t *owner, const dmx_voice_card_config &config, required_memory_region *sample_rom)
435
+ dmx_voice_card_device::dmx_voice_card_device (const machine_config &mconfig, const char *tag, device_t *owner, const dmx_voice_card_config &config, required_memory_region *sample_rom)
436
436
: device_t(mconfig, DMX_VOICE_CARD, tag, owner, 0 )
437
437
, device_sound_interface(mconfig, *this )
438
438
, m_timer(*this , " 555_u5" )
@@ -445,7 +445,7 @@ dmx_voice_card::dmx_voice_card(const machine_config &mconfig, const char *tag, d
445
445
init_pitch ();
446
446
}
447
447
448
- dmx_voice_card::dmx_voice_card (const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
448
+ dmx_voice_card_device::dmx_voice_card_device (const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
449
449
: device_t(mconfig, DMX_VOICE_CARD, tag, owner, clock)
450
450
, device_sound_interface(mconfig, *this )
451
451
, m_timer(*this , " 555_u5" )
@@ -457,7 +457,7 @@ dmx_voice_card::dmx_voice_card(const machine_config &mconfig, const char *tag, d
457
457
{
458
458
}
459
459
460
- void dmx_voice_card ::trigger (bool tr0, bool tr1)
460
+ void dmx_voice_card_device ::trigger (bool tr0, bool tr1)
461
461
{
462
462
assert (tr0 || tr1);
463
463
if (tr1 && tr0)
@@ -479,19 +479,19 @@ void dmx_voice_card::trigger(bool tr0, bool tr1)
479
479
LOGMASKED (LOG_SOUND, " Trigger: (%d, %d) %d %f\n " , tr0, tr1, m_trigger_mode);
480
480
}
481
481
482
- void dmx_voice_card ::set_pitch_adj (s32 t1_percent)
482
+ void dmx_voice_card_device ::set_pitch_adj (s32 t1_percent)
483
483
{
484
484
m_stream->update ();
485
485
m_t1_percent = t1_percent;
486
486
compute_pitch_variations ();
487
487
}
488
488
489
- void dmx_voice_card ::device_add_mconfig (machine_config &config)
489
+ void dmx_voice_card_device ::device_add_mconfig (machine_config &config)
490
490
{
491
491
static constexpr const double SK_R3 = RES_M (999.99 );
492
492
static constexpr const double SK_R4 = RES_R (0.001 );
493
493
494
- TIMER (config, m_timer).configure_generic (FUNC (dmx_voice_card ::clock_callback));
494
+ TIMER (config, m_timer).configure_generic (FUNC (dmx_voice_card_device ::clock_callback));
495
495
DAC76 (config, m_dac, 0U );
496
496
DMX_VOICE_CARD_VCA (config, m_vca, m_config);
497
497
@@ -513,7 +513,7 @@ void dmx_voice_card::device_add_mconfig(machine_config &config)
513
513
m_filters[2 ]->add_route (ALL_OUTPUTS, *this , 1.0 );
514
514
}
515
515
516
- void dmx_voice_card ::device_start ()
516
+ void dmx_voice_card_device ::device_start ()
517
517
{
518
518
m_stream = stream_alloc (1 , 1 , machine ().sample_rate ());
519
519
@@ -522,25 +522,25 @@ void dmx_voice_card::device_start()
522
522
save_item (NAME (m_trigger_mode));
523
523
}
524
524
525
- void dmx_voice_card ::device_reset ()
525
+ void dmx_voice_card_device ::device_reset ()
526
526
{
527
527
m_trigger_mode = 0 ;
528
528
reset_counter ();
529
529
compute_pitch_variations ();
530
530
}
531
531
532
- void dmx_voice_card ::sound_stream_update (sound_stream &stream, const std::vector<read_stream_view> &inputs, std::vector<write_stream_view> &outputs)
532
+ void dmx_voice_card_device ::sound_stream_update (sound_stream &stream, const std::vector<read_stream_view> &inputs, std::vector<write_stream_view> &outputs)
533
533
{
534
534
outputs[0 ] = inputs[0 ];
535
535
}
536
536
537
- void dmx_voice_card ::reset_counter ()
537
+ void dmx_voice_card_device ::reset_counter ()
538
538
{
539
539
m_counter = 0 ;
540
540
m_counting = false ;
541
541
}
542
542
543
- void dmx_voice_card ::init_pitch ()
543
+ void dmx_voice_card_device ::init_pitch ()
544
544
{
545
545
// Precompute all variations of CV (pin 5 of 555 timer).
546
546
@@ -582,7 +582,7 @@ void dmx_voice_card::init_pitch()
582
582
m_sample_t .resize (m_cv.size ());
583
583
}
584
584
585
- void dmx_voice_card ::compute_pitch_variations ()
585
+ void dmx_voice_card_device ::compute_pitch_variations ()
586
586
{
587
587
static constexpr const float R3 = RES_K (1 );
588
588
static constexpr const float R4 = RES_K (10 );
@@ -645,7 +645,7 @@ void dmx_voice_card::compute_pitch_variations()
645
645
select_pitch ();
646
646
}
647
647
648
- void dmx_voice_card ::select_pitch ()
648
+ void dmx_voice_card_device ::select_pitch ()
649
649
{
650
650
attotime sampling_t ;
651
651
if (m_config.pitch_control )
@@ -661,7 +661,7 @@ void dmx_voice_card::select_pitch()
661
661
1.0 / sampling_t .as_double ());
662
662
}
663
663
664
- bool dmx_voice_card ::is_decay_enabled () const
664
+ bool dmx_voice_card_device ::is_decay_enabled () const
665
665
{
666
666
switch (m_config.decay )
667
667
{
@@ -675,7 +675,7 @@ bool dmx_voice_card::is_decay_enabled() const
675
675
return false ;
676
676
}
677
677
678
- bool dmx_voice_card ::is_early_decay_enabled () const
678
+ bool dmx_voice_card_device ::is_early_decay_enabled () const
679
679
{
680
680
switch (m_config.early_decay )
681
681
{
@@ -687,7 +687,7 @@ bool dmx_voice_card::is_early_decay_enabled() const
687
687
return false ;
688
688
}
689
689
690
- TIMER_DEVICE_CALLBACK_MEMBER (dmx_voice_card ::clock_callback)
690
+ TIMER_DEVICE_CALLBACK_MEMBER (dmx_voice_card_device ::clock_callback)
691
691
{
692
692
if (!m_counting)
693
693
return ;
@@ -970,7 +970,7 @@ class dmx_state : public driver_device
970
970
output_finder<> m_metronome_mix;
971
971
output_finder<> m_metronome;
972
972
973
- required_device_array<dmx_voice_card , 8 > m_voices;
973
+ required_device_array<dmx_voice_card_device , 8 > m_voices;
974
974
required_device<mixer_device> m_left_mixer;
975
975
required_device<mixer_device> m_right_mixer;
976
976
required_device<speaker_device> m_left_speaker;
@@ -1575,35 +1575,35 @@ INPUT_PORTS_START(dmx)
1575
1575
// as "PITCH ADJ."
1576
1576
1577
1577
PORT_START (" pitch_adj_1" )
1578
- PORT_ADJUSTER (dmx_voice_card ::T1_DEFAULT_PERCENT, " BASS pitch" )
1578
+ PORT_ADJUSTER (dmx_voice_card_device ::T1_DEFAULT_PERCENT, " BASS pitch" )
1579
1579
PORT_CHANGED_MEMBER (DEVICE_SELF, FUNC(dmx_state::pitch_adj_changed), dmx_state::VC_BASS)
1580
1580
1581
1581
PORT_START (" pitch_adj_2" )
1582
- PORT_ADJUSTER (dmx_voice_card ::T1_DEFAULT_PERCENT, " SNARE pitch" )
1582
+ PORT_ADJUSTER (dmx_voice_card_device ::T1_DEFAULT_PERCENT, " SNARE pitch" )
1583
1583
PORT_CHANGED_MEMBER (DEVICE_SELF, FUNC(dmx_state::pitch_adj_changed), dmx_state::VC_SNARE)
1584
1584
1585
1585
PORT_START (" pitch_adj_3" )
1586
- PORT_ADJUSTER (dmx_voice_card ::T1_DEFAULT_PERCENT, " HI-HAT pitch" )
1586
+ PORT_ADJUSTER (dmx_voice_card_device ::T1_DEFAULT_PERCENT, " HI-HAT pitch" )
1587
1587
PORT_CHANGED_MEMBER (DEVICE_SELF, FUNC(dmx_state::pitch_adj_changed), dmx_state::VC_HIHAT)
1588
1588
1589
1589
PORT_START (" pitch_adj_4" )
1590
- PORT_ADJUSTER (dmx_voice_card ::T1_DEFAULT_PERCENT, " TOM1 pitch" )
1590
+ PORT_ADJUSTER (dmx_voice_card_device ::T1_DEFAULT_PERCENT, " TOM1 pitch" )
1591
1591
PORT_CHANGED_MEMBER (DEVICE_SELF, FUNC(dmx_state::pitch_adj_changed), dmx_state::VC_SMALL_TOMS)
1592
1592
1593
1593
PORT_START (" pitch_adj_5" )
1594
- PORT_ADJUSTER (dmx_voice_card ::T1_DEFAULT_PERCENT, " TOM2 pitch" )
1594
+ PORT_ADJUSTER (dmx_voice_card_device ::T1_DEFAULT_PERCENT, " TOM2 pitch" )
1595
1595
PORT_CHANGED_MEMBER (DEVICE_SELF, FUNC(dmx_state::pitch_adj_changed), dmx_state::VC_LARGE_TOMS)
1596
1596
1597
1597
PORT_START (" pitch_adj_6" )
1598
- PORT_ADJUSTER (dmx_voice_card ::T1_DEFAULT_PERCENT, " CYMBAL pitch" )
1598
+ PORT_ADJUSTER (dmx_voice_card_device ::T1_DEFAULT_PERCENT, " CYMBAL pitch" )
1599
1599
PORT_CHANGED_MEMBER (DEVICE_SELF, FUNC(dmx_state::pitch_adj_changed), dmx_state::VC_CYMBAL)
1600
1600
1601
1601
PORT_START (" pitch_adj_7" )
1602
- PORT_ADJUSTER (dmx_voice_card ::T1_DEFAULT_PERCENT, " PERC1 pitch" )
1602
+ PORT_ADJUSTER (dmx_voice_card_device ::T1_DEFAULT_PERCENT, " PERC1 pitch" )
1603
1603
PORT_CHANGED_MEMBER (DEVICE_SELF, FUNC(dmx_state::pitch_adj_changed), dmx_state::VC_PERC1)
1604
1604
1605
1605
PORT_START (" pitch_adj_8" )
1606
- PORT_ADJUSTER (dmx_voice_card ::T1_DEFAULT_PERCENT, " PERC2 pitch" )
1606
+ PORT_ADJUSTER (dmx_voice_card_device ::T1_DEFAULT_PERCENT, " PERC2 pitch" )
1607
1607
PORT_CHANGED_MEMBER (DEVICE_SELF, FUNC(dmx_state::pitch_adj_changed), dmx_state::VC_PERC2)
1608
1608
INPUT_PORTS_END
1609
1609
0 commit comments