OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 5:05 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: change text mode VGA width/height?
PostPosted: Wed Sep 01, 2021 11:02 am 
Offline
Member
Member

Joined: Tue Aug 31, 2021 7:25 am
Posts: 67
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.


Top
 Profile  
 
 Post subject: Re: change text mode VGA width/height?
PostPosted: Wed Sep 01, 2021 2:40 pm 
Offline
Member
Member

Joined: Tue Feb 18, 2020 3:29 pm
Posts: 1071
There are some obscure higher resolution VGA text modes AFAIK, but I am not sure how widely implemented they are implemented.

_________________
"How did you do this?"
"It's very simple — you read the protocol and write the code." - Bill Joy
Projects: NexNix | libnex | nnpkg


Top
 Profile  
 
 Post subject: Re: change text mode VGA width/height?
PostPosted: Wed Sep 01, 2021 2:46 pm 
Offline
Member
Member

Joined: Mon Feb 02, 2015 7:11 pm
Posts: 898
It is possible, here is some high-level info:

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

_________________
https://github.com/kiznit/rainbow-os


Top
 Profile  
 
 Post subject: Re: change text mode VGA width/height?
PostPosted: Wed Sep 01, 2021 3:03 pm 
Offline
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 5100
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.)


Top
 Profile  
 
 Post subject: Re: change text mode VGA width/height?
PostPosted: Fri Sep 10, 2021 6:04 am 
Offline
Member
Member
User avatar

Joined: Mon May 22, 2017 5:56 am
Posts: 812
Location: Hyperspace
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.

_________________
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


Top
 Profile  
 
 Post subject: Re: change text mode VGA width/height?
PostPosted: Mon Sep 13, 2021 12:45 pm 
Offline
Member
Member

Joined: Thu Feb 09, 2012 6:53 am
Posts: 67
Location: Czechoslovakia
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

_________________
hypervisor-based solutions developer (Intel, AMD)


Top
 Profile  
 
 Post subject: Re: change text mode VGA width/height?
PostPosted: Thu Mar 28, 2024 4:55 am 
Offline

Joined: Fri Jan 05, 2024 10:10 am
Posts: 5
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?


Top
 Profile  
 
 Post subject: Re: change text mode VGA width/height?
PostPosted: Thu Mar 28, 2024 12:46 pm 
Offline
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 5100
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 85 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group