From 0b02c6ff24db7b41d5cd1df911261c53c6e7bcaf Mon Sep 17 00:00:00 2001 From: angelosa Date: Sun, 25 Feb 2024 15:49:00 +0100 Subject: [PATCH] video/pc_vga_s3: bulk rename s3_vga_device -> s3trio64_vga_device --- src/devices/bus/isa/svga_s3.cpp | 8 +++---- src/devices/bus/isa/svga_s3.h | 2 +- src/devices/bus/pci/virge_pci.cpp | 4 ++-- src/devices/bus/pci/vision.cpp | 24 +++++++++---------- src/devices/bus/pci/vision.h | 2 +- src/devices/video/pc_vga_s3.cpp | 38 +++++++++++++++---------------- src/devices/video/pc_vga_s3.h | 8 +++---- src/devices/video/s3virge.cpp | 8 +++---- src/devices/video/s3virge.h | 2 +- src/mame/misc/savquest.cpp | 8 +++---- 10 files changed, 52 insertions(+), 52 deletions(-) diff --git a/src/devices/bus/isa/svga_s3.cpp b/src/devices/bus/isa/svga_s3.cpp index 527fa762ad7..c935e3e0152 100644 --- a/src/devices/bus/isa/svga_s3.cpp +++ b/src/devices/bus/isa/svga_s3.cpp @@ -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))); } //------------------------------------------------- diff --git a/src/devices/bus/isa/svga_s3.h b/src/devices/bus/isa/svga_s3.h index c391443abe0..921eff6f440 100644 --- a/src/devices/bus/isa/svga_s3.h +++ b/src/devices/bus/isa/svga_s3.h @@ -37,7 +37,7 @@ protected: void io_isa_map(address_map &map); private: - required_device m_vga; + required_device m_vga; required_device m_8514; }; diff --git a/src/devices/bus/pci/virge_pci.cpp b/src/devices/bus/pci/virge_pci.cpp index 7dda66ddc14..ae3d7b56662 100644 --- a/src/devices/bus/pci/virge_pci.cpp +++ b/src/devices/bus/pci/virge_pci.cpp @@ -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(m_vga.target())->mem_r(offset); + return downcast(m_vga.target())->mem_r(offset); } void virge_pci_device::vram_w(offs_t offset, uint8_t data) { - downcast(m_vga.target())->mem_w(offset, data); + downcast(m_vga.target())->mem_w(offset, data); } void virge_pci_device::postload() diff --git a/src/devices/bus/pci/vision.cpp b/src/devices/bus/pci/vision.cpp index e463d41ef10..15fd057c040 100644 --- a/src/devices/bus/pci/vision.cpp +++ b/src/devices/bus/pci/vision.cpp @@ -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(m_vga.target())->mem_r(offset); + return downcast(m_vga.target())->mem_r(offset); } void vision864_device::vram_w(offs_t offset, uint8_t data) { - downcast(m_vga.target())->mem_w(offset, data); + downcast(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) diff --git a/src/devices/bus/pci/vision.h b/src/devices/bus/pci/vision.h index e800aa65743..33150702a76 100644 --- a/src/devices/bus/pci/vision.h +++ b/src/devices/bus/pci/vision.h @@ -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 m_vga; + required_device m_vga; required_memory_region m_bios; private: u8 vram_r(offs_t offset); diff --git a/src/devices/video/pc_vga_s3.cpp b/src/devices/video/pc_vga_s3.cpp index 83398f01015..cc29993b972 100644 --- a/src/devices/video/pc_vga_s3.cpp +++ b/src/devices/video/pc_vga_s3.cpp @@ -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); diff --git a/src/devices/video/pc_vga_s3.h b/src/devices/video/pc_vga_s3.h index b3a4060a67d..376ed18ca63 100644 --- a/src/devices/video/pc_vga_s3.h +++ b/src/devices/video/pc_vga_s3.h @@ -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 diff --git a/src/devices/video/s3virge.cpp b/src/devices/video/s3virge.cpp index bd28462a444..bcca234ab90 100644 --- a/src/devices/video/s3virge.cpp +++ b/src/devices/video/s3virge.cpp @@ -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) { diff --git a/src/devices/video/s3virge.h b/src/devices/video/s3virge.h index 812634970cd..d99b14446f5 100644 --- a/src/devices/video/s3virge.h +++ b/src/devices/video/s3virge.h @@ -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 diff --git a/src/mame/misc/savquest.cpp b/src/mame/misc/savquest.cpp index 103e9dfa569..a59d87baa97 100644 --- a/src/mame/misc/savquest.cpp +++ b/src/mame/misc/savquest.cpp @@ -112,7 +112,7 @@ private: std::unique_ptr m_smram; - required_device m_vga; + required_device m_vga; required_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);