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
183
184
185
186
187
188
189
190
191
|
/***************************************************************************
Epson PF-10
Serial floppy drive
Skeleton driver, not working
***************************************************************************/
#include "emu.h"
#include "pf10.h"
#include "cpu/m6800/m6800.h"
#include "machine/upd765.h"
/***************************************************************************
TYPE DEFINITIONS
***************************************************************************/
typedef struct _pf10_state pf10_state;
struct _pf10_state
{
UINT8 dummy;
};
/*****************************************************************************
INLINE FUNCTIONS
*****************************************************************************/
INLINE pf10_state *get_safe_token(device_t *device)
{
assert(device != NULL);
assert(device->type() == PF10);
return (pf10_state *)downcast<pf10_device *>(device)->token();
}
/*****************************************************************************
ADDRESS MAPS
*****************************************************************************/
static ADDRESS_MAP_START( pf10_mem, AS_PROGRAM, 8, pf10_device )
AM_RANGE(0x0040, 0x013f) AM_RAM /* internal ram */
AM_RANGE(0x0800, 0x0fff) AM_RAM /* external 2k ram */
AM_RANGE(0xe000, 0xffff) AM_ROM AM_REGION("pf10", 0)
ADDRESS_MAP_END
static ADDRESS_MAP_START( pf10_io, AS_IO, 8, pf10_device )
ADDRESS_MAP_UNMAP_HIGH
ADDRESS_MAP_GLOBAL_MASK(0xff)
ADDRESS_MAP_END
/*****************************************************************************
MACHINE CONFIG
*****************************************************************************/
static const upd765_interface pf10_upd765a_intf =
{
DEVCB_NULL, /* interrupt line */
DEVCB_NULL,
NULL,
UPD765_RDY_PIN_NOT_CONNECTED, /* ??? */
{NULL, NULL, NULL, NULL}
};
static MACHINE_CONFIG_FRAGMENT( pf10 )
MCFG_CPU_ADD("pf10", M6803, XTAL_2_4576MHz / 4 /* ??? */) /* HD63A03 */
MCFG_CPU_PROGRAM_MAP(pf10_mem)
MCFG_CPU_IO_MAP(pf10_io)
MCFG_UPD765A_ADD("upd765a", pf10_upd765a_intf)
MACHINE_CONFIG_END
/***************************************************************************
ROM DEFINITIONS
***************************************************************************/
ROM_START( pf10 )
ROM_REGION(0x2000, "pf10", 0)
ROM_LOAD("k3pf1.bin", 0x0000, 0x2000, CRC(eef4593a) SHA1(bb176e4baf938fe58c2d32f7c46d7bb7b0627755))
ROM_END
/*****************************************************************************
DEVICE INTERFACE
*****************************************************************************/
static DEVICE_START( pf10 )
{
pf10_state *pf10 = get_safe_token(device);
pf10->dummy = 0;
}
static DEVICE_RESET( pf10 )
{
}
/***************************************************************************
IMPLEMENTATION
***************************************************************************/
/* serial interface in (to the host computer) */
READ_LINE_DEVICE_HANDLER( pf10_txd1_r )
{
logerror("%s: pf10_txd1_r\n", device->machine().describe_context());
return 0;
}
WRITE_LINE_DEVICE_HANDLER( pf10_rxd1_w )
{
logerror("%s: pf10_rxd1_w %u\n", device->machine().describe_context(), state);
}
/* serial interface out (to another floppy drive) */
READ_LINE_DEVICE_HANDLER( pf10_txd2_r )
{
logerror("%s: pf10_txd2_r\n", device->machine().describe_context());
return 0;
}
WRITE_LINE_DEVICE_HANDLER( pf10_rxd2_w )
{
logerror("%s: pf10_rxd2_w %u\n", device->machine().describe_context(), state);
}
const device_type PF10 = &device_creator<pf10_device>;
pf10_device::pf10_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, PF10, "PF-10", tag, owner, clock)
{
m_token = global_alloc_array_clear(UINT8, sizeof(pf10_state));
}
//-------------------------------------------------
// device_config_complete - perform any
// operations now that the configuration is
// complete
//-------------------------------------------------
void pf10_device::device_config_complete()
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void pf10_device::device_start()
{
DEVICE_START_NAME( pf10 )(this);
}
//-------------------------------------------------
// device_reset - device-specific reset
//-------------------------------------------------
void pf10_device::device_reset()
{
DEVICE_RESET_NAME( pf10 )(this);
}
//-------------------------------------------------
// device_mconfig_additions - return a pointer to
// the device's machine fragment
//-------------------------------------------------
machine_config_constructor pf10_device::device_mconfig_additions() const
{
return MACHINE_CONFIG_NAME( pf10 );
}
//-------------------------------------------------
// device_rom_region - return a pointer to the
// the device's ROM definitions
//-------------------------------------------------
const rom_entry *pf10_device::device_rom_region() const
{
return ROM_NAME(pf10 );
}
|