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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
|
// license:GPL-2.0+
// copyright-holders:Dirk Best
/***************************************************************************
EACA Colour Genie Parallel Slot
20-pin slot
***************************************************************************/
#include "parallel.h"
//**************************************************************************
// DEVICE DEFINITIONS
//**************************************************************************
const device_type PARALLEL_SLOT = &device_creator<parallel_slot_device>;
//**************************************************************************
// SLOT DEVICE
//**************************************************************************
//-------------------------------------------------
// parallel_slot_device - constructor
//-------------------------------------------------
parallel_slot_device::parallel_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
device_t(mconfig, PARALLEL_SLOT, "Parallel Slot", tag, owner, clock, "parallel_slot", __FILE__),
device_slot_interface(mconfig, *this),
m_cart(nullptr)
{
}
//-------------------------------------------------
// parallel_slot_device - destructor
//-------------------------------------------------
parallel_slot_device::~parallel_slot_device()
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void parallel_slot_device::device_start()
{
m_cart = dynamic_cast<device_parallel_interface *>(get_card_device());
}
//-------------------------------------------------
// device_reset - device-specific reset
//-------------------------------------------------
void parallel_slot_device::device_reset()
{
}
//**************************************************************************
// I/O PORTS
//**************************************************************************
READ8_MEMBER( parallel_slot_device::pa_r )
{
if (m_cart)
return m_cart->pa_r();
else
return 0xff;
}
WRITE8_MEMBER( parallel_slot_device::pa_w )
{
if (m_cart)
m_cart->pa_w(data);
}
READ8_MEMBER( parallel_slot_device::pb_r )
{
if (m_cart)
return m_cart->pb_r();
else
return 0xff;
}
WRITE8_MEMBER( parallel_slot_device::pb_w )
{
if (m_cart)
m_cart->pb_w(data);
}
//**************************************************************************
// CARTRIDGE INTERFACE
//**************************************************************************
//-------------------------------------------------
// device_parallel_interface - constructor
//-------------------------------------------------
device_parallel_interface::device_parallel_interface(const machine_config &mconfig, device_t &device) :
device_slot_card_interface(mconfig, device)
{
m_slot = dynamic_cast<parallel_slot_device *>(device.owner());
}
//-------------------------------------------------
// ~device_parallel_interface - destructor
//-------------------------------------------------
device_parallel_interface::~device_parallel_interface()
{
}
|