From 38e044ca34b40d77c66f1c525ce0c6fb0938756f Mon Sep 17 00:00:00 2001 From: TC1995 Date: Tue, 2 Apr 2024 15:09:18 +0200 Subject: [PATCH] Tseng Labs fixes and bug-compatible fixes too. ET3000AX: the chip in question should not support 1MB of video memory. ET4000AX: the early TC6058AF revision can support 1MB of video memory (e.g.: Diamond Speedstar BIOS D3.10, undumped anyway), and actually don't update the rowoffset to 256 when using such chip in 320x200x256 mode. Fixes the copper demo in said chip revision. --- src/include/86box/vid_svga.h | 1 + src/video/vid_et3000.c | 2 -- src/video/vid_et4000.c | 19 +++++++++---------- 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/src/include/86box/vid_svga.h b/src/include/86box/vid_svga.h index 2f8a83a1d..bc33ac746 100644 --- a/src/include/86box/vid_svga.h +++ b/src/include/86box/vid_svga.h @@ -129,6 +129,7 @@ typedef struct svga_t { int hblank_end_mask; int hblank_sub; int packed_4bpp; + int ps_bit_bug; int ati_4color; /*The three variables below allow us to implement memory maps like that seen on a 1MB Trio64 : diff --git a/src/video/vid_et3000.c b/src/video/vid_et3000.c index 97da08822..a7d2a749f 100644 --- a/src/video/vid_et3000.c +++ b/src/video/vid_et3000.c @@ -557,8 +557,6 @@ static const device_config_t et3000_config[] = { .value = 256 }, { .description = "512 KB", .value = 512 }, - { .description = "1 MB", - .value = 1024 }, { .description = "" } } }, { .type = CONFIG_END } }; diff --git a/src/video/vid_et4000.c b/src/video/vid_et4000.c index 7ceacb823..583487c5f 100644 --- a/src/video/vid_et4000.c +++ b/src/video/vid_et4000.c @@ -652,7 +652,9 @@ et4000_recalctimings(svga_t *svga) svga->ma_latch |= (svga->crtc[0x33] & 3) << 16; - svga->hblankstart = (((svga->crtc[0x3f] & 0x4) >> 2) << 8) + svga->crtc[2]; + svga->hblankstart = (((svga->crtc[0x3f] & 0x4) >> 2) << 8) + svga->crtc[2]; + + svga->ps_bit_bug = (dev->type == ET4000_TYPE_TC6058AF) && svga->lowres && ((svga->gdcreg[5] & 0x60) >= 0x40); if (svga->crtc[0x35] & 1) svga->vblankstart |= 0x400; @@ -664,7 +666,7 @@ et4000_recalctimings(svga_t *svga) svga->vsyncstart |= 0x400; if (svga->crtc[0x35] & 0x10) svga->split |= 0x400; - if (!svga->rowoffset) + if (!svga->rowoffset && !svga->ps_bit_bug) svga->rowoffset = 0x100; if (svga->crtc[0x3f] & 1) svga->htotal |= 0x100; @@ -729,13 +731,6 @@ et4000_recalctimings(svga_t *svga) svga->rowoffset <<= 1; svga->render = svga_render_8bpp_highres; } - - if (dev->type == ET4000_TYPE_TC6058AF) { - if (svga->render == svga_render_8bpp_lowres) - svga->render = svga_render_8bpp_tseng_lowres; - else if (svga->render == svga_render_8bpp_highres) - svga->render = svga_render_8bpp_tseng_highres; - } } static void @@ -962,6 +957,10 @@ static const device_config_t et4000_tc6058af_config[] = { .description = "512 KB", .value = 512 }, + { + .description = "1 MB", + .value = 1024 + }, { .description = "" } @@ -1071,7 +1070,7 @@ const device_t et4000_tc6058af_isa_device = { .name = "Tseng Labs ET4000AX (TC6058AF) (ISA)", .internal_name = "et4000ax_tc6058af", .flags = DEVICE_ISA, - .local = 0, + .local = ET4000_TYPE_TC6058AF, .init = et4000_init, .close = et4000_close, .reset = NULL,