Skip to content

Commit 3936865

Browse files
committed
video/pc_vga_s3: separate Vision864/964/968 from Trio64, fix SDD UVCONFIG.EXE detection
1 parent b278713 commit 3936865

File tree

4 files changed

+196
-91
lines changed

4 files changed

+196
-91
lines changed

src/devices/bus/pci/vision.cpp

+50-48
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
S3 Vision 864 / 868 / 964 / 968
66
77
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
911
1012
**************************************************************************************************/
1113

@@ -21,22 +23,22 @@ S3 Vision 864 / 868 / 964 / 968
2123
#define LOGWARN(...) LOGMASKED(LOG_WARN, __VA_ARGS__)
2224

2325

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")
2527
// 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")
2830

2931

3032

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)
3234
: pci_card_device(mconfig, type, tag, owner, clock)
3335
, m_vga(*this, "vga")
3436
, m_bios(*this, "bios")
3537
{
3638
}
3739

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)
4042
{
4143
// device IDs:
4244
// 88c0 = 86c864 DRAM v0
@@ -54,28 +56,28 @@ ROM_START( vision864 )
5456
ROM_IGNORE( 0x8000 )
5557
ROM_END
5658

57-
const tiny_rom_entry *vision864_device::device_rom_region() const
59+
const tiny_rom_entry *vision864_pci_device::device_rom_region() const
5860
{
5961
return ROM_NAME(vision864);
6062
}
6163

62-
void vision864_device::device_add_mconfig(machine_config &config)
64+
void vision864_pci_device::device_add_mconfig(machine_config &config)
6365
{
6466
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
6567
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));
6769

68-
S3_TRIO64_VGA(config, m_vga, 0);
70+
S3_VISION864_VGA(config, m_vga, 0);
6971
m_vga->set_screen("screen");
7072
// 1MB, option for 2MB
7173
m_vga->set_vram_size(2*1024*1024);
7274
}
7375

74-
void vision864_device::device_start()
76+
void vision864_pci_device::device_start()
7577
{
7678
pci_card_device::device_start();
7779

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));
7981
// set_map_address(0, 0x70000000);
8082

8183
add_rom((u8 *)m_bios->base(), 0x8000);
@@ -84,7 +86,7 @@ void vision864_device::device_start()
8486
// TODO: can't read the intr pin reg but still has an INTA#
8587
}
8688

87-
void vision864_device::device_reset()
89+
void vision864_pci_device::device_reset()
8890
{
8991
pci_card_device::device_reset();
9092

@@ -96,32 +98,32 @@ void vision864_device::device_reset()
9698
remap_cb();
9799
}
98100

99-
void vision864_device::legacy_io_map(address_map &map)
101+
void vision864_pci_device::legacy_io_map(address_map &map)
100102
{
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));
102104
}
103105

104-
uint8_t vision864_device::vram_r(offs_t offset)
106+
uint8_t vision864_pci_device::vram_r(offs_t offset)
105107
{
106-
return downcast<s3trio64_vga_device *>(m_vga.target())->mem_r(offset);
108+
return downcast<s3vision864_vga_device *>(m_vga.target())->mem_r(offset);
107109
}
108110

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)
110112
{
111-
downcast<s3trio64_vga_device *>(m_vga.target())->mem_w(offset, data);
113+
downcast<s3vision864_vga_device *>(m_vga.target())->mem_w(offset, data);
112114
}
113115

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,
115117
uint64_t io_window_start, uint64_t io_window_end, uint64_t io_offset, address_space *io_space)
116118
{
117119
if (BIT(command, 1))
118120
{
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)));
120122
}
121123

122124
if (BIT(command, 0))
123125
{
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);
125127
}
126128
}
127129

@@ -131,13 +133,13 @@ void vision864_device::map_extra(uint64_t memory_window_start, uint64_t memory_w
131133
*
132134
*****************/
133135

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)
136138
{
137139
}
138140

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)
141143
{
142144
// device IDs:
143145
// 88d0-88d1 = 86c964 VRAM v0-1
@@ -154,18 +156,18 @@ ROM_START( vision964 )
154156
ROMX_LOAD( "mirocrystal.vbi", 0x0000, 0x8000, CRC(d0b0aa1c) SHA1(004e2432c4783f1539a7989e7d9ee422df09e695), ROM_BIOS(0) )
155157
ROM_END
156158

157-
const tiny_rom_entry *vision964_device::device_rom_region() const
159+
const tiny_rom_entry *vision964_pci_device::device_rom_region() const
158160
{
159161
return ROM_NAME(vision964);
160162
}
161163

162-
void vision964_device::device_add_mconfig(machine_config &config)
164+
void vision964_pci_device::device_add_mconfig(machine_config &config)
163165
{
164166
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
165167
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));
167169

