From 0cc23a47694316b95fda27074333225a5a7baf56 Mon Sep 17 00:00:00 2001 From: OBattler Date: Fri, 2 Mar 2018 00:52:31 +0100 Subject: [PATCH] Fixed CL-GD 542x 2 MB aperture mapping. --- src/video/vid_cl54xx.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/video/vid_cl54xx.c b/src/video/vid_cl54xx.c index f9a42b155..dcaeb06f4 100644 --- a/src/video/vid_cl54xx.c +++ b/src/video/vid_cl54xx.c @@ -9,7 +9,7 @@ * Emulation of select Cirrus Logic cards (CL-GD 5428, * CL-GD 5429, 5430, 5434 and 5436 are supported). * - * Version: @(#)vid_cl_54xx.c 1.0.6 2018/03/01 + * Version: @(#)vid_cl_54xx.c 1.0.7 2018/03/01 * * Authors: Sarah Walker, * Barry Rodewald, @@ -552,17 +552,20 @@ gd543x_recalc_mapping(gd54xx_t *gd54xx) uint32_t base, size; if (svga->crtc[0x27] <= CIRRUS_ID_CLGD5429 || (!gd54xx->pci && !gd54xx->vlb)) { - base = (svga->seqregs[7] & 0xf0) << 16; - if (svga->gdcreg[0xb] & 0x20) + if (svga->gdcreg[0xb] & 0x20) { + base = (svga->seqregs[7] & 0xf0) << 16; size = 1 * 1024 * 1024; - else + } else { + base = (svga->seqregs[7] & 0xe0) << 16; size = 2 * 1024 * 1024; + } } else if (gd54xx->pci) { base = gd54xx->lfb_base; if (svga->crtc[0x27] == CIRRUS_ID_CLGD5436) size = 16 * 1024 * 1024; - else + else if (svga->crtc[0x27] >= CIRRUS_ID_CLGD5430) size = 4 * 1024 * 1024; + else } else { /*VLB*/ base = 128*1024*1024; if (svga->crtc[0x27] == CIRRUS_ID_CLGD5436)