X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=KernelLand%2FModules%2FDisplay%2FVESA%2Fmain.c;h=3f2f1c9cea56a10968f3b2838e5fa226a95be9a6;hb=45c91b880402af13c4b8f934c53780d7cba24aac;hp=ddf0671ae5ff8af38831169eba47a42ae7caca05;hpb=4538ee944b71b52f183809978cccfe60143d70c5;p=tpg%2Facess2.git diff --git a/KernelLand/Modules/Display/VESA/main.c b/KernelLand/Modules/Display/VESA/main.c index ddf0671a..3f2f1c9c 100644 --- a/KernelLand/Modules/Display/VESA/main.c +++ b/KernelLand/Modules/Display/VESA/main.c @@ -112,6 +112,8 @@ int VBE_int_GetModeList(void) } modes = (Uint16 *) VM8086_GetPointer(gpVesa_BiosState, info->VideoModes.seg, info->VideoModes.ofs); + LOG("Virtual addres of mode list from %04x:%04x is %p", + info->VideoModes.seg, info->VideoModes.ofs, modes); // VM8086_Deallocate( gpVesa_BiosState, info ); // Count Modes @@ -155,6 +157,7 @@ void VBE_int_FillMode_Int(int Index, tVesa_CallModeInfo *vbeinfo, tFarPtr *BufPt return ; } + #if 0 #define S_LOG(s, fld, fmt) LOG(" ."#fld" = "fmt, (s).fld) LOG("vbeinfo[0x%x] = {", mode->code); S_LOG(*vbeinfo, attributes, "0x%02x"); @@ -166,6 +169,7 @@ void VBE_int_FillMode_Int(int Index, tVesa_CallModeInfo *vbeinfo, tFarPtr *BufPt S_LOG(*vbeinfo, segmentB, "0x%04x"); LOG(" .realFctPtr = %04x:%04x", vbeinfo->realFctPtr.seg, vbeinfo->realFctPtr.ofs); S_LOG(*vbeinfo, pitch, "0x%04x"); + // -- Extended S_LOG(*vbeinfo, Xres, "%i"); S_LOG(*vbeinfo, Yres, "%i"); @@ -194,6 +198,7 @@ void VBE_int_FillMode_Int(int Index, tVesa_CallModeInfo *vbeinfo, tFarPtr *BufPt S_LOG(*vbeinfo, image_count_banked, "%i"); S_LOG(*vbeinfo, image_count_lfb, "%i"); LOG("}"); + #endif mode->flags = FLAG_POPULATED; if( !(vbeinfo->attributes & 1) ) { @@ -366,14 +371,14 @@ int Vesa_Int_SetMode(int mode) int Vesa_Int_FindMode(tVideo_IOCtl_Mode *data) { int i; - int best = -1, bestFactor = 1000; - int factor, tmp; + int best = -1, tmp; + unsigned int factor, bestFactor = -1; ENTER("idata->width idata->height idata->bpp", data->width, data->height, data->bpp); Vesa_int_FillModeList(); - for(i=0;iwidth * data->height; tmp = tmp < 0 ? -tmp : tmp; - factor = tmp * 1000 / (data->width * data->height); + factor = (Uint64)tmp * 1000 / (data->width * data->height); if( data->bpp == 8 && gVesa_Modes[i].bpp != 8 ) continue; if( data->bpp == 16 && gVesa_Modes[i].bpp != 16 ) continue;