Thread: Quick question about mode13h

  1. #1
    Registered User Nutshell's Avatar
    Join Date
    Jan 2002
    Posts
    1,020

    Quick question about mode13h

    Hi,

    Is mode 13h ( or mode13h) for real dos only? Do people use it anymore? Do you have to be in real dos for the program to work? What is the difference between it and the graphics libraries like allegro and such? How many modes are there? Why 13h?

    Thanks

  2. #2
    Normal vector Carlos's Avatar
    Join Date
    Sep 2001
    Location
    Budapest
    Posts
    463
    Mode 13h is one of the VGA BIOS supported video-modes (320 x 200 x 256 colors).

    There are many other video modes (text and grafical) which can be initialized through BIOS int 10h.

    These modes are color or B&W (grey shades), for CGA, EGA and VGA cards. (The hierarchy is CGA < EGA < VGA, therefore a VGA card is able to init a CGA video mode, but don't try mode 13h on a CGA card - anyhow, who on earth still owns and uses a CGA video card? )

    If you need some more detailed info about video modes, you'll find them in the Norton Guides or TechHelp (Dan Rollins). The last one is very nice structured TSR, I used it very often in the old DOS times. If you need taht tool, I'll send it to you (788 kb.)

    I used BIOS int 10h only to initialize this video mode, and implemented own functions for further operations, as BIOS ints are slooooow!

    However, directly accessing VGA card ports is not an easy task, and if you're really a newbie, then use first the functionalities given by BIOS's int10h.

    [Q]Do you have to be in real dos for the program to work?[/Q]
    It works under Win, too, but it'll open a full screen DOS command prompt.

    Have fun!
    Last edited by Carlos; 01-29-2003 at 03:46 AM.

  3. #3
    Registered User Nutshell's Avatar
    Join Date
    Jan 2002
    Posts
    1,020
    I went to blueparrots.com and some of the games i downloaded will either crash or not load, and i suspect they're using dos graphics functions etc.

    I suppose you need special libraries to access those dos functions. I have DevC++, and i predict that borland compiler might has it. Who else has them? Where can i get them? I'm just curious

  4. #4
    Normal vector Carlos's Avatar
    Join Date
    Sep 2001
    Location
    Budapest
    Posts
    463
    DOS games from blueparrots.com? Well, restart in DOS-mode, and run them in "pure" DOS. Running DOS programs under Windows is not a good idea, especially under WinNT, Win2000 and XP. Such games often try to access hardware ports (timer, speaker, video) directly, and Windows won't allow this (it might even crash with a GPF ).

    Really don't know whether DevC++ has libs for Mode13h,
    as I told you, I made my own functions.
    However, I'm sure there are many custom libraries out there.
    Just perform a quick search on google, and you'll find lots of such stuff.

  5. #5
    Registered User Nutshell's Avatar
    Join Date
    Jan 2002
    Posts
    1,020
    Briefly tell me, how do you actually implement your own functions? What existing functions do you use? Is it the one with header file dos.h or something?

    thnx he

  6. #6
    Normal vector Carlos's Avatar
    Join Date
    Sep 2001
    Location
    Budapest
    Posts
    463
    I start from scratch, no *.h files, no libs, no bgi-s - just pure Assembly.

    As I've told you, I didn't even use BIOS ints for some low-level operations, but directly accessed HW ports.

    If you have the required information, and know some ASM stuff, it's really fun, I can tell you .

    Nowadays I'm working as professional programmer at a big SW company, and unfortunately we do everything in 4GL (Visual C++, Delphi). Still, one can be creative in such circumstances as well - at least at home, making your own projects...

  7. #7
    Registered User
    Join Date
    Aug 2001
    Posts
    380
    Here's a site that explain how to program mode 13h using C
    http://www.brackeen.com/home/vga/index.html

    Also, there use to be a site here: http://www.codehead.f2s.com/coding/index.html that showed how to program mode 13h with inline asm, but now it has either moved or been closed.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Very quick math question
    By jverkoey in forum A Brief History of Cprogramming.com
    Replies: 8
    Last Post: 10-26-2005, 11:05 PM
  2. very quick question.
    By Unregistered in forum C++ Programming
    Replies: 7
    Last Post: 07-24-2002, 03:48 AM
  3. quick question
    By Unregistered in forum C++ Programming
    Replies: 5
    Last Post: 07-22-2002, 04:44 AM
  4. Quick Question Regarding Pointers
    By charash in forum C++ Programming
    Replies: 4
    Last Post: 05-04-2002, 11:04 AM
  5. Quick question: exit();
    By Cheeze-It in forum C Programming
    Replies: 6
    Last Post: 08-15-2001, 05:46 PM