Skip to content

Commit db93342

Browse files
authored
dmx.cpp, midiverb.cpp, fatman.cpp: Added _device suffix to devices. (#13334)
1 parent 24cb885 commit db93342

File tree

3 files changed

+63
-63
lines changed

3 files changed

+63
-63
lines changed

src/mame/alesis/midiverb.cpp

+11-11
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,10 @@ Audio inputs are emulated using MAME's sample playback mechanism.
7676

7777
// Emulation of the MIDIverb DSP circuit, built out of discrete logic
7878
// components.
79-
class midiverb_dsp : public device_t, public device_sound_interface
79+
class midiverb_dsp_device : public device_t, public device_sound_interface
8080
{
8181
public:
82-
midiverb_dsp(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0) ATTR_COLD;
82+
midiverb_dsp_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0) ATTR_COLD;
8383

8484
void program_select_w(u8 data);
8585

@@ -106,17 +106,17 @@ class midiverb_dsp : public device_t, public device_sound_interface
106106
static constexpr const float DAC_MAX_V = 4.8F;
107107
};
108108

109-
DEFINE_DEVICE_TYPE(MIDIVERB_DSP, midiverb_dsp, "midiverb_dsp", "MIDIverb discrete DSP");
109+
DEFINE_DEVICE_TYPE(MIDIVERB_DSP, midiverb_dsp_device, "midiverb_dsp", "MIDIverb discrete DSP");
110110

