VOGONS


First post, by PlaneVuki

User metadata
Rank Member
Rank
Member

Hi !

I am using Turbo Pascal programming. The editor uses 80x25 text mode, but I am mostly programming for mode13h (320x200 with 8bit color).

There is an option to switch to 80x43 (if card is ega) OR 80x50 (if card is vga).

My question: is it possible to "fool" the editor into thinking that the card is EGA, while in reality it is VGA.

Basically I want to to use 80x43 text mode editor (even if it simply uses 43 lines of 50 available) and mode13h for graphics.

Perhaps there is a TSR or something that would report EGA when Turbo Pascal asks it?

(I am using real-mode only, 8086 compatible, 1mb limit and also Dosbox)

Have such a thing been done, can you please provide it ?

Thanks in advance !

Reply 1 of 10, by Zup

User metadata
Rank Oldbie
Rank
Oldbie

AFAIR the editor kept the video mode when launched, so you could set 80*43 on command line and then launch Turbo Pascal.

I didn't like 80*43 nor 80*50, because:
- They are graphic modes, and writing text was slow in my VGA.
- The text is very small and less readable.

If I were to use a non standard mode, I would use 80*28. It's very readable and still is a text mode, but the difference in lines is minimal.

I have traveled across the universe and through the years to find Her.
Sometimes going all the way is just a start...

I'm selling some stuff!

Reply 2 of 10, by mkarcher

User metadata
Rank l33t
Rank
l33t

The VGA card is able to produce the 43 line mode if you configure the text mode to use 350 lines instead of 400 lines. There is a BIOS call to downgrade text modes to 350 lines or 200 lines you can invoke before initializing mode 3. I'm unsure whether that call only works for the next mode set, or works until revoked. See http://www.ctyme.com/intr/rb-0167.htm (Interrupt 10h, AH=12h, BL=30h)

It's not true that the 80*43 or 80*50 modes implemented in the Borland IDEs is a graphics mode. Instead, these modes are normal text modes, replacing the 8x14 or 8x16 character set by an 8x8 character set.

Reply 3 of 10, by PlaneVuki

User metadata
Rank Member
Rank
Member

Thank you mkarcher! That worked.

Zup, I didn't know that mode 80x28 existed.

Any idea how I can force editor to 80x28 mode?

(I assume it is done by loading ega font in vga mode 400/14=28.57=28, but how to achieve this?)

I am looking for a solution here, if you have an idea please let me know!
DOSBOX scaling question

Thanks guys!

Reply 4 of 10, by debs3759

User metadata
Rank Oldbie
Rank
Oldbie

The number of lines of text and the resolution determine the size of font. Changing the font won't affect the number of lines of text.

See my graphics card database at www.gpuzoo.com
Constantly being worked on. Feel free to message me with any corrections or details of cards you would like me to research and add.

Reply 6 of 10, by mkarcher

User metadata
Rank l33t
Rank
l33t
debs3759 wrote on 2024-01-16, 08:06:

The number of lines of text and the resolution determine the size of font. Changing the font won't affect the number of lines of text.

That's only partially true. When you use INT 10h, AH=11h, you can optionally enable "text mode adjustment". If enabled, the BIOS will reprogram the character height and re-calculate the number of text lines on the screen. In that case, changing the font (to a font with a different height) does change the number of lines on the screen.

Reply 7 of 10, by mkarcher

User metadata
Rank l33t
Rank
l33t
PlaneVuki wrote on 2024-01-16, 12:17:

Is there a more permanent method to set 80x28? (like mkarchers link did for 80x43)

I'm afraid there is not. The Borland IDEs insist on re-initializing the video mode. The recognize the *43 / *50 modes and also re-configure the font to 8x8 after setting mode 3, but this is not a generic solution to keep any exotic video mode configured.

Reply 8 of 10, by PlaneVuki

User metadata
Rank Member
Rank
Member

mkarcher, understood.

(Thinking outside borland editor now)

So we can load characters of height 8, 14 and 16. Anything else?

Is it possible to load font with charac height 12 easy way?
(I imagine hard way could be to redraw smaller characs within 16high ones, then limit drawn charac height to 12? Not sure if this would allow more lines of text though, 33 lines)

(Also, is code I fount to initialize 80*28 correct?)

Reply 9 of 10, by Jo22

User metadata
Rank l33t++
Rank
l33t++

Can't the Borland IDE be patched?
If it sets certain things we don't want, a NOP could be inserted, maybe? 🤷‍♂️

"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 10 of 10, by mkarcher

User metadata
Rank l33t
Rank
l33t
PlaneVuki wrote on 2024-01-16, 15:40:

So we can load characters of height 8, 14 and 16. Anything else?

The BIOS contains built-in fonts of height 8, 14 and 16. The BIOS also allows to load custom fonts of any height between 1 and 32. I would refrain from heights one and two, because at 400 scanlines, this would produce 400 or 200 rows, which will likely break a lot of software that doesn't blindly assume 25 lines. There is a way (using the "video save table") to register a font that automatically gets loaded as soon as you initialize certain modes, which would allow to make fonts persistent over mode sets. I currently don't have the information at hand whether custom fonts loaded using the save table will be loaded with "row count adjustment", or whether the number of row in mode 3 stays at 25, even if the save table instructs to load a custom 8x8 font.

You should be able to find fonts between 8*6 and 8*20 floating around in the internet. Resources around the Linux tool "SVGATextMode" (if they still exist) might be a good start to get fonts of unusual dimensions. Some fonts are optimized for the 9-pixel character box of the native VGA text mode, whereas other fonts are optimized for 8-pixel character boxes.