From 0297243a50ff08d0734533dc28eae86f66011ac4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miran=20Gr=C4=8Da?= Date: Tue, 6 Jul 2021 19:40:16 +0200 Subject: [PATCH] Trident TGUI9680 linear framebuffer PCI BAR is now correctly 4 MB aligned. --- src/video/vid_tgui9440.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/video/vid_tgui9440.c b/src/video/vid_tgui9440.c index 556bb1f22..2429f52b1 100644 --- a/src/video/vid_tgui9440.c +++ b/src/video/vid_tgui9440.c @@ -895,14 +895,20 @@ void tgui_pci_write(int func, int addr, uint8_t val, void *p) break; case 0x12: - tgui->linear_base = (tgui->linear_base & 0xff000000) | ((val & 0xe0) << 16); + if (tgui->type == TGUI_9680) + tgui->linear_base = (tgui->linear_base & 0xff000000) | ((val & 0xc0) << 16); + else + tgui->linear_base = (tgui->linear_base & 0xff000000) | ((val & 0xe0) << 16); tgui->linear_size = tgui->vram_size; svga->decode_mask = tgui->vram_mask; svga->crtc[0x21] = (svga->crtc[0x21] & ~0xf) | (val >> 4); tgui_recalcmapping(tgui); break; case 0x13: - tgui->linear_base = (tgui->linear_base & 0xe00000) | (val << 24); + if (tgui->type == TGUI_9680) + tgui->linear_base = (tgui->linear_base & 0xc00000) | (val << 24); + else + tgui->linear_base = (tgui->linear_base & 0xe00000) | (val << 24); tgui->linear_size = tgui->vram_size; svga->decode_mask = tgui->vram_mask; svga->crtc[0x21] = (svga->crtc[0x21] & ~0xc0) | (val >> 6); @@ -2947,4 +2953,4 @@ const device_t tgui9680_pci_device = tgui_speed_changed, tgui_force_redraw, tgui96xx_config -}; \ No newline at end of file +};