From 8650020d404c06630f4559faf790864954d0958f Mon Sep 17 00:00:00 2001 From: OBattler Date: Tue, 10 Oct 2017 00:55:15 +0200 Subject: [PATCH] Fixed the ATi and S3 VLB graphics cards. --- src/video/vid_ati_mach64.c | 10 +++---- src/video/vid_s3.c | 12 ++++---- src/video/vid_s3_virge.c | 57 ++++++++++++++++---------------------- 3 files changed, 35 insertions(+), 44 deletions(-) diff --git a/src/video/vid_ati_mach64.c b/src/video/vid_ati_mach64.c index 00fbc96a6..2ab02f2de 100644 --- a/src/video/vid_ati_mach64.c +++ b/src/video/vid_ati_mach64.c @@ -3322,12 +3322,12 @@ static void *mach64_common_init(device_t *info) if (info->flags & DEVICE_PCI) { mach64->card = pci_add_card(PCI_ADD_VIDEO, mach64_pci_read, mach64_pci_write, mach64); - - mach64->pci_regs[PCI_REG_COMMAND] = 3; - mach64->pci_regs[0x30] = 0x00; - mach64->pci_regs[0x32] = 0x0c; - mach64->pci_regs[0x33] = 0x00; } + + mach64->pci_regs[PCI_REG_COMMAND] = 3; + mach64->pci_regs[0x30] = 0x00; + mach64->pci_regs[0x32] = 0x0c; + mach64->pci_regs[0x33] = 0x00; ati68860_ramdac_init(&mach64->ramdac); diff --git a/src/video/vid_s3.c b/src/video/vid_s3.c index 0d381c22d..b7921e8e4 100644 --- a/src/video/vid_s3.c +++ b/src/video/vid_s3.c @@ -2186,13 +2186,13 @@ static void *s3_init(device_t *info, wchar_t *bios_fn, int chip) if (info->flags & DEVICE_PCI) { s3->card = pci_add_card(PCI_ADD_VIDEO, s3_pci_read, s3_pci_write, s3); - - s3->pci_regs[0x04] = 7; - - s3->pci_regs[0x30] = 0x00; - s3->pci_regs[0x32] = 0x0c; - s3->pci_regs[0x33] = 0x00; } + + s3->pci_regs[0x04] = 7; + + s3->pci_regs[0x30] = 0x00; + s3->pci_regs[0x32] = 0x0c; + s3->pci_regs[0x33] = 0x00; s3->chip = chip; diff --git a/src/video/vid_s3_virge.c b/src/video/vid_s3_virge.c index e7f3d2e75..5176fe1b3 100644 --- a/src/video/vid_s3_virge.c +++ b/src/video/vid_s3_virge.c @@ -3804,17 +3804,14 @@ static void *s3_virge_init(device_t *info) io_sethandler(0x03c0, 0x0020, s3_virge_in, NULL, NULL, s3_virge_out, NULL, NULL, virge); - if (info->flags & DEVICE_PCI) - { - virge->pci_regs[4] = 3; - virge->pci_regs[5] = 0; - virge->pci_regs[6] = 0; - virge->pci_regs[7] = 2; - virge->pci_regs[0x32] = 0x0c; - virge->pci_regs[0x3d] = 1; - virge->pci_regs[0x3e] = 4; - virge->pci_regs[0x3f] = 0xff; - } + virge->pci_regs[4] = 3; + virge->pci_regs[5] = 0; + virge->pci_regs[6] = 0; + virge->pci_regs[7] = 2; + virge->pci_regs[0x32] = 0x0c; + virge->pci_regs[0x3d] = 1; + virge->pci_regs[0x3e] = 4; + virge->pci_regs[0x3f] = 0xff; virge->virge_id_high = 0x56; virge->virge_id_low = 0x31; @@ -3906,17 +3903,14 @@ static void *s3_virge_988_init(device_t *info) io_sethandler(0x03c0, 0x0020, s3_virge_in, NULL, NULL, s3_virge_out, NULL, NULL, virge); - if (info->flags & DEVICE_PCI) - { - virge->pci_regs[4] = 3; - virge->pci_regs[5] = 0; - virge->pci_regs[6] = 0; - virge->pci_regs[7] = 2; - virge->pci_regs[0x32] = 0x0c; - virge->pci_regs[0x3d] = 1; - virge->pci_regs[0x3e] = 4; - virge->pci_regs[0x3f] = 0xff; - } + virge->pci_regs[4] = 3; + virge->pci_regs[5] = 0; + virge->pci_regs[6] = 0; + virge->pci_regs[7] = 2; + virge->pci_regs[0x32] = 0x0c; + virge->pci_regs[0x3d] = 1; + virge->pci_regs[0x3e] = 4; + virge->pci_regs[0x3f] = 0xff; virge->virge_id_high = 0x88; virge->virge_id_low = 0x3d; @@ -4008,17 +4002,14 @@ static void *s3_virge_375_init(device_t *info, wchar_t *romfn) io_sethandler(0x03c0, 0x0020, s3_virge_in, NULL, NULL, s3_virge_out, NULL, NULL, virge); - if (info->flags & DEVICE_PCI) - { - virge->pci_regs[4] = 3; - virge->pci_regs[5] = 0; - virge->pci_regs[6] = 0; - virge->pci_regs[7] = 2; - virge->pci_regs[0x32] = 0x0c; - virge->pci_regs[0x3d] = 1; - virge->pci_regs[0x3e] = 4; - virge->pci_regs[0x3f] = 0xff; - } + virge->pci_regs[4] = 3; + virge->pci_regs[5] = 0; + virge->pci_regs[6] = 0; + virge->pci_regs[7] = 2; + virge->pci_regs[0x32] = 0x0c; + virge->pci_regs[0x3d] = 1; + virge->pci_regs[0x3e] = 4; + virge->pci_regs[0x3f] = 0xff; virge->virge_id_high = 0x8a; virge->virge_id_low = 0x01;