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
|
// license:GPL-2.0+
// copyright-holders:Dirk Best
/***************************************************************************
VTech Laser/VZ Laser Memory Expansions
***************************************************************************/
#include "emu.h"
#include "memory.h"
//**************************************************************************
// DEVICE DEFINITIONS
//**************************************************************************
DEFINE_DEVICE_TYPE(VTECH_LASER110_16K, vtech_laser110_16k_device, "vtech_laser110_16k", "Laser 110/200/VZ-200 16k Memory")
DEFINE_DEVICE_TYPE(VTECH_LASER210_16K, vtech_laser210_16k_device, "vtech_laser210_16k", "Laser 210/VZ-200 16k Memory")
DEFINE_DEVICE_TYPE(VTECH_LASER310_16K, vtech_laser310_16k_device, "vtech_laser310_16k", "Laser 310/VZ-300 16k Memory")
DEFINE_DEVICE_TYPE(VTECH_LASER_64K, vtech_laser_64k_device, "vtech_laser_64k", "Laser/VZ 64k Memory")
//**************************************************************************
// LASER 110 16K DEVICE
//**************************************************************************
//-------------------------------------------------
// mem_map - memory space address map
//-------------------------------------------------
void vtech_laser110_16k_device::mem_map(address_map &map)
{
map.unmap_value_high();
map(0x8000, 0xbfff).ram();
}
//-------------------------------------------------
// laser110_16k_device - constructor
//-------------------------------------------------
vtech_laser110_16k_device::vtech_laser110_16k_device(const machine_config &mconfig, const char *tag, device_t *owner, const XTAL &clock) :
vtech_memexp_device(mconfig, VTECH_LASER110_16K, tag, owner, clock)
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void vtech_laser110_16k_device::device_start()
{
vtech_memexp_device::device_start();
}
//**************************************************************************
// LASER 210 16K DEVICE
//**************************************************************************
//-------------------------------------------------
// mem_map - memory space address map
//-------------------------------------------------
void vtech_laser210_16k_device::mem_map(address_map &map)
{
map.unmap_value_high();
map(0x9000, 0xcfff).ram();
}
//-------------------------------------------------
// vtech_laser210_16k_device - constructor
//-------------------------------------------------
vtech_laser210_16k_device::vtech_laser210_16k_device(const machine_config &mconfig, const char *tag, device_t *owner, const XTAL &clock) :
vtech_memexp_device(mconfig, VTECH_LASER210_16K, tag, owner, clock)
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void vtech_laser210_16k_device::device_start()
{
vtech_memexp_device::device_start();
}
//**************************************************************************
// VZ300 16K DEVICE
//**************************************************************************
//-------------------------------------------------
// mem_map - memory space address map
//-------------------------------------------------
void vtech_laser310_16k_device::mem_map(address_map &map)
{
map.unmap_value_high();
map(0xb800, 0xf7ff).ram();
}
//-------------------------------------------------
// vtech_laser310_16k_device - constructor
//-------------------------------------------------
vtech_laser310_16k_device::vtech_laser310_16k_device(const machine_config &mconfig, const char *tag, device_t *owner, const XTAL &clock) :
vtech_memexp_device(mconfig, VTECH_LASER310_16K, tag, owner, clock)
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void vtech_laser310_16k_device::device_start()
{
vtech_memexp_device::device_start();
}
//**************************************************************************
// VZ300 64K DEVICE
//**************************************************************************
//-------------------------------------------------
// mem_map - memory space address map
//-------------------------------------------------
void vtech_laser_64k_device::mem_map(address_map &map)
{
map.unmap_value_high();
map(0x8000, 0xbfff).bankrw(m_fixed_bank);
map(0xc000, 0xffff).bankrw(m_bank);
}
//-------------------------------------------------
// io_map - memory space address map
//-------------------------------------------------
void vtech_laser_64k_device::io_map(address_map &map)
{
map.unmap_value_high();
map(0x70, 0x70).mirror(0x0f).lw8(NAME([this] (uint8_t data) { m_bank->set_entry(data & 0x03); }));
}
//-------------------------------------------------
// vtech_laser_64k_device - constructor
//-------------------------------------------------
vtech_laser_64k_device::vtech_laser_64k_device(const machine_config &mconfig, const char *tag, device_t *owner, const XTAL &clock) :
vtech_memexp_device(mconfig, VTECH_LASER_64K, tag, owner, clock),
m_fixed_bank(*this, "fixed_bank"),
m_bank(*this, "bank")
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void vtech_laser_64k_device::device_start()
{
vtech_memexp_device::device_start();
// init ram
m_ram = std::make_unique<uint8_t[]>(0x10000);
// configure banking
m_fixed_bank->set_base(m_ram.get());
m_bank->configure_entries(0, 4, m_ram.get(), 0x4000);
m_bank->set_entry(1);
// register for savestates
save_pointer(NAME(m_ram), 0x10000);
}
|