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
|
// license:BSD-3-Clause
// copyright-holders:Philip Bennett
/***************************************************************************
Capcom CPS-3 Sound Hardware
****************************************************************************/
#ifndef MAME_AUDIO_CPS3_H
#define MAME_AUDIO_CPS3_H
#pragma once
//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
struct cps3_voice
{
cps3_voice() :
pos(0),
frac(0)
{
memset(regs, 0, sizeof(uint32_t)*8);
}
uint32_t regs[8];
uint32_t pos;
uint32_t frac;
};
// ======================> cps3_sound_device
class cps3_sound_device : public device_t, public device_sound_interface
{
public:
cps3_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
~cps3_sound_device() { }
void set_base(int8_t* base) { m_base = base; }
void sound_w(offs_t offset, uint32_t data, uint32_t mem_mask = ~0);
uint32_t sound_r(offs_t offset, uint32_t mem_mask = ~0);
protected:
// device-level overrides
virtual void device_start() override;
// sound stream update overrides
virtual void sound_stream_update(sound_stream &stream, std::vector<read_stream_view> const &inputs, std::vector<write_stream_view> &outputs) override;
private:
sound_stream *m_stream;
cps3_voice m_voice[16];
uint16_t m_key;
int8_t* m_base;
};
DECLARE_DEVICE_TYPE(CPS3, cps3_sound_device)
#endif // MAME_AUDIO_CPS3_H
|