First post, by cde
As noted by myself and others, feeding the VGA output from 320x200 games into a LCD most often leads to extra duplicated horizontal pixels which is due to LCD deciding to sample VGA as 720x400 instead of the correct 640x400; see this post for example pictures of the problem: Re: Widescreen monitors and 4:3 aspect ratio compatibility thread
In addition, 1280x1024 monitors drop frames @ 70 Hz and have an incorrect aspect ratio of 5:4, and some 1920x1080 monitor lack 4:3 aspect ratio correction. Using the DVI output of a card directly is not ideal either: the 60 Hz refresh rate is incorrect and some games internal mechanics, like Lotus III, depends on the vertical refresh rate for their timings. Furthermore, when using a 1920x1080 monitor, cards will directly output 1080p under DOS which is not desirable.
So looking for a solution, I found this rather cheap and effective hack. The idea is to trick the graphics card by replacing the monitor's EDID with my own EDID (stored on an I2C flash) that contains 1280x960 as the preferred resolution (here we're using the card's DVI output). This way, the graphics card directly upscales 320x200 into 1280x960, preserving the 4:3 aspect ratio, and using the correct vertical refresh frequency. By swapping the flash and rebooting, I can switch between 70 Hz and 60 Hz depending on whether a game uses 320x200 or 320x240/640x480/800x600.
I implemented this hack and it turns out the result works extremely well. I have mainly tested two graphics cards so far: a GeForce 6800 GT and a Radeon 9250. Both accept this custom resolution, and games run with the exact 4:3 aspect ratio, perfect pixel accuracy horizontally, and almost perfect accuracy vertically. So it's a great success and all the games I've tested so far including FPS such as Quake and DOOM work perfectly 😄 (the GeForce 6 series applies a slight blur however, so I do recommend the Radeon instead for a sharper image).
Now if you'd like to do this hack yourself, the prerequisites are as follows:
- You need a monitor that accepts 1280x960@70 Hz without frame dropping and also provides a 1:1 image ratio option (the image is displayed "as-is", centered). The 144 Hz monitor I'm using is the AOC G2590PX and fits the criteria, so it's a good choice if you're looking for such a monitor.
- You need to buy at least two 256 bytes (8 bit address) DIP8 I2C serial flash + DIP8 sockets : one for 70 Hz and one for 60 Hz. I'm presently using AT24C02C chips (ATMLU904 02CM PH 19041KR). Note that larger flash that do not use 8-bit addresses will not be compatible with the graphics card.
- You need a way to program the serial flash. I'm using a TL866II+ which is supported under Linux by the minipro project (it's also useful to reprogram BIOS chips); an alternative would be to program the chip with the graphics card (eg. https://github.com/ChalkElec/write-edid/blob/ … r/write-edid.sh) but I haven't tried it
- Finally, you need two identical DVI-HDMI cable (or HDMI cable + adapter) on which the surgery will be performed. The first cable will be sacrificed to determine (using a multimeter in continuity test mode) which wires carry the signals of interest.
The procedure to create this custom EDID cable is as follows:
- As noted above, cut the first cable, and identify with the help of the DVI pinout + continuity tester the following wires: 14 (+5V), GND, 6 (DDC clock), 7 (DDC data): see https://en.wikipedia.org/wiki/Digital_Visual_Interface
- Carefully remove a small portion the plastic outer layer with a cutter, while being very careful not to cut any wires underneath.
- Gently scrape the plastic top of the 5V and GND cables and solder a wire for each of them, add scotch tape to avoid shorts. Do not cut the wires as they are needed by the monitor.
- Cut the DDC clock and data cables. Leave the monitor side unconnected, and solder wires to the graphics (DVI) side, again using scotch tape.
- Attach the DIP8 socket to the cable with glue, and solder pins 1 to 4 (A0, A1, A2 & GND) of the socket together to the cable's GND wire.
- Solder the data wire to pin 5, clock to pin 6 and VCC to pin 8 (leaving pin 7 unconnected): https://www.hobbytronics.co.uk/image/data/tut … out-24LC256.png
Now program the AT24C02C flash, eg. using minipro or the equivalent Windows software . Attached to this post are custom 1280x960 EDIDs I made with a software called AW EDID Editor (https://www.analogway.com/americas/products/s … aw-edid-editor/) that I found easy to use and very powerful.
./minipro -p 24LC02 -w edid-1280x960\@70.bin
Place the flash chip on the cable (check the orientation), reboot and if everything works the monitor is now showing a 1280x960 image at the chosen vertical refresh frequency! Apply electrical tape to secure the part of the cable where the plastic has been removed. Below is my modified HDMI extension cable with a DVI adapter attached:
Amusingly, it is even possible to run games at 120 Hz with the appropriate EDID, which I tested with a HD 4000 (Core i7 3770K). I had to first boot with the hacked cable above, but the screen remained black. By removing this extender cable and plugging in an unmodified HDMI cable the screen would correctly display the 1280x960@120 Hz outputted by the card (it's possible the hack reduced the signal integrity, causing problem with this high pixel clock). Some games such as Jazz Jackrabbit do indeed run twice as fast as they should (Jazz Jackrabbit uses 320x199@60 Hz). It's not very practical or useful but fun nonetheless 😆
What about older PCs that lack an AGP port? Well the Radeon 9250 is available in PCI form, so this could be a solution for these PCs.