]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Use also DPMS state when deciding if emulated graphics board is active.
authorToni Wilen <twilen@winuae.net>
Sun, 27 Jul 2025 16:36:30 +0000 (19:36 +0300)
committerToni Wilen <twilen@winuae.net>
Sun, 27 Jul 2025 16:36:30 +0000 (19:36 +0300)
pcem/vid_cl5429.cpp
pcem/vid_s3.cpp
pcem/vid_s3_virge.cpp
pcem/vid_svga.cpp
pcem/vid_voodoo_banshee.cpp

index f0fff68b7da1a54ee82dd85ab59b86fe82b0a2fe..81f01fa5607d315a2deb9216601570ab9b90982d 100644 (file)
@@ -663,7 +663,13 @@ void gd5429_out(uint16_t addr, uint8_t val, void *p)
                                 gd5429->overlay.colorkeycomparemask = val;
                                 gd5429_update_overlay(gd5429);
                                 break;
-
+                                case 0x0e:
+                                if (gd5429->type >= CL_TYPE_GD5426) {
+                                    svga->dpms = (val & 0x06) && ((svga->miscout & ((val & 0x06) << 5)) != 0xc0);
+                                    svga_recalctimings(svga);
+                                }
+                                break;
+        
                                 case 0x10:
                                 gd5429_mmio_write(0xb8001, val, gd5429);
                                 break;
index b47d6c8ac6c583c42aa8a1c7e9b78f047b06bd74..b103bdce6fffe0869da2b0989f64a4bea38b4a24 100644 (file)
@@ -975,6 +975,8 @@ static void s3_queue(s3_t *s3, uint32_t addr, uint32_t val, uint32_t type)
                 wake_fifo_thread(s3);
 }
 
+static void s3_io_set(s3_t*s3);
+
 void s3_out(uint16_t addr, uint8_t val, void *p)
 {
         s3_t *s3 = (s3_t *)p;
@@ -1004,6 +1006,24 @@ void s3_out(uint16_t addr, uint8_t val, void *p)
                         if (val & 8) svga->write_bank = svga->read_bank = s3->bank << 16;
                         else         svga->write_bank = svga->read_bank = s3->bank << 14;
                 }
+                else if (svga->seqaddr == 9) {
+                    svga->seqregs[9] = val & 0x80;
+                    s3_io_set(s3);
+                    return;
+                } else if (svga->seqaddr == 0xa) {
+                    svga->seqregs[0xa] = val & 0x80;
+                    return;
+                } else if (s3->chip >= S3_TRIO32) {
+                    if (svga->seqaddr == 8) {
+                        svga->seqregs[8] = val & 0x0f;
+                        return;
+                    } else if ((svga->seqaddr == 0xd) && (svga->seqregs[8] == 0x06)) {
+                        svga->seqregs[0xd] = val;
+                        svga->dpms = (svga->crtc[0x56] & ((s3->chip >= S3_TRIO32) ? 0x06 : 0x20));
+                        svga_recalctimings(svga);
+                        return;
+                    }
+                }
                 break;
                 
                 case 0x3C6: case 0x3C7: case 0x3C8: case 0x3C9:
@@ -1148,6 +1168,11 @@ void s3_out(uint16_t addr, uint8_t val, void *p)
                         s3_updatemapping(s3);
                         break;
                         
+                        case 0x56:
+                            svga->dpms = (svga->crtc[0x56] & ((s3->chip >= S3_TRIO32) ? 0x06 : 0x20));
+                            old = ~val; /* force recalc */
+                        break;
+
                         case 0x67:
                         if (s3->chip == S3_TRIO32 || s3->chip == S3_TRIO64)
                         {
index 3de51d3cae7d133ae0a4f6f962c23e7fafdebb84..4df9d068dfa0a3d4f2a24dd5f3098f197ec62c3a 100644 (file)
@@ -354,17 +354,27 @@ static void s3_virge_out(uint16_t addr, uint8_t val, void *p)
         switch (addr)
         {
                 case 0x3c5:
-                if (svga->seqaddr >= 0x10)
-                {
-                        svga->seqregs[svga->seqaddr & 0x1f]=val;
+                    if (svga->seqaddr >= 0x10) {
+                        svga->seqregs[svga->seqaddr] = val;
                         svga_recalctimings(svga);
                         return;
-                }
-                if (svga->seqaddr == 4) /*Chain-4 - update banking*/
-                {
-                        if (val & 8) svga->write_bank = svga->read_bank = virge->bank << 16;
-                        else         svga->write_bank = svga->read_bank = virge->bank << 14;
-                }
+                    }
+                    if (svga->seqaddr == 4) { /*Chain-4 - update banking*/
+                        if (val & 8)
+                            svga->write_bank = svga->read_bank = virge->bank << 16;
+                        else
+                            svga->write_bank = svga->read_bank = virge->bank << 14;
+                    }
+                    else if (svga->seqaddr == 0x08) {
+                        svga->seqregs[svga->seqaddr] = val & 0x0f;
+                        return;
+                    }
+                    else if ((svga->seqaddr == 0x0d) && (svga->seqregs[0x08] == 0x06)) {
+                        svga->seqregs[svga->seqaddr] = val;
+                        svga->dpms = (svga->seqregs[0x0d] & 0x50) || (svga->crtc[0x56] & 0x06);
+                        svga_recalctimings(svga);
+                        return;
+                    }
                 break;
                 
                 //case 0x3C6: case 0x3C7: case 0x3C8: case 0x3C9:
@@ -498,6 +508,11 @@ static void s3_virge_out(uint16_t addr, uint8_t val, void *p)
                         s3_virge_updatemapping(virge);
                         break;
                         
+                        case 0x56:
+                            svga->dpms = (svga->seqregs[0x0d] & 0x50) || (svga->crtc[0x56] & 0x06);
+                            old = ~val; /* force recalc */
+                        break;
+
                         case 0x67:
                         switch (val >> 4)
                         {
index 51d3715ce80519c0542b219b20782ad67a69a1c8..aeac0a1d377910ce5d5da4b0f2d0524ba92f2c13 100644 (file)
@@ -25,7 +25,7 @@ static svga_t *svga_pri;
 bool svga_on(void *p)
 {
     svga_t *svga = (svga_t*)p;
-    return svga->scrblank == 0 && svga->hdisp >= 80 && (svga->crtc[0x17] & 0x80);
+    return svga->scrblank == 0 && svga->hdisp >= 80 && (svga->crtc[0x17] & 0x80) && !svga->dpms;
 }
 
 int svga_get_vtotal(void *p)
@@ -635,8 +635,13 @@ int svga_poll(void *p)
                         if (svga->hwcursor_on || svga->dac_hwcursor_on || svga->overlay_on)
                                 svga->changedvram[svga->ma >> 12] = svga->changedvram[(svga->ma >> 12) + 1] = svga->interlace ? 3 : 2;
                       
-                        if (!svga->override)
+                        if (!svga->override) {
+                            if (svga->dpms) {
+                                svga_render_blank(svga);
+                            } else {
                                 svga->render(svga);
+                            }
+                        }
                         
                         if (svga->overlay_on)
                         {
index a1f0b04c5f0cd906ae459955774884ff50d1f070..74ff3718241f29b5a2a5f3db46d3dd4ab893a74c 100644 (file)
@@ -651,6 +651,8 @@ static void banshee_ext_outl(uint16_t addr, uint32_t val, void *p)
 
                 case DAC_dacMode:
                 banshee->dacMode = val;
+                svga->dpms = !!(val & 0x0a);
+                svga_recalctimings(svga);
                 break;
                 case DAC_dacAddr:
                 banshee->dacAddr = val & 0x1ff;