VOGONS


First post, by Titan91

User metadata
Rank Newbie
Rank
Newbie

https://odysee.com/@Crashdance22:1/scanline-generator-test:d

I have 2 scanline generators, the Mini SLG and SLG 3000 v2. Both are simple and inexpensive, powered by the VGA port itself. I can get Windows 3.1 and Windows 98 to show scanlines properly at 640x480 31KHz horizontal at 60Hz vertical. I tested the Mini SLG on both my 3.1 and 98 Pentium machines. It did not work at all with the 3.1 machine no matter what resolutions I set in Windows or DOS. But, the SLG 3000 does work on the 3.1 computer at this resolution using Windows, but not in DOS.

With DOS's default 720x400 70Hz text mode and 640x480 60Hz, in both cases the SLG 3000 generates scanlines but the reset pin on the flip-flop IC is not triggering on vertical refresh. As a result the picture is flickery and interlaced, and looks wrong. This would be ideal for playing interlaced standard definition video files, but not for generating scanlines for 320x200 Mode 13h resolution games that are otherwise pixelated and line doubled.

This always works in both versions of Windows on both computers. The SLG 3000 has a switch for vsync detection. This is supposed to align the scanlines on every refresh so they don't flicker. The video shows DOS at 720x400 70Hz, then Windows 3.1 at 640x480 60Hz with the vsync detection switch turned off, and the same screen with the switch turned on. The first 2 scenes show the interlaced flickering, the 3rd scene shows normal scanlines.

Since I can't get either of these scanline generators to work properly at all in DOS, I'm wondering if vertical sync polarity is the issue. I'm using VGA240.COM, part of the modern DOSLib set of tools, to set the mode in DOS to 640x480 at 60Hz. The exact same as Windows 3.1 and Windows 98. I have verified with my monitor's menu that it is indeed changing to these values. My understanding is sync polarity is supposed to be negative. Does anyone with some hardware/video mode experience know if vertical sync polarity changes between DOS and Windows? If sync polarity is wrong, the flip-flop chip won't be resetting its timing and will result in wrong looking flickering/misaligned scanlines.

Last edited by Titan91 on 2024-12-25, 17:18. Edited 1 time in total.

Reply 1 of 5, by Tiido

User metadata
Rank l33t
Rank
l33t

Sync polarity(both H and V) is resolution dependent as it was used to tell the monitor which timings to switch to in the EGA and VGA era, before SVGA came into being. Most multisync monitors don't care about sync polarity and adapt automatically.

You can build a circuit using XOR gates + RC time constant to make a circuit that adapts polarity automatically for both line and frame sync signals so that the generators will work with anything tossed at them, or add an inverter and switch for manual operation.
The RC time delay determines how fast the circuit reacts to resolution changes. Circuits online tend to use really big value capacitors which makes them quite slow.

T-04YBSC, a new YMF71x based sound card & Official VOGONS thread about it
Newly made 4MB 60ns 30pin SIMMs ~
mida sa loed ? nagunii aru ei saa 😜

Reply 2 of 5, by Titan91

User metadata
Rank Newbie
Rank
Newbie

Thanks. When the Windows driver is loaded the card appears to output TTL level vsync and averages to 3.66v according to my multimeter. When in DOS, its output appears to switch to line level vsync and averages to 0.38v. I don't have an oscilloscope to verify the exact peak-to-peak signal levels, but TTL sync should be 5v.

Is there an interrupt or register that can be changed in MS-DOS mode to switch vsync to TTL level, maybe via a TSR?

https://imgur.com/a/q3wIPRS

Reply 3 of 5, by Darmok

User metadata
Rank Newbie
Rank
Newbie

If you have the ability to make simple devices yourself, you can use the option offered here - Simple DIY scanliner . This device supports any resolutions and scanning frequencies automatically.

Reply 4 of 5, by Tiido

User metadata
Rank l33t
Rank
l33t
Titan91 wrote on 2024-12-25, 03:09:

Thanks. When the Windows driver is loaded the card appears to output TTL level vsync and averages to 3.66v according to my multimeter. When in DOS, its output appears to switch to line level vsync and averages to 0.38v. I don't have an oscilloscope to verify the exact peak-to-peak signal levels, but TTL sync should be 5v.

Is there an interrupt or register that can be changed in MS-DOS mode to switch vsync to TTL level, maybe via a TSR?

https://imgur.com/a/q3wIPRS

the 0.38V shows that the sync is positive, where sync pulses go to 5V. Since the pulses are relatively narrow, that is why the average voltage is so low. In windows the sync polarity is negative instead with 0V going pulses. Multimeter will also struggle as freq increases since it is meant to show you DC level or 50/60Hz AC voltage. You'll only be able to read 5V with negative sync at very narrow duty cycles. Anyway the figures seem to be ok.

To change sync polarity, one of the VGA registers will have to be reprogrammed on resolution changes : http://www.osdever.net/FreeVGA/vga/extreg.htm#3CCR3C2W
A TSR can do it when a game uses BIOS function to change resolution, but it won't work for all games since there are games that will program stuff themselves.
Only bulletproof solution is at hardware level, either as an automatic sync polarity adaptation circuit or manual sync polarity selection.

T-04YBSC, a new YMF71x based sound card & Official VOGONS thread about it
Newly made 4MB 60ns 30pin SIMMs ~
mida sa loed ? nagunii aru ei saa 😜

Reply 5 of 5, by Titan91

User metadata
Rank Newbie
Rank
Newbie

Thank you both for the input. For anyone wanting to get the intended scanline look themselves, I was finally able to figure this out. I used the LCD640 TSR from this thread to invert the vertical sync polarity.

wbcbz7's MS-DOS VGA TSR goodies

https://imgur.com/a/4IlCSdz

With vsync now set to negative, the same as in Windows, the SLG3000 v2 scanline generator now works properly in 320x200 VGA mode DOS games. The results are great! I just created a BAT file and called LCD640.COM before starting the game. It also uninstalls the TSR when I quit the game.

https://imgur.com/a/8720TyS