First post, by Scaled Lizard
- Rank
- Newbie
Hello nice people at DosBox.com,
I come to visit from nearby mech2.org site. We use DosBox for running the DOS-based editions of MechWarrior 2, and I have created a front end called MechVM which uses DosBox. It works very well.
I am trying to create a patch for DosBox that adds the current desktop resolution as a VESA BIOS mode. The reason is that current widescreen monitors often have resolutions wildly different of those offered by VESA BIOS implementations. To my knowledge, DosBox does not support resolutions like 1280x800, 1680x1050 and 1920x1080 in the shipped executables or current sources. I can get it working for my own laptop, and I was wondering whether there is interest to develop it fully so that it can be integrated into DosBox permanently. The one thing that I can determine experimentally only for fixed resolution are the struct members called ModeList_VGA.htotal and ModeList_VGA.vtotal.
I use the following. In int10_modes.cpp, I added
[code]
void setDesktopVideoSize(int w, int h)
{
int i = 0;
while (ModeList_VGA.mode!=0xffff) {
if (0x227 <= ModeList_VGA.mode
&& ModeList_VGA.mode <= 0x229)
{
ModeList_VGA.swidth = w; // screen width
ModeList_VGA.sheight = h; // screen height
ModeList_VGA.vdispend = h; // ???
ModeList_VGA.cwidth = 8; // cursor width
ModeList_VGA.cheight = 16; // cursor height
ModeList_VGA[i].ptotal = 1; // number of bit planes
ModeList_VGA[i].pstart = 0xA0000; // pointer to frame window start
ModeList_VGA[i].plength = 0x10000; // start of frame window
ModeList_VGA[i].twidth = w / ModeList_VGA[i].cwidth; // text screen width
ModeList_VGA[i].theight = h / ModeList_VGA[i].cheight; // text screen height
ModeList_VGA[i].htotal = ModeList_VGA[i].twidth;
//ModeList_VGA[i].htotal = 1;
//ModeList_VGA[i].vtotal = ModeList_VGA[i].swidth;
}
++i;
}
}
[/code]
ModeList_VGA additions:
{ 0x227 ,M_LIN8 ,80, 80 ,160,25 ,8 ,16 ,1 ,0xA0000 ,0x10000,212 ,1066,160, 800, 0},
{ 0x228 ,M_LIN16 ,80 ,80 ,160,25 ,8 ,16 ,1 ,0xA0000 ,0x10000,132 ,1066,320, 800, 0},
{ 0x229 ,M_LIN32 ,80 ,80 ,160,25 ,8 ,16 ,1 ,0xA0000 ,0x10000,132 ,1066,106, 800, 0},
sldmain.cpp requires a header for setDesktopVideoSize somewhere, and I call that function after SDL_Init:
[code]
const SDL_VideoInfo* info = SDL_GetVideoInfo();
setDesktopVideoSize(info->current_w, info->current_h);
[/code]
. If somebody could describe in little more detail what the variables ModeList_VGA[i].htotal and ModeList_VGA[i].vtotal mean, I guess I would be able to finish this.
I got reasonably far considering the relatively brief amount of time that I have invested in this, which is a testament to good code quality of DosBox.
I should add that I used version DosBox 0.74 source code for this.
Thanks in advance
Scaled Lizard