Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

How different is the API for EGA and VGA for MSDOS applications? We're talking about the API that was used in games like Doom, Quest for Glory, Duke 3D, etc.

More specifically, how much work would be involved in changing an application's use of EGA APIs to VGA APIs? or SVGA even? They seem to be fairly similar in terms of interrupt strategies, registers used, etc. Looking for a little more definite answer though, if possible.


Forum post that suggests wrapping memory access may provide a partial solution: http://www.allegro.cc/forums/thread/604334

Some basic information on using VGA, but nothing on EGA:

http://www.brackeen.com/vga/basics.html

http://www.wagemakers.be/english/doc/vga

share|improve this question
add comment

1 Answer

up vote 4 down vote accepted

The problem is more complex than simply exchanging out EGA for VGA.

In fact, the VGA interface is what grew out of the EGA interface, which grew out of the CGA interface, which grew out of the MDA interface, which is why you see the interrupt call schemas as so similar.

Basically the idea was "here's interrupt 0x10... and a few simple functions for setting the graphics mode and plotting pixels... go!"

However, that isn't all there is to the story.

For example, very few applications actually used the pixel plotting functionality of 0x10.

Why not?

It was slow.

What did they use instead?

Direct memory manipulation.

Generally, the memory locations for the various display modes started at one of three locations: B000:0000, B800:0000, or A000:0000.

And the code for talking to a 4 color CGA (2 bit) display versus a 16 color EGA (4 bit) display and a 256 color VGA (8 bit) display would be so very different that they would not be adaptable to other pixel depths. You'd basically have to rewrite the entire rendering engine from scratch.

To further complicate things, the popular video mode was 13h, which was 320x200x256.

It also just so happened that the VGA could be tweaked into 320x240x256 (to give square pixels on a 4:3 display) "mode x", which was actually split into four pieces for putting together the video data.

In other words, the games you mention only used the VGA API for one thing: to set the video mode. After that, it was all display resolution specific stuff. They didn't use the setpixel call of int 0x10.

So, the answer is: the int 0x10 "api" (if you want to call it that) was not that terribly different, but it also wasn't widely used for high performance applications (games).

share|improve this answer
6  
p.s. after giving this answer, I feel really old. –  PlayDeezGames Jul 26 '12 at 17:44
    
That was a very helpful response. I do recall reading that EGA and VGA used the same address space (A000:0000 I think?), so I do not feel completely hopeless as far as converting the function calls. It's a shame that no one used the set pixel plotting function though, since that would have helped future compatibility. As far as feeling old, I hear you. It's crazy to think these games came out 15-20 years ago. –  Wisteso Jul 26 '12 at 18:38
    
You might be interested in this too : shikadi.net/moddingwiki/Raw_EGA_data –  Aybe Jul 26 '12 at 22:45
    
Thank you for the link, Aybe. That is very useful information! –  Wisteso Jul 31 '12 at 15:12
    
I never heard about MDA video mode and google dont bring me any result about this. Are you sure it ever existed ? –  tigrou Apr 1 '13 at 12:19
show 1 more comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.