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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
|
// license:BSD-3-Clause
// copyright-holders:Acho A. Tang,R. Belmont
/*********************************************************
Irem GA20 PCM Sound Chip
*********************************************************/
#pragma once
#ifndef __IREMGA20_H__
#define __IREMGA20_H__
//**************************************************************************
// INTERFACE CONFIGURATION MACROS
//**************************************************************************
#define MCFG_IREMGA20_ADD(_tag, _clock) \
MCFG_DEVICE_ADD(_tag, IREMGA20, _clock)
#define MCFG_IREMGA20_REPLACE(_tag, _clock) \
MCFG_DEVICE_REPLACE(_tag, IREMGA20, _clock)
//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
struct IremGA20_channel_def
{
UINT32 rate;
UINT32 size;
UINT32 start;
UINT32 pos;
UINT32 frac;
UINT32 end;
UINT32 volume;
UINT32 pan;
UINT32 effect;
UINT32 play;
};
// ======================> iremga20_device
class iremga20_device : public device_t,
public device_sound_interface
{
public:
iremga20_device(const machine_config &mconfig, std::string tag, device_t *owner, UINT32 clock);
~iremga20_device() { }
protected:
// device-level overrides
virtual void device_start() override;
virtual void device_reset() override;
// sound stream update overrides
virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) override;
public:
DECLARE_WRITE8_MEMBER( irem_ga20_w );
DECLARE_READ8_MEMBER( irem_ga20_r );
private:
void iremga20_reset();
private:
UINT8 *m_rom;
INT32 m_rom_size;
sound_stream *m_stream;
UINT16 m_regs[0x40];
IremGA20_channel_def m_channel[4];
};
extern const device_type IREMGA20;
#endif /* __IREMGA20_H__ */
|