Page 1 of 1

How to get a list of available text modes

Posted: Fri Jan 21, 2005 6:05 pm
by XStream
Hi,

I am wondering if anyone knows how to get a list of available text modes using either the BIOS or the VGA Registers directly, I have been looking throught the Interrupt list but can only find functions to get the current mode details. I also had a look at the FreeVGA project but couldn't seem to find anything.

Cheers.

Re:How to get a list of available text modes

Posted: Fri Jan 21, 2005 7:25 pm
by Colonel Kernel
I've never tried using the BIOS functions for VGA, but I've used the info at FreeVGA to help me write code to set various text modes (80x25, 80x50, 90x60, etc.). I don't think the VGA hardware itself has any concept of "modes". You basically have to know what values to put in all the VGA registers for any given "mode".

This sample code by Chris Giese helped me a lot:

http://my.execpc.com/~geezer/osd/graphics/modes.c

Re:How to get a list of available text modes

Posted: Fri Jan 21, 2005 10:21 pm
by XStream
Cool, that looks good.

Also, is it possible to change the location in memory that is mapped to the VGA ram?

Thanks.

Re:How to get a list of available text modes

Posted: Sat Jan 22, 2005 9:58 am
by bubach

Code: Select all

INT 10h, Service 0h
Set Screen Mode

Input:  AH = 0h
        AL = Mode Number (see below)
Output:  The video mode is changed.

Mode Number  Text Res.  Graphics Res.  Description  Adapters  Max. Pages
---------------------------------------------------------------------------
        0h      40x25        ------  B&W Text    CGA+              8
        1h      80x25        ------  B&W Text    MDPA+              8
        2h      40x25        ------  Color Text  CGA+          4 or 8
        3h      80x25        ------  Color Text  (MDPA?)/CGA+  4 or 8
        4h      40x25        320x200  4 colors    CGA+              1
        5h      40x25        320x200  2 colors    CGA+              1
        6h      80x25        640x200  2 colors    CGA+              1
        7h      80x25        ------  B&W          MDPA (CGA+?)      1
        8h to Ch -- PCjr or other adapters; no longer used
        Dh      40x25        320x200  16 colors    EGA+              8
        Eh      80x25        640x200  16 colors    EGA+              4
        Fh      80x25        640x350  2 colors    EGA+              2
        10h      80x25        640x350  16 colors    EGA+              2
        11h      80x25        640x480  2 colors    VGA+              1
        12h      80x25        640x480  16 colors    VGA+              1
        13h      40x25        320x200  256 colors  VGA+              1