summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/psx/parallel.cpp
blob: 4fa5b29da66ed87cd1943726721955e0b3b82255 (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
// license:BSD-3-Clause
// copyright-holders:David Haywood
/**********************************************************************

        Sony Playstation 'Parallel' slot

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

#include "emu.h"
#include "parallel.h"

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

DEFINE_DEVICE_TYPE(PSX_PARALLEL_SLOT, psx_parallel_slot_device, "psx_parallel_slot", "Playstation Parallel Slot")


//**************************************************************************
//  DEVICE SPECTRUM_EXPANSION CARD INTERFACE
//**************************************************************************

//-------------------------------------------------
//  psx_parallel_interface - constructor
//-------------------------------------------------

psx_parallel_interface::psx_parallel_interface(const machine_config &mconfig, device_t &device)
	: device_slot_card_interface(mconfig, device)
{
}


//-------------------------------------------------
//  ~psx_parallel_interface - destructor
//-------------------------------------------------

psx_parallel_interface::~psx_parallel_interface()
{
}

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

//-------------------------------------------------
//  psx_parallel_slot_device - constructor
//-------------------------------------------------

psx_parallel_slot_device::psx_parallel_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
	device_t(mconfig, PSX_PARALLEL_SLOT, tag, owner, clock),
	device_slot_interface(mconfig, *this),
	m_card(nullptr)
{
}

//-------------------------------------------------
//  expansion_slot_device - destructor
//-------------------------------------------------

psx_parallel_slot_device::~psx_parallel_slot_device()
{
}

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

void psx_parallel_slot_device::device_start()
{
	m_card = dynamic_cast<psx_parallel_interface *>(get_card_device());
}

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

void psx_parallel_slot_device::device_reset()
{
}

//-------------------------------------------------
//  exp_r
//-------------------------------------------------

READ16_MEMBER(psx_parallel_slot_device::exp_r)
{
	if (m_card)
		return m_card->exp_r(space, offset);
	else
		return 0xff;
}

//-------------------------------------------------
//  exp_w
//-------------------------------------------------

WRITE16_MEMBER(psx_parallel_slot_device::exp_w)
{
	if (m_card)
		m_card->exp_w(space, offset, data);
}

//-------------------------------------------------
//  SLOT_INTERFACE( spectrum_expansion_devices )
//-------------------------------------------------


// slot devices
#include "gamebooster.h"

SLOT_INTERFACE_START( psx_parallel_devices )
	SLOT_INTERFACE("gamebooster", PSX_GAMEBOOSTER)
SLOT_INTERFACE_END