Skip to content

Commit 3eea926

Browse files
committed
video/pc_vga_cirrus: fix pitch offset
1 parent d5aebf8 commit 3eea926

File tree

6 files changed

+10
-17
lines changed

6 files changed

+10
-17
lines changed

src/devices/bus/pci/clgd5446.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Assume Rev. B
2323
#define LOGWARN(...) LOGMASKED(LOG_WARN, __VA_ARGS__)
2424
#define LOGTODO(...) LOGMASKED(LOG_TODO, __VA_ARGS__)
2525

26-
DEFINE_DEVICE_TYPE(GD5446_PCI, cirrus_gd5446_pci_device, "clgd5446_pci", "Cirrus Logic GD-5446 card")
26+
DEFINE_DEVICE_TYPE(GD5446_PCI, cirrus_gd5446_pci_device, "clgd5446_pci", "Cirrus Logic GD5446 card")
2727

2828
cirrus_gd5446_pci_device::cirrus_gd5446_pci_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
2929
: pci_card_device(mconfig, GD5446_PCI, tag, owner, clock)

src/devices/video/pc_vga.h

+2
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,8 @@ class vga_device : public device_t
125125
virtual void gc_map(address_map &map);
126126
virtual void attribute_map(address_map &map);
127127

128+
// NOTE: do not use the subclassed result when determining pitch in SVGA modes.
129+
// dw & word mode should apply to normal VGA modes only.
128130
virtual uint16_t offset();
129131
virtual uint32_t start_addr();
130132
virtual uint8_t vga_latch_write(int offs, uint8_t data);

src/devices/video/pc_vga_cirrus.cpp

+3-6
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ void cirrus_gd5428_vga_device::crtc_map(address_map &map)
220220
cirrus_define_video_mode();
221221
})
222222
);
223+
// map(0x25, 0x25) PSR Part Status (r/o, "factory testing and internal tracking only")
223224
map(0x27, 0x27).lr8(
224225
NAME([this] (offs_t offset) {
225226
LOGMASKED(LOG_REG, "CR27: Read ID\n");
@@ -841,13 +842,10 @@ void cirrus_gd5428_vga_device::cirrus_define_video_mode()
841842

842843
uint16_t cirrus_gd5428_vga_device::offset()
843844
{
844-
uint16_t off = vga_device::offset();
845-
846845
// TODO: check true enable condition
847846
if (svga.rgb8_en || svga.rgb15_en || svga.rgb16_en || svga.rgb24_en || svga.rgb32_en)
848-
off <<= 2;
849-
// popmessage("Offset: %04x %s %s ** -- actual: %04x",vga.crtc.offset,vga.crtc.dw?"DW":"--",vga.crtc.word_mode?"BYTE":"WORD",off);
850-
return off;
847+
return vga.crtc.offset << 3;
848+
return svga_device::offset();
851849
}
852850

853851
void cirrus_gd5428_vga_device::start_bitblt()
@@ -1164,7 +1162,6 @@ uint8_t cirrus_gd5428_vga_device::mem_r(offs_t offset)
11641162

11651163
// Is the display address adjusted automatically when not using Chain-4 addressing?
11661164
// The GD542x BIOS doesn't do it, but Virtual Pool expects it.
1167-
11681165
if(!(vga.sequencer.data[4] & 0x8))
11691166
addr <<= 2;
11701167

src/devices/video/pc_vga_oak.cpp

+1-4
Original file line numberDiff line numberDiff line change
@@ -357,12 +357,9 @@ void oak_oti111_vga_device::ramdac_mmio_map(address_map &map)
357357

358358
uint16_t oak_oti111_vga_device::offset()
359359
{
360-
uint16_t off = svga_device::offset();
361-
362360
if (m_oak_gfx_mode)
363361
return vga.crtc.offset << 4;
364-
else
365-
return off;
362+
return svga_device::offset();
366363
}
367364

368365
u8 oak_oti111_vga_device::mem_r(offs_t offset)

src/devices/video/pc_vga_s3.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ u16 s3vision864_vga_device::line_compare_mask()
9494

9595
uint16_t s3vision864_vga_device::offset()
9696
{
97-
//popmessage("Offset: %04x %s %s %s",vga.crtc.offset,vga.crtc.dw?"DW":"--",vga.crtc.word_mode?"BYTE":"WORD",(s3.memory_config & 0x08)?"31":"--");
9897
if(s3.memory_config & 0x08)
9998
return vga.crtc.offset << 3;
10099
return vga_device::offset();

src/devices/video/pc_vga_trident.cpp

+3-5
Original file line numberDiff line numberDiff line change
@@ -812,12 +812,10 @@ uint32_t trident_vga_device::screen_update(screen_device &screen, bitmap_rgb32 &
812812

813813
uint16_t trident_vga_device::offset()
814814
{
815-
uint16_t off = svga_device::offset();
816-
815+
// don't know if this is right, but Eggs Playing Chicken switches off doubleword mode, but expects the same offset length
817816
if (svga.rgb8_en || svga.rgb15_en || svga.rgb16_en || svga.rgb32_en)
818-
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
819-
else
820-
return off;
817+
return vga.crtc.offset << 3;
818+
return svga_device::offset();
821819
}
822820

823821
int trident_vga_device::calculate_clock()

0 commit comments

Comments
 (0)