1 // license:BSD-3-Clause
2 // copyright-holders:Nigel Barnes
3 /**********************************************************************
4 
5     Hybrid Music 4000 Keyboard
6 
7     https://www.retro-kit.co.uk/page.cfm/content/Hybrid-Music-4000-Keyboard/
8     http://chrisacorns.computinghistory.org.uk/8bit_Upgrades/Hybrid_Music4000.html
9 
10 **********************************************************************/
11 
12 
13 #ifndef MAME_BUS_BBC_USERPORT_M4000_H
14 #define MAME_BUS_BBC_USERPORT_M4000_H
15 
16 #pragma once
17 
18 #include "userport.h"
19 
20 //**************************************************************************
21 //  TYPE DEFINITIONS
22 //**************************************************************************
23 
24 // ======================> bbc_m4000_device
25 
26 class bbc_m4000_device :
27 	public device_t,
28 	public device_bbc_userport_interface
29 {
30 public:
31 	// construction/destruction
32 	bbc_m4000_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
33 
34 protected:
35 	// device-level overrides
36 	virtual void device_start() override;
37 
38 	// optional information overrides
39 	virtual ioport_constructor device_input_ports() const override;
40 
41 	virtual uint8_t pb_r() override;
42 	virtual void write_cb1(int state) override;
43 	virtual void write_cb2(int state) override;
44 
45 private:
46 	required_ioport_array<8> m_kbd;
47 
48 	int m_clk;
49 	int m_dsb;
50 	uint8_t m_out;
51 };
52 
53 
54 // device type definition
55 DECLARE_DEVICE_TYPE(BBC_M4000, bbc_m4000_device)
56 
57 
58 #endif // MAME_BUS_BBC_USERPORT_M4000_H
59