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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
|
// license:BSD-3-Clause
// copyright-holders:Curt Coder
/**********************************************************************
CST Q+4 emulation
Copyright MESS Team.
Visit http://mamedev.org for licensing and usage restrictions.
**********************************************************************/
#include "cst_q_plus4.h"
//**************************************************************************
// MACROS/CONSTANTS
//**************************************************************************
#define MC6821_TAG "mc6821"
//**************************************************************************
// DEVICE DEFINITIONS
//**************************************************************************
const device_type CST_Q_PLUS4 = &device_creator<cst_q_plus4_t>;
//-------------------------------------------------
// ROM( cst_q_plus4 )
//-------------------------------------------------
ROM_START( cst_q_plus4 )
ROM_REGION( 0x2000, "rom", 0 )
ROM_LOAD( "qplus4.rom", 0x0000, 0x2000, CRC(53a078fb) SHA1(53d6828c1b6ba052b862fd80ac8a364b0078330d) )
ROM_END
//-------------------------------------------------
// rom_region - device-specific ROM region
//-------------------------------------------------
const rom_entry *cst_q_plus4_t::device_rom_region() const
{
return ROM_NAME( cst_q_plus4 );
}
//-------------------------------------------------
// MACHINE_CONFIG_FRAGMENT( cst_q_plus4 )
//-------------------------------------------------
static MACHINE_CONFIG_FRAGMENT( cst_q_plus4 )
MCFG_DEVICE_ADD(MC6821_TAG, PIA6821, 0)
MCFG_QL_EXPANSION_SLOT_ADD("exp1", ql_expansion_cards, NULL)
MCFG_QL_EXPANSION_SLOT_EXTINTL_CALLBACK(WRITELINE(cst_q_plus4_t, exp1_extintl_w))
MCFG_QL_EXPANSION_SLOT_ADD("exp2", ql_expansion_cards, NULL)
MCFG_QL_EXPANSION_SLOT_EXTINTL_CALLBACK(WRITELINE(cst_q_plus4_t, exp2_extintl_w))
MCFG_QL_EXPANSION_SLOT_ADD("exp3", ql_expansion_cards, NULL)
MCFG_QL_EXPANSION_SLOT_EXTINTL_CALLBACK(WRITELINE(cst_q_plus4_t, exp3_extintl_w))
MCFG_QL_EXPANSION_SLOT_ADD("exp4", ql_expansion_cards, NULL)
MCFG_QL_EXPANSION_SLOT_EXTINTL_CALLBACK(WRITELINE(cst_q_plus4_t, exp4_extintl_w))
MACHINE_CONFIG_END
//-------------------------------------------------
// machine_config_additions - device-specific
// machine configurations
//-------------------------------------------------
machine_config_constructor cst_q_plus4_t::device_mconfig_additions() const
{
return MACHINE_CONFIG_NAME( cst_q_plus4 );
}
//**************************************************************************
// LIVE DEVICE
//**************************************************************************
//-------------------------------------------------
// cst_q_plus4_t - constructor
//-------------------------------------------------
cst_q_plus4_t::cst_q_plus4_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
device_t(mconfig, CST_Q_PLUS4, "CST Q+4", tag, owner, clock, "ql_qplus4", __FILE__),
device_ql_expansion_card_interface(mconfig, *this),
m_exp1(*this, "exp1"),
m_exp2(*this, "exp2"),
m_exp3(*this, "exp3"),
m_exp4(*this, "exp4"),
m_rom(*this, "rom"),
m_exp1_extinl(CLEAR_LINE),
m_exp2_extinl(CLEAR_LINE),
m_exp3_extinl(CLEAR_LINE),
m_exp4_extinl(CLEAR_LINE)
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void cst_q_plus4_t::device_start()
{
}
//-------------------------------------------------
// read -
//-------------------------------------------------
UINT8 cst_q_plus4_t::read(address_space &space, offs_t offset, UINT8 data)
{
if (offset >= 0xc000 && offset < 0xc200)
{
data = m_rom->base()[offset & 0x1fff];
}
data = m_exp1->read(space, offset, data);
data = m_exp2->read(space, offset, data);
data = m_exp3->read(space, offset, data);
data = m_exp4->read(space, offset, data);
return data;
}
//-------------------------------------------------
// write -
//-------------------------------------------------
void cst_q_plus4_t::write(address_space &space, offs_t offset, UINT8 data)
{
m_exp1->write(space, offset, data);
m_exp2->write(space, offset, data);
m_exp3->write(space, offset, data);
m_exp4->write(space, offset, data);
}
|