OSDev.org
https://forum.osdev.org/

change text mode VGA width/height?
https://forum.osdev.org/viewtopic.php?f=1&t=51832
Page 1 of 1

Author:  YDeeps1 [ Wed Sep 01, 2021 11:02 am ]
Post subject:  change text mode VGA width/height?

I keep searching for the answer but I cant find any so I'm curious if it is possible to change the VGA text mode width & height from 80x25 to something else (whether thats by resizing the text of whatever) without switching to pixel mode and drawing the characters myself.

Is this possible? Thanks.

Author:  nexos [ Wed Sep 01, 2021 2:40 pm ]
Post subject:  Re: change text mode VGA width/height?

There are some obscure higher resolution VGA text modes AFAIK, but I am not sure how widely implemented they are implemented.

Author:  kzinti [ Wed Sep 01, 2021 2:46 pm ]
Post subject:  Re: change text mode VGA width/height?

It is possible, here is some high-level info:

https://en.wikipedia.org/wiki/VGA_text_mode

Author:  Octocontrabass [ Wed Sep 01, 2021 3:03 pm ]
Post subject:  Re: change text mode VGA width/height?

Standard VGA doesn't have a whole lot of options for higher resolutions, but you can make the character cells smaller. Using the default 720x400 text mode resolution, the character cells are 9x16 which results in 80x25 cells. Using only standard BIOS calls, you can reduce the cell height - for example, use 9x8 characters for an 80x50 text mode. I'm not sure if it's possible with BIOS calls, but by poking the registers directly, you can change the cell width to 8 pixels. With 8x8 character cells, you can have a 90x50 text mode. (You might also be able to increase the vertical resolution to 480 lines, giving you 60 rows, but I haven't tried to work out the timings to see if displays would accept it.)

Author:  eekee [ Fri Sep 10, 2021 6:04 am ]
Post subject:  Re: change text mode VGA width/height?

Octocontrabass wrote:
Standard VGA doesn't have a whole lot of options for higher resolutions, but you can make the character cells smaller. Using the default 720x400 text mode resolution, the character cells are 9x16 which results in 80x25 cells.

Note: There is an old alternative standard, "LCD", for 80s laptops. This has 640x400 (or 640x200) pixels and 8x16 (or 8x8) characters. I mention it because some much more recent laptops implement it, even when it's quite unnecessary to do so. I have a Thinkpad X61 which implements LCD text although its screen is greater than 720 pixels wide and the characters have to be stretched in software.

Some other VGA BIOSes implemented 132-column modes, presumably 1056 pixels wide, but I haven't seen one for many years. Lilo was good at probing for these things.

Author:  feryno [ Mon Sep 13, 2021 12:45 pm ]
Post subject:  Re: change text mode VGA width/height?

I used this code in my very old project to change from 80x25 to 80x50, I hope it will help you and is still present:
Code:
; set 80x50 text mode
   mov   ax,1112h   ; AH=11h TEXT-MODE CHARACTER GENERATOR FUNCTIONS
            ; AL=12h load ROM 8x8 double-dot pattern (PS,EGA,VGA)
   xor   bl,bl      ; block to load
   int   10h

Author:  FrankRay78 [ Thu Mar 28, 2024 4:55 am ]
Post subject:  Re: change text mode VGA width/height?

feryno wrote:
I used this code in my very old project to change from 80x25 to 80x50, I hope it will help you and is still present:
Code:
; set 80x50 text mode
   mov   ax,1112h   ; AH=11h TEXT-MODE CHARACTER GENERATOR FUNCTIONS
            ; AL=12h load ROM 8x8 double-dot pattern (PS,EGA,VGA)
   xor   bl,bl      ; block to load
   int   10h


Is the above code snippet actually correct? Wouldn't we expect to see AH=00h included somewhere, along with AL specifying which text mode to switch to?

Author:  Octocontrabass [ Thu Mar 28, 2024 12:46 pm ]
Post subject:  Re: change text mode VGA width/height?

It's not switching to a different mode, it's just changing the font. If you want to also set the mode, you'd write something like this:

Code:
mov ax, 0x0003 ; VGA text mode, 720x400 pixels, 9x16 font, 80x25 characters
int 0x10
mov ax, 0x1112 ; replace 9x16 font with 9x8 font, so now it's 80x50 characters
mov bl, 0x00
int 0x10

Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/