5
5
S3 Vision 864 / 868 / 964 / 968
6
6
7
7
TODO:
8
- - Downgrade S3_VGA (gets detected as Trio card with SDD UVCONFIG.EXE)
8
+ - Add Vision868
9
+ - Add Trio32/Trio64, pillage roms from isa/svga_s3
10
+ - Make ViRGE to derive from here rather than reinventing the wheel
9
11
10
12
**************************************************************************************************/
11
13
@@ -21,22 +23,22 @@ S3 Vision 864 / 868 / 964 / 968
21
23
#define LOGWARN (...) LOGMASKED(LOG_WARN, __VA_ARGS__)
22
24
23
25
24
- DEFINE_DEVICE_TYPE (VISION864_PCI, vision864_device , " vision864" , " S3 86C864 Vision864" )
26
+ DEFINE_DEVICE_TYPE (VISION864_PCI, vision864_pci_device , " vision864" , " S3 86C864 Vision864" )
25
27
// Vision868
26
- DEFINE_DEVICE_TYPE(VISION964_PCI, vision964_device , " vision964" , " S3 86C964 Vision964" )
27
- DEFINE_DEVICE_TYPE(VISION968_PCI, vision968_device , " vision968" , " S3 86C968 Vision968" )
28
+ DEFINE_DEVICE_TYPE(VISION964_PCI, vision964_pci_device , " vision964" , " S3 86C964 Vision964" )
29
+ DEFINE_DEVICE_TYPE(VISION968_PCI, vision968_pci_device , " vision968" , " S3 86C968 Vision968" )
28
30
29
31
30
32
31
- vision864_device::vision864_device (const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
33
+ vision864_pci_device::vision864_pci_device (const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
32
34
: pci_card_device(mconfig, type, tag, owner, clock)
33
35
, m_vga(*this , " vga" )
34
36
, m_bios(*this , " bios" )
35
37
{
36
38
}
37
39
38
- vision864_device::vision864_device (const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
39
- : vision864_device (mconfig, VISION864_PCI, tag, owner, clock)
40
+ vision864_pci_device::vision864_pci_device (const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
41
+ : vision864_pci_device (mconfig, VISION864_PCI, tag, owner, clock)
40
42
{
41
43
// device IDs:
42
44
// 88c0 = 86c864 DRAM v0
@@ -54,28 +56,28 @@ ROM_START( vision864 )
54
56
ROM_IGNORE( 0x8000 )
55
57
ROM_END
56
58
57
- const tiny_rom_entry *vision864_device ::device_rom_region() const
59
+ const tiny_rom_entry *vision864_pci_device ::device_rom_region() const
58
60
{
59
61
return ROM_NAME (vision864);
60
62
}
61
63
62
- void vision864_device ::device_add_mconfig (machine_config &config)
64
+ void vision864_pci_device ::device_add_mconfig (machine_config &config)
63
65
{
64
66
screen_device &screen (SCREEN (config, " screen" , SCREEN_TYPE_RASTER));
65
67
screen.set_raw (XTAL (25'174'800 ), 900 , 0 , 640 , 526 , 0 , 480 );
66
- screen.set_screen_update (" vga" , FUNC (s3trio64_vga_device ::screen_update));
68
+ screen.set_screen_update (" vga" , FUNC (s3vision864_vga_device ::screen_update));
67
69
68
- S3_TRIO64_VGA (config, m_vga, 0 );
70
+ S3_VISION864_VGA (config, m_vga, 0 );
69
71
m_vga->set_screen (" screen" );
70
72
// 1MB, option for 2MB
71
73
m_vga->set_vram_size (2 *1024 *1024 );
72
74
}
73
75
74
- void vision864_device ::device_start ()
76
+ void vision864_pci_device ::device_start ()
75
77
{
76
78
pci_card_device::device_start ();
77
79
78
- // add_map(64 * 1024 * 1024, M_MEM | M_DISABLED, FUNC(vision864_device ::lfb_map));
80
+ // add_map(64 * 1024 * 1024, M_MEM | M_DISABLED, FUNC(vision864_pci_device ::lfb_map));
79
81
// set_map_address(0, 0x70000000);
80
82
81
83
add_rom ((u8 *)m_bios->base (), 0x8000 );
@@ -84,7 +86,7 @@ void vision864_device::device_start()
84
86
// TODO: can't read the intr pin reg but still has an INTA#
85
87
}
86
88
87
- void vision864_device ::device_reset ()
89
+ void vision864_pci_device ::device_reset ()
88
90
{
89
91
pci_card_device::device_reset ();
90
92
@@ -96,32 +98,32 @@ void vision864_device::device_reset()
96
98
remap_cb ();
97
99
}
98
100
99
- void vision864_device ::legacy_io_map (address_map &map)
101
+ void vision864_pci_device ::legacy_io_map (address_map &map)
100
102
{
101
- map (0 , 0x02f ).m (m_vga, FUNC (s3trio64_vga_device ::io_map));
103
+ map (0 , 0x02f ).m (m_vga, FUNC (s3vision864_vga_device ::io_map));
102
104
}
103
105
104
- uint8_t vision864_device ::vram_r (offs_t offset)
106
+ uint8_t vision864_pci_device ::vram_r (offs_t offset)
105
107
{
106
- return downcast<s3trio64_vga_device *>(m_vga.target ())->mem_r (offset);
108
+ return downcast<s3vision864_vga_device *>(m_vga.target ())->mem_r (offset);
107
109
}
108
110
109
- void vision864_device ::vram_w (offs_t offset, uint8_t data)
111
+ void vision864_pci_device ::vram_w (offs_t offset, uint8_t data)
110
112
{
111
- downcast<s3trio64_vga_device *>(m_vga.target ())->mem_w (offset, data);
113
+ downcast<s3vision864_vga_device *>(m_vga.target ())->mem_w (offset, data);
112
114
}
113
115
114
- void vision864_device ::map_extra (uint64_t memory_window_start, uint64_t memory_window_end, uint64_t memory_offset, address_space *memory_space,
116
+ void vision864_pci_device ::map_extra (uint64_t memory_window_start, uint64_t memory_window_end, uint64_t memory_offset, address_space *memory_space,
115
117
uint64_t io_window_start, uint64_t io_window_end, uint64_t io_offset, address_space *io_space)
116
118
{
117
119
if (BIT (command, 1 ))
118
120
{
119
- memory_space->install_readwrite_handler (0xa0000 , 0xbffff , read8sm_delegate (*this , FUNC (vision864_device ::vram_r)), write8sm_delegate (*this , FUNC (vision864_device ::vram_w)));
121
+ memory_space->install_readwrite_handler (0xa0000 , 0xbffff , read8sm_delegate (*this , FUNC (vision864_pci_device ::vram_r)), write8sm_delegate (*this , FUNC (vision864_pci_device ::vram_w)));
120
122
}
121
123
122
124
if (BIT (command, 0 ))
123
125
{
124
- io_space->install_device (0x03b0 , 0x03df , *this , &vision864_device ::legacy_io_map);
126
+ io_space->install_device (0x03b0 , 0x03df , *this , &vision864_pci_device ::legacy_io_map);
125
127
}
126
128
}
127
129
@@ -131,13 +133,13 @@ void vision864_device::map_extra(uint64_t memory_window_start, uint64_t memory_w
131
133
*
132
134
*****************/
133
135
134
- vision964_device::vision964_device (const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
135
- : vision864_device (mconfig, type, tag, owner, clock)
136
+ vision964_pci_device::vision964_pci_device (const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
137
+ : vision864_pci_device (mconfig, type, tag, owner, clock)
136
138
{
137
139
}
138
140
139
- vision964_device::vision964_device (const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
140
- : vision964_device (mconfig, VISION964_PCI, tag, owner, clock)
141
+ vision964_pci_device::vision964_pci_device (const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
142
+ : vision964_pci_device (mconfig, VISION964_PCI, tag, owner, clock)
141
143
{
142
144
// device IDs:
143
145
// 88d0-88d1 = 86c964 VRAM v0-1
@@ -154,18 +156,18 @@ ROM_START( vision964 )
154
156
ROMX_LOAD( " mirocrystal.vbi" , 0x0000 , 0x8000 , CRC(d0b0aa1c) SHA1(004e2432c4783f1539a7989e7d9ee422df09e695), ROM_BIOS(0 ) )
155
157
ROM_END
156
158
157
- const tiny_rom_entry *vision964_device ::device_rom_region() const
159
+ const tiny_rom_entry *vision964_pci_device ::device_rom_region() const
158
160
{
159
161
return ROM_NAME (vision964);
160
162
}
161
163
162
- void vision964_device ::device_add_mconfig (machine_config &config)
164
+ void vision964_pci_device ::device_add_mconfig (machine_config &config)
163
165
{
164
166
screen_device &screen (SCREEN (config, " screen" , SCREEN_TYPE_RASTER));
165
167
screen.set_raw (XTAL (25'174'800 ), 900 , 0 , 640 , 526 , 0 , 480 );
166
- screen.set_screen_update (" vga" , FUNC (s3trio64_vga_device ::screen_update));
168
+ screen.set_screen_update (" vga" , FUNC (s3vision964_vga_device ::screen_update));
167
169
168
- S3_TRIO64_VGA (config, m_vga, 0 );
170
+ S3_VISION964_VGA (config, m_vga, 0 );
169
171
m_vga->set_screen (" screen" );
170
172
// 2MB/4MB/8MB
171
173
m_vga->set_vram_size (4 *1024 *1024 );
@@ -178,8 +180,8 @@ void vision964_device::device_add_mconfig(machine_config &config)
178
180
*
179
181
*****************/
180
182
181
- vision968_device::vision968_device (const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
182
- : vision964_device (mconfig, VISION968_PCI, tag, owner, clock)
183
+ vision968_pci_device::vision968_pci_device (const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
184
+ : vision964_pci_device (mconfig, VISION968_PCI, tag, owner, clock)
183
185
{
184
186
// device IDs:
185
187
// 88f0-88f3 = 86c968 RAM v0-3
@@ -204,30 +206,30 @@ ROM_START( vision968 )
204
206
ROM_IGNORE( 0x8000 )
205
207
ROM_END
206
208
207
- const tiny_rom_entry *vision968_device ::device_rom_region() const
209
+ const tiny_rom_entry *vision968_pci_device ::device_rom_region() const
208
210
{
209
211
return ROM_NAME (vision968);
210
212
}
211
213
212
- void vision968_device ::device_add_mconfig (machine_config &config)
214
+ void vision968_pci_device ::device_add_mconfig (machine_config &config)
213
215
{
214
216
screen_device &screen (SCREEN (config, " screen" , SCREEN_TYPE_RASTER));
215
217
screen.set_raw (XTAL (25'174'800 ), 900 , 0 , 640 , 526 , 0 , 480 );
216
- screen.set_screen_update (" vga" , FUNC (s3trio64_vga_device ::screen_update));
218
+ screen.set_screen_update (" vga" , FUNC (s3vision968_vga_device ::screen_update));
217
219
218
- S3_TRIO64_VGA (config, m_vga, 0 );
220
+ S3_VISION968_VGA (config, m_vga, 0 );
219
221
m_vga->set_screen (" screen" );
220
222
// 2MB/4MB/8MB
221
223
m_vga->set_vram_size (4 *1024 *1024 );
222
- // m_vga->linear_config_changed().set(FUNC(s3trio64_vga_device ::linear_config_changed_w));
224
+ // m_vga->linear_config_changed().set(FUNC(s3vision864_vga_device ::linear_config_changed_w));
223
225
}
224
226
225
- void vision968_device ::device_start ()
227
+ void vision968_pci_device ::device_start ()
226
228
{
227
229
pci_card_device::device_start ();
228
230
229
- // add_map(64 * 1024 * 1024, M_MEM | M_DISABLED, FUNC(vision968_device ::lfb_map));
230
- add_map (64 * 1024 * 1024 , M_MEM, FUNC (vision968_device ::lfb_map));
231
+ // add_map(64 * 1024 * 1024, M_MEM | M_DISABLED, FUNC(vision968_pci_device ::lfb_map));
232
+ add_map (64 * 1024 * 1024 , M_MEM, FUNC (vision968_pci_device ::lfb_map));
231
233
set_map_address (0 , 0x70000000 );
232
234
233
235
add_rom ((u8 *)m_bios->base (), 0x8000 );
@@ -237,7 +239,7 @@ void vision968_device::device_start()
237
239
intr_pin = 1 ;
238
240
}
239
241
240
- void vision968_device ::device_reset ()
242
+ void vision968_pci_device ::device_reset ()
241
243
{
242
244
pci_card_device::device_reset ();
243
245
@@ -250,15 +252,15 @@ void vision968_device::device_reset()
250
252
}
251
253
252
254
// TODO: 0x0200'0000 "mirror" (really an endian relocation?)
253
- void vision968_device ::lfb_map (address_map &map)
255
+ void vision968_pci_device ::lfb_map (address_map &map)
254
256
{
255
- map (0x0000'0000 , 0x00ff'ffff ).rw (m_vga, FUNC (s3trio64_vga_device ::mem_linear_r), FUNC (s3trio64_vga_device ::mem_linear_w));
257
+ map (0x0000'0000 , 0x00ff'ffff ).rw (m_vga, FUNC (s3vision864_vga_device ::mem_linear_r), FUNC (s3vision864_vga_device ::mem_linear_w));
256
258
// map(0x0100'0000, 0x0100'7fff) image transfer data
257
- map (0x0100'8000 , 0x0100'803f ).m (FUNC (vision968_device ::config_map));
259
+ map (0x0100'8000 , 0x0100'803f ).m (FUNC (vision968_pci_device ::config_map));
258
260
// map(0x0100'8100, 0x0100'816f) packed copro regs
259
261
// map(0x0100'82e8, 0x0100'82e8) current ypos
260
262
// map(0x0100'82ea, 0x0100'82ea) current ypos-2
261
- map (0x0100'83b0 , 0x0100'83df ).m (m_vga, FUNC (s3trio64_vga_device ::io_map));
263
+ map (0x0100'83b0 , 0x0100'83df ).m (m_vga, FUNC (s3vision968_vga_device ::io_map));
262
264
// map(0x0100'8502, 0x0100'8502) (VGA $0102 alias)
263
265
// map(0x0100'8504, 0x0100'8504) (VGA $42e8 alias)
264
266
// map(0x0100'8508, 0x0100'8508) (VGA $46e8 alias)
@@ -269,10 +271,10 @@ void vision968_device::lfb_map(address_map &map)
269
271
// map(0x0101'8080, 0x0101'809f) Pixel formatter regs
270
272
}
271
273
272
- void vision968_device ::map_extra (uint64_t memory_window_start, uint64_t memory_window_end, uint64_t memory_offset, address_space *memory_space,
274
+ void vision968_pci_device ::map_extra (uint64_t memory_window_start, uint64_t memory_window_end, uint64_t memory_offset, address_space *memory_space,
273
275
uint64_t io_window_start, uint64_t io_window_end, uint64_t io_offset, address_space *io_space)
274
276
{
275
- vision964_device ::map_extra (
277
+ vision964_pci_device ::map_extra (
276
278
memory_window_start, memory_window_end, memory_offset, memory_space,
277
279
io_window_start, io_window_end, io_offset, io_space
278
280
);
0 commit comments