]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Hardware emulated RTG board compatibility fixes
authorToni Wilen <twilen@winuae.net>
Tue, 23 Apr 2024 17:32:28 +0000 (20:32 +0300)
committerToni Wilen <twilen@winuae.net>
Tue, 23 Apr 2024 17:32:28 +0000 (20:32 +0300)
mame/tm34010/tms34010.cpp
pcem/vid_bt482_ramdac.cpp
pcem/vid_cl5429.cpp
pcem/vid_et4000w32.cpp
pcem/vid_permedia2.cpp
pcem/vid_s3_virge.cpp
pcem/vid_svga.cpp

index c5d4472034beb4d5e8d130fe45a8b878d29dbabd..25c5566ade2475170f6f28e8237868fb126c9d46 100644 (file)
@@ -1568,17 +1568,19 @@ WRITE16_MEMBER( tms340x0_device::host_w )
                /* upper 16 bits of the address */
                case TMS34010_HOST_ADDRESS_H:
                        IOREG(REG_HSTADRH) = data;
-                       addr = (IOREG(REG_HSTADRH) << 16) | IOREG(REG_HSTADRL);
-                       m_prefetch_data = TMS34010_RDMEM_WORD(TOBYTE(addr & 0xfffffff0));
+                       if (!(IOREG(REG_HSTCTLH) & 0x2000)) {
+                               addr = (IOREG(REG_HSTADRH) << 16) | IOREG(REG_HSTADRL);
+                               m_prefetch_data = TMS34010_RDMEM_WORD(TOBYTE(addr & 0xfffffff0));
+                       }
                        break;
 
                /* lower 16 bits of the address */
                case TMS34010_HOST_ADDRESS_L:
                        IOREG(REG_HSTADRL) = data;
-#if 0
-                       addr = (IOREG(REG_HSTADRH) << 16) | IOREG(REG_HSTADRL);
-                       m_prefetch_data = TMS34010_RDMEM_WORD(TOBYTE(addr & 0xfffffff0));
-#endif
+                       if (IOREG(REG_HSTCTLH) & 0x2000) {
+                               addr = (IOREG(REG_HSTADRH) << 16) | IOREG(REG_HSTADRL);
+                               m_prefetch_data = TMS34010_RDMEM_WORD(TOBYTE(addr & 0xfffffff0));
+                       }
                        break;
 
                /* actual data */
index cffa63f995e3a479b630c09b3eda1acbf9dcad6a..3b1eb60a206673f3ba0361285cae96372a5e2edd 100644 (file)
@@ -67,7 +67,7 @@ bt482_ramdac_out(uint16_t addr, int rs2, uint8_t val, void *priv, svga_t *svga)
                 switch(svga->dac_addr)
                 {
                     case 2: // command B
-                        svga->ramdac_type = (val & 0x02) ? RAMDAC_8BIT : RAMDAC_6BIT;
+                        svga_set_ramdac_type(svga, (val & 0x02) ? RAMDAC_8BIT : RAMDAC_6BIT);
                         ramdac->cmd_r1 = val;
                         break;
                     case 3: // cursor
@@ -204,7 +204,7 @@ bt482_hwcursor_draw(svga_t *svga, int displine)
     clr2 = ramdac->extpallook[2];
     clr3 = ramdac->extpallook[3];
 
-    offset <<= svga->horizontal_linedbl;
+    offset <<= ((svga->horizontal_linedbl ? 1 : 0) + (svga->lowres ? 1 : 0));
 
     /* The planes come in two parts, and each plane is 1bpp,
        32x32 cursor has 4 bytes per line */
index b5febbddc0ee84f04a8bc5dc73c4b4c7d9dbd44f..a76f0e3acbb3ad6efcd55499822ef0619945a832 100644 (file)
@@ -1839,7 +1839,7 @@ uint8_t gd5429_read_linear(uint32_t addr, void *p)
         else
                 addr<<=2;
 
-//        addr &= svga->decode_mask;
+        addr &= svga->decode_mask;
 
         if (latch_addr >= svga->vram_max)
         {
index 9b49625e2347ce3365ff03bf3e91a91c12d0039d..d2ecc1ab1acd84976d2df6757e0069cd6024deb3 100644 (file)
@@ -70,7 +70,7 @@ typedef struct et4000w32p_t {
     mem_mapping_t linear_mapping;
     mem_mapping_t mmu_mapping, mmu_mapping2;
 
-    void *ramdac_sdac;
+    sdac_ramdac_t ramdac_sdac;
     void *ramdac_bt;
 
     rom_t bios_rom;
@@ -215,8 +215,8 @@ et4000w32p_out(uint16_t addr, uint8_t val, void *priv)
         case 0x3c7:
         case 0x3c8:
         case 0x3c9:
-            if (et4000->ramdac_sdac)
-                sdac_ramdac_out(addr & 3, val, (sdac_ramdac_t*)et4000->ramdac_sdac, svga);
+            if (!et4000->ramdac_bt)
+                sdac_ramdac_out(addr & 3, val, &et4000->ramdac_sdac, svga);
             return;
 
         case 0x3cb: /* Banking extension */
@@ -400,8 +400,8 @@ et4000w32p_in(uint16_t addr, void *priv)
         case 0x3c7:
         case 0x3c8:
         case 0x3c9:
-            if (et4000->ramdac_sdac)
-                return sdac_ramdac_in(addr & 3, (sdac_ramdac_t*)et4000->ramdac_sdac, svga);
+            if (!et4000->ramdac_bt)
+                return sdac_ramdac_in(addr & 3, &et4000->ramdac_sdac, svga);
             return 0;
         case 0x3cb:
             return et4000->banking2;
@@ -3327,8 +3327,6 @@ et4000w32p_close_sc(void *priv)
 
     svga_close(&et4000->svga);
 
-    sc1502x_ramdac_close(et4000->ramdac_sdac);
-
     free(et4000);
 }
 
@@ -3603,8 +3601,8 @@ void *et4000w32_omnibus_z2_init()
     void *p = et4000w32p_init(NULL);
     et4000w32p_t *et4000w32p = (et4000w32p_t *)p;
 
-    et4000w32p->ramdac_sdac = sc1502x_ramdac_init(NULL);
-    et4000w32p->svga.ramdac = et4000w32p->ramdac_sdac;
+    sdac_init(&et4000w32p->ramdac_sdac);
+    et4000w32p->svga.ramdac = &et4000w32p->ramdac_sdac;
 
     return p;
 }
index 0c53d62deae326fef5b7a5403aeece3fd89c4bfe..ef9b371c98a73c742335722da30bdc414c80bdbc 100644 (file)
@@ -379,11 +379,23 @@ void permedia2_recalctimings(svga_t *svga)
             }
  
             svga->fullchange = changeframecount;
