summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author angelosa <lordkale4@gmail.com>2024-03-10 01:53:33 +0100
committer angelosa <lordkale4@gmail.com>2024-03-10 01:53:33 +0100
commit3eea92649cad25a0ac2dc56aaf00eb9038d229db (patch)
tree645630dc541b11c60f8c7f0195d22fe60a623479
parentd5aebf8557e8a1f6ead5e32fe39c996d867397e5 (diff)
video/pc_vga_cirrus: fix pitch offset
-rw-r--r--src/devices/bus/pci/clgd5446.cpp2
-rw-r--r--src/devices/video/pc_vga.h2
-rw-r--r--src/devices/video/pc_vga_cirrus.cpp9
-rw-r--r--src/devices/video/pc_vga_oak.cpp5
-rw-r--r--src/devices/video/pc_vga_s3.cpp1
-rw-r--r--src/devices/video/pc_vga_trident.cpp8
6 files changed, 10 insertions, 17 deletions
diff --git a/src/devices/bus/pci/clgd5446.cpp b/src/devices/bus/pci/clgd5446.cpp
index 6fc66d2b99a..2f901f85cea 100644
--- a/src/devices/bus/pci/clgd5446.cpp
+++ b/src/devices/bus/pci/clgd5446.cpp
@@ -23,7 +23,7 @@ Assume Rev. B
#define LOGWARN(...) LOGMASKED(LOG_WARN, __VA_ARGS__)
#define LOGTODO(...) LOGMASKED(LOG_TODO, __VA_ARGS__)
-DEFINE_DEVICE_TYPE(GD5446_PCI, cirrus_gd5446_pci_device, "clgd5446_pci", "Cirrus Logic GD-5446 card")
+DEFINE_DEVICE_TYPE(GD5446_PCI, cirrus_gd5446_pci_device, "clgd5446_pci", "Cirrus Logic GD5446 card")
cirrus_gd5446_pci_device::cirrus_gd5446_pci_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: pci_card_device(mconfig, GD5446_PCI, tag, owner, clock)
diff --git a/src/devices/video/pc_vga.h b/src/devices/video/pc_vga.h
index c5a709d7d13..158f282678d 100644
--- a/src/devices/video/pc_vga.h
+++ b/src/devices/video/pc_vga.h
@@ -125,6 +125,8 @@ protected:
virtual void gc_map(address_map &map);
virtual void attribute_map(address_map &map);
+ // NOTE: do not use the subclassed result when determining pitch in SVGA modes.
+ // dw & word mode should apply to normal VGA modes only.
virtual uint16_t offset();
virtual uint32_t start_addr();
virtual uint8_t vga_latch_write(int offs, uint8_t data);
diff --git a/src/devices/video/pc_vga_cirrus.cpp b/src/devices/video/pc_vga_cirrus.cpp
index a4a141e8ebb..ac8673450d7 100644
--- a/src/devices/video/pc_vga_cirrus.cpp
+++ b/src/devices/video/pc_vga_cirrus.cpp
@@ -220,6 +220,7 @@ void cirrus_gd5428_vga_device::crtc_map(address_map &map)
cirrus_define_video_mode();
})
);
+// map(0x25, 0x25) PSR Part Status (r/o, "factory testing and internal tracking only")
map(0x27, 0x27).lr8(
NAME([this] (offs_t offset) {
LOGMASKED(LOG_REG, "CR27: Read ID\n");
@@ -841,13 +842,10 @@ void cirrus_gd5428_vga_device::cirrus_define_video_mode()
uint16_t cirrus_gd5428_vga_device::offset()
{
- uint16_t off = vga_device::offset();
-
// TODO: check true enable condition
if (svga.rgb8_en || svga.rgb15_en || svga.rgb16_en || svga.rgb24_en || svga.rgb32_en)
- off <<= 2;
-// popmessage("Offset: %04x %s %s ** -- actual: %04x",vga.crtc.offset,vga.crtc.dw?"DW":"--",vga.crtc.word_mode?"BYTE":"WORD",off);
- return off;
+ return vga.crtc.offset << 3;
+ return svga_device::offset();
}
void cirrus_gd5428_vga_device::start_bitblt()
@@ -1164,7 +1162,6 @@ uint8_t cirrus_gd5428_vga_device::mem_r(offs_t offset)
// Is the display address adjusted automatically when not using Chain-4 addressing?
// The GD542x BIOS doesn't do it, but Virtual Pool expects it.
-
if(!(vga.sequencer.data[4] & 0x8))
addr <<= 2;
diff --git a/src/devices/video/pc_vga_oak.cpp b/src/devices/video/pc_vga_oak.cpp
index 88245f9cf51..a30c9a57426 100644
--- a/src/devices/video/pc_vga_oak.cpp
+++ b/src/devices/video/pc_vga_oak.cpp
@@ -357,12 +357,9 @@ void oak_oti111_vga_device::ramdac_mmio_map(address_map &map)
uint16_t oak_oti111_vga_device::offset()
{
- uint16_t off = svga_device::offset();
-
if (m_oak_gfx_mode)
return vga.crtc.offset << 4;
- else
- return off;
+ return svga_device::offset();
}
u8 oak_oti111_vga_device::mem_r(offs_t offset)
diff --git a/src/devices/video/pc_vga_s3.cpp b/src/devices/video/pc_vga_s3.cpp
index 4dc582141ed..c087515e5c0 100644
--- a/src/devices/video/pc_vga_s3.cpp
+++ b/src/devices/video/pc_vga_s3.cpp
@@ -94,7 +94,6 @@ u16 s3vision864_vga_device::line_compare_mask()
uint16_t s3vision864_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)
return vga.crtc.offset << 3;
return vga_device::offset();
diff --git a/src/devices/video/pc_vga_trident.cpp b/src/devices/video/pc_vga_trident.cpp
index f12c03e46c3..4f3b70ba3db 100644
--- a/src/devices/video/pc_vga_trident.cpp
+++ b/src/devices/video/pc_vga_trident.cpp
@@ -812,12 +812,10 @@ uint32_t trident_vga_device::screen_update(screen_device &screen, bitmap_rgb32 &
uint16_t trident_vga_device::offset()
{
- uint16_t off = svga_device::offset();
-
+ // don't know if this is right, but Eggs Playing Chicken switches off doubleword mode, but expects the same offset length
if (svga.rgb8_en || svga.rgb15_en || svga.rgb16_en || svga.rgb32_en)
- return vga.crtc.offset << 3; // don't know if this is right, but Eggs Playing Chicken switches off doubleword mode, but expects the same offset length
- else
- return off;
+ return vga.crtc.offset << 3;
+ return svga_device::offset();
}
int trident_vga_device::calculate_clock()