111-
midiverb_dsp::midiverb_dsp(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
111+
midiverb_dsp_device::midiverb_dsp_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
112112
: device_t(mconfig, MIDIVERB_DSP, tag, owner, clock)
113113
, device_sound_interface(mconfig, *this)
114114
, m_microcode(*this, ":dsp_microcode")
115115
, m_ram(0x4000, 0) // 16K
116116
{
117117
}
118118

119-
void midiverb_dsp::program_select_w(u8 data)
119+
void midiverb_dsp_device::program_select_w(u8 data)
120120
{
121121
const u8 new_program = data & 0x3f;
122122
if (m_program == new_program)
@@ -127,7 +127,7 @@ void midiverb_dsp::program_select_w(u8 data)
127127
LOGMASKED(LOG_PROGRAM_CHANGE, "DSP: Program changed to: %d\n", m_program);
128128
}
129129

130-
void midiverb_dsp::device_start()
130+
void midiverb_dsp_device::device_start()
131131
{
132132
// The actual sample rate works out to 23,437.5 KHz. But stream_alloc takes
133133
// a u32, and .value() will round it down to 23,437 KHz.
@@ -146,7 +146,7 @@ void midiverb_dsp::device_start()
146146
LOGMASKED(LOG_DSP_EXECUTION, __VA_ARGS__); \
147147
} while(0)
148148

149-
void midiverb_dsp::sound_stream_update(sound_stream &stream, const std::vector<read_stream_view> &inputs, std::vector<write_stream_view> &outputs)
149+
void midiverb_dsp_device::sound_stream_update(sound_stream &stream, const std::vector<read_stream_view> &inputs, std::vector<write_stream_view> &outputs)
150150
{
151151
static constexpr const u8 MAX_PC = 0x7f;
152152
static constexpr const int DEBUG_SAMPLES = 2;
@@ -264,7 +264,7 @@ void midiverb_dsp::sound_stream_update(sound_stream &stream, const std::vector<r
264264
LOGMASKED(LOG_DSP_EXECUTION, "\n");
265265
}
266266

267-
u16 midiverb_dsp::analog_to_digital(float sample) const
267+
u16 midiverb_dsp_device::analog_to_digital(float sample) const
268268
{
269269
// Analog-to-digital conversion is done with a 12-bit DAC+SAR.
270270
// Note that samples in the stream are treated as voltages (see
@@ -279,7 +279,7 @@ u16 midiverb_dsp::analog_to_digital(float sample) const
279279
return static_cast<u16>(quantized);
280280
}
281281

282-
float midiverb_dsp::digital_to_analog(u16 sample) const
282+
float midiverb_dsp_device::digital_to_analog(u16 sample) const
283283
{
284284
// Digital-to-analog conversion uses the 12-bit DAC and 1 extra bit
285285
// (LSB), for a total of 13 bits. The extra bit is implemented by
@@ -342,7 +342,7 @@ class midiverb_state : public driver_device
342342
required_ioport m_mix;
343343
required_ioport m_input_level;
344344
required_device<samples_device> m_audio_in;
345-
required_device<midiverb_dsp> m_dsp;
345+
required_device<midiverb_dsp_device> m_dsp;
346346
required_device<mixer_device> m_left_out;
347347
required_device<mixer_device> m_right_out;
348348

@@ -580,7 +580,7 @@ void midiverb_state::midiverb(machine_config &config)
580580
m_maincpu->set_addrmap(AS_IO, &midiverb_state::external_memory_map);
581581

582582
m_maincpu->port_out_cb<1>().set(FUNC(midiverb_state::digit_select_w)).mask(0x03); // P1.0-P1.1
583-
m_maincpu->port_out_cb<1>().append(m_dsp, FUNC(midiverb_dsp::program_select_w)).rshift(2); // P1.2-P1.7
583+
m_maincpu->port_out_cb<1>().append(m_dsp, FUNC(midiverb_dsp_device::program_select_w)).rshift(2); // P1.2-P1.7
584584
m_maincpu->port_in_cb<3>().set(FUNC(midiverb_state::midi_rxd_r)).mask(0x01); // P3.0
585585
m_maincpu->port_in_cb<3>().append_ioport("buttons").lshift(2).mask(0x3c); // P3.2-P3.5
586586

src/mame/oberheim/dmx.cpp

+42-42
Original file line numberDiff line numberDiff line change
@@ -173,11 +173,11 @@ struct dmx_voice_card_config
173173
// voices), and the multiplying DAC form a VCA. The gain control circuit sets
174174
// the reference current into the DAC, and the DAC multiplies that with the
175175
// 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
177177
{
178178
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;
181181

182182
void start(int trigger_mode);
183183
void decay();
@@ -209,24 +209,24 @@ class dmx_voice_card_vca : public device_t, public device_sound_interface
209209
attotime m_decay_start_time;
210210
};
211211

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");
213213

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)
215215
: device_t(mconfig, DMX_VOICE_CARD_VCA, tag, owner, 0)
216216
, device_sound_interface(mconfig, *this)
217217
, m_gain_control(!config.pitch_control)
218218
{
219219
init_gain_and_decay_variations(config);
220220
}
221221

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)
223223
: device_t(mconfig, DMX_VOICE_CARD_VCA, tag, owner, clock)
224224
, device_sound_interface(mconfig, *this)
225225
, m_gain_control(false)
226226
{
227227
}
228228

229-
void dmx_voice_card_vca::start(int trigger_mode)
229+
void dmx_voice_card_vca_device::start(int trigger_mode)
230230
{
231231
assert(trigger_mode >= 1 && trigger_mode <= 3);
232232

@@ -250,7 +250,7 @@ void dmx_voice_card_vca::start(int trigger_mode)
250250
m_selected_gain, m_selected_rc_inv);
251251
}
252252

253-
void dmx_voice_card_vca::decay()
253+
void dmx_voice_card_vca_device::decay()
254254
{
255255
assert(has_decay());
256256
if (!has_decay())
@@ -261,7 +261,7 @@ void dmx_voice_card_vca::decay()
261261
m_decay_start_time = machine().time();
262262
}
263263

264-
void dmx_voice_card_vca::device_start()
264+
void dmx_voice_card_vca_device::device_start()
265265
{
266266
m_stream = stream_alloc(1, 1, machine().sample_rate());
267267

@@ -272,15 +272,15 @@ void dmx_voice_card_vca::device_start()
272272
save_item(NAME(m_decay_start_time));
273273
}
274274

