How to invert screen colors on Windows 1.01?

Discuss MS-DOS, Windows 1, 2 and 3.
Post Reply
DVINTHEHOUSEMAN
User avatar
Posts: 386
Joined: Sun Apr 16, 2017 12:39 am
Location: Northern Wisconsin

How to invert screen colors on Windows 1.01?

Post by DVINTHEHOUSEMAN »

I have recently bought an IBM 5140 PC Convertible, and installed Windows 1.01 on it. Since the screen colors are inverted, the OS looks horrible. I have inverted the color scheme, but it’s not contiguous through the whole OS, such as icons and some graphical apps such as Paint, Calculator, or Calendar show inverted of how they should look. Is there a driver or way to invert the whole screen, including icons and apps, in Windows when it is running so it looks normal? If there is, please let me know.
DV
Go check me out on YouTube!

mrpijey wrote:Or someone slipped on a banana peel, fell backwards and accidently hit both the betaarchive.com and "DDoS Express" buttons at the same time.

Overdoze
User avatar
Posts: 1762
Joined: Mon Feb 24, 2014 10:28 am
Location: Slovenia

Re: How to invert screen colors on Windows 1.01?

Post by Overdoze »

It may be possible the swap the foreground and background colors at the driver level (CGA.DRV) to achieve this.
All roads lead to Neptune™

KRNL386 - my site about retro computing | My site about Windows 1.0 | My blog | 86Box Manager | LeakDB - list of PC OS warez leaks

DVINTHEHOUSEMAN
User avatar
Posts: 386
Joined: Sun Apr 16, 2017 12:39 am
Location: Northern Wisconsin

Re: How to invert screen colors on Windows 1.01?

Post by DVINTHEHOUSEMAN »

How would I do that?
DV
Go check me out on YouTube!

mrpijey wrote:Or someone slipped on a banana peel, fell backwards and accidently hit both the betaarchive.com and "DDoS Express" buttons at the same time.

Overdoze
User avatar
Posts: 1762
Joined: Mon Feb 24, 2014 10:28 am
Location: Slovenia

Re: How to invert screen colors on Windows 1.01?

Post by Overdoze »

I guess disassemble the driver with IDA Pro, see how it configures the card and if it's possible to change the background.
All roads lead to Neptune™

KRNL386 - my site about retro computing | My site about Windows 1.0 | My blog | 86Box Manager | LeakDB - list of PC OS warez leaks

John Elliott
Posts: 75
Joined: Thu Aug 25, 2011 7:46 pm

Re: How to invert screen colors on Windows 1.01?

Post by John Elliott »

I had a quick go the last time this question was asked, but it's not simple. I hoped it would just be a matter of rewriting RealizeObject to map dark colours to white and light colours to black, but it isn't. It also needs a rewrite of the logic operations in BitBlt and StrBlt - painting done with OR instead of AND or vice versa, and it might be necessary to insert extra XOR instructions to invert mask bytes.

If we had the source code it might just be a matter of flipping an equate somewhere and letting the build process generate the appropriate code (in GEM it was just a matter of setting rev_vid to false and recompiling). But starting with a disassembly is a lot harder - not only do you have to do a lot of work to go from the disassembly to something that builds to the original driver, you then have to gain a thorough understanding of what the code is doing so you know which areas to change. And with Windows 1.01 still under copyright, the legal environment is less friendly, too.

From my point of view Windows drivers are tougher to understand than GEM drivers, because they have to support drawing on bitmaps as well as on the screen, so there are extra code paths all over the place. And they're more like hand-compiled C than assembly, with variables all on the stack rather than in the data segment, which my ancient freeware version of IDA can't cope with.

DVINTHEHOUSEMAN
User avatar
Posts: 386
Joined: Sun Apr 16, 2017 12:39 am
Location: Northern Wisconsin

Re: How to invert screen colors on Windows 1.01?

Post by DVINTHEHOUSEMAN »

Oh. I’m not very experienced with code disassembly, or with Windows 1.x drivers, so it might just be a lost cause.
DV
Go check me out on YouTube!

mrpijey wrote:Or someone slipped on a banana peel, fell backwards and accidently hit both the betaarchive.com and "DDoS Express" buttons at the same time.

Tootles
User avatar
Donator
Posts: 1017
Joined: Mon Feb 12, 2007 12:50 pm
Location: England

Re: How to invert screen colors on Windows 1.01?

Post by Tootles »

A thought I had after I gave up trying with my Amstrad (upgraded to a 286) to get it working was maybe a TSR in DOS to intercept the driver's draw commands and invert them. But I don't have the programming chops for that.
Long days, and pleasant nights.

John Elliott
Posts: 75
Joined: Thu Aug 25, 2011 7:46 pm

Re: How to invert screen colors on Windows 1.01?

Post by John Elliott »

On a dumb framebuffer device like a CGA, there are no 'draw commands' you can hook - the driver just reads and writes bytes in video RAM or an offscreen bitmap. The closest you could come is doing something with the single-step interrupt to check every single instruction to see if it's a read/write to video RAM. But that would really slow things down.

Post Reply