VOGONS


First post, by sofakng

User metadata
Rank Member
Rank
Member

Does anybody know if it's possible to output 320x200 (EGA) on a VGA card?

If I understand correctly, VGA cards doublescan the output resolution so 320x200 is output as 640x400 (confirmed on my PC monitor and scalers).

I'm testing an upscaler (DExx, from the creator of the OSSC) which can upscale to 1440p to 640x400p is too much for the scaler to handle. However, 240p is fine.

(I'm also using a weeCee x86 if that makes a difference...)

Reply 1 of 43, by mkarcher

User metadata
Rank l33t
Rank
l33t

You can disable double-scanning on the VGA card. Instead of 400 lines at 70Hz, you will get 200 lines at 140Hz. Double-Scanning is only about vertical resolution, not about horizontal resolution. Horizontal resolution is determined by the pixel clock. The standard VGA pixel clocks provide 640 or 720 pixels at the standard VGA line frequency (which is twice the TV line frequency). You can divide the VGA pixel clock by two, which will provide 640/720 pixels at the TV line frequency, or, if you tell the card to only generate half as much pixels per line, 320/360 pixels at VGA line frequency. To obtain 320/360 pixels at TV line frequency, you would need to divide the standard clock by four. This is not provided on standard VGA hardware.

Reply 4 of 43, by Grzyb

User metadata
Rank Oldbie
Rank
Oldbie
sofakng wrote on 2022-10-14, 03:51:

Are there any TSRs to output at the native 70 Hz but at 320x200?

VGA by default outputs 320x200 at 70 Hz.

Basically, there are three modes:
- 350 scanlines - 70 Hz
- 400 scanlines (inluding double-scanned 200) - 70 Hz
- 480 scanlines - 60 Hz

Żywotwór planetarny, jego gnijące błoto, jest świtem egzystencji, fazą wstępną, i wyłoni się z krwawych ciastomózgowych miedź miłująca...

Reply 5 of 43, by Jo22

User metadata
Rank l33t++
Rank
l33t++

It's been a while, but I vaguely remember that VGA mode 13h 320x200 is seen as 320x400 by the monitor.
Speaking under correction, though.

There's a scroller text in the demo "YARDEMO" by a group named "Renaissance" which
describes how to disable the line doubling in order to use 400 lines.

I've recorded a video years ago, since no material was available.
(I'm not affiliated to them. I'm just an user.)

https://www.youtube.com/watch?v=F3mikF1bUT4

https://hornet.org/demos/1992/yardemo.zip

The interesting thing about EGA's 640x350 mode on VGA is,
that it's actually displayed in a 640x400 frame or view port.
Because of that,- a 200 or 400 line mode is used -, EGA timing runs too fast.
Normally, it's in 60 Hz (like CGA), but on VGA it is in 70 Hz.

Unless an EGA emulation mode is used, *maybe*.
Early ISA SVGA cards shipped with a mode utility that allowed for switching into CGA/HGC, EGA, higher res. text modes and so on.
Some cards did the emulation more detailed than others, also.

"Time, it seems, doesn't flow. For some it's fast, for some it's slow.
In what to one race is no time at all, another race can rise and fall..." - The Minstrel

//My video channel//

Reply 6 of 43, by maxtherabbit

User metadata
Rank l33t
Rank
l33t
sofakng wrote on 2022-10-14, 03:51:

Very interesting, thanks!

Are there any TSRs to output at the native 70 Hz but at 320x200?

No, and even if there were it wouldn't work on any real CRT, except maybe some super obscure multiformat pro monitor

Reply 7 of 43, by Jo22

User metadata
Rank l33t++
Rank
l33t++

I second this.

Classic VGA monitors were socalled "fixed-frequency" monitors.
As opposed to better "multi-sync" monitors.
- Which also were compatible with timings associated with MDA, EGA, Super EGA, SVGA, CGA etc and both the sync polarities (neg, pos).

Roughly 56-72 Hz and 31,5 KHz was the valid frequency range.
400 lines were the minimum normal VGA monitors could display (thus the line doubling), the maximum was a bit below 600 lines, I vaguely remember.
Without manual adjustment, I mean. And progressive scan.

Some tweaked VGA modes existed that got near the popular 800x600 resolution,
without needing a new SVGA monitor.
They got there by using a different timing/pixel clock etc. I'm just a user.

"Time, it seems, doesn't flow. For some it's fast, for some it's slow.
In what to one race is no time at all, another race can rise and fall..." - The Minstrel

//My video channel//

Reply 8 of 43, by Namrok

User metadata
Rank Oldbie
Rank
Oldbie

I wonder if this is related to something I noticed noodling around in EGA mode 0x0D. It's supposed to be 320x200, but polling the int 33 mouse driver for it's location returns double the X value, as though the screen is actually 640x200. Some amateur google sleuthing showed I'm not the only person to notice this. But explanations as to why, and if it's universal, were non-existent.

So would the mouse in mode 0x0D on a native EGA card return non-doubled values? Is it only doubled on VGA cards?

Win95/DOS 7.1 - P233 MMX (@2.5 x 100 FSB), Diamond Viper V330 AGP, SB16 CT2800
Win98 - K6-2+ 500, GF2 MX, SB AWE 64 CT4500, SBLive CT4780
Win98 - Pentium III 1000, GF2 GTS, SBLive CT4760
WinXP - Athlon 64 3200+, GF 7800 GS, Audigy 2 ZS

Reply 9 of 43, by sofakng

User metadata
Rank Member
Rank
Member

Thanks for all of the information, but I'm still a little confused... (it does seem to be a very confusing subject!)

According to Wikipedia, CGA resolution is 320x200 with a refresh rate of 59.923 Hz.

However, VGA uses 320x200 (400 lines) with 70 Hz. I think expect this conversion of games written for CGA (60 Hz) to be running too fast or have incorrect animation on VGA (70 Hz) ?

Reply 10 of 43, by Jo22

User metadata
Rank l33t++
Rank
l33t++

Hi there!

CGA is a special case. It uses NTSC timings, essentially.
Monitors used for CGA cards are nothing more than fancy TV sets.
They use 60 Hz and 15 KHz for timing, like an NES*.

In fact, you can connect a normal video monitor to the RCA (Cinch) connector of the CGA card.
It's just ordinary composite video signal (CVBS).

Edit: Yes, CGA games are running at 70 Hz on VGA, instead of 60 Hz.
The CGA compatibility is merely superficial on VGA, anyway.
The Motorola MC6845 isn't emulated, at all.
Except through a separate CGA emulation mode that VGA cards had.
It's accessible by a DOS program, a mode utility.
If the VGA is set to CGA, it will react appropriately to CGA register writes cazsed by DOS games.
Things like alternative palettes now magically work.
However, Composite CGA still is out of reach.

*Old game consoles use a weird 240p (NTSC) or 288p (PAL) signal.
It's known as Low-Definition (LD) signal, with pseudo progressive scan.
TV stations were forbidden to air it.
Modern TVs always get confused by it (they think it's 480i or 576i).
Normal analogie television used SD (Standard Definition). DVD players supported ED (Enhanced Definition).

Last edited by Jo22 on 2022-10-14, 13:32. Edited 1 time in total.

"Time, it seems, doesn't flow. For some it's fast, for some it's slow.
In what to one race is no time at all, another race can rise and fall..." - The Minstrel

//My video channel//

Reply 11 of 43, by Grzyb

User metadata
Rank Oldbie
Rank
Oldbie
sofakng wrote on 2022-10-14, 13:12:

According to Wikipedia, CGA resolution is 320x200 with a refresh rate of 59.923 Hz.

However, VGA uses 320x200 (400 lines) with 70 Hz. I think expect this conversion of games written for CGA (60 Hz) to be running too fast or have incorrect animation on VGA (70 Hz) ?

Possible.
But there's more reasons why CGA games are problematic on VGA: no register-level compatibility, and the fact that CGA games were often targetted at 8088@4.77, while VGA is usually used with much faster CPUs.

Żywotwór planetarny, jego gnijące błoto, jest świtem egzystencji, fazą wstępną, i wyłoni się z krwawych ciastomózgowych miedź miłująca...

Reply 12 of 43, by Jo22

User metadata
Rank l33t++
Rank
l33t++

I recommend trying out the CGA Compatibility Tester in both VGA mode and CGA emulation mode (via utility).

http://www.oldskool.org/pc/cgacomp

It will show all the information needed, I believe.
Even the 60 / 70 Hz thing.

"Time, it seems, doesn't flow. For some it's fast, for some it's slow.
In what to one race is no time at all, another race can rise and fall..." - The Minstrel

//My video channel//

Reply 13 of 43, by maxtherabbit

User metadata
Rank l33t
Rank
l33t
sofakng wrote on 2022-10-14, 13:12:

Thanks for all of the information, but I'm still a little confused... (it does seem to be a very confusing subject!)

According to Wikipedia, CGA resolution is 320x200 with a refresh rate of 59.923 Hz.

However, VGA uses 320x200 (400 lines) with 70 Hz. I think expect this conversion of games written for CGA (60 Hz) to be running too fast or have incorrect animation on VGA (70 Hz) ?

CGA/EGA games do indeed sometimes run too fast at 70Hz

Reply 14 of 43, by Gustavo

User metadata
Rank Newbie
Rank
Newbie
maxtherabbit wrote on 2022-10-15, 02:42:

CGA/EGA games do indeed sometimes run too fast at 70Hz

Alley Cat has some small delay in the controls with VGA card on a Turbo XT. The problem of course don´t occur with a CGA card. Could it be the 70Hz refresh?

Reply 15 of 43, by Gustavo

User metadata
Rank Newbie
Rank
Newbie

https://github.com/joncampbell123/doslib/blob … hw/vga/vga240.c

This utility can set some VGA modes to 60Hz. Tried with AlleyCat and it indeed set it to 60Hz (the image gets a little squashed).

It did not solve the delay problem I mentioned.

Reply 16 of 43, by Grzyb

User metadata
Rank Oldbie
Rank
Oldbie

What VGA card you have in that Turbo XT?
Chances are, it supports register-level CGA compatibility mode...

Żywotwór planetarny, jego gnijące błoto, jest świtem egzystencji, fazą wstępną, i wyłoni się z krwawych ciastomózgowych miedź miłująca...

Reply 17 of 43, by jmarsh

User metadata
Rank Oldbie
Rank
Oldbie
Namrok wrote on 2022-10-14, 13:08:

I wonder if this is related to something I noticed noodling around in EGA mode 0x0D. It's supposed to be 320x200, but polling the int 33 mouse driver for it's location returns double the X value, as though the screen is actually 640x200. Some amateur google sleuthing showed I'm not the only person to notice this. But explanations as to why, and if it's universal, were non-existent.

So would the mouse in mode 0x0D on a native EGA card return non-doubled values? Is it only doubled on VGA cards?

INT33 function 7 should let you set the horizontal range to whatever you want regardless of the video mode. The default range may vary depending on what the specific mouse driver decides to use.

Reply 18 of 43, by Gustavo

User metadata
Rank Newbie
Rank
Newbie
Grzyb wrote on 2022-10-15, 13:01:

What VGA card you have in that Turbo XT?
Chances are, it supports register-level CGA compatibility mode...

Trident T8900D or 9000B, don´t remember now.

But the utility I mentioned sets the VGA card to 480 line mode to obtain a 60Hz refresh. That´s the reason 320x200 games get squashed.

Reply 19 of 43, by 7F20

User metadata
Rank Member
Rank
Member
Jo22 wrote on 2022-10-14, 07:45:

It's been a while, but I vaguely remember that VGA mode 13h 320x200 is seen as 320x400 by the monitor.
Speaking under correction, though.

The monitor doesn't change the signal, it's done on the VGA hardware. All VGA modes are vertically line-doubled.