mirror of
https://github.com/holub/mame
synced 2025-04-23 08:49:55 +03:00
video/pc_vga_s3: bulk rename s3_vga_device -> s3trio64_vga_device
This commit is contained in:
parent
29f3e69bd8
commit
0b02c6ff24
@ -75,9 +75,9 @@ void isa16_svga_s3_device::device_add_mconfig(machine_config &config)
|
||||
{
|
||||
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
|
||||
screen.set_raw(25.175_MHz_XTAL, 800, 0, 640, 524, 0, 480);
|
||||
screen.set_screen_update(m_vga, FUNC(s3_vga_device::screen_update));
|
||||
screen.set_screen_update(m_vga, FUNC(s3trio64_vga_device::screen_update));
|
||||
|
||||
S3_VGA(config, m_vga, 0);
|
||||
S3_TRIO64_VGA(config, m_vga, 0);
|
||||
m_vga->set_screen("screen");
|
||||
m_vga->set_vram_size(0x100000);
|
||||
}
|
||||
@ -108,7 +108,7 @@ isa16_svga_s3_device::isa16_svga_s3_device(const machine_config &mconfig, const
|
||||
|
||||
void isa16_svga_s3_device::io_isa_map(address_map &map)
|
||||
{
|
||||
map(0x00, 0x2f).m(m_vga, FUNC(s3_vga_device::io_map));
|
||||
map(0x00, 0x2f).m(m_vga, FUNC(s3trio64_vga_device::io_map));
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
@ -141,7 +141,7 @@ void isa16_svga_s3_device::device_start()
|
||||
m_isa->install16_device(0xbee8, 0xbeeb, read16smo_delegate(*m_8514, FUNC(ibm8514a_device::ibm8514_multifunc_r)), write16smo_delegate(*m_8514, FUNC(ibm8514a_device::ibm8514_multifunc_w)));
|
||||
m_isa->install16_device(0xe2e8, 0xe2eb, read16sm_delegate(*m_8514, FUNC(ibm8514a_device::ibm8514_pixel_xfer_r)), write16sm_delegate(*m_8514, FUNC(ibm8514a_device::ibm8514_pixel_xfer_w)));
|
||||
|
||||
m_isa->install_memory(0xa0000, 0xbffff, read8sm_delegate(*m_vga, FUNC(s3_vga_device::mem_r)), write8sm_delegate(*m_vga, FUNC(s3_vga_device::mem_w)));
|
||||
m_isa->install_memory(0xa0000, 0xbffff, read8sm_delegate(*m_vga, FUNC(s3trio64_vga_device::mem_r)), write8sm_delegate(*m_vga, FUNC(s3trio64_vga_device::mem_w)));
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
|
@ -37,7 +37,7 @@ protected:
|
||||
void io_isa_map(address_map &map);
|
||||
|
||||
private:
|
||||
required_device<s3_vga_device> m_vga;
|
||||
required_device<s3trio64_vga_device> m_vga;
|
||||
required_device<ibm8514a_device> m_8514;
|
||||
};
|
||||
|
||||
|
@ -128,12 +128,12 @@ void virge_pci_device::linear_config_changed_w(int state)
|
||||
|
||||
uint8_t virge_pci_device::vram_r(offs_t offset)
|
||||
{
|
||||
return downcast<s3_vga_device *>(m_vga.target())->mem_r(offset);
|
||||
return downcast<s3virge_vga_device *>(m_vga.target())->mem_r(offset);
|
||||
}
|
||||
|
||||
void virge_pci_device::vram_w(offs_t offset, uint8_t data)
|
||||
{
|
||||
downcast<s3_vga_device *>(m_vga.target())->mem_w(offset, data);
|
||||
downcast<s3virge_vga_device *>(m_vga.target())->mem_w(offset, data);
|
||||
}
|
||||
|
||||
void virge_pci_device::postload()
|
||||
|
@ -63,9 +63,9 @@ void vision864_device::device_add_mconfig(machine_config &config)
|
||||
{
|
||||
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
|
||||
screen.set_raw(XTAL(25'174'800), 900, 0, 640, 526, 0, 480);
|
||||
screen.set_screen_update("vga", FUNC(s3_vga_device::screen_update));
|
||||
screen.set_screen_update("vga", FUNC(s3trio64_vga_device::screen_update));
|
||||
|
||||
S3_VGA(config, m_vga, 0);
|
||||
S3_TRIO64_VGA(config, m_vga, 0);
|
||||
m_vga->set_screen("screen");
|
||||
// 1MB, option for 2MB
|
||||
m_vga->set_vram_size(2*1024*1024);
|
||||
@ -98,17 +98,17 @@ void vision864_device::device_reset()
|
||||
|
||||
void vision864_device::legacy_io_map(address_map &map)
|
||||
{
|
||||
map(0, 0x02f).m(m_vga, FUNC(s3_vga_device::io_map));
|
||||
map(0, 0x02f).m(m_vga, FUNC(s3trio64_vga_device::io_map));
|
||||
}
|
||||
|
||||
uint8_t vision864_device::vram_r(offs_t offset)
|
||||
{
|
||||
return downcast<s3_vga_device *>(m_vga.target())->mem_r(offset);
|
||||
return downcast<s3trio64_vga_device *>(m_vga.target())->mem_r(offset);
|
||||
}
|
||||
|
||||
void vision864_device::vram_w(offs_t offset, uint8_t data)
|
||||
{
|
||||
downcast<s3_vga_device *>(m_vga.target())->mem_w(offset, data);
|
||||
downcast<s3trio64_vga_device *>(m_vga.target())->mem_w(offset, data);
|
||||
}
|
||||
|
||||
void vision864_device::map_extra(uint64_t memory_window_start, uint64_t memory_window_end, uint64_t memory_offset, address_space *memory_space,
|
||||
@ -163,9 +163,9 @@ void vision964_device::device_add_mconfig(machine_config &config)
|
||||
{
|
||||
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
|
||||
screen.set_raw(XTAL(25'174'800), 900, 0, 640, 526, 0, 480);
|
||||
screen.set_screen_update("vga", FUNC(s3_vga_device::screen_update));
|
||||
screen.set_screen_update("vga", FUNC(s3trio64_vga_device::screen_update));
|
||||
|
||||
S3_VGA(config, m_vga, 0);
|
||||
S3_TRIO64_VGA(config, m_vga, 0);
|
||||
m_vga->set_screen("screen");
|
||||
// 2MB/4MB/8MB
|
||||
m_vga->set_vram_size(4*1024*1024);
|
||||
@ -213,13 +213,13 @@ void vision968_device::device_add_mconfig(machine_config &config)
|
||||
{
|
||||
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
|
||||
screen.set_raw(XTAL(25'174'800), 900, 0, 640, 526, 0, 480);
|
||||
screen.set_screen_update("vga", FUNC(s3_vga_device::screen_update));
|
||||
screen.set_screen_update("vga", FUNC(s3trio64_vga_device::screen_update));
|
||||
|
||||
S3_VGA(config, m_vga, 0);
|
||||
S3_TRIO64_VGA(config, m_vga, 0);
|
||||
m_vga->set_screen("screen");
|
||||
// 2MB/4MB/8MB
|
||||
m_vga->set_vram_size(4*1024*1024);
|
||||
// m_vga->linear_config_changed().set(FUNC(s3_vga_device::linear_config_changed_w));
|
||||
// m_vga->linear_config_changed().set(FUNC(s3trio64_vga_device::linear_config_changed_w));
|
||||
}
|
||||
|
||||
void vision968_device::device_start()
|
||||
@ -252,13 +252,13 @@ void vision968_device::device_reset()
|
||||
// TODO: 0x0200'0000 "mirror" (really an endian relocation?)
|
||||
void vision968_device::lfb_map(address_map &map)
|
||||
{
|
||||
map(0x0000'0000, 0x00ff'ffff).rw(m_vga, FUNC(s3_vga_device::mem_linear_r), FUNC(s3_vga_device::mem_linear_w));
|
||||
map(0x0000'0000, 0x00ff'ffff).rw(m_vga, FUNC(s3trio64_vga_device::mem_linear_r), FUNC(s3trio64_vga_device::mem_linear_w));
|
||||
// map(0x0100'0000, 0x0100'7fff) image transfer data
|
||||
map(0x0100'8000, 0x0100'803f).m(FUNC(vision968_device::config_map));
|
||||
// map(0x0100'8100, 0x0100'816f) packed copro regs
|
||||
// map(0x0100'82e8, 0x0100'82e8) current ypos
|
||||
// map(0x0100'82ea, 0x0100'82ea) current ypos-2
|
||||
map(0x0100'83b0, 0x0100'83df).m(m_vga, FUNC(s3_vga_device::io_map));
|
||||
map(0x0100'83b0, 0x0100'83df).m(m_vga, FUNC(s3trio64_vga_device::io_map));
|
||||
// map(0x0100'8502, 0x0100'8502) (VGA $0102 alias)
|
||||
// map(0x0100'8504, 0x0100'8504) (VGA $42e8 alias)
|
||||
// map(0x0100'8508, 0x0100'8508) (VGA $46e8 alias)
|
||||
|
@ -31,7 +31,7 @@ protected:
|
||||
virtual void map_extra(uint64_t memory_window_start, uint64_t memory_window_end, uint64_t memory_offset, address_space *memory_space,
|
||||
uint64_t io_window_start, uint64_t io_window_end, uint64_t io_offset, address_space *io_space) override;
|
||||
|
||||
required_device<s3_vga_device> m_vga;
|
||||
required_device<s3trio64_vga_device> m_vga;
|
||||
required_memory_region m_bios;
|
||||
private:
|
||||
u8 vram_r(offs_t offset);
|
||||
|
@ -22,27 +22,27 @@ enum
|
||||
};
|
||||
|
||||
|
||||
DEFINE_DEVICE_TYPE(S3_VGA, s3_vga_device, "s3_vga", "S3 Graphics VGA")
|
||||
DEFINE_DEVICE_TYPE(S3_TRIO64_VGA, s3trio64_vga_device, "s3_vga", "S3 86c764 Trio64 VGA i/f")
|
||||
|
||||
s3_vga_device::s3_vga_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
|
||||
: s3_vga_device(mconfig, S3_VGA, tag, owner, clock)
|
||||
s3trio64_vga_device::s3trio64_vga_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
|
||||
: s3trio64_vga_device(mconfig, S3_TRIO64_VGA, tag, owner, clock)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
s3_vga_device::s3_vga_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
|
||||
s3trio64_vga_device::s3trio64_vga_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
|
||||
: svga_device(mconfig, type, tag, owner, clock)
|
||||
{
|
||||
m_crtc_space_config = address_space_config("crtc_regs", ENDIANNESS_LITTLE, 8, 8, 0, address_map_constructor(FUNC(s3_vga_device::crtc_map), this));
|
||||
m_seq_space_config = address_space_config("sequencer_regs", ENDIANNESS_LITTLE, 8, 8, 0, address_map_constructor(FUNC(s3_vga_device::sequencer_map), this));
|
||||
m_crtc_space_config = address_space_config("crtc_regs", ENDIANNESS_LITTLE, 8, 8, 0, address_map_constructor(FUNC(s3trio64_vga_device::crtc_map), this));
|
||||
m_seq_space_config = address_space_config("sequencer_regs", ENDIANNESS_LITTLE, 8, 8, 0, address_map_constructor(FUNC(s3trio64_vga_device::sequencer_map), this));
|
||||
}
|
||||
|
||||
void s3_vga_device::device_add_mconfig(machine_config &config)
|
||||
void s3trio64_vga_device::device_add_mconfig(machine_config &config)
|
||||
{
|
||||
IBM8514A(config, "8514a", 0).set_vga_owner();
|
||||
}
|
||||
|
||||
TIMER_CALLBACK_MEMBER(s3_vga_device::vblank_timer_cb)
|
||||
TIMER_CALLBACK_MEMBER(s3trio64_vga_device::vblank_timer_cb)
|
||||
{
|
||||
// not sure if this is correct, but XF86_S3 seems to expect the viewport scrolling to be faster
|
||||
if(s3.memory_config & 0x08)
|
||||
@ -53,7 +53,7 @@ TIMER_CALLBACK_MEMBER(s3_vga_device::vblank_timer_cb)
|
||||
m_vblank_timer->adjust( screen().time_until_pos(vga.crtc.vert_blank_start + vga.crtc.vert_blank_end) );
|
||||
}
|
||||
|
||||
void s3_vga_device::device_start()
|
||||
void s3trio64_vga_device::device_start()
|
||||
{
|
||||
svga_device::device_start();
|
||||
memset(&s3, 0, sizeof(s3));
|
||||
@ -73,7 +73,7 @@ void s3_vga_device::device_start()
|
||||
// s3.id_cr30 = 0xc1;
|
||||
}
|
||||
|
||||
void s3_vga_device::device_reset()
|
||||
void s3trio64_vga_device::device_reset()
|
||||
{
|
||||
vga_device::device_reset();
|
||||
// Power-on strapping bits. Sampled at reset, but can be modified later.
|
||||
@ -84,13 +84,13 @@ void s3_vga_device::device_reset()
|
||||
s3.sr11 = 0x41;
|
||||
}
|
||||
|
||||
u16 s3_vga_device::line_compare_mask()
|
||||
u16 s3trio64_vga_device::line_compare_mask()
|
||||
{
|
||||
// TODO: pinpoint condition
|
||||
return svga.rgb8_en ? 0x7ff : 0x3ff;
|
||||
}
|
||||
|
||||
uint16_t s3_vga_device::offset()
|
||||
uint16_t s3trio64_vga_device::offset()
|
||||
{
|
||||
//popmessage("Offset: %04x %s %s %s",vga.crtc.offset,vga.crtc.dw?"DW":"--",vga.crtc.word_mode?"BYTE":"WORD",(s3.memory_config & 0x08)?"31":"--");
|
||||
if(s3.memory_config & 0x08)
|
||||
@ -98,7 +98,7 @@ uint16_t s3_vga_device::offset()
|
||||
return vga_device::offset();
|
||||
}
|
||||
|
||||
void s3_vga_device::s3_define_video_mode()
|
||||
void s3trio64_vga_device::s3_define_video_mode()
|
||||
{
|
||||
int divisor = 1;
|
||||
int xtal = ((vga.miscellaneous_output & 0xc) ? XTAL(28'636'363) : XTAL(25'174'800)).value();
|
||||
@ -151,7 +151,7 @@ void s3_vga_device::s3_define_video_mode()
|
||||
recompute_params_clock(divisor, xtal);
|
||||
}
|
||||
|
||||
void s3_vga_device::refresh_pitch_offset()
|
||||
void s3trio64_vga_device::refresh_pitch_offset()
|
||||
{
|
||||
// bit 2 = bit 8 of offset register, but only if bits 4-5 of CR51 are 00h.
|
||||
vga.crtc.offset &= 0xff;
|
||||
@ -161,7 +161,7 @@ void s3_vga_device::refresh_pitch_offset()
|
||||
vga.crtc.offset |= (s3.cr51 & 0x30) << 4;
|
||||
}
|
||||
|
||||
void s3_vga_device::crtc_map(address_map &map)
|
||||
void s3trio64_vga_device::crtc_map(address_map &map)
|
||||
{
|
||||
svga_device::crtc_map(map);
|
||||
map(0x2d, 0x2d).lr8(
|
||||
@ -665,7 +665,7 @@ bit 0 Vertical Total bit 10. Bit 10 of the Vertical Total register (3d4h
|
||||
);
|
||||
}
|
||||
|
||||
void s3_vga_device::sequencer_map(address_map &map)
|
||||
void s3trio64_vga_device::sequencer_map(address_map &map)
|
||||
{
|
||||
svga_device::sequencer_map(map);
|
||||
// TODO: SR8 (unlocks SRD)
|
||||
@ -721,7 +721,7 @@ void s3_vga_device::sequencer_map(address_map &map)
|
||||
);
|
||||
}
|
||||
|
||||
uint8_t s3_vga_device::mem_r(offs_t offset)
|
||||
uint8_t s3trio64_vga_device::mem_r(offs_t offset)
|
||||
{
|
||||
if (svga.rgb8_en || svga.rgb15_en || svga.rgb16_en || svga.rgb32_en)
|
||||
{
|
||||
@ -755,7 +755,7 @@ uint8_t s3_vga_device::mem_r(offs_t offset)
|
||||
return 0xff;
|
||||
}
|
||||
|
||||
void s3_vga_device::mem_w(offs_t offset, uint8_t data)
|
||||
void s3trio64_vga_device::mem_w(offs_t offset, uint8_t data)
|
||||
{
|
||||
ibm8514a_device* dev = get_8514();
|
||||
// bit 4 of CR53 enables memory-mapped I/O
|
||||
@ -1025,7 +1025,7 @@ void s3_vga_device::mem_w(offs_t offset, uint8_t data)
|
||||
}
|
||||
|
||||
|
||||
uint32_t s3_vga_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
|
||||
uint32_t s3trio64_vga_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
|
||||
{
|
||||
svga_device::screen_update(screen, bitmap, cliprect);
|
||||
|
||||
|
@ -11,11 +11,11 @@
|
||||
#include "screen.h"
|
||||
|
||||
|
||||
class s3_vga_device : public svga_device
|
||||
class s3trio64_vga_device : public svga_device
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
s3_vga_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
s3trio64_vga_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
virtual uint8_t mem_r(offs_t offset) override;
|
||||
virtual void mem_w(offs_t offset, uint8_t data) override;
|
||||
@ -27,7 +27,7 @@ public:
|
||||
ibm8514a_device* get_8514() { return m_8514; }
|
||||
|
||||
protected:
|
||||
s3_vga_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
|
||||
s3trio64_vga_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
// device-level overrides
|
||||
virtual void device_start() override;
|
||||
@ -98,6 +98,6 @@ private:
|
||||
};
|
||||
|
||||
// device type definition
|
||||
DECLARE_DEVICE_TYPE(S3_VGA, s3_vga_device)
|
||||
DECLARE_DEVICE_TYPE(S3_TRIO64_VGA, s3trio64_vga_device)
|
||||
|
||||
#endif // MAME_VIDEO_PC_VGA_S3_H
|
||||
|
@ -59,7 +59,7 @@ s3virge_vga_device::s3virge_vga_device(const machine_config &mconfig, const char
|
||||
}
|
||||
|
||||
s3virge_vga_device::s3virge_vga_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
|
||||
: s3_vga_device(mconfig, type, tag, owner, clock)
|
||||
: s3trio64_vga_device(mconfig, type, tag, owner, clock)
|
||||
, m_linear_config_changed_cb(*this)
|
||||
{
|
||||
}
|
||||
@ -154,7 +154,7 @@ void s3virgedx_rev1_vga_device::device_start()
|
||||
|
||||
void s3virge_vga_device::device_reset()
|
||||
{
|
||||
s3_vga_device::device_reset();
|
||||
s3trio64_vga_device::device_reset();
|
||||
// Power-on strapping bits. Sampled at reset, but can be modified later.
|
||||
// These are just assumed defaults.
|
||||
s3.strapping = 0x000f0912;
|
||||
@ -191,12 +191,12 @@ uint16_t s3virge_vga_device::offset()
|
||||
// this breaks VBETest, which detects these VESA modes as 32bpp.
|
||||
if(svga.rgb24_en)
|
||||
return vga.crtc.offset * 6;
|
||||
return s3_vga_device::offset();
|
||||
return s3trio64_vga_device::offset();
|
||||
}
|
||||
|
||||
void s3virge_vga_device::crtc_map(address_map &map)
|
||||
{
|
||||
s3_vga_device::crtc_map(map);
|
||||
s3trio64_vga_device::crtc_map(map);
|
||||
// TODO: verify these overrides
|
||||
map(0x3a, 0x3a).lw8(
|
||||
NAME([this] (offs_t offset, u8 data) {
|
||||
|
@ -16,7 +16,7 @@
|
||||
|
||||
// ======================> s3virge_vga_device
|
||||
|
||||
class s3virge_vga_device : public s3_vga_device
|
||||
class s3virge_vga_device : public s3trio64_vga_device
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
|
@ -112,7 +112,7 @@ private:
|
||||
|
||||
std::unique_ptr<uint8_t[]> m_smram;
|
||||
|
||||
required_device<s3_vga_device> m_vga;
|
||||
required_device<s3trio64_vga_device> m_vga;
|
||||
required_device<voodoo_2_device> m_voodoo;
|
||||
|
||||
int m_haspind = 0;
|
||||
@ -788,7 +788,7 @@ void savquest_state::savquest_io(address_map &map)
|
||||
map(0x0170, 0x0177).rw("ide2", FUNC(ide_controller_32_device::cs0_r), FUNC(ide_controller_32_device::cs0_w));
|
||||
map(0x01f0, 0x01f7).rw("ide", FUNC(ide_controller_32_device::cs0_r), FUNC(ide_controller_32_device::cs0_w));
|
||||
map(0x0378, 0x037b).rw(FUNC(savquest_state::parallel_port_r), FUNC(savquest_state::parallel_port_w));
|
||||
map(0x03b0, 0x03df).m("vga", FUNC(s3_vga_device::io_map));
|
||||
map(0x03b0, 0x03df).m("vga", FUNC(s3trio64_vga_device::io_map));
|
||||
map(0x0370, 0x0377).rw("ide2", FUNC(ide_controller_32_device::cs1_r), FUNC(ide_controller_32_device::cs1_w));
|
||||
map(0x03f0, 0x03f7).rw("ide", FUNC(ide_controller_32_device::cs1_r), FUNC(ide_controller_32_device::cs1_w));
|
||||
|
||||
@ -871,9 +871,9 @@ void savquest_state::savquest(machine_config &config)
|
||||
// TODO: map to ISA bus, make sure that the Voodoo can override s3 in screen update
|
||||
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
|
||||
screen.set_raw(25.1748_MHz_XTAL, 900, 0, 640, 526, 0, 480);
|
||||
screen.set_screen_update("vga", FUNC(s3_vga_device::screen_update));
|
||||
screen.set_screen_update("vga", FUNC(s3trio64_vga_device::screen_update));
|
||||
|
||||
s3_vga_device &vga(S3_VGA(config, "vga", 0));
|
||||
s3trio64_vga_device &vga(S3_TRIO64_VGA(config, "vga", 0));
|
||||
vga.set_screen("screen");
|
||||
vga.set_vram_size(0x100000);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user