summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/psx/parallel.cpp
blob: 01112b1cd79fca711aba1d0e23453cafd8abd616 (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
// 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_interface(device, "psxparallel")
{
}


//-------------------------------------------------
//  ~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, const XTAL &clock) :
	device_t(mconfig, PSX_PARALLEL_SLOT, tag, owner, clock),
	device_single_card_slot_interface<psx_parallel_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 = get_card_device();
}

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

uint16_t psx_parallel_slot_device::exp_r(offs_t offset)
{
	if (m_card)
		return m_card->exp_r(offset);
	else
		return 0xff;
}

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

void psx_parallel_slot_device::exp_w(offs_t offset, uint16_t data)
{
	if (m_card)
		m_card->exp_w(offset, data);
}

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


// slot devices
#include "gamebooster.h"

void psx_parallel_devices(device_slot_interface &device)
{
	device.option_add("gamebooster", PSX_GAMEBOOSTER);
}