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.
change text mode VGA width/height?
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.
-
- Member
- Posts: 5560
- Joined: Mon Mar 25, 2013 7:01 pm
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.)
Re: change text mode VGA width/height?
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.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.
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.
Kaph — a modular OS intended to be easy and fun to administer and code for.
"May wisdom, fun, and the greater good shine forth in all your work." — Leo Brodie
"May wisdom, fun, and the greater good shine forth in all your work." — Leo Brodie
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: Select all
; 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
hypervisor-based solutions developer (Intel, AMD)
-
- Posts: 22
- Joined: Fri Jan 05, 2024 10:10 am
Re: change text mode VGA width/height?
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?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: Select all
; 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
Better software requirements can change the world. Better Software UK.
-
- Member
- Posts: 5560
- Joined: Mon Mar 25, 2013 7:01 pm
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: Select all
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