168-
S3_TRIO64_VGA(config, m_vga, 0);
170+
S3_VISION964_VGA(config, m_vga, 0);
169171
m_vga->set_screen("screen");
170172
// 2MB/4MB/8MB
171173
m_vga->set_vram_size(4*1024*1024);
@@ -178,8 +180,8 @@ void vision964_device::device_add_mconfig(machine_config &config)
178180
*
179181
*****************/
180182

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)
183185
{
184186
// device IDs:
185187
// 88f0-88f3 = 86c968 RAM v0-3
@@ -204,30 +206,30 @@ ROM_START( vision968 )
204206
ROM_IGNORE( 0x8000 )
205207
ROM_END
206208

207-
const tiny_rom_entry *vision968_device::device_rom_region() const
209+
const tiny_rom_entry *vision968_pci_device::device_rom_region() const
208210
{
209211
return ROM_NAME(vision968);
210212
}
211213

212-
void vision968_device::device_add_mconfig(machine_config &config)
214+
void vision968_pci_device::device_add_mconfig(machine_config &config)
213215
{
214216
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
215217
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));
217219

218-
S3_TRIO64_VGA(config, m_vga, 0);
220+
S3_VISION968_VGA(config, m_vga, 0);
219221
m_vga->set_screen("screen");
220222
// 2MB/4MB/8MB
221223
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));
223225
}
224226

225-
void vision968_device::device_start()
227+
void vision968_pci_device::device_start()
226228
{
227229
pci_card_device::device_start();
228230

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));
231233
set_map_address(0, 0x70000000);
232234

233235
add_rom((u8 *)m_bios->base(), 0x8000);
@@ -237,7 +239,7 @@ void vision968_device::device_start()
237239
intr_pin = 1;
238240
}
239241

240-
void vision968_device::device_reset()
242+
void vision968_pci_device::device_reset()
241243
{
242244
pci_card_device::device_reset();
243245

@@ -250,15 +252,15 @@ void vision968_device::device_reset()
250252
}
251253

252254
// 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)
254256
{
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));
256258
// 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));
258260
// map(0x0100'8100, 0x0100'816f) packed copro regs
259261
// map(0x0100'82e8, 0x0100'82e8) current ypos
260262
// 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));
262264
// map(0x0100'8502, 0x0100'8502) (VGA $0102 alias)
263265
// map(0x0100'8504, 0x0100'8504) (VGA $42e8 alias)
264266
// map(0x0100'8508, 0x0100'8508) (VGA $46e8 alias)
@@ -269,10 +271,10 @@ void vision968_device::lfb_map(address_map &map)
269271
// map(0x0101'8080, 0x0101'809f) Pixel formatter regs
270272
}
271273

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,
273275
uint64_t io_window_start, uint64_t io_window_end, uint64_t io_offset, address_space *io_space)
274276
{
275-
vision964_device::map_extra(
277+
vision964_pci_device::map_extra(
276278
memory_window_start, memory_window_end, memory_offset, memory_space,
277279
io_window_start, io_window_end, io_offset, io_space
278280
);

src/devices/bus/pci/vision.h

+12-12
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,17 @@
1010

1111
#include "video/pc_vga_s3.h"
1212

13-
class vision864_device : public pci_card_device
13+
class vision864_pci_device : public pci_card_device
1414
{
1515
public:
16-
vision864_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
16+
vision864_pci_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
1717

1818
static constexpr feature_type imperfect_features() { return feature::GRAPHICS; }
1919

2020
void legacy_io_map(address_map &map);
2121

2222
protected:
23-
vision864_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
23+
vision864_pci_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
2424

2525
virtual void device_start() override;
2626
virtual void device_reset() override;
@@ -31,30 +31,30 @@ class vision864_device : public pci_card_device
3131
virtual void map_extra(uint64_t memory_window_start, uint64_t memory_window_end, uint64_t memory_offset, address_space *memory_space,
3232
uint64_t io_window_start, uint64_t io_window_end, uint64_t io_offset, address_space *io_space) override;
3333

34-
required_device<s3trio64_vga_device> m_vga;
34+
required_device<s3vision864_vga_device> m_vga;
3535
required_memory_region m_bios;
3636
private:
3737
u8 vram_r(offs_t offset);
3838
void vram_w(offs_t offset, uint8_t data);
3939
};
4040

41-
class vision964_device : public vision864_device
41+
class vision964_pci_device : public vision864_pci_device
4242
{
4343
public:
44-
vision964_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
44+
vision964_pci_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
4545

4646
protected:
47-
vision964_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
47+
vision964_pci_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
4848

4949
virtual void device_add_mconfig(machine_config &config) override;
5050

5151
virtual const tiny_rom_entry *device_rom_region() const override;
5252
};
5353

54-
class vision968_device : public vision964_device
54+
class vision968_pci_device : public vision964_pci_device
5555
{
5656
public:
57-
vision968_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
57+
vision968_pci_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
5858

5959
protected:
6060
virtual void device_add_mconfig(machine_config &config) override;
@@ -69,8 +69,8 @@ class vision968_device : public vision964_device
6969
void lfb_map(address_map &map);
7070
};
7171

72-
DECLARE_DEVICE_TYPE(VISION864_PCI, vision864_device)
73-
DECLARE_DEVICE_TYPE(VISION964_PCI, vision964_device)
74-
DECLARE_DEVICE_TYPE(VISION968_PCI, vision968_device)
72+
DECLARE_DEVICE_TYPE(VISION864_PCI, vision864_pci_device)
73+
DECLARE_DEVICE_TYPE(VISION964_PCI, vision964_pci_device)
74+
DECLARE_DEVICE_TYPE(VISION968_PCI, vision968_pci_device)
7575

7676
#endif // MAME_BUS_PCI_S3VISION_PCI_H

0 commit comments

Comments
 (0)