Using the IBM 3514 Borland Graphics Interface driver in High resolution mode in Turbo C++ on Windows 7 64 bit OS using DosBox

StackOverflow https://stackoverflow.com/questions/7808504

Question

I'm running a graphical program in Turbo C++ using DosBox on Windows 7 64 bit. Now, I want to use the IBM3514 graphics driver in the High resolution mode (IBM3514HI). So, I wrote the following bare bones program to test it:

#include <graphics.h>
#include <iostream.h>

void main() {
    int gd = IBM3514, gm = IBM3514HI, e;
    initgraph(&gd, &gm, "C:\\TC\\BGI");
    if (e = graphresult()) {
        cout << grapherrormsg(e);
    }
    cleardevice();
    rectangle(100, 100, 300, 300);
    cin.get();
    closegraph();
    restorecrtmode();
}

Now, the program compiles and runs without any errors. However, the initgraph function call doesn't initialize graphics mode. The return value of graphresult is 0. Hence, no error has occurred. Yet, the program still runs in text mode. The blinking underscore is visible and the rectangle is not drawn.

I checked my C:\TC\BGI folder and the IMB3514.BGI file exists. Thus I assume that it does load the graphics driver. Yet, I can't figure out why the program doesn't execute in graphics mode, or even throw an error. However it works perfectly fine if I use the default settings: int gd = DETECT, gm;

Any explanation as to why my program doesn't work will be greatly appreciated. Please try to provide a fix to this problem. I would really like to draw on a 1024x768 screen with 256 colors.

Was it helpful?

Solution

Under Windows your graphical adaptor is virtualized. You can't access it directly and use its specific features (unless you use DirectX/OpenGL/other strange methods). DOSBox emulates some "historical" graphical adaptors for the programs it runs (to be precise: Tandy/Hercules/CGA/EGA/VGA/VESA). You must use the VESA 2.0 driver of TC (or in general the VESA driver).

OTHER TIPS

the correctly Name of the Driver is ibm8514.bgi - not "3514" and not "imb" or so. But like my previous speaker said, better you use another driver. The best choice is to use the egavga.bgi Driver of the Turbo resp. Borland C++ or Turbo Pascal package. Then you should compile them successful.
Expect you need a special feature of this driver. Then you must check them of this effort if you need them. I think the egavga.bgi, vesa or a directly switch to the grafic mode with some special routines to make grafic should work in DOSBox, EmuDOS or in all 32-Bit-Version of Windows like Windows XP or so. Guenni60

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top