Thread: Mode13h

  1. #1
    Registered User JoshG's Avatar
    Join Date
    Mar 2002
    Posts
    326

    Mode13h

    Is there a way to test if the video went to mode 13h?

    I use this code to go into mode13h

    Code:
    void SetGraphicsMode()
    {
      _AH = 0;
      _AL = 0x13;
      geninterrupt(0x10);
    }
    I want to make SetGraphicsMode() return a bool or an int so I know if I went to mode14h or not, how would I go about doing this?

  2. #2
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    You should check the RBIL under interrupt 10h to see what values are returned in what registers.


    int SetVideoMode(int mode)
    {
    asm {
    mov ax,13h
    mov ah,0
    int 10h
    }
    return _AX;
    }


    I'm assuming that the error code is return in _AX. Most BIOS calls use this register to return error codes to the caller. If not, just change the returned register.

    There is no reason this call should fail, though.

  3. #3
    Registered User JoshG's Avatar
    Join Date
    Mar 2002
    Posts
    326
    I noticed in your code you had ax as 13h, and ah as 0. I usualy have ah as 0 and al as 13h, what is the difference?

  4. #4
    Confused Magos's Avatar
    Join Date
    Sep 2001
    Location
    Sweden
    Posts
    3,145
    Originally posted by JoshG
    I noticed in your code you had ax as 13h, and ah as 0. I usualy have ah as 0 and al as 13h, what is the difference?
    AX consists of AL (low byte) and AH (high byte). When you set AX to a number < 256, it is set to the low byte, so both ways works.
    MagosX.com

    Give a man a fish and you feed him for a day.
    Teach a man to fish and you feed him for a lifetime.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Quick question about mode13h
    By Nutshell in forum Game Programming
    Replies: 6
    Last Post: 01-29-2003, 06:56 AM
  2. mode13h
    By Anglos in forum C Programming
    Replies: 5
    Last Post: 04-01-2002, 10:51 AM