blob: 04f6c1eb18f67391e7ddeb28929c4708fa71e088 (
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
|
// 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_interface
{
public:
virtual uint8_t read() { return 0xff; }
virtual void write(uint8_t data) { }
protected:
// construction/destruction
msx_audio_kb_port_interface(machine_config const &mconfig, device_t &device);
};
class msx_audio_kbdc_port_device : public device_t, public device_single_card_slot_interface<msx_audio_kb_port_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)
{
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, const XTAL &clock);
// Physical connection simply consists of 8 input and 8 output lines split across 2 connectors
void write(uint8_t data);
uint8_t read();
protected:
// device-level overrides
virtual void device_start() override;
msx_audio_kb_port_interface *m_keyboard;
};
void msx_audio_keyboards(device_slot_interface &device);
#endif // MAME_BUS_MSX_CART_MSX_AUDIO_KB_H
|