summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/epson_qx/sound_card.h
blob: 61d1a8a4ed1555ca3a01f1fcfffa266bc0eafe5c (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
// license:BSD-3-Clause
// copyright-holders:Brian Johnson
/*******************************************************************
 *
 * YM2149 based sound card with header for an external MPU401
 *
 *******************************************************************/

#ifndef MAME_BUS_EPSON_QX_SOUND_CARD_H
#define MAME_BUS_EPSON_QX_SOUND_CARD_H

#pragma once

#include "option.h"

#include "machine/mpu401.h"
#include "sound/ay8910.h"

namespace bus::epson_qx {

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

/* YM2149 Sound Card Device */

class ym2149_sound_card_device : public device_t, public device_option_expansion_interface
{
public:
	// construction/destruction
	ym2149_sound_card_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);

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

	// optional information overrides
	virtual void device_add_mconfig(machine_config &config) override ATTR_COLD;
	virtual ioport_constructor device_input_ports() const override ATTR_COLD;

	void map(address_map &map) ATTR_COLD;

private:
	uint8_t m_irqline;
	void mpu_irq_out(int state);

	required_device<mpu401_device> m_mpu401;
	required_device<ym2149_device> m_ssg;
	required_ioport m_iobase;
	required_ioport m_irq;
	bool m_installed;
};

} // namespace bus::epson_qx

// device type definition
DECLARE_DEVICE_TYPE_NS(EPSON_QX_OPTION_YM2149, bus::epson_qx, ym2149_sound_card_device)


#endif // MAME_BUS_EPSON_QX_SOUND_CARD_H