SVGA mode in Borland C

This is a discussion on SVGA mode in Borland C within the C Programming forums, part of the General Programming Boards category; I'm using Turbo C (3.0 to be exact) and I was wondering how do I call the video to a ...

  1. #1
    Registered User
    Join Date
    Mar 2002
    Posts
    25

    SVGA mode in Borland C

    I'm using Turbo C (3.0 to be exact) and I was wondering how do I call the video to a SVGA mode. Any help? Thanks ;-)

  2. #2
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,598
    First consult the RBIL and look up the VESA VBE functions on int 10h.

    To set the video mode:

    asm
    {
    mov ax,4F02
    mov bx,mode
    les di,CRTCbufferblock
    int 10h
    }

    note that you do not have to load ESI with anything if bit 11 in the mode is not set.

    To enable the LFB, set bit 13 in the mode - only valid for protected mode and for video modes that support the LFB.

    Again, get RBIL and look up the functions.

    http://www-2.cs.cmu.edu/~ralf/files.html

  3. #3
    Registered User
    Join Date
    Mar 2002
    Posts
    25

    the mode

    What's the exact mode of it? For example, mode 12h is 640x480 VGA (16 colors), 13h is 340x200 VGA (256 colors), mode blah blah blah.

  4. #4
    Linguistic Engineer... doubleanti's Avatar
    Join Date
    Aug 2001
    Location
    CA
    Posts
    2,459
    There was a bit of board processing up there. He meant ES: DI, the memory address register [if i'm not mistaken] of the 8086. Oh and the modes vary from card to card, as do their capabilities, so it's not as straight forward [or compatible] as 13h would be. Not to mention using VESA is [unfortunately] looked upon as outdated by much of the newer community. Here are the general steps for getting you started. [read up on RBIL and the VBE 3.x specs to implement it...]

    1.) get the controller information and modes list
    2.) get the pointer to the video display [and any backbuffers if you use them]
    3.) enjoy...
    hasafraggin shizigishin oppashigger...

  5. #5
    Registered User
    Join Date
    Mar 2002
    Posts
    25

    thanks

    Thanks for the input ;-)

    By using te video interrupt 10h and the C interrupt function, I was able to set it in SVGA:

    void set_mode_svga(void)
    {

    union REGS inregs,outregs;

    inregs.h.ah = 0;
    inregs.h.al = 0x005f; // video mode to change to

    int86(0x10, &inregs, &outregs);

    }
    Only problem is, it's showing double images at the top of the screen. I think I can figure that out, though. Thanks ;-)
    Last edited by WHurricane16; 04-09-2002 at 07:27 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. console mode and service mode
    By George2 in forum C# Programming
    Replies: 0
    Last Post: 06-01-2008, 02:42 AM
  2. 6 measly errors
    By beene in forum Game Programming
    Replies: 11
    Last Post: 11-14-2006, 11:06 AM
  3. SVGA graphics mode in MS VC++ 98
    By bennyandthejets in forum C++ Programming
    Replies: 3
    Last Post: 07-27-2002, 10:55 PM
  4. Showing the directory sturcture
    By Unregistered in forum C Programming
    Replies: 1
    Last Post: 03-26-2002, 04:46 PM
  5. free() usage
    By pdstatha in forum C Programming
    Replies: 5
    Last Post: 03-13-2002, 09:28 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21