275-
void dmx_voice_card_vca::device_reset()
275+
void dmx_voice_card_vca_device::device_reset()
276276
{
277277
m_selected_gain = 1;
278278
m_decaying = false;
279279
m_decay_done = false;
280280
m_selected_rc_inv = 1;
281281
}
282282

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)
284284
{
285285
// Gain lower than MIN_GAIN will be treated as 0.
286286
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
324324
tag(), gain, in.get(0), in.get(n - 1));
325325
}
326326

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)
328328
{
329329
static constexpr const float VD = 0.6; // Diode drop.
330330
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
382382
// Emulates the original DMX voice cards, including the cymbal card. Later
383383
// DMX models shipped with the "Mark II" voice cards for the Tom voices.
384384
// 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
386386
{
387387
public:
388388
// Default value of pitch adjustment trimpot.
389389
static constexpr const s32 T1_DEFAULT_PERCENT = 50;
390390

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;
393393

394394
void trigger(bool tr0, bool tr1);
395395
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
414414

415415
required_device<timer_device> m_timer; // 555, U5.
416416
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;
418418
required_device_array<filter_biquad_device, 3> m_filters;
419419

420420
// Configuration. Do not include in save state.
@@ -430,9 +430,9 @@ class dmx_voice_card : public device_t, public device_sound_interface
430430
u8 m_trigger_mode = 0; // Valid modes: 1-3. 0 OK after reset.
431431
};
432432

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");
434434

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)
436436
: device_t(mconfig, DMX_VOICE_CARD, tag, owner, 0)
437437
, device_sound_interface(mconfig, *this)
438438
, m_timer(*this, "555_u5")
@@ -445,7 +445,7 @@ dmx_voice_card::dmx_voice_card(const machine_config &mconfig, const char *tag, d
445445
init_pitch();
446446
}
447447

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)
449449
: device_t(mconfig, DMX_VOICE_CARD, tag, owner, clock)
450450
, device_sound_interface(mconfig, *this)
451451
, m_timer(*this, "555_u5")
@@ -457,7 +457,7 @@ dmx_voice_card::dmx_voice_card(const machine_config &mconfig, const char *tag, d
457457
{
458458
}
459459

460-
void dmx_voice_card::trigger(bool tr0, bool tr1)
460+
void dmx_voice_card_device::trigger(bool tr0, bool tr1)
461461
{
462462
assert(tr0 || tr1);
463463
if (tr1 && tr0)
@@ -479,19 +479,19 @@ void dmx_voice_card::trigger(bool tr0, bool tr1)
479479
LOGMASKED(LOG_SOUND, "Trigger: (%d, %d) %d %f\n", tr0, tr1, m_trigger_mode);
480480
}
481481

482-
void dmx_voice_card::set_pitch_adj(s32 t1_percent)
482+
void dmx_voice_card_device::set_pitch_adj(s32 t1_percent)
483483
{
484484
m_stream->update();
485485
m_t1_percent = t1_percent;
486486
compute_pitch_variations();
487487
}
488488

489-
void dmx_voice_card::device_add_mconfig(machine_config &config)
489+
void dmx_voice_card_device::device_add_mconfig(machine_config &config)
490490
{
491491
static constexpr const double SK_R3 = RES_M(999.99);
492492
static constexpr const double SK_R4 = RES_R(0.001);
493493

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));
495495
DAC76(config, m_dac, 0U);
496496
DMX_VOICE_CARD_VCA(config, m_vca, m_config);
497497

@@ -513,7 +513,7 @@ void dmx_voice_card::device_add_mconfig(machine_config &config)
513513
m_filters[2]->add_route(ALL_OUTPUTS, *this, 1.0);
514514
}
515515

516-
void dmx_voice_card::device_start()
516+
void dmx_voice_card_device::device_start()
517517
{
518518
m_stream = stream_alloc(1, 1, machine().sample_rate());
519519

@@ -522,25 +522,25 @@ void dmx_voice_card::device_start()
522522
save_item(NAME(m_trigger_mode));
523523
}
524524

525-
void dmx_voice_card::device_reset()
525+
void dmx_voice_card_device::device_reset()
526526
{
527527
m_trigger_mode = 0;
528528
reset_counter();
529529
compute_pitch_variations();
530530
}
531531

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)
533533
{
534534
outputs[0] = inputs[0];
535535
}
536536

537-
void dmx_voice_card::reset_counter()
537+
void dmx_voice_card_device::reset_counter()
538538
{
539539
m_counter = 0;
540540
m_counting = false;
541541
}
542542

