Windows 3.1 DOS Box VGA grabbing

Support and general discussion.
User avatar
SarahWalker
Site Admin
Posts: 2054
Joined: Thu 24 Apr, 2014 4:18 pm

Re: Windows 3.1 DOS Box VGA grabbing

Post by SarahWalker »

It's not very well supported - at least the IBM VGA board doesn't implement it, and most clone boards followed suit. Given this, and that IRQ2 might be used by something else, I find it unlikely that any Windows drivers would attempt to use it.
SA1988
Posts: 274
Joined: Wed 30 Apr, 2014 9:38 am

Re: Windows 3.1 DOS Box VGA grabbing

Post by SA1988 »

I noticed that, at one point, in vdds3old.386 that Battler gave me (too), there's the virtual address of 0xfff78000, all other vdd 386 drivers have 0xffff8000, is this, maybe, the culprit? I'm not sure.
Battler
Posts: 793
Joined: Sun 06 Jul, 2014 7:05 pm

Re: Windows 3.1 DOS Box VGA grabbing

Post by Battler »

- SA1988: No, I just tried changing it to 0xffff8000 in vdds3old.386, and it still grabs the thing properly. So that's not the problem. Also, it's an address mask rather than an address per se, as the instruction with which that's used is clearly an AND.
SA1988
Posts: 274
Joined: Wed 30 Apr, 2014 9:38 am

Re: Windows 3.1 DOS Box VGA grabbing

Post by SA1988 »

Pretty much everything that has a "07" or "08" in the 0xX00 range in the one that doesn't work is replaced by "06" and "07" in this order in the one that doesn't black out.
Capture_s3.PNG
Capture_s3.PNG (146.14 KiB) Viewed 9411 times
Battler
Posts: 793
Joined: Sun 06 Jul, 2014 7:05 pm

Re: Windows 3.1 DOS Box VGA grabbing

Post by Battler »

Now, it would be interesting to find out just *WHAT* that affects. Evidently putting a value too big in that LEA statement causes something to go wrong. I suspect it might start reading or writing the segment, reaching the limit, wrapping around, maybe expecting a fault to react on to detect it's writing too far, but getting none and therefore continuing to write. I'm not sure but it could well be.

Edit: I just tested a small thing, reading from the text buffer in real mode on Virtual PC 2007 causes DEBUG.EXE to suddenly report the program execution has terminated after the execution that read from there was executed. In PCem, that doesn't happen. Same goes for writes to that buffer, and I suspect it might happen with any area of memory assigned to the graphics card.
Battler
Posts: 793
Joined: Sun 06 Jul, 2014 7:05 pm

Re: Windows 3.1 DOS Box VGA grabbing

Post by Battler »

I am more and more convinced it's either a MMU or a CPU bug, because with any VDD that black screens the DOS box, after closing the DOS prompt while it's in windowed mode, Windows as a whole becomes incredibly unstable, and the more you open the DOS prompt, the more stuff crashes, and the emulator eventually freezes. With the VDD that does not black screen it, however, Windows remains perfectly stable.
SA1988
Posts: 274
Joined: Wed 30 Apr, 2014 9:38 am

Re: Windows 3.1 DOS Box VGA grabbing

Post by SA1988 »

Hmm, looks like the LEA instruction has a bug, but I can be wrong.
Capture4.PNG
Capture4.PNG (174.4 KiB) Viewed 9334 times
User avatar
SarahWalker
Site Admin
Posts: 2054
Joined: Thu 24 Apr, 2014 4:18 pm

Re: Windows 3.1 DOS Box VGA grabbing

Post by SarahWalker »

I think that's data you're looking at there, not code.
Battler
Posts: 793
Joined: Sun 06 Jul, 2014 7:05 pm

Re: Windows 3.1 DOS Box VGA grabbing

Post by Battler »

Nah, he has simply had IDA list all occurrences of the LEA instruction in both VDD files.

Anyway, he found that switching all references to <whatever>+7xx/8xx to <whatever>+6xx/7xx (ie. setting back by 100h) makes the non-working VDD work properly. This makes me wonder what actual address data is being read/written from by those commands.
User avatar
SarahWalker
Site Admin
Posts: 2054
Joined: Thu 24 Apr, 2014 4:18 pm

Re: Windows 3.1 DOS Box VGA grabbing

Post by SarahWalker »

Attached rev 351 as a patch, which seems to fix this from my testing. Quite why IBM decided to hide a video enable bit in an index register is beyond me.
Attachments
351.patch
(2.01 KiB) Downloaded 344 times
SA1988
Posts: 274
Joined: Wed 30 Apr, 2014 9:38 am

Re: Windows 3.1 DOS Box VGA grabbing

Post by SA1988 »

thank you very much Tom!
Battler
Posts: 793
Joined: Sun 06 Jul, 2014 7:05 pm

Re: Windows 3.1 DOS Box VGA grabbing

Post by Battler »

Indeed, thank you very much!
Post Reply