VOGONS


First post, by clb

User metadata
Rank Member
Rank
Member

Hi all,

I am developing a text editor in real mode to my 8088 and 486 DOS PCs to use.

I want to add a flexible text resolution mode support, so that it works across multiple character modes.

So far I am able to support six different text modes:
- 40x25 on a CGA card,
- 40x28, 40x50, 80x25, 80x28 and 80x50 on a VGA card.

The 40x28 and 40x50 modes are basically the same video mode as 40x25, but with the VGA adapter programmed to more scanlines and smaller font. (same goes with 80x28 and 80x50, they are the same mode as 80x25)

1. Are there any other compatible modes that would be possible on all CGA, EGA or VGA adapters? I read references to a 90x60 mode, but not sure if that would be compatible.

However now I got interested after seeing this video mode list:

http://www.columbia.edu/~em36/wpdos/videomodes.txt

There are quite a lot of adapter specific text modes there.

2. Is it possible to write code that would be able to enumerate the support for different adapter-specific text modes? I know that VESA added functionality to query available video modes, but is there anything like that for pre-VESA graphics modes. I understand that the above videomodes.txt lists specifically non-VESA modes that were just vendor-specific extensions?

3. Even if there is no general way (which I presume there might not be... that was what VESA was all about) to enumerate/discover supported modes, does anyone know of vendor-specific ways of discovering available text modes?

I.e. maybe on all Tseng or Oak family of cards one might have a functionality that allows one to query "give me all the available text modes?", or "is mode xyz supported?"

4. If the above is not possible, then, I suppose the only way will be to write some code to identify the display adapter vendor identifier string (which is located somewhere in graphics ROM area?), and then statically codify the set of adapter specific formats that are supported by that adapter? If so, does anyone know of links that would make this kind of identification more robust? E.g. any vendor published "best practices for detecting a Tseng card" type of thing that could be helpful here?

5. Finally, is it possible to program VESA from real mode? When I did VESA back in the day, that was well in the protected mode era, and all references I could find deal with protected mode since that is what it was already all about then. Though I wonder if VESA modes would be available from real mode as well? (or do they all require virtual memory/XMS addressing?)

Thanks!

Reply 1 of 6, by Kalle

User metadata
Rank Newbie
Rank
Newbie

1. Are there any other compatible modes that would be possible on all CGA, EGA or VGA adapters? I read references to a 90x60 mode, but not sure if that would be compatible.

Compatible modes for all cards would be those defined by IBM, as the details about the resolution and character size are handled by the BIOS. 90x60 is an unofficial mode that can only be achieved on VGA cards, as their 80x25 mode uses a resolution of 720x400, but adding a 9th column to each character. Turning this feature off gives you 80 pixels more, therefore 10 more characters. The vertical resolution can be raised to x480, thereby giving you space for 10 more characters as well (using an 8x8 font, that is). It's achieved by altering some registers directly, and only available on the VGA card. On EGA or CGA cards, their maximum scanlines are already used for the standard text modes, and they don't add the 9th column that you could use.

Regarding the SVGA cards, you're right, there was no general way, hence the VESA BIOS extensions. You'd have to look at each adapter to find out what it supports. Right, the list you linked to shows vendor specific modes, as standard VGA ends at 13h and VESA starts at 100h.

5. Finally, is it possible to program VESA from real mode?

Yes, it works. It offers some int 10h functions to obtain information regarding the card and switch to the desired mode. Its video memory is mapped to the same region as with the non-SVGA modes, 0xB800, and accessed the same way (character on even addresses, color on odd ones). To use multiple pages you might have to map a different part of the video memory to the 0xB800 location, that's done using bank switching.

Reply 2 of 6, by bakemono

User metadata
Rank Oldbie
Rank
Oldbie

CGA has an 8x8 character font. EGA has 8x8 and 8x14. VGA has what, 8x8, 8x14, 8x16, and optional 9th column?

CGA can output 320x200 or 640x200 pixels. EGA has that plus 350 lines. VGA has that plus 400 or 480 lines, as well as 360/720 widths.

That is quite a few combinations of character size and screen resolution right there. With an SVGA monitor (can go above 31KHz) then you can do custom scanrates with VGA that would basically trade off horizontal resolution for more vertical resolution.

VGA has 25MHz and 28MHz pixel clocks which are used to select the different horizontal resolutions. Third-party VGA cards and SVGA cards have more options here, and they are non-standard but then again not entirely random. Usually you can use the same exact register (3CC/3C2) to choose new pixel clocks by setting bit 3 which didn't do anything on the original VGA. So in addition to 25MHz and 28MHz (640 and 720 res) now you might have 32MHz, 36MHz, 40MHz, 45MHz, or who knows what.

again another retro game on itch: https://90soft90.itch.io/shmup-salad

Reply 3 of 6, by BloodyCactus

User metadata
Rank Oldbie
Rank
Oldbie

your link doesnt work for me, but you basically have 80x12, 80x14, 80x21, 80x25, 80x28, 80x30, 80x34, 80x43, 80x50, 80x60, 80x70.

the common ones are 80x25, 80x28, 80x43, 80x50.

some like 80x30, 80x32 can be card depending (they get their font cut off a bit).

then there is the crazy vesa modes like 132x25

--/\-[ Stu : Bloody Cactus :: [ https://bloodycactus.com :: http://kråketær.com ]-/\--

Reply 4 of 6, by clb

User metadata
Rank Member
Rank
Member

Thanks for all the pointers. My current code is so far able to utilize the VGA 8x8, 8x14 and 8x16 font sizes to come up with the 80x25, 80x28 and 80x50 modes.

I stumbled onto this page: http://www.techhelpmanual.com/937-int_10h_4f0 … ga_support.html , which if I understand correctly is part of a VESA-defined SVGA spec. I wonder if that is *the* same standard as the "VESA BIOS Extensions" (VBE) spec is/was, that I recall having developed a long time ago on RHIDE+DJGPP combo in protected mode on a 486 - or is that Vesa SVGA int10h extension at AX=4f00h+ something that predates VESA VBE?

That site looks like it has enough info that I can code in the SVGA side - I'll give that a try soon.

I tried to find info about enabling/disabling the 9th column - if someone has more info or programming links on that, would be much appreciated.

Reply 5 of 6, by clb

User metadata
Rank Member
Rank
Member

Looks like I found the 8 vs 9 dots per character illustrated here in detail: https://www.ardent-tool.com/video/VGA_Video_Modes.html

That looks like enough info to do an implementation. I'll put that to a test soon as well.

Reply 6 of 6, by clb

User metadata
Rank Member
Rank
Member

Based on the code from https://files.osdev.org/mirrors/geezer/software/90x60.asm I was able to initialize a 90x60 video mode. I am viewing through OSSC scan converter, where the resulting video mode ends up looking like it's not pixel perfect.. maybe I need to configure it somehow as well to make it more clear.

Wrote another test to flip just from 9 dots per character to 8 dots per character in 80x25 mode, though at least with OSSC all it caused was some shimmering on the produced video image - the 9th column between text did not vanish.

Also wrote some code to reprogram the CRTC and play with manually setting the timing values to see how they behave. Wasn't able to produce anything good that the above 90x60.asm code didn't already do.

Finally, I was able to follow the VESA 1.0 spec to initialize VESA SVGA modes from real mode. Too bad my MiroVideo 12PD 2.0 PCI card on my 486 does not support any SVGA text modes, it just reports SVGA graphics modes. Oh well, I guess the 80x50 mode will be the sweet spot. I might try to find another SVGA card that supports one of the fancy VESA text modes in the future, to see how that would look.