blob: 88c5fad08fd116b8691b03c5aa87b0a72eb1b68c (
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
|
// license:BSD-3-Clause
// copyright-holders:Curt Coder
/**********************************************************************
Diag264 User Port Loop Back Connector emulation
Copyright MESS Team.
Visit http://mamedev.org for licensing and usage restrictions.
**********************************************************************/
#pragma once
#ifndef __DIAG264_USER_PORT_LOOPBACK__
#define __DIAG264_USER_PORT_LOOPBACK__
#include "emu.h"
#include "machine/plus4user.h"
//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
// ======================> diag264_user_port_loopback_device
class diag264_user_port_loopback_device : public device_t,
public device_plus4_user_port_interface
{
public:
// construction/destruction
diag264_user_port_loopback_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
protected:
// device-level overrides
virtual void device_start();
// device_plus4_user_port_interface overrides
virtual UINT8 plus4_p_r() { logerror("P read %02x\n", ((m_p << 4) & 0xf0) | (m_p >> 4)); return ((m_p << 4) & 0xf0) | (m_p >> 4); }
virtual void plus4_p_w(UINT8 data) { logerror("P write %02x\n", data); m_p = data; }
virtual int plus4_rxd_r() { return m_txd; }
virtual int plus4_dcd_r() { return m_dtr; }
virtual int plus4_dsr_r() { return m_rts; }
virtual void plus4_txd_w(int state) { m_txd = state; }
virtual void plus4_dtr_w(int state) { m_dtr = state; }
virtual void plus4_rts_w(int state) { m_rts = state; }
private:
UINT8 m_p;
int m_txd;
int m_rts;
int m_dtr;
};
// device type definition
extern const device_type DIAG264_USER_PORT_LOOPBACK;
#endif
|