summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/fmt_scsi/fmt121.cpp
blob: 34f784115a0b4d654547f81bf98284762e2565ba (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
// license:BSD-3-Clause
// copyright-holders:r09
/****************************************************************************

    Fujitsu FMT-121 SCSI Card

    An expansion card for the dedicated SCSI card slot on the FM Towns
    Model 1 and 2 computers. It contains a Fujitsu MB673522U SCSI controller
    and an external 50-pin Centronics connector.

                          |||||||||||||||||||||
+-------------------------|                   |-------------------------+
|                     CN1 +-------------------+                         |
|                                                                       |
|                                                 74LS04N               |
|       74LS14N       74LS240N      SN74LS06N                           |
|                                                            MB413      |
|   MB463                                                               |
|                                                            74AS00N    |
|                           +-----------+                               |
|   MB463                   |           |                               |
|                           | MB673522U |                    MB412      |
|                           +-----------+                               |
|   MB463                                                    74LS240N   |
|                             CN3                                       |
|              ..........................................               |
|              .                                        .               |
|              ..........................................               |
|                             CN2                                       |
|              +----------------------------------------+               |
|              |                                        |               |
+--------------|                                        |---------------+
               ||||||||||||||||||||||||||||||||||||||||||

    CN1: 30-pin MFC-30LFD DIP connector
    CN2: 50-pin Centronics connector
    CN3: solder pads for internal 50-pin connector (not present)

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

#include "emu.h"
#include "fmt121.h"

#include "bus/scsi/scsi.h"
#include "bus/scsi/scsihd.h"

//**************************************************************************
//  GLOBAL VARIABLES
//**************************************************************************

// device type definition
DEFINE_DEVICE_TYPE(FMT121, fmt121_device, "fmt121", "FMT-121 SCSI Card")

//**************************************************************************
//  DEVICE DEFINITION
//**************************************************************************

//-------------------------------------------------
//  fmt121_device - construction
//-------------------------------------------------

fmt121_device::fmt121_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
	: device_t(mconfig, FMT121, tag, owner, clock)
	, fmt_scsi_card_interface(mconfig, *this)
	, m_scsi_ctlr(*this, "fmscsi")
{
}


//-------------------------------------------------
//  device_add_mconfig - add device-specific
//  machine configuration
//-------------------------------------------------

void fmt121_device::device_add_mconfig(machine_config &config)
{
	scsi_port_device &scsi(SCSI_PORT(config, "scsi", 0));
	scsi.set_slot_device(1, "harddisk", SCSIHD, DEVICE_INPUT_DEFAULTS_NAME(SCSI_ID_0));
	scsi.set_slot_device(2, "harddisk", SCSIHD, DEVICE_INPUT_DEFAULTS_NAME(SCSI_ID_1));
	scsi.set_slot_device(3, "harddisk", SCSIHD, DEVICE_INPUT_DEFAULTS_NAME(SCSI_ID_2));
	scsi.set_slot_device(4, "harddisk", SCSIHD, DEVICE_INPUT_DEFAULTS_NAME(SCSI_ID_3));
	scsi.set_slot_device(5, "harddisk", SCSIHD, DEVICE_INPUT_DEFAULTS_NAME(SCSI_ID_4));

	FMSCSI(config, m_scsi_ctlr, 0);
	m_scsi_ctlr->set_scsi_port("scsi");
	m_scsi_ctlr->irq_handler().set(FUNC(fmt121_device::irq_w));
	m_scsi_ctlr->drq_handler().set(FUNC(fmt121_device::drq_w));
}


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

void fmt121_device::device_start()
{
}

//**************************************************************************
//  FMT121 INTERFACE
//**************************************************************************

//-------------------------------------------------
//  fmt_scsi_read - I/O read access
//-------------------------------------------------

u8 fmt121_device::fmt_scsi_read(offs_t offset)
{
	return m_scsi_ctlr->fmscsi_r(offset);
}


//-------------------------------------------------
//  fmt_scsi_write - I/O write access
//-------------------------------------------------

void fmt121_device::fmt_scsi_write(offs_t offset, u8 data)
{
	m_scsi_ctlr->fmscsi_w(offset, data);
}

//-------------------------------------------------
//  fmt_scsi_data_read - data read access
//-------------------------------------------------

u8 fmt121_device::fmt_scsi_data_read()
{
	return m_scsi_ctlr->fmscsi_data_r();
}

//-------------------------------------------------
//  fmt_scsi_data_write - data write access
//-------------------------------------------------

void fmt121_device::fmt_scsi_data_write(u8 data)
{
	m_scsi_ctlr->fmscsi_data_w(data);
}


void fmt121_device::irq_w(int state)
{
	m_slot->irq_w(state);
}


void fmt121_device::drq_w(int state)
{
	m_slot->drq_w(state);
}