summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/bbc/tube/tube.cpp
blob: 6fa9dc700f667c1477b3f699f9d180534f443e3a (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
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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
// license:BSD-3-Clause
// copyright-holders:Nigel Barnes
/**********************************************************************

    BBC Tube emulation

**********************************************************************/

#include "emu.h"
#include "tube.h"



//**************************************************************************
//  DEVICE DEFINITIONS
//**************************************************************************

DEFINE_DEVICE_TYPE(BBC_TUBE_SLOT, bbc_tube_slot_device, "bbc_tube_slot", "BBC Micro Tube port")



//**************************************************************************
//  DEVICE BBC_TUBE PORT INTERFACE
//**************************************************************************

//-------------------------------------------------
//  device_bbc_tube_interface - constructor
//-------------------------------------------------

device_bbc_tube_interface::device_bbc_tube_interface(const machine_config &mconfig, device_t &device)
	: device_interface(device, "bbctube")
{
	m_slot = dynamic_cast<bbc_tube_slot_device *>(device.owner());
}


//**************************************************************************
//  LIVE DEVICE
//**************************************************************************

//-------------------------------------------------
//  bbc_tube_slot_device - constructor
//-------------------------------------------------

bbc_tube_slot_device::bbc_tube_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
	device_t(mconfig, BBC_TUBE_SLOT, tag, owner, clock),
	device_single_card_slot_interface<device_bbc_tube_interface>(mconfig, *this),
	m_card(nullptr),
	m_irq_handler(*this)
{
}


//-------------------------------------------------
//  device_start - device-specific startup
//-------------------------------------------------

void bbc_tube_slot_device::device_start()
{
	m_card = get_card_device();

	// resolve callbacks
	m_irq_handler.resolve_safe();
}


//-------------------------------------------------
//  host_r
//-------------------------------------------------

uint8_t bbc_tube_slot_device::host_r(offs_t offset)
{
	if (m_card)
		return m_card->host_r(offset);
	else
		return 0xfe;
}

//-------------------------------------------------
//  host_w
//-------------------------------------------------

void bbc_tube_slot_device::host_w(offs_t offset, uint8_t data)
{
	if (m_card)
		m_card->host_w(offset, data);
}


// slot devices
#include "tube_32016.h"
#include "tube_6502.h"
#include "tube_80186.h"
#include "tube_80286.h"
//#include "tube_a500.h"
#include "tube_arm.h"
#include "tube_casper.h"
//#include "tube_pmsb2p.h"
#include "tube_rc6502.h"
//#include "tube_x25.h"
#include "tube_z80.h"
#include "tube_zep100.h"


//-------------------------------------------------
//  SLOT_INTERFACE( bbc_tube_devices )
//-------------------------------------------------

void bbc_tube_devices(device_slot_interface &device)
{
	device.option_add("6502",   BBC_TUBE_6502);    /* Acorn ANC01 6502 2nd processor */
	device.option_add("z80",    BBC_TUBE_Z80);     /* Acorn ANC04 Z80 2nd processor */
	device.option_add("32016", BBC_TUBE_32016);    /* Acorn ANC05 32016 2nd processor */
	device.option_add("arm",    BBC_TUBE_ARM);     /* Acorn ANC13 ARM Evaluation System */
	device.option_add("80286",  BBC_TUBE_80286);   /* Acorn 80286 2nd Processor */
	//device.option_add("a500",   BBC_TUBE_A500);    /* Acorn A500 2nd Processor */
	device.option_add("casper", BBC_TUBE_CASPER);  /* Casper 68000 2nd Processor */
	//device.option_add("pmsb2p", BBC_TUBE_PMSB2P);  /* PMS B2P-6502 */
	//device.option_add("hdp68k", BBC_TUBE_HDP68K);  /* Torch Unicorn (HDP68K) */
	//device.option_add("x25",    BBC_TUBE_X25);     /* Econet X25 Gateway */
	device.option_add("zep100", BBC_TUBE_ZEP100);  /* Torch Z80 Communicator (ZEP100) (Torch) */
	//device.option_add("zep100l", BBC_TUBE_ZEP100L); /* Torch Z80 Communicator (ZEP100) (Model B) */
	//device.option_add("zep100w", BBC_TUBE_ZEP100W); /* Torch Z80 Communicator (ZEP100) (Model B+) */
	/* Acorn ANC21 Universal 2nd Processor Unit */
	device.option_add("65c102", BBC_TUBE_65C102);  /* Acorn ADC06 65C102 co-processor */
	device.option_add("80186",  BBC_TUBE_80186);   /* Acorn ADC08 80186 co-processor */
	device.option_add("rc6502", BBC_TUBE_RC6502);   /* ReCo6502 (6502) */
	device.option_add("rc65816", BBC_TUBE_RC65816); /* ReCo6502 (65816) */
}


//-------------------------------------------------
//  SLOT_INTERFACE( bbc_extube_devices )
//-------------------------------------------------

void bbc_extube_devices(device_slot_interface &device)
{
	device.option_add("6502",   BBC_TUBE_6502);     /* Acorn ANC01 6502 2nd processor */
	device.option_add("z80",    BBC_TUBE_Z80);      /* Acorn ANC04 Z80 2nd processor */
	device.option_add("32016", BBC_TUBE_32016);     /* Acorn ANC05 32016 2nd processor */
	device.option_add("arm",    BBC_TUBE_ARM);      /* Acorn ANC13 ARM Evaluation System */
	device.option_add("80286",  BBC_TUBE_80286);    /* Acorn 80286 2nd Processor */
	//device.option_add("a500",   BBC_TUBE_A500);   /* Acorn A500 2nd Processor */
	//device.option_add("pmsb2p", BBC_TUBE_PMSB2P);   /* PMS B2P-6502 */
	//device.option_add("zep100m", BBC_TUBE_ZEP100M); /* Torch Z80 Communicator (ZEP100) (Master) */
	/* Acorn ANC21 Universal 2nd Processor Unit */
	device.option_add("65c102", BBC_TUBE_65C102);   /* Acorn ADC06 65C102 co-processor */
	device.option_add("80186",  BBC_TUBE_80186);    /* Acorn ADC08 80186 co-processor */
	device.option_add("rc6502", BBC_TUBE_RC6502);   /* ReCo6502 (6502) */
	device.option_add("rc65816", BBC_TUBE_RC65816); /* ReCo6502 (65816) */
}


//-------------------------------------------------
//  SLOT_INTERFACE( bbc_intube_devices )
//-------------------------------------------------

void bbc_intube_devices(device_slot_interface &device)
{
	device.option_add("65c102", BBC_TUBE_65C102);  /* Acorn ADC06 65C102 co-processor */
	device.option_add("80186",  BBC_TUBE_80186);   /* Acorn ADC08 80186 co-processor */
	//device.option_add("arm7",    BBC_TUBE_ARM7);    /* Sprow ARM7 co-processor */
	device.option_add("rc6502",  BBC_TUBE_RC6502);  /* ReCo6502 (6502) */
	device.option_add("rc65816", BBC_TUBE_RC65816); /* ReCo6502 (65816) */
}


//-------------------------------------------------
//  SLOT_INTERFACE( electron_tube_devices )
//-------------------------------------------------

void electron_tube_devices(device_slot_interface &device)
{
	device.option_add("6502",   BBC_TUBE_6502);    /* Acorn ANC01 6502 2nd processor */
	device.option_add("z80",    BBC_TUBE_Z80);     /* Acorn ANC04 Z80 2nd processor */
	device.option_add("32016",  BBC_TUBE_32016);   /* Acorn ANC05 32016 2nd processor */
	device.option_add("arm",    BBC_TUBE_ARM);     /* Acorn ANC13 ARM Evaluation System */
	device.option_add("65c102", BBC_TUBE_65C102);  /* Acorn ADC06 65C102 co-processor */
	device.option_add("80186",  BBC_TUBE_80186);   /* Acorn ADC08 80186 co-processor */
	device.option_add("rc6502", BBC_TUBE_RC6502);  /* ReCo6502 (6502) */
	device.option_add("rc65816", BBC_TUBE_RC65816); /* ReCo6502 (65816) */
}