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
|
// license:BSD-3-Clause
// copyright-holders:Nigel Barnes
/**********************************************************************
ATPL AutoPrommer - Eprom Programmer with Auto-Run
Emulation is purely based upon contents of boot ROM. The manual
is apparently quite detailed, according to reviews, but has not
been found.
Emulating an EPROM programmer is not very useful but the Auto-Run
on this device makes it different. The Auto-Run ROMs are paged into
JIM at startup, and as very few devices make use of this feature
it provides a good test case.
**********************************************************************/
#include "emu.h"
#include "autoprom.h"
//**************************************************************************
// DEVICE DEFINITIONS
//**************************************************************************
DEFINE_DEVICE_TYPE(BBC_AUTOPROM, bbc_autoprom_device, "bbc_autoprom", "ATPL AutoPrommer")
//-------------------------------------------------
// INPUT_PORTS( autoprom )
//-------------------------------------------------
static INPUT_PORTS_START( autoprom )
PORT_START("boot")
PORT_DIPNAME(0x03, 0x01, "EPROM") PORT_DIPLOCATION("BOOT:1,2")
PORT_DIPSETTING(0x00, "Disable Auto-Run")
PORT_DIPSETTING(0x01, "4K")
PORT_DIPSETTING(0x02, "8K")
PORT_DIPSETTING(0x03, "16K")
PORT_DIPNAME(0x04, 0x04, "Program") PORT_DIPLOCATION("BOOT:3")
PORT_DIPSETTING(0x00, "BASIC")
PORT_DIPSETTING(0x04, "M/C")
PORT_DIPNAME(0x08, 0x08, "OS") PORT_DIPLOCATION("BOOT:4")
PORT_DIPSETTING(0x00, "0.1")
PORT_DIPSETTING(0x08, "1.x")
INPUT_PORTS_END
//-------------------------------------------------
// input_ports - device-specific input ports
//-------------------------------------------------
ioport_constructor bbc_autoprom_device::device_input_ports() const
{
return INPUT_PORTS_NAME( autoprom );
}
//-------------------------------------------------
// ROM( autoprom )
//-------------------------------------------------
ROM_START( autoprom )
ROM_REGION(0x8000, "autorun", 0)
// 2 Auto-Run sockets, each can take 2732/2764/27128 types
ROM_LOAD("prommer.rom", 0x0000, 0x2000, CRC(9ec497ec) SHA1(48d76606d55bfce866baac1d9ac6390f5243c244))
ROM_RELOAD(0x2000, 0x2000)
ROM_LOAD("boot.rom", 0x4000, 0x1000, CRC(0843bb06) SHA1(9f584f0cc54bbbf6128e96f5f97fa811cc3d68ce))
ROM_RELOAD(0x5000, 0x1000)
ROM_RELOAD(0x6000, 0x1000)
ROM_RELOAD(0x7000, 0x1000)
ROM_END
//-------------------------------------------------
// device_add_mconfig - add device configuration
//-------------------------------------------------
void bbc_autoprom_device::device_add_mconfig(machine_config &config)
{
}
//-------------------------------------------------
// rom_region - device-specific ROM region
//-------------------------------------------------
const tiny_rom_entry *bbc_autoprom_device::device_rom_region() const
{
return ROM_NAME( autoprom );
}
//**************************************************************************
// LIVE DEVICE
//**************************************************************************
//-------------------------------------------------
// bbc_autoprom_device - constructor
//-------------------------------------------------
bbc_autoprom_device::bbc_autoprom_device(const machine_config &mconfig, const char *tag, device_t *owner, const XTAL &clock)
: device_t(mconfig, BBC_AUTOPROM, tag, owner, clock)
, device_bbc_1mhzbus_interface(mconfig, *this)
, m_autorun(*this, "autorun")
, m_boot(*this, "boot")
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void bbc_autoprom_device::device_start()
{
save_item(NAME(m_rom_offset));
}
//-------------------------------------------------
// device_reset - device-specific reset
//-------------------------------------------------
void bbc_autoprom_device::device_reset()
{
m_slot->irq_w(ASSERT_LINE);
}
//**************************************************************************
// IMPLEMENTATION
//**************************************************************************
uint8_t bbc_autoprom_device::fred_r(offs_t offset)
{
uint8_t data = 0xff;
switch (offset)
{
case 0xc0:
data = m_unk_c0;
break;
case 0xc1:
data = m_autorun->base()[m_rom_offset];
break;
case 0xcc:
break;
case 0xd0:
data = (m_rom_offset >> 8) & 0xff;
break;
case 0xd1:
data = (m_rom_offset >> 0) & 0xff;
break;
case 0xdc:
break;
}
return data;
}
void bbc_autoprom_device::fred_w(offs_t offset, uint8_t data)
{
switch (offset)
{
case 0xc0:
m_unk_c0 = data;
break;
case 0xc1:
break;
case 0xcc:
break;
case 0xd0:
m_rom_offset = (m_rom_offset & 0x00ff) | (data << 8);
break;
case 0xd1:
m_rom_offset = (m_rom_offset & 0xff00) | (data << 0);
break;
case 0xdc:
break;
}
}
uint8_t bbc_autoprom_device::jim_r(offs_t offset)
{
// not known when to clear the IRQ, but has been acknowledged to get here
if (!machine().side_effects_disabled())
{
if (offset == 0xfe) m_slot->irq_w(CLEAR_LINE);
}
// the switches seem to determine which page of the boot ROM is accessed via JIM
return m_autorun->base()[0x4000 | ((m_boot->read() << 8) + offset)];
}
|