blob: c61ac5a4910a1d517e96dcc6a82d22df79bd19bd (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
// license: BSD-3-Clause
// copyright-holders: Dirk Best
/***************************************************************************
NEC μPD934G
Percussion Generator
***************************************************************************/
#ifndef MAME_SOUND_UPD934G_H
#define MAME_SOUND_UPD934G_H
#pragma once
//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
class upd934g_device : public device_t, public device_sound_interface
{
public:
static constexpr feature_type imperfect_features() { return feature::SOUND; }
// construction/destruction
upd934g_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// configuration
auto data_callback() { return m_data_cb.bind(); }
void write(offs_t offset, uint8_t data);
protected:
// device-level overrides
virtual void device_start() override;
virtual void device_reset() override;
virtual void sound_stream_update(sound_stream &stream, std::vector<read_stream_view> const &inputs, std::vector<write_stream_view> &outputs) override;
private:
devcb_read8 m_data_cb;
sound_stream *m_stream;
uint16_t m_addr[16];
struct
{
uint16_t pos;
int playing;
int volume;
}
m_channel[4];
int m_sample;
bool m_ready;
};
// device type definition
DECLARE_DEVICE_TYPE(UPD934G, upd934g_device)
#endif // MAME_SOUND_UPD934G_H
|