Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- FUNCky - <b>name:</b> <b>setmode() - set a new video mode</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
  Name:     setmode() - set a new video mode
  Usage:    setmode(<mode>)
  Params:   integer <mode> - video mode number to set

            The following modes are allowed providing you have
            the correct adapter to handle the selected mode.

            Mode - Description
            0    - 40x25 16 color alphanumeric (color disabled)
            1    - 40x25 16 color alphanumeric
            2    - 80x25 16 color alphanumeric (color disabled)
            3    - 80x25 16 color alphanumeric
            4    - 320x200 4 color graphics
            5    - 320x200 4 color graphics (color disabled)
            6    - 640x200 2 color graphics
            7    - 80x25 monochrome alphanumeric (N/A on CGA)
            8    - 160x200 16 color graphics (PCjr only)
            9    - 320x200 16 color graphics (PCjr only)
            10   - 640x200 4 color graphics (PCjr only)
            13   - 320x200 - 16 color graphics (EGA & VGA only)
            14   - 640x200 - 16 color graphics (EGA & VGA only)
            15   - 640x350 - mono graphics (EGA & VGA only)
            16   - 640x350 - 16 color graphics (EGA/VGA with 128kb)
                   640x350 - 4 color graphics (EGA 64kb)
            17   - 640x480 - 2 color graphics (MCGA & VGA only)
            18   - 640x480 - 16 color graphics (VGA only)
            19   - 320x200 - 256 color graphics (MCGA & VGA only)

            In addition, 2 extra modes have been added by FUNCky
            to switch into 43 line EGA mode and 50 line VGA mode.
            The additional modes are:

            43   - goes into 43 line alphanumeric mode (EGA/VGA)
            50   - goes into 50 line alphanumeric mode (VGA only)

  Returns:  nothing. However, if you are in 43 or 50 line mode, getmode()
            will return mode 3, since that is the actual mode in use.
            To check 43 or 50 line mode you can use maxrow().

 ---------------------------------- Example ---------------------------------

                 setmode(1)     && switch into 40x25 alphanumeric
                 setmode(43)    && switch into 43 line EGA
                 setmode(3)     && switch into 80x25 (EGA VGA)
                 setmode(50)    && switch into 50 line (VGA only)

                 tempvar = getmode()
                 setmode(43)
                 ** do something **
                 setmode(tempvar)

  Note:     If your adaptor supports other modes you might be able
            to set them them with setmode() as well. Consult your
            adaptors reference manual.

            If you have a Paradise Autoswitch EGA 480, you can easily
            switch into the 132 column mode by using the following
            modes:

            51   - 80x30 line alphanumeric mode, 16 color
            54   - 132x43 line alphanumeric mode, 16 color
            55   - 132x25 line alphanumeric mode, 16 color
            56   - 132x43 line alphanumeric mode, 4 color
            57   - 132x25 line alphanumeric mode, 4 color

            If your adaptor supports extended modes that can
            be set via the BIOS interrupt 10h, then you can set
            those modes with the setmode() function. If your
            adaptor takes additional parameters to set the mode,
            you can still set it using the interrupt() function.
            If you use the interrupt() function to set a video
            mode, call the __vinit() function immediately after
            setting the mode so that all row/column coordinates
            are updated.

            Setmode() clears out any fonts you may have loaded,
            clears any palette settings you might have had set as
            well as setting the cursor back on, and to it's proper
            size for that mode.

  Warning!: Do not attempt to set your adaptor into video modes
            that your monitor does not support. Doing so can result
            in damage to your monitor. See your adaptor card
            reference to see the available modes for your adaptor.
            If you reset the size of your screen, be aware that any
            screens saved prior to the mode set will not restore
            properly. Any virtual pages created before the mode
            change should not be used if the new mode changes the
            size of the screen. When writing to virtual pages, the
            size of the currently displayed screen is used as a
            reference for boundary checking unless you re-size the
            virtual screen with the setscreen() function.


See Also: getmode() interrupt() setscreen() setpage()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson