1 // license:BSD-3-Clause
2 // copyright-holders:Brad Oliver, Nicola Salmoria
3 #ifndef MAME_AUDIO_REDBARON_H
4 #define MAME_AUDIO_REDBARON_H
5 
6 //**************************************************************************
7 //  TYPE DEFINITIONS
8 //**************************************************************************
9 
10 // ======================> redbaron_sound_device
11 
12 class redbaron_sound_device : public device_t, public device_sound_interface
13 {
14 public:
15 	redbaron_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
16 
17 	void sounds_w(uint8_t data);
18 
19 protected:
20 	// device-level overrides
21 	virtual void device_start() override;
22 
23 	// sound stream update overrides
24 	virtual void sound_stream_update(sound_stream &stream, std::vector<read_stream_view> const &inputs, std::vector<write_stream_view> &outputs) override;
25 
26 private:
27 	std::unique_ptr<int16_t[]> m_vol_lookup;
28 
29 	int16_t m_vol_crash[16];
30 
31 	sound_stream *m_channel;
32 	int m_latch;
33 	int m_poly_counter;
34 	int m_poly_shift;
35 
36 	int m_filter_counter;
37 
38 	int m_crash_amp;
39 	int m_shot_amp;
40 	int m_shot_amp_counter;
41 
42 	int m_squeal_amp;
43 	int m_squeal_amp_counter;
44 	int m_squeal_off_counter;
45 	int m_squeal_on_counter;
46 	int m_squeal_out;
47 };
48 
49 DECLARE_DEVICE_TYPE(REDBARON, redbaron_sound_device)
50 
51 #endif // MAME_AUDIO_REDBARON_H
52