Re: Tweaked video mode

Search this archive.

From: Matan Ziv-Av (matan@svgalib.org)
Date: Fri 14 Jul 2000 - 20:47:49 IDT


> I'm pretty new to SVGALIB, I'm busy writing a game under Dos, and would
> like to start Linux development as well. But I have a problem, my game
> modifies the VGA registers to change the video mode to 292x220x256
> (chained). How would I go about doing this under Linux? Is there a way to
> tweak video modes under Linux? (I'm sure there is!)

xmame is doing this. This is done the same as in DOS.
Use svgalib to set a graphics mode (as you would use the BIOS in DOS),
then simply use outb, the same way as you would do under DOS.
Please note that in Linux it leaves you with some burden: The user might
switch away from the virtual console you use, and then switch back. When
that happens, svgalib will restore the original mode you set, not the
tweaked one, so you have to use vga_runinbackground(VGA_COMEFROMBACK,...)
and tweak the mode every time.
Please note that xmame does this (catching console switches for 
retweaking) wrongly by using the signals that svgalib uses, but
different versions of svgalib use different signals, so xmame fails to
retweak with newer svgalib.
Also note that this won't work with svgalib-2.0, as your program won't
have permission to access the io ports. I'll have a better solution for
tweaked modes in svgalib-2.0, and it will also include it in 1.4.x,
sometime.

> P.s. Is it possible to use SVGALIB with NASM? The Dos version of my game is
> written in TASM, now I know it's a lot of workto port Assembly code
> between operating systems, but I want it working on both. Otherwise, I'll
> just re-write the Linux version in C.

Using svgalib is merely a matter of calling C functions (and including C
header files for the constants), so if that can be done in nasm, you can
use svgalib.



-- 
Matan Ziv-Av.                         matan@svgalib.org


This archive was generated by hypermail 2.1.4 : Wed 21 Jan 2004 - 22:10:23 IST