diff options
| author | 2026-02-12 00:03:08 +0100 | |
|---|---|---|
| committer | 2026-02-12 13:18:44 +0100 | |
| commit | 68051f0b93809639f0bbe5f6bb8f5f7849c67aba (patch) | |
| tree | eea6b02dc9571034518abeef81bb9fc6f0ef0bee | |
| parent | 14d3c9dd873022220d9e9e50a323a89aabcf6301 (diff) | |
video/pc_vga_ati.cpp: move EEPROM hookup to ISA cards
| -rw-r--r-- | src/devices/bus/isa/vga_ati.cpp | 28 | ||||
| -rw-r--r-- | src/devices/bus/isa/vga_ati.h | 4 | ||||
| -rw-r--r-- | src/devices/video/ati_mach32.cpp | 7 | ||||
| -rw-r--r-- | src/devices/video/pc_vga_ati.cpp | 32 | ||||
| -rw-r--r-- | src/devices/video/pc_vga_ati.h | 11 | ||||
| -rw-r--r-- | src/devices/video/pc_vga_oak.cpp | 2 |
6 files changed, 64 insertions, 20 deletions
diff --git a/src/devices/bus/isa/vga_ati.cpp b/src/devices/bus/isa/vga_ati.cpp index f6fcaec84fb..612def91655 100644 --- a/src/devices/bus/isa/vga_ati.cpp +++ b/src/devices/bus/isa/vga_ati.cpp @@ -83,9 +83,15 @@ void isa16_vga_gfxultra_device::device_add_mconfig(machine_config &config) screen.set_raw(25.175_MHz_XTAL, 800, 0, 640, 524, 0, 480); screen.set_screen_update(m_vga, FUNC(ati_vga_device::screen_update)); + EEPROM_93C46_16BIT(config, m_eeprom); + ATI_VGA(config, m_vga, 0); m_vga->set_screen("screen"); m_vga->set_vram_size(0x100000); + m_vga->eeprom_data_in_cb().set(m_eeprom, FUNC(eeprom_serial_93cxx_device::do_read)); + m_vga->eeprom_data_out_cb().set(m_eeprom, FUNC(eeprom_serial_93cxx_device::di_write)); + m_vga->eeprom_clock_out_cb().set(m_eeprom, FUNC(eeprom_serial_93cxx_device::clk_write)); + m_vga->eeprom_chip_select_out_cb().set(m_eeprom, FUNC(eeprom_serial_93cxx_device::cs_write)); } void isa16_vga_gfxultrapro_device::device_add_mconfig(machine_config &config) @@ -94,9 +100,15 @@ void isa16_vga_gfxultrapro_device::device_add_mconfig(machine_config &config) screen.set_raw(25.175_MHz_XTAL, 800, 0, 640, 524, 0, 480); screen.set_screen_update(m_vga, FUNC(mach32_device::screen_update)); + EEPROM_93C56_16BIT(config, m_eeprom); + ATIMACH32(config, m_vga, 0); m_vga->set_screen("screen"); m_vga->set_vram_size(0x400000); + m_vga->eeprom_data_in_cb().set(m_eeprom, FUNC(eeprom_serial_93cxx_device::do_read)); + m_vga->eeprom_data_out_cb().set(m_eeprom, FUNC(eeprom_serial_93cxx_device::di_write)); + m_vga->eeprom_clock_out_cb().set(m_eeprom, FUNC(eeprom_serial_93cxx_device::clk_write)); + m_vga->eeprom_chip_select_out_cb().set(m_eeprom, FUNC(eeprom_serial_93cxx_device::cs_write)); } void isa16_vga_mach64_device::device_add_mconfig(machine_config &config) @@ -105,9 +117,15 @@ void isa16_vga_mach64_device::device_add_mconfig(machine_config &config) screen.set_raw(25.175_MHz_XTAL, 800, 0, 640, 524, 0, 480); screen.set_screen_update(m_vga, FUNC(mach64_device::screen_update)); + EEPROM_93C56_16BIT(config, m_eeprom); + ATIMACH64(config, m_vga, 0); m_vga->set_screen("screen"); m_vga->set_vram_size(0x400000); + m_vga->eeprom_data_in_cb().set(m_eeprom, FUNC(eeprom_serial_93cxx_device::do_read)); + m_vga->eeprom_data_out_cb().set(m_eeprom, FUNC(eeprom_serial_93cxx_device::di_write)); + m_vga->eeprom_clock_out_cb().set(m_eeprom, FUNC(eeprom_serial_93cxx_device::clk_write)); + m_vga->eeprom_chip_select_out_cb().set(m_eeprom, FUNC(eeprom_serial_93cxx_device::cs_write)); } @@ -141,21 +159,25 @@ const tiny_rom_entry *isa16_vga_mach64_device::device_rom_region() const isa16_vga_gfxultra_device::isa16_vga_gfxultra_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ISA16_VGA_GFXULTRA, tag, owner, clock), device_isa16_card_interface(mconfig, *this), - m_vga(*this, "vga"), m_8514(*this, "vga:8514a") + m_vga(*this, "vga"), + m_8514(*this, "vga:8514a"), + m_eeprom(*this, "eeprom") { } isa16_vga_gfxultrapro_device::isa16_vga_gfxultrapro_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ISA16_SVGA_GFXULTRAPRO, tag, owner, clock), device_isa16_card_interface(mconfig, *this), - m_vga(*this, "vga") + m_vga(*this, "vga"), + m_eeprom(*this, "eeprom") { } isa16_vga_mach64_device::isa16_vga_mach64_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ISA16_SVGA_MACH64, tag, owner, clock), device_isa16_card_interface(mconfig, *this), - m_vga(*this, "vga") + m_vga(*this, "vga"), + m_eeprom(*this, "eeprom") { } diff --git a/src/devices/bus/isa/vga_ati.h b/src/devices/bus/isa/vga_ati.h index 39fdb19cce2..143db242ccb 100644 --- a/src/devices/bus/isa/vga_ati.h +++ b/src/devices/bus/isa/vga_ati.h @@ -12,6 +12,7 @@ #include "isa.h" +#include "machine/eepromser.h" #include "video/ati_mach32.h" #include "video/ati_mach8.h" #include "video/pc_vga_ati.h" @@ -47,6 +48,7 @@ protected: private: required_device<ati_vga_device> m_vga; required_device<mach8_device> m_8514; + required_device<eeprom_serial_93cxx_device> m_eeprom; }; class isa16_vga_gfxultrapro_device : @@ -72,6 +74,7 @@ protected: private: required_device<mach32_device> m_vga; + required_device<eeprom_serial_93cxx_device> m_eeprom; }; class isa16_vga_mach64_device : @@ -96,6 +99,7 @@ protected: void io_isa_map(address_map &map) ATTR_COLD; private: required_device<mach64_device> m_vga; + required_device<eeprom_serial_93cxx_device> m_eeprom; }; diff --git a/src/devices/video/ati_mach32.cpp b/src/devices/video/ati_mach32.cpp index e2eb9eaf4b5..66c8ba62529 100644 --- a/src/devices/video/ati_mach32.cpp +++ b/src/devices/video/ati_mach32.cpp @@ -58,7 +58,6 @@ mach32_device::mach32_device(const machine_config &mconfig, device_type type, co void mach32_device::device_add_mconfig(machine_config &config) { ATIMACH32_8514A(config, "8514a", 0).set_vga(DEVICE_SELF); - EEPROM_93C56_16BIT(config, "ati_eeprom"); } void mach32_8514a_device::device_start() @@ -141,13 +140,17 @@ void mach32_device::device_reset() ati_vga_device::device_reset(); } +// TODO: has issues in SDD 15bpp tests and onward, MACH64 doesn't work at all void mach32_device::ati_define_video_mode() { uint16_t config = m_8514a->get_ext_config(); + ati_vga_device::ati_define_video_mode(); + // SDD disagrees with this //if(ati.ext_reg[0x30] & 0x20) { + // TODO: use devcb instead of this goofy handling if(m_8514a->has_display_mode_changed()) { svga.rgb8_en = svga.rgb15_en = svga.rgb16_en = svga.rgb24_en = svga.rgb32_en = 0; @@ -186,7 +189,6 @@ void mach32_device::ati_define_video_mode() // ati_vga_device::ati_define_video_mode(); // return; //} - ati_vga_device::ati_define_video_mode(); set_dot_clock(); } @@ -387,7 +389,6 @@ mach64_device::mach64_device(const machine_config &mconfig, device_type type, co void mach64_device::device_add_mconfig(machine_config &config) { ATIMACH64_8514A(config, "8514a", 0).set_vga(DEVICE_SELF); - EEPROM_93C56_16BIT(config, "ati_eeprom"); } void mach64_8514a_device::device_start() diff --git a/src/devices/video/pc_vga_ati.cpp b/src/devices/video/pc_vga_ati.cpp index 6e5c6b1a05f..adbd41ce07f 100644 --- a/src/devices/video/pc_vga_ati.cpp +++ b/src/devices/video/pc_vga_ati.cpp @@ -21,6 +21,10 @@ ati_vga_device::ati_vga_device(const machine_config &mconfig, const char *tag, d ati_vga_device::ati_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_eeprom_data_in(*this, 0) + , m_eeprom_data_out(*this) + , m_eeprom_clock_out(*this) + , m_eeprom_chip_select_out(*this) { } @@ -40,7 +44,6 @@ void ati_vga_device::device_start() void ati_vga_device::device_add_mconfig(machine_config &config) { MACH8(config, "8514a", 0).set_vga_owner(); - EEPROM_93C46_16BIT(config, "ati_eeprom"); } // TODO: fails VBETEST (after UNIVBE load) @@ -202,11 +205,11 @@ uint8_t ati_vga_device::ati_port_ext_r(offs_t offset) ret = ati.vga_chip_id; // Chip revision (6 for the 28800-6, 5 for the 28800-5) This register is not listed in ATI's mach32 docs LOG( "ATI2A (VGA ID) read\n"); break; + // EEPROM interface read case 0x37: { - eeprom_serial_93cxx_device* eep = subdevice<eeprom_serial_93cxx_device>("ati_eeprom"); - ret = 0x00; - ret |= eep->do_read() << 3; + ret = 0; + ret |= m_eeprom_data_in() << 3; } break; case 0x3d: @@ -279,16 +282,21 @@ void ati_vga_device::ati_port_ext_w(offs_t offset, uint8_t data) //LOG( "ATI: Memory Page Select write %02x (read: %i write %i)\n",data,svga.bank_r,svga.bank_w); break; case 0x33: // EEPROM + // bit 4: <reserved> + // bit 5: ISA bus 8/16-bit memory operation (depends on RMCE1B config pin) + // bit 6: 4-bit PEL (mode 55h) + // bit 7: Double Scan Enable ati.ext_reg[ati.ext_reg_select] = data & 0xef; - if(data & 0x04) + // EEPROM Interface Enable + // TODO: does it also pull reading high? + if(BIT(data, 2)) { - eeprom_serial_93cxx_device* eep = subdevice<eeprom_serial_93cxx_device>("ati_eeprom"); - if(eep != nullptr) - { - eep->di_write((data & 0x01) ? ASSERT_LINE : CLEAR_LINE); - eep->clk_write((data & 0x02) ? ASSERT_LINE : CLEAR_LINE); - eep->cs_write((data & 0x08) ? ASSERT_LINE : CLEAR_LINE); - } + // CS + m_eeprom_chip_select_out(BIT(data, 3)); + // CLK + m_eeprom_clock_out(BIT(data, 1)); + // DI + m_eeprom_data_out(BIT(data, 0)); } else { diff --git a/src/devices/video/pc_vga_ati.h b/src/devices/video/pc_vga_ati.h index 006874fecb2..2800505b65d 100644 --- a/src/devices/video/pc_vga_ati.h +++ b/src/devices/video/pc_vga_ati.h @@ -6,7 +6,6 @@ #pragma once -#include "machine/eepromser.h" #include "video/ati_mach8.h" #include "video/pc_vga.h" @@ -29,6 +28,12 @@ public: virtual uint16_t offset() override; mach8_device* get_8514() { return m_8514; } + + auto eeprom_data_in_cb() { return m_eeprom_data_in.bind(); } + auto eeprom_data_out_cb() { return m_eeprom_data_out.bind(); } + auto eeprom_clock_out_cb() { return m_eeprom_clock_out.bind(); } + auto eeprom_chip_select_out_cb() { return m_eeprom_chip_select_out.bind(); } + protected: ati_vga_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); @@ -47,6 +52,10 @@ protected: private: mach8_device* m_8514; + devcb_read_line m_eeprom_data_in; + devcb_write_line m_eeprom_data_out; + devcb_write_line m_eeprom_clock_out; + devcb_write_line m_eeprom_chip_select_out; }; // device type definition diff --git a/src/devices/video/pc_vga_oak.cpp b/src/devices/video/pc_vga_oak.cpp index a30c9a57426..19915f194b8 100644 --- a/src/devices/video/pc_vga_oak.cpp +++ b/src/devices/video/pc_vga_oak.cpp @@ -222,7 +222,7 @@ void oak_oti111_vga_device::oak_map(address_map &map) //map(0x26, 0x26) RASn Control //map(0x27, 0x27) CASn Control //map(0x28, 0x28) Refresh Control - //map(0x29, 0x29) Hardware Window Aribtration + //map(0x29, 0x29) Hardware Window Arbitration //map(0x30, 0x30) OTI CRT Overflow //map(0x31, 0x31) CRT Start Address |
