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
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
|
// license:BSD-3-Clause
// copyright-holders:Curt Coder
/**********************************************************************
Luxor ABC-80 Owoco Super Smartaid cartridge emulation
New BASIC commands:
AUTO, CHANGE, CLEAR, CONT, DEL, DIR, DISP, ED, EX, FIND,
FOR-NEXT, HELP, JOB, KEY, LIB, LIST, NEW, OLD, PEEK, PEW, POW,
REN, RESUME, SPOOL, STACK, START, SYS, TAB, TIME/NOTIME, TRACE,
VAR, Û (LIST)
0x4000-0x4fff = 4KB ROM bank
0x5000-0x57ff = 2KB NVRAM
0x7800-0x7bff = 1KB ROM bank
*********************************************************************/
/*
PCB Layout
----------
Super Smartaid / Super Smartaid Magnum 4
[---------------------------------------------------|
| PROM LS155 LS08 |
| |
||-----------CN1----------| LS74 HC32 |
| |
| ROM1 RAM |
| |
|LS245 LS126 LS393 LS00 BAT |
| ROM2 |
| LS260 LS74 LS32 |
|---------------------------------------------------|
Notes:
All IC's shown.
RAM - Hitachi HM6116LP-3 / Fujitsu MB8416A-15 2Kx8 SRAM
ROM1 - Mitsubishi M5L2764K 8Kx8 EPROM
ROM2 - SGS M2716F1 2Kx8 EPROM / NEC D27128D 16Kx8 EPROM
PROM - Signetics N82S131N 512x4 bipolar PROM
CN1 - ABC bus connector
BAT - Varta 3/V150H 3.6V 140mAh Ni-MH battery
*/
/*
TODO:
- entering a bad command locks up the system
*/
#include "emu.h"
#include "ssa.h"
//**************************************************************************
// DEVICE DEFINITIONS
//**************************************************************************
DEFINE_DEVICE_TYPE(ABC_SUPER_SMARTAID, abc_super_smartaid_device, "abc_ssa", "Super Smartaid")
//-------------------------------------------------
// device_add_mconfig - add device configuration
//-------------------------------------------------
void abc_super_smartaid_device::device_add_mconfig(machine_config &config)
{
ABCBUS_SLOT(config, m_bus, DERIVED_CLOCK(1, 1), abc80_cards, nullptr);
}
//-------------------------------------------------
// ROM( super_smartaid )
//-------------------------------------------------
ROM_START( super_smartaid )
ROM_REGION( 0x800, "ssa1", 0 )
ROM_LOAD( "ssa1.bin", 0x000, 0x800, CRC(4c015aba) SHA1(d83d50fb3da04d6cfed7a0ab595afbbef2812951) )
ROM_REGION( 0x2000, "ssa2", 0 )
ROM_LOAD( "ssa2.bin", 0x0000, 0x2000, CRC(8e8bbd2a) SHA1(ff745e346ead247ebcc622bdd811e5f7de629639) )
ROM_REGION( 0x200, "ssa3", 0 )
ROM_LOAD( "ssa3.bin", 0x000, 0x200, CRC(9671e00b) SHA1(9010cb3426bc61711ae940551b79b6ecba67defa) )
ROM_END
//-------------------------------------------------
// rom_region - device-specific ROM region
//-------------------------------------------------
const tiny_rom_entry *abc_super_smartaid_device::device_rom_region() const
{
return ROM_NAME( super_smartaid );
}
//**************************************************************************
// LIVE DEVICE
//**************************************************************************
//-------------------------------------------------
// abc_super_smartaid_device - constructor
//-------------------------------------------------
abc_super_smartaid_device::abc_super_smartaid_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, ABC_SUPER_SMARTAID, tag, owner, clock),
device_abcbus_card_interface(mconfig, *this),
device_nvram_interface(mconfig, *this),
m_bus(*this, "bus"),
m_rom_1(*this, "ssa1"),
m_rom_2(*this, "ssa2"),
m_prom(*this, "ssa3"),
m_nvram(*this, "nvram", 0x800, ENDIANNESS_LITTLE),
m_rom_bank(0),
m_prom_bank(0)
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void abc_super_smartaid_device::device_start()
{
// descramble ROMs
for (offs_t i = 0; i < 0x800; i++)
{
m_rom_1->base()[i] = bitswap<8>(m_rom_1->base()[i], 7, 4, 3, 0, 5, 2, 1, 6);
}
for (offs_t i = 0; i < 0x2000; i++)
{
m_rom_2->base()[i] = bitswap<8>(m_rom_2->base()[i], 2, 6, 1, 4, 3, 5, 7, 0);
}
// state saving
save_item(NAME(m_rom_bank));
save_item(NAME(m_prom_bank));
}
//-------------------------------------------------
// device_reset - device-specific reset
//-------------------------------------------------
void abc_super_smartaid_device::device_reset()
{
m_rom_bank = 0;
m_prom_bank = 0;
}
//**************************************************************************
// ABC BUS INTERFACE
//**************************************************************************
//-------------------------------------------------
// abcbus_xmemfl -
//-------------------------------------------------
uint8_t abc_super_smartaid_device::abcbus_xmemfl(offs_t offset)
{
uint8_t data = 0xff;
switch (m_prom->base()[(m_prom_bank << 6) | (offset >> 10)])
{
case 0x08:
m_prom_bank = 1;
// fallthru
case 0x0c: case 0x0f:
data = m_rom_2->base()[(m_rom_bank << 12) | (offset & 0xfff)];
break;
case 0x0d:
data = m_rom_1->base()[(m_rom_bank << 10) | (offset & 0x3ff)];
break;
case 0x0e:
data = m_nvram[offset & 0x7ff];
break;
default:
data = m_bus->xmemfl_r(offset);
break;
}
return data;
}
//-------------------------------------------------
// abcbus_xmemw -
//-------------------------------------------------
void abc_super_smartaid_device::abcbus_xmemw(offs_t offset, uint8_t data)
{
if ((offset == 0x4040) || (offset == 0x4041))
{
m_rom_bank = BIT(offset, 0);
}
switch (m_prom->base()[(m_prom_bank << 6) | (offset >> 10)])
{
case 0x0e:
m_nvram[offset & 0x7ff] = data;
break;
default:
m_bus->xmemw_w(offset, data);
break;
}
}
|