From 97b24a0865407b0e3c49226a0b086eee23042ec7 Mon Sep 17 00:00:00 2001 From: Toni Wilen Date: Sun, 4 May 2025 13:11:22 +0300 Subject: [PATCH] Keep FB only mode unless VGA planar mode is selected (4 or 16 colors). --- pcem/vid_cl5429.cpp | 3 ++- pcem/vid_svga.cpp | 13 +++++++++++++ pcem/vid_svga.h | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/pcem/vid_cl5429.cpp b/pcem/vid_cl5429.cpp index 40d93b6d..f0fff68b 100644 --- a/pcem/vid_cl5429.cpp +++ b/pcem/vid_cl5429.cpp @@ -2897,7 +2897,8 @@ static void *cl_init(int type, char *fn, int pci_card, uint32_t force_vram_size) gd5429->pci_regs[0x33] = 0x00; } - gd5429->svga.fb_only = 0; + gd5429->svga.fb_only = -1; + gd5429->svga.fb_auto = 1; return gd5429; } diff --git a/pcem/vid_svga.cpp b/pcem/vid_svga.cpp index 478eaa65..51d3715c 100644 --- a/pcem/vid_svga.cpp +++ b/pcem/vid_svga.cpp @@ -342,6 +342,10 @@ void svga_recalctimings(svga_t *svga) double _dispontime, _dispofftime, disptime; int text = 0; + if (svga->fb_auto == 1) { + svga->fb_only = -1; + } + svga->vtotal = svga->crtc[6]; svga->dispend = svga->crtc[0x12]; svga->vsyncstart = svga->crtc[0x10]; @@ -416,6 +420,9 @@ void svga_recalctimings(svga_t *svga) } svga->hdisp_old = svga->hdisp; text = 1; + if (svga->fb_auto) { + svga->fb_only = 0; + } } else { @@ -429,12 +436,18 @@ void svga_recalctimings(svga_t *svga) svga->render = svga_render_4bpp_lowres; else svga->render = svga_render_4bpp_highres; + if (svga->fb_auto) { + svga->fb_only = 0; + } break; case 0x20: /*4 colours*/ if (svga->seqregs[1] & 8) /*Low res (320)*/ svga->render = svga_render_2bpp_lowres; else svga->render = svga_render_2bpp_highres; + if (svga->fb_auto) { + svga->fb_only = 0; + } break; case 0x40: case 0x60: /*256+ colours*/ switch (svga->bpp) diff --git a/pcem/vid_svga.h b/pcem/vid_svga.h index 5ca4a6b9..6f4364ca 100644 --- a/pcem/vid_svga.h +++ b/pcem/vid_svga.h @@ -55,7 +55,7 @@ typedef struct svga_t uint8_t plane_mask; - int fb_only; + int fb_only, fb_auto; int fast; uint8_t colourcompare, colournocare; -- 2.47.3