From: Toni Wilen Date: Thu, 4 Dec 2025 16:02:06 +0000 (+0200) Subject: Merge 86box Matrox fixes X-Git-Tag: 6020~29 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=5beee1387b011ecae36a6ee9126b1c5c54c04727;p=francis%2Fwinuae.git Merge 86box Matrox fixes --- diff --git a/pcem/vid_mga.cpp b/pcem/vid_mga.cpp index bf0a978f..28cb652a 100644 --- a/pcem/vid_mga.cpp +++ b/pcem/vid_mga.cpp @@ -4882,6 +4882,7 @@ blit_trap(mystique_t *mystique) int pattern = mystique->dwgreg.pattern[yoff][xoff]; uint32_t dst; + if (!transc || pattern) switch (mystique->maccess_running & MACCESS_PWIDTH_MASK) { case MACCESS_PWIDTH_8: dst = svga->vram[(mystique->dwgreg.ydst_lin + x_l) & mystique->vram_mask]; @@ -4981,6 +4982,7 @@ blit_trap(mystique_t *mystique) uint32_t dst; uint32_t old_dst; + if (!transc || pattern) switch (mystique->maccess_running & MACCESS_PWIDTH_MASK) { case MACCESS_PWIDTH_8: dst = old_dst = svga->vram[(mystique->dwgreg.ydst_lin + x_l) & mystique->vram_mask]; @@ -5762,6 +5764,7 @@ blit_bitblt(mystique_t *mystique) mystique->dwgreg.ar[0] += mystique->dwgreg.ar[5]; mystique->dwgreg.ar[3] += mystique->dwgreg.ar[5]; src_addr = mystique->dwgreg.ar[3]; + break; } else src_addr += x_dir; @@ -5874,6 +5877,7 @@ blit_bitblt(mystique_t *mystique) mystique->dwgreg.ar[0] += mystique->dwgreg.ar[5]; mystique->dwgreg.ar[3] += mystique->dwgreg.ar[5]; src_addr = mystique->dwgreg.ar[3]; + break; } else src_addr += x_dir; @@ -5960,6 +5964,7 @@ blit_bitblt(mystique_t *mystique) mystique->dwgreg.ar[0] += mystique->dwgreg.ar[5]; mystique->dwgreg.ar[3] += mystique->dwgreg.ar[5]; src_addr = mystique->dwgreg.ar[3]; + break; } else src_addr += x_dir; @@ -6056,6 +6061,7 @@ blit_bitblt(mystique_t *mystique) mystique->dwgreg.ar[0] += mystique->dwgreg.ar[5]; mystique->dwgreg.ar[3] += mystique->dwgreg.ar[5]; src_addr = mystique->dwgreg.ar[3]; + break; } else src_addr += x_dir; @@ -6743,6 +6749,7 @@ mystique_pci_write(UNUSED(int func), int addr, uint8_t val, void *priv) mystique->pci_regs[addr] = val; if (addr == 0x30) mystique->pci_regs[addr] &= 1; + if (mystique->pci_regs[0x30] & 0x01) { uint32_t biosaddr = (mystique->pci_regs[0x32] << 16) | (mystique->pci_regs[0x33] << 24); mem_mapping_set_addrx(&mystique->bios_rom.mapping, biosaddr, (mystique->type == MGA_G100) ? 0x10000 : 0x8000); @@ -6755,27 +6762,24 @@ mystique_pci_write(UNUSED(int func), int addr, uint8_t val, void *priv) return; case 0x40: - mystique->pci_regs[addr] = val & 0x3f; + mystique->pci_regs[0x40] = val & 0x3f; break; case 0x41: - mystique->pci_regs[addr] = val; + mystique->pci_regs[0x41] = val; break; case 0x42: - mystique->pci_regs[addr] = val & 0x1f; + mystique->pci_regs[0x42] = val & 0x1f; break; case 0x43: - mystique->pci_regs[addr] = val; - //pclog("%08x\n", (mystique->pci_regs[0x40] << 0) | (mystique->pci_regs[0x41] << 8) | (mystique->pci_regs[0x42] << 16) | (mystique->pci_regs[0x43] << 24)); - if (addr == 0x43) { - if (val & 0x40) { - if (mystique->pci_regs[0x30] & 0x01) { - uint32_t biosaddr = (mystique->pci_regs[0x32] << 16) | (mystique->pci_regs[0x33] << 24); - mem_mapping_set_addrx(&mystique->bios_rom.mapping, biosaddr, (mystique->type == MGA_G100) ? 0x10000 : 0x8000); - } else - mem_mapping_disablex(&mystique->bios_rom.mapping); + mystique->pci_regs[0x43] = val; + if (val & 0x40) { + if (mystique->pci_regs[0x30] & 0x01) { + uint32_t biosaddr = (mystique->pci_regs[0x32] << 16) | (mystique->pci_regs[0x33] << 24); + mem_mapping_set_addrx(&mystique->bios_rom.mapping, biosaddr, (mystique->type == MGA_G100) ? 0x10000 : 0x8000); } else - mem_mapping_set_addrx(&mystique->bios_rom.mapping, 0x000c0000, (mystique->type == MGA_G100) ? 0x10000 : 0x8000); - } + mem_mapping_disablex(&mystique->bios_rom.mapping); + } else + mem_mapping_set_addrx(&mystique->bios_rom.mapping, 0x000c0000, (mystique->type == MGA_G100) ? 0x10000 : 0x8000); break; case 0x4c: @@ -6803,17 +6807,17 @@ mystique_pci_write(UNUSED(int func), int addr, uint8_t val, void *priv) mystique_ctrl_write_bx(addr, val, mystique); break; - case 0xf8: - mystique->pci_regs[0xf8] = val & 0x7; - break; + case 0xf8: + mystique->pci_regs[0xf8] = val & 0x7; + break; - case 0xf9: - mystique->pci_regs[0xf9] = val & 0x3; - break; + case 0xf9: + mystique->pci_regs[0xf9] = val & 0x3; + break; - case 0xfb: - mystique->pci_regs[0xfb] = val; - break; + case 0xfb: + mystique->pci_regs[0xfb] = val; + break; default: break; @@ -6894,6 +6898,7 @@ mystique_init(const device_t *info) mystique->svga.conv_16to32 = tvp3026_conv_16to32; if (mystique->type == MGA_2164W) mystique->svga.decode_mask = 0xffffff; + video_inform(VIDEO_FLAG_TYPE_SPECIAL, (mystique->type == MGA_2164W) ? &timing_matrox_mystique : &timing_matrox_millennium); svga_init(info, &mystique->svga, mystique, mystique->vram_size << 20, mystique_recalctimings,