summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/sound/n63701x.h
blob: 0bb48b5afc88f50c09f29351bd33e33f168f87e8 (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
// license:BSD-3-Clause
// copyright-holders:Nicola Salmoria
#ifndef MAME_SOUND_N63701X_H
#define MAME_SOUND_N63701X_H

#pragma once

//**************************************************************************
//  TYPE DEFINITIONS
//**************************************************************************


// ======================> namco_63701x_device

class namco_63701x_device : public device_t,
							public device_sound_interface
{
public:
	namco_63701x_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);

	void write(offs_t offset, uint8_t data);

protected:
	// device-level overrides
	virtual void device_start() override;

	// sound stream update overrides
	virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) override;

private:
	struct voice_63701x
	{
		voice_63701x() { }

		int select          = 0;
		int playing         = 0;
		int base_addr       = 0;
		int position        = 0;
		int volume          = 0;
		int silence_counter = 0;
	};

	required_region_ptr<uint8_t> m_rom;
	voice_63701x m_voices[2];
	sound_stream *m_stream; /* channel assigned by the mixer */
};

DECLARE_DEVICE_TYPE(NAMCO_63701X, namco_63701x_device)

#endif // MAME_SOUND_N63701X_H