543-
void dmx_voice_card::init_pitch()
543+
void dmx_voice_card_device::init_pitch()
544544
{
545545
// Precompute all variations of CV (pin 5 of 555 timer).
546546

@@ -582,7 +582,7 @@ void dmx_voice_card::init_pitch()
582582
m_sample_t.resize(m_cv.size());
583583
}
584584

585-
void dmx_voice_card::compute_pitch_variations()
585+
void dmx_voice_card_device::compute_pitch_variations()
586586
{
587587
static constexpr const float R3 = RES_K(1);
588588
static constexpr const float R4 = RES_K(10);
@@ -645,7 +645,7 @@ void dmx_voice_card::compute_pitch_variations()
645645
select_pitch();
646646
}
647647

648-
void dmx_voice_card::select_pitch()
648+
void dmx_voice_card_device::select_pitch()
649649
{
650650
attotime sampling_t;
651651
if (m_config.pitch_control)
@@ -661,7 +661,7 @@ void dmx_voice_card::select_pitch()
661661
1.0 / sampling_t.as_double());
662662
}
663663

664-
bool dmx_voice_card::is_decay_enabled() const
664+
bool dmx_voice_card_device::is_decay_enabled() const
665665
{
666666
switch (m_config.decay)
667667
{
@@ -675,7 +675,7 @@ bool dmx_voice_card::is_decay_enabled() const
675675
return false;
676676
}
677677

678-
bool dmx_voice_card::is_early_decay_enabled() const
678+
bool dmx_voice_card_device::is_early_decay_enabled() const
679679
{
680680
switch (m_config.early_decay)
681681
{
@@ -687,7 +687,7 @@ bool dmx_voice_card::is_early_decay_enabled() const
687687
return false;
688688
}
689689

690-
TIMER_DEVICE_CALLBACK_MEMBER(dmx_voice_card::clock_callback)
690+
TIMER_DEVICE_CALLBACK_MEMBER(dmx_voice_card_device::clock_callback)
691691
{
692692
if (!m_counting)
693693
return;
@@ -970,7 +970,7 @@ class dmx_state : public driver_device
970970
output_finder<> m_metronome_mix;
971971
output_finder<> m_metronome;
972972

973-
required_device_array<dmx_voice_card, 8> m_voices;
973+
required_device_array<dmx_voice_card_device, 8> m_voices;
974974
required_device<mixer_device> m_left_mixer;
975975
required_device<mixer_device> m_right_mixer;
976976
required_device<speaker_device> m_left_speaker;
@@ -1575,35 +1575,35 @@ INPUT_PORTS_START(dmx)
15751575
// as "PITCH ADJ."
15761576

15771577
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")
15791579
PORT_CHANGED_MEMBER(DEVICE_SELF, FUNC(dmx_state::pitch_adj_changed), dmx_state::VC_BASS)
15801580

15811581
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")
15831583
PORT_CHANGED_MEMBER(DEVICE_SELF, FUNC(dmx_state::pitch_adj_changed), dmx_state::VC_SNARE)
15841584

15851585
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")
15871587
PORT_CHANGED_MEMBER(DEVICE_SELF, FUNC(dmx_state::pitch_adj_changed), dmx_state::VC_HIHAT)
15881588

15891589
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")
15911591
PORT_CHANGED_MEMBER(DEVICE_SELF, FUNC(dmx_state::pitch_adj_changed), dmx_state::VC_SMALL_TOMS)
15921592

15931593
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")
15951595
PORT_CHANGED_MEMBER(DEVICE_SELF, FUNC(dmx_state::pitch_adj_changed), dmx_state::VC_LARGE_TOMS)
15961596

15971597
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")
15991599
PORT_CHANGED_MEMBER(DEVICE_SELF, FUNC(dmx_state::pitch_adj_changed), dmx_state::VC_CYMBAL)
16001600

16011601
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")
16031603
PORT_CHANGED_MEMBER(DEVICE_SELF, FUNC(dmx_state::pitch_adj_changed), dmx_state::VC_PERC1)
16041604

16051605
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")
16071607
PORT_CHANGED_MEMBER(DEVICE_SELF, FUNC(dmx_state::pitch_adj_changed), dmx_state::VC_PERC2)
16081608
INPUT_PORTS_END
16091609

0 commit comments

Comments
 (0)