}\r
\r
modes = (Uint16 *) VM8086_GetPointer(gpVesa_BiosState, info->VideoModes.seg, info->VideoModes.ofs);\r
+ LOG("Virtual addres of mode list from %04x:%04x is %p",\r
+ info->VideoModes.seg, info->VideoModes.ofs, modes);\r
// VM8086_Deallocate( gpVesa_BiosState, info );\r
\r
// Count Modes\r
return ;\r
}\r
\r
+ #if 0\r
#define S_LOG(s, fld, fmt) LOG(" ."#fld" = "fmt, (s).fld)\r
LOG("vbeinfo[0x%x] = {", mode->code);\r
S_LOG(*vbeinfo, attributes, "0x%02x");\r
S_LOG(*vbeinfo, segmentB, "0x%04x");\r
LOG(" .realFctPtr = %04x:%04x", vbeinfo->realFctPtr.seg, vbeinfo->realFctPtr.ofs);\r
S_LOG(*vbeinfo, pitch, "0x%04x");\r
+\r
// -- Extended\r
S_LOG(*vbeinfo, Xres, "%i");\r
S_LOG(*vbeinfo, Yres, "%i");\r
S_LOG(*vbeinfo, image_count_banked, "%i");\r
S_LOG(*vbeinfo, image_count_lfb, "%i");\r
LOG("}");\r
+ #endif\r
\r
mode->flags = FLAG_POPULATED;\r
if( !(vbeinfo->attributes & 1) ) {\r
int Vesa_Int_FindMode(tVideo_IOCtl_Mode *data)\r
{\r
int i;\r
- int best = -1, bestFactor = 1000;\r
- int factor, tmp;\r
+ int best = -1, tmp;\r
+ unsigned int factor, bestFactor = -1;\r
\r
ENTER("idata->width idata->height idata->bpp", data->width, data->height, data->bpp);\r
\r
Vesa_int_FillModeList();\r
\r
- for(i=0;i<giVesaModeCount;i++)\r
+ for(i = 0; i < giVesaModeCount; i ++)\r
{\r
LOG("Mode %i (%ix%ix%i)", i, gVesa_Modes[i].width, gVesa_Modes[i].height, gVesa_Modes[i].bpp);\r
\r
tmp = gVesa_Modes[i].width * gVesa_Modes[i].height;\r
tmp -= data->width * data->height;\r
tmp = tmp < 0 ? -tmp : tmp;\r
- factor = tmp * 1000 / (data->width * data->height);\r
+ factor = (Uint64)tmp * 1000 / (data->width * data->height);\r
\r
if( data->bpp == 8 && gVesa_Modes[i].bpp != 8 ) continue;\r
if( data->bpp == 16 && gVesa_Modes[i].bpp != 16 ) continue;\r