-
Notifications
You must be signed in to change notification settings - Fork 125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Overlapping text in Windows 95 with CL-GD5430 #398
Comments
I tried to reproduce this issue with both Win95 original and Win95 B using default drivers, but I don't see overlapping text here. |
I found two things. First, driver behaves weird in this case. It renders text with BitBLT first ( Second, similarily to #364, diff --git a/bochs/iodev/display/svga_cirrus.cc b/bochs/iodev/display/svga_cirrus.cc
index 893d70747..d33d3c0c0 100644
--- a/bochs/iodev/display/svga_cirrus.cc
+++ b/bochs/iodev/display/svga_cirrus.cc
@@ -468,36 +468,44 @@ void bx_svga_cirrus_c::redraw_area(unsigned x0, unsigned y0, unsigned width,
void bx_svga_cirrus_c::mem_write_mode4and5_8bpp(Bit8u mode, Bit32u offset, Bit8u value)
{
+ Bit8u sequ_map_mask = BX_CIRRUS_THIS sequencer.reg[0x02];
Bit8u val = value;
Bit8u *dst;
dst = BX_CIRRUS_THIS s.memory + offset;
for (int x = 0; x < 8; x++) {
- if (val & 0x80) {
- *dst = BX_CIRRUS_THIS control.shadow_reg1;
- } else if (mode == 5) {
- *dst = BX_CIRRUS_THIS control.shadow_reg0;
+ if (sequ_map_mask & 0x80) {
+ if (val & 0x80) {
+ *dst = BX_CIRRUS_THIS control.shadow_reg1;
+ } else if (mode == 5) {
+ *dst = BX_CIRRUS_THIS control.shadow_reg0;
+ }
}
val <<= 1;
+ sequ_map_mask <<= 1;
dst++;
}
}
void bx_svga_cirrus_c::mem_write_mode4and5_16bpp(Bit8u mode, Bit32u offset, Bit8u value)
{
+ Bit8u sequ_map_mask = BX_CIRRUS_THIS sequencer.reg[0x02];
Bit8u val = value;
Bit8u *dst;
dst = BX_CIRRUS_THIS s.memory + offset;
for (int x = 0; x < 8; x++) {
- if (val & 0x80) {
- *dst = BX_CIRRUS_THIS control.shadow_reg1;
- *(dst + 1) = BX_CIRRUS_THIS control.reg[0x11];
- } else if (mode == 5) {
- *dst = BX_CIRRUS_THIS control.shadow_reg0;
- *(dst + 1) = BX_CIRRUS_THIS control.reg[0x10];
+ if (sequ_map_mask & 0x80) {
+ if (val & 0x80) {
+ *dst = BX_CIRRUS_THIS control.shadow_reg1;
+ *(dst + 1) = BX_CIRRUS_THIS control.reg[0x11];
+ } else if (mode == 5) {
+ *dst = BX_CIRRUS_THIS control.shadow_reg0;
+ *(dst + 1) = BX_CIRRUS_THIS control.reg[0x10];
+ }
}
val <<= 1;
+ sequ_map_mask <<= 1;
dst += 2;
}
} |
After having a look at the Qemu and PCem sources, I decided to accept the suggested change. Qemu does not implement the extended SR2 usage at all, but PCem using similar code in the CL-GD5429 code. Having a look at it's memory write code may help us to verify the correctness of other suggested changes. I guess the currently missing features are also available in the PCI version, but the drivers use the bitblt engine instead of the legacy extended memory write features. BTW: I tried to find some specs for the 5430, but I have only found a data sheet for the 543X family. It says that the 5430 is VLB or PCI and the 5434 is ISA only. Since the drivers are almost working, it seems that it doesn't matter. |
I noticed that something is not right when I tried to search for 5430 ISA BIOS. This is not good because it makes impossible to compare Bochs behaviour with behaviour of real hardware. Sadly, I don't have examples when 5429 may be better (except for theoretical tests on real hardware). What do you think, @vruppert? |
When we started implementing the Cirrus cards in Bochs I have only found a file called VGALOCAL.BIN for the ISA version. Now I had a look at this binary and found out that it is designed for the 542x family. Since the author of the Cirrus code for Bochs and Qemu also wrote the Cirrus extension for the LGPL VGABIOS, we did not use the original VGABIOS images for a long time. |
I have a damaged i486 motherboard (a lot of things happened before I obtained it) with a CL-GD5428-80QC-A onboard. |
I don't know if it is useful to have such a BIOS. For emulating the 5428 it is required to compare the current code with the specs and add some extra code for the different models. Now I tried to find some stuff about the 5430 and found it at vgamuseum.info. As expected the BIOS file contains versions for VLB and ISA, but not for ISA. Booting to DOS works with both images. Since this mistake happend 20 years ago and most people using the Cirrus PCI, I think it's not necessary to change the Cirrus ISA model. But if I change would be required, I would prefer to use the 5434, since it's ISA only. |
I don't know what you mean by "programming notes", but here are manuals and they are huge: CL-GD542X, 621 pages, 24 MB: CL-GD543X/'4X, 700 pages, 27 MB
5434 will allow to verify emulation correctness with real hardware, right.
Ok, let's leave it as is for now, until more information is collected. |
With default driver, Cirrus Logic 5429/30/34/36, text is rendered incorrectly sometimes in Windows 95.
This problem appears with 8 or 16 bpp video modes. 24 bpp modes are fine.
Looks like text rendering should be done with some sort of masking/clipping, but it is not active.
![bochs_cir5430](https://private-user-images.githubusercontent.com/1242858/390782544-4e9688d6-00f8-4fdb-9536-66e4e2ee8e76.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyNjkwOTksIm5iZiI6MTczOTI2ODc5OSwicGF0aCI6Ii8xMjQyODU4LzM5MDc4MjU0NC00ZTk2ODhkNi0wMGY4LTRmZGItOTUzNi02NmU0ZTJlZThlNzYucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxMSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTFUMTAxMzE5WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9Yzc1YTMyN2UyNWIzYmEyNjA2ODE4MjgwN2MyMDVkNGFmNDU1MzhkYWM4MTA0ODE2NjViYjJmYWEyNGMxODEyOSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.NifPrVCDrtAvAVArLMwn-Rpam3hmSXbcdkdhdfwJLPI)
Here is how problem looks like, with 8 bpp mode:
Zoomed in:
![image](https://private-user-images.githubusercontent.com/1242858/390784073-52e7c4db-a454-4436-8fda-b9b015e00fa3.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyNjkwOTksIm5iZiI6MTczOTI2ODc5OSwicGF0aCI6Ii8xMjQyODU4LzM5MDc4NDA3My01MmU3YzRkYi1hNDU0LTQ0MzYtOGZkYS1iOWIwMTVlMDBmYTMucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxMSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTFUMTAxMzE5WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9YmVkOTc0Mjg3MmI4NWU2OTgzMGZhZGI1NGZiMDFiNmViZDVkYzU5MmEzZGNlNzk4NDA4OWU0M2FiNGYyM2E0MSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.Cn5G34UPzk_459qNUEeKoSlAe0igfc98m8HPENOY9Ws)
Correct rendering, with 24 bpp mode:
![image](https://private-user-images.githubusercontent.com/1242858/390785351-13384936-394f-4bef-afd1-7409cb10bc7a.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyNjkwOTksIm5iZiI6MTczOTI2ODc5OSwicGF0aCI6Ii8xMjQyODU4LzM5MDc4NTM1MS0xMzM4NDkzNi0zOTRmLTRiZWYtYWZkMS03NDA5Y2IxMGJjN2EucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxMSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTFUMTAxMzE5WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MmFiMzVkMWEzMWM2N2UwZDViMWUyMGY1NWJkNzU3ZjdlYjYyMjYwYWNjYzA4NDY3YzY0NjExMmQ1Y2JhMjJiMSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.tnH2Lpap6M2ygU79qEvPk8fT5XcZopkWNVcSv_oXnjQ)
Version: 63ff26c
The text was updated successfully, but these errors were encountered: