From f8458dbb29d826cbf8157c42b0a6446a2aef4d0d Mon Sep 17 00:00:00 2001 From: angelosa Date: Sat, 16 Nov 2024 15:50:57 +0100 Subject: [PATCH] video/pc_vga_tseng: implement extended start address register --- src/devices/bus/isa/svga_tseng.cpp | 4 ++-- src/devices/video/pc_vga_tseng.cpp | 37 +++++++++++++++++++++++++++--- src/devices/video/pc_vga_tseng.h | 6 +++++ 3 files changed, 42 insertions(+), 5 deletions(-) diff --git a/src/devices/bus/isa/svga_tseng.cpp b/src/devices/bus/isa/svga_tseng.cpp index e48a4004ca9..639a69e8371 100644 --- a/src/devices/bus/isa/svga_tseng.cpp +++ b/src/devices/bus/isa/svga_tseng.cpp @@ -163,7 +163,7 @@ isa16_svga_et4k_w32i_device::isa16_svga_et4k_w32i_device(const machine_config &m ROM_START( et4kw32i ) ROM_REGION(0x8000,"vga_rom", 0) - ROM_SYSTEM_BIOS(0, "v800n", "Tseng Version 8.00N 04/28/95") + ROM_SYSTEM_BIOS(0, "v800n", "Tseng Version 8.00N 04/28/95 ISA 06/17/95") ROMX_LOAD("et4kw32i.vbi", 0x00000, 0x8000, CRC(14542962) SHA1(d5aee7205af8bd1fef0ecf1db2c07308a2b10b17), ROM_BIOS(0) ) ROM_END @@ -189,7 +189,7 @@ void isa16_svga_et4k_w32i_device::device_start() set_isa_device(); remap(AS_PROGRAM, 0, 0xfffff); - remap(AS_IO, 0, 0x3ff); + remap(AS_IO, 0, 0xffff); } void isa16_svga_et4k_w32i_device::device_reset() diff --git a/src/devices/video/pc_vga_tseng.cpp b/src/devices/video/pc_vga_tseng.cpp index 42549b05630..c03c5263b9a 100644 --- a/src/devices/video/pc_vga_tseng.cpp +++ b/src/devices/video/pc_vga_tseng.cpp @@ -22,8 +22,8 @@ DEFINE_DEVICE_TYPE(TSENG_VGA, tseng_vga_device, "tseng_vga", "Tseng Labs ET4000AX VGA i/f") -tseng_vga_device::tseng_vga_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : svga_device(mconfig, TSENG_VGA, tag, owner, clock) +tseng_vga_device::tseng_vga_device(const machine_config &mconfig, const char *tag, device_type type, device_t *owner, uint32_t clock) + : svga_device(mconfig, type, tag, owner, clock) { m_main_if_space_config = address_space_config("io_regs", ENDIANNESS_LITTLE, 8, 4, 0, address_map_constructor(FUNC(tseng_vga_device::io_3bx_3dx_map), this)); m_crtc_space_config = address_space_config("crtc_regs", ENDIANNESS_LITTLE, 8, 8, 0, address_map_constructor(FUNC(tseng_vga_device::crtc_map), this)); @@ -31,6 +31,11 @@ tseng_vga_device::tseng_vga_device(const machine_config &mconfig, const char *ta m_atc_space_config = address_space_config("attribute_regs", ENDIANNESS_LITTLE, 8, 8, 0, address_map_constructor(FUNC(tseng_vga_device::attribute_map), this)); } +tseng_vga_device::tseng_vga_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : tseng_vga_device(mconfig, tag, TSENG_VGA, owner, clock) +{ +} + void tseng_vga_device::device_start() { svga_device::device_start(); @@ -120,7 +125,23 @@ void tseng_vga_device::crtc_map(address_map &map) // map(0x30, 0x30) System Segment Map Comparator // map(0x31, 0x31) General Purpose (& Clock Select 3/4) // map(0x32, 0x32) RAS/CAS Configuration (RCCONF) -// map(0x33, 0x33) Extended Start Address + /* + * ---- xx-- Cursor address bits 16-17 + * ---- --xx Start address bits 16-17 + */ +// Extended Start Address + map(0x33, 0x33).lrw8( + NAME([this] (offs_t offset) { + return et4k.crtc_ext_start; + }), + NAME([this] (offs_t offset, u8 data) { + et4k.crtc_ext_start = data; + vga.crtc.start_addr_latch &= ~0x30000; + vga.crtc.start_addr_latch |= ((data & 0x3) << 16); + vga.crtc.cursor_addr &= ~0x30000; + vga.crtc.cursor_addr |= ((data & 0xc) << 14); + }) + ); // Auxiliary Control map(0x34, 0x34).lrw8( NAME([this] (offs_t offset) { @@ -274,3 +295,13 @@ void tseng_vga_device::mem_w(offs_t offset, uint8_t data) vga_device::mem_w(offset,data); } +uint32_t tseng_vga_device::latch_start_addr() +{ + // TODO: condition for this (SDD scroll/buffer tests) + if(svga.rgb8_en) + { + return vga.crtc.start_addr_latch << 2; + } + return vga.crtc.start_addr_latch; +} + diff --git a/src/devices/video/pc_vga_tseng.h b/src/devices/video/pc_vga_tseng.h index 129717c827d..8dceb834360 100644 --- a/src/devices/video/pc_vga_tseng.h +++ b/src/devices/video/pc_vga_tseng.h @@ -23,6 +23,8 @@ public: virtual void mem_w(offs_t offset, uint8_t data) override; protected: + tseng_vga_device(const machine_config &mconfig, const char *tag, device_type type, device_t *owner, uint32_t clock); + virtual void device_start() override ATTR_COLD; virtual void io_3bx_3dx_map(address_map &map) override ATTR_COLD; @@ -37,6 +39,8 @@ protected: virtual void attribute_map(address_map &map) override ATTR_COLD; virtual void recompute_params() override; + + virtual uint32_t latch_start_addr() override; private: struct { @@ -48,11 +52,13 @@ private: bool ext_reg_ena; uint8_t misc1; uint8_t misc2; + uint8_t crtc_ext_start; }et4k; }; // device type definition DECLARE_DEVICE_TYPE(TSENG_VGA, tseng_vga_device) +//DECLARE_DEVICE_TYPE(ET4KW32I_VGA, et4kw32i_vga_device) #endif // MAME_VIDEO_PC_VGA_TSENG_H