+
+            // GP video enabled
+            if (!(permedia2->vc_regs[0x58 / 4] & 1)) {
+                bpp = 0;
+            }
+            svga->linedbl = 0;
+            if (permedia2->vc_regs[0x58 / 4] & 4) {
+                svga->linedbl = 1;
+            }
         }
 
 
         switch (bpp)
         {
+            default:
+                svga->render = svga_render_blank;
+                break;
             case 4:
                 svga->render = svga_render_4bpp_highres;
                 break;
index e7de4ae098430e3554a2dcc478f2f1695fb54570..e4a498215a63159964ecc701e5a965b0db9b49b4 100644 (file)
@@ -785,15 +785,17 @@ static void s3_virge_updatemapping(virge_t *virge)
                         break;
                 }
                 virge->linear_base &= ~(virge->linear_size - 1);
-//                pclog("%08X %08X  %02X %02X %02X\n", linear_base, linear_size, crtc[0x58], crtc[0x59], crtc[0x5a]);
+                //pclog("%08X %08X  %02X %02X %02X\n", virge->linear_base, virge->linear_size, svga->crtc[0x58], svga->crtc[0x59], svga->crtc[0x5a]);
                 pclog("Linear framebuffer at %08X size %08X\n", virge->linear_base, virge->linear_size);
                 if (virge->linear_base == 0xa0000)
                 {
                         mem_mapping_set_addrx(&svga->mapping, 0xa0000, 0x10000);
                         mem_mapping_disablex(&virge->linear_mapping);
                 }
-                else
-                        mem_mapping_set_addrx(&virge->linear_mapping, virge->linear_base, virge->linear_size);
+                else {
+                    virge->linear_base &= 0xfc000000;
+                    mem_mapping_set_addrx(&virge->linear_mapping, virge->linear_base, virge->linear_size);
+                }
                 svga->fb_only = 1;
         }
         else
@@ -2424,8 +2426,9 @@ skip_line:
                 }
                 break;
 
-                default:
-                fatal("s3_virge_bitblt : blit command %i %08x\n", (virge->s3d.cmd_set >> 27) & 0xf, virge->s3d.cmd_set);
+                // Amiga NetBSD has a bug: it writes %0111 instead of %1111 (NOP)
+                //default:
+                //fatal("s3_virge_bitblt : blit command %i %08x\n", (virge->s3d.cmd_set >> 27) & 0xf, virge->s3d.cmd_set);
         }
 }
 
index a571dbda7b3c994cf0e4ad0a325f3bf30f4d8cb1..d6494a356c8c1edd11f35713ce76c6c62d04bff3 100644 (file)
@@ -24,7 +24,7 @@ static svga_t *svga_pri;
 bool svga_on(void *p)
 {
     svga_t *svga = (svga_t*)p;
-    return svga->scrblank == 0 && svga->hdisp >= 128 && (svga->crtc[0x17] & 0x80);
+    return svga->scrblank == 0 && svga->hdisp >= 80 && (svga->crtc[0x17] & 0x80);
 }
 
 int svga_get_vtotal(void *p)