summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/msx_cart/msx_audio_kb.h
blob: 25f0a2d24f89dae65530c979596ed691f60c350f (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
// license:BSD-3-Clause
// copyright-holders:Wilbert Pol
#ifndef MAME_BUS_MSX_CART_MSX_AUDIO_KB_H
#define MAME_BUS_MSX_CART_MSX_AUDIO_KB_H

#pragma once

DECLARE_DEVICE_TYPE(MSX_AUDIO_KBDC_PORT, msx_audio_kbdc_port_device)

class msx_audio_kb_port_interface : public device_slot_card_interface
{
public:

	virtual DECLARE_READ8_MEMBER(read) { return 0xff; }
	virtual DECLARE_WRITE8_MEMBER(write) { }

protected:
	// construction/destruction
	using device_slot_card_interface::device_slot_card_interface;
};


class msx_audio_kbdc_port_device : public device_t, public device_slot_interface
{
public:
	// construction/destruction
	template <typename T>
	msx_audio_kbdc_port_device(machine_config const &mconfig, char const *tag, device_t *owner, T &&opts, char const *dflt)
		: msx_audio_kbdc_port_device(mconfig, tag, owner, (uint32_t)0)
	{
		option_reset();
		opts(*this);
		set_default_option(dflt);
		set_fixed(false);
	}
	msx_audio_kbdc_port_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);

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

	// Physical connection simply consists of 8 input and 8 output lines split across 2 connectors
	DECLARE_WRITE8_MEMBER(write);
	DECLARE_READ8_MEMBER(read);


protected:
	msx_audio_kb_port_interface *m_keyboard;
};


void msx_audio_keyboards(device_slot_interface &device);


#endif // MAME_BUS_MSX_CART_MSX_AUDIO_KB_H