blob: e8cea1a516d59ffdea958afcc615e2c3b5d4d9c2 (
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
62
63
64
65
66
67
68
69
70
71
72
73
|
// license:GPL-2.0+
// copyright-holders:Dirk Best
/***************************************************************************
ACT Apricot Keyboard (HLE)
***************************************************************************/
#pragma once
#ifndef __APRICOTKB_HLE__
#define __APRICOTKB_HLE__
#include "emu.h"
//**************************************************************************
// INTERFACE CONFIGURATION MACROS
//**************************************************************************
#define MCFG_APRICOT_KEYBOARD_ADD(_tag) \
MCFG_DEVICE_ADD(_tag, APRICOT_KEYBOARD_HLE, 0)
#define MCFG_APRICOT_KEYBOARD_TXD_HANDLER(_write) \
devcb = &apricot_keyboard_hle_device::set_txd_handler(*device, DEVCB_##_write);
//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
// ======================> apricot_keyboard_hle_device
class apricot_keyboard_hle_device : public device_t, public device_serial_interface
{
public:
// construction/destruction
apricot_keyboard_hle_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
template<class _Object> static devcb_base &set_txd_handler(device_t &device, _Object object)
{ return downcast<apricot_keyboard_hle_device &>(device).m_txd_handler.set_callback(object); }
DECLARE_WRITE_LINE_MEMBER(rxd_w);
DECLARE_INPUT_CHANGED_MEMBER(key_callback);
protected:
// device_t overrides
virtual ioport_constructor device_input_ports() const;
virtual void device_start();
virtual void device_reset();
// device_serial_interface overrides
virtual void tra_callback();
virtual void tra_complete();
virtual void rcv_callback();
virtual void rcv_complete();
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
private:
devcb_write_line m_txd_handler;
int m_rxd;
UINT8 m_data_in;
UINT8 m_data_out;
};
// device type definition
extern const device_type APRICOT_KEYBOARD_HLE;
#endif // __APRICOTKB_HLE__
|