VOGONS


First post, by Distriived

User metadata
Rank Newbie
Rank
Newbie

I don't know if this is the right area for this. I created a program to run under Dos, Compiling with Borland Turbo C++ 3.0 I've been using Dosbox-x 2025.02.01 and even tried Dosbox 0.74 but when i ran it I'm getting an error trying to load in video drivers. I have confirmed it IS in the current working directory. I even created a little test program to try and load different vga and vesa drivers but still get the same problem. So I'm not sure if this is a coding error on my part or a quirk of DOSBox. I have the error below and I'll paste my code snippet too. I found the svga driver on github by jharg93 .

DOSBox-X Error:
Attempting to install SVGA256 driver...
Error: Installuserdriver failed.
Return code: 16
Ensure SVGA256.BGI is in the current directory.

Code to load SVGA256.BGI File:
/* SVGA Initialization */
void initialize_graphics(void) {
int gdriver = DETECT;
int gmode;
int errorcode;
char *driver_path = ".";
int install_result;

install_result = installuserdriver("SVGA256", SelectSvga640x480x256);
if (install_result != 0) {
printf("Error: Could not install SVGA BGI driver (%d).\n", install_result);
printf("Ensure SVGA256.BGI is in the correct path.\n");
getch(); exit(1);
}
initgraph(&gdriver, &gmode, driver_path);
errorcode = graphresult();
if (errorcode != grOk) {
printf("BGI graphics error: %s\n", grapherrormsg(errorcode));
printf("Could not initialize 640x480x256 mode (%d).\n", gmode);
getch(); exit(1);
}
setbkcolor(COLOR_BG_BLUE);
setcolor(15); /* White */
printf("SVGA BGI Graphics Initialized: Mode %dx%d (256 Colors)\n", getmaxx() + 1, getmaxy() + 1);
}