summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/einstein/pipe/pipe.cpp
blob: 51169544ba7b7b49aabad5e49a922d45e4afb98f (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
// license: GPL-2.0+
// copyright-holders: Dirk Best
/***************************************************************************

    Einstein "Tatung Pipe"

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

#include "emu.h"
#include "pipe.h"

// supported devices
#include "silicon_disc.h"
#include "speculator.h"
#include "tk02.h"


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

DEFINE_DEVICE_TYPE(TATUNG_PIPE, tatung_pipe_device, "tatung_pipe", "Tatung Pipe Slot")


//**************************************************************************
//  SLOT DEVICE
//**************************************************************************

//-------------------------------------------------
//  tatung_pipe_device - constructor
//-------------------------------------------------

tatung_pipe_device::tatung_pipe_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
	device_t(mconfig, TATUNG_PIPE, tag, owner, clock),
	device_slot_interface(mconfig, *this),
	m_program(nullptr),
	m_io(nullptr),
	m_card(nullptr),
	m_int_handler(*this),
	m_nmi_handler(*this),
	m_reset_handler(*this)
{
}

//-------------------------------------------------
//  tatung_pipe_device - destructor
//-------------------------------------------------

tatung_pipe_device::~tatung_pipe_device()
{
}

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

void tatung_pipe_device::device_start()
{
	// get inserted module
	m_card = dynamic_cast<device_tatung_pipe_interface *>(get_card_device());

	// resolve callbacks
	m_int_handler.resolve_safe();
	m_nmi_handler.resolve_safe();
	m_reset_handler.resolve_safe();
}

//-------------------------------------------------
//  device_reset - device-specific reset
//-------------------------------------------------

void tatung_pipe_device::device_reset()
{
}

//-------------------------------------------------
//  host to module interface
//-------------------------------------------------

WRITE_LINE_MEMBER( tatung_pipe_device::host_int_w )
{
	if (m_card)
		m_card->int_w(state);
}

//-------------------------------------------------
//  set_program_space - set address space we are attached to
//-------------------------------------------------

void tatung_pipe_device::set_program_space(address_space *program)
{
	m_program = program;
}

//-------------------------------------------------
//  set_io_space - set address space we are attached to
//-------------------------------------------------

void tatung_pipe_device::set_io_space(address_space *io)
{
	m_io = io;
}


//**************************************************************************
//  CARD INTERFACE
//**************************************************************************

//-------------------------------------------------
//  device_tatung_pipe_interface - constructor
//-------------------------------------------------

device_tatung_pipe_interface::device_tatung_pipe_interface(const machine_config &mconfig, device_t &device) :
	device_slot_card_interface(mconfig, device)
{
	m_slot = dynamic_cast<tatung_pipe_device *>(device.owner());
}

//-------------------------------------------------
//  ~device_tatung_pipe_interface - destructor
//-------------------------------------------------

device_tatung_pipe_interface::~device_tatung_pipe_interface()
{
}


//**************************************************************************
//  SLOT INTERFACE
//**************************************************************************

SLOT_INTERFACE_START( tatung_pipe_cards )
	SLOT_INTERFACE("silicon_disc", EINSTEIN_SILICON_DISC)
	SLOT_INTERFACE("speculator", EINSTEIN_SPECULATOR)
	SLOT_INTERFACE("tk02", TK02_80COL)
SLOT_INTERFACE_END