From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.30) id 1BIwiD-0000xO-PE for qemu-devel@nongnu.org; Wed, 28 Apr 2004 17:35:25 -0400 Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.30) id 1BIwhe-0000mM-VO for qemu-devel@nongnu.org; Wed, 28 Apr 2004 17:35:22 -0400 Received: from [68.144.28.253] (helo=localhost.localdomain) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.30) id 1BIwhe-0000kr-2r for qemu-devel@nongnu.org; Wed, 28 Apr 2004 17:34:50 -0400 Received: from aclaro.com (internal.aclaro.com [68.144.28.252]) (authenticated bits=0) by localhost.localdomain (8.12.8/8.12.8) with ESMTP id i3SLYIje021012 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 28 Apr 2004 15:34:39 -0600 Message-ID: <4090235C.6040305@aclaro.com> Date: Wed, 28 Apr 2004 15:34:20 -0600 From: Matthew Mastracci MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------020108000108060501090105" Subject: [Qemu-devel] Fix for bochs vbe issues Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org This is a multi-part message in MIME format. --------------020108000108060501090105 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit I found a way to fix the bochs VBE issues in Windows 2000. It looks really good in 16+ bit color. The changes in this patch are: - Use linear (chain-4) mode for all VBE_DISPI_ENABLED modes - Add ff80 and ff81 as valid ioport registers (these are the old ports, still used by the driver) Some of the issues with the patch: - There are black lines that appear on the screen at what appear to be lines that span a display bank. This only seems to happen in 8- or 24-bit. Puzzling! - The shutdown screen in windows 2000 is corrupted. A better patch might tweak some of the sequence controller and bank select registers to set the chain-4 mode, but I haven't tried that yet. diff -u -r ./hw/vga.c ../../qemu-0.5.4/hw/vga.c --- ./hw/vga.c 2004-04-26 15:17:28.000000000 -0600 +++ ../../qemu-0.5.4/hw/vga.c 2004-04-27 21:46:20.828796000 -0600 @@ -678,7 +678,10 @@ break; } - if (s->sr[4] & 0x08) { + if (s->vbe_regs[VBE_DISPI_INDEX_ENABLE] & VBE_DISPI_ENABLED) { + /* VBE mode : simplest access */ + ret = s->vram_ptr[addr]; + } else if (s->sr[4] & 0x08) { /* chain 4 mode : simplest access */ ret = s->vram_ptr[addr]; } else if (s->gr[5] & 0x10) { @@ -756,7 +759,17 @@ break; } - if (s->sr[4] & 0x08) { + if (s->vbe_regs[VBE_DISPI_INDEX_ENABLE] & VBE_DISPI_ENABLED) { + /* VBE mode : simplest access */ + plane = (s->gr[4] & 2) | (addr & 1); + if (s->sr[2] & (1 << plane)) { + s->vram_ptr[addr] = val; +#ifdef DEBUG_VGA_MEM + printf("vga: VBE: [0x%x]\n", addr); +#endif + cpu_physical_memory_set_dirty(s->vram_offset + addr); + } + } else if (s->sr[4] & 0x08) { /* chain 4 mode : simplest access */ plane = addr & 3; if (s->sr[2] & (1 << plane)) { @@ -1768,6 +1781,11 @@ register_ioport_write(0x1ce, 1, 2, vbe_ioport_write, s); register_ioport_write(0x1cf, 1, 2, vbe_ioport_write, s); + register_ioport_read(0xff80, 1, 2, vbe_ioport_read, s); + register_ioport_read(0xff81, 1, 2, vbe_ioport_read, s); + + register_ioport_write(0xff80, 1, 2, vbe_ioport_write, s); + register_ioport_write(0xff81, 1, 2, vbe_ioport_write, s); #endif vga_io_memory = cpu_register_io_memory(0, vga_mem_read, vga_mem_write); --------------020108000108060501090105 Content-Type: text/x-vcard; charset=utf8; name="matt.vcf" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="matt.vcf" begin:vcard fn:Matthew Mastracci n:Mastracci;Matthew org:aclaro Softworks, inc. adr:;;1900 a - 11 St. SE;Calgary;Alberta;T2H 3G2;Canada email;internet:matt@aclaro.com title:Software Developer tel;work:(403) 299-6612 x-mozilla-html:FALSE url:http://www.aclaro.com version:2.1 end:vcard --------------020108000108060501090105--