Index: branches/azimutz/Chazi/i386/libsaio/autoresolution.c =================================================================== --- branches/azimutz/Chazi/i386/libsaio/autoresolution.c (revision 566) +++ branches/azimutz/Chazi/i386/libsaio/autoresolution.c (revision 567) @@ -232,7 +232,7 @@ } -void closeVbios(vBiosMap * map); +//void closeVbios(vBiosMap * map); azi: dup - declared on header vBiosMap * openVbios(chipsetType forcedChipset) { Index: branches/azimutz/Chazi/i386/boot2/boot.c =================================================================== --- branches/azimutz/Chazi/i386/boot2/boot.c (revision 566) +++ branches/azimutz/Chazi/i386/boot2/boot.c (revision 567) @@ -358,8 +358,11 @@ { //Get Resolution from Graphics Mode key or EDID int count = getNumberArrayFromProperty(kGraphicsModeKey, params, 4); + if (count < 3) + { getResolution(params); + } else { if ( params[2] == 256 ) params[2] = 8; @@ -373,7 +376,9 @@ //perfom the actual VBIOS patching if (params[0] != 0 && params[1] != 0) + { patchVbios(map, params[0], params[1], params[2], 0, 0); + } } if (useGUI && initGUI()) @@ -424,7 +429,7 @@ // //AutoResolution - Reapply the patch or cancel if Graphics Mode was incorrect // or EDID Info was insane - getBoolForKey(kAutoResolutionKey, &gAutoResolution, &bootInfo->bootConfig); +// getBoolForKey(kAutoResolutionKey, &gAutoResolution, &bootInfo->bootConfig); //Restore the vbios for Cancelation if ((gAutoResolution == false) && map) @@ -447,8 +452,11 @@ { //or get resolution from Graphics Mode or EDID int count = getNumberArrayFromProperty(kGraphicsModeKey, params, 4); + if (count < 3) + { getResolution(params); + } else { if ( params[2] == 256 ) params[2] = 8; @@ -464,6 +472,9 @@ patchVbios(map, params[0], params[1], params[2], 0, 0); } closeVbios(map); + //Azi: gAutoResolution was just set to false on closeVbios; + // we need it to be true here for drawBootGraphics(). + gAutoResolution = true; } status = processBootOptions(); @@ -623,26 +634,26 @@ ret = GetFileInfo(NULL, bootFileSpec, &flags, &time); if (ret == -1) { - sprintf(bootFileSpec, "com.apple.boot.R/%s", bootFile); - ret = GetFileInfo(NULL, bootFileSpec, &flags, &time); - if (ret == -1) - { - sprintf(bootFileSpec, "com.apple.boot.S/%s", bootFile); - ret = GetFileInfo(NULL, bootFileSpec, &flags, &time); - if (ret == -1) - { - // Not found any alternate locations, using the original kernel image path. - strcpy(bootFileSpec, bootFile); - } - } + sprintf(bootFileSpec, "com.apple.boot.R/%s", bootFile); + ret = GetFileInfo(NULL, bootFileSpec, &flags, &time); + if (ret == -1) + { + sprintf(bootFileSpec, "com.apple.boot.S/%s", bootFile); + ret = GetFileInfo(NULL, bootFileSpec, &flags, &time); + if (ret == -1) + { + // Not found any alternate locations, using the original kernel image path. + strcpy(bootFileSpec, bootFile); + } + } } verbose("Loading kernel %s\n", bootFileSpec); ret = LoadThinFatFile(bootFileSpec, &binary); if (ret <= 0 && archCpuType == CPU_TYPE_X86_64) { - archCpuType = CPU_TYPE_I386; - ret = LoadThinFatFile(bootFileSpec, &binary); + archCpuType = CPU_TYPE_I386; + ret = LoadThinFatFile(bootFileSpec, &binary); } } while (0); @@ -674,13 +685,14 @@ // chainboot if (status==1) { - if (getVideoMode() == GRAPHICS_MODE) { // if we are already in graphics-mode, - setVideoMode(VGA_TEXT_MODE, 0); // switch back to text mode - } + if (getVideoMode() == GRAPHICS_MODE) { // if we are already in graphics-mode, + setVideoMode(VGA_TEXT_MODE, 0); // switch back to text mode + } } - if ((gBootFileType == kNetworkDeviceType) && gUnloadPXEOnExit) { - nbpUnloadBaseCode(); + if ((gBootFileType == kNetworkDeviceType) && gUnloadPXEOnExit) + { + nbpUnloadBaseCode(); } } Index: branches/azimutz/Chazi/i386/boot2/gui.c =================================================================== --- branches/azimutz/Chazi/i386/boot2/gui.c (revision 566) +++ branches/azimutz/Chazi/i386/boot2/gui.c (revision 567) @@ -236,7 +236,7 @@ if (images[i].image == NULL) { images[i].image = malloc(sizeof(pixmap_t)); } - sprintf(dirspec, "/Extra/Themes/%s/%s.png", theme_name, image); + sprintf(dirspec, "bt(0.0)/Extra/Themes/%s/%s.png", theme_name, image); width = 0; height = 0; imagedata = NULL; @@ -679,7 +679,7 @@ if ((strlen(theme_name) + 27) > sizeof(dirspec)) { return 1; } - sprintf(dirspec, "/Extra/Themes/%s/theme.plist", theme_name); + sprintf(dirspec, "bt(0.0)/Extra/Themes/%s/theme.plist", theme_name); if (loadConfigFile(dirspec, &bootInfo->themeConfig) != 0) { #ifdef EMBED_THEME config_file_t *config; @@ -715,7 +715,7 @@ } else { - // parse display size parameters + // parse display size parameters if (getIntForKey("screen_width", &val, &bootInfo->themeConfig) && val > 0) { screen_params[0] = val; @@ -1837,7 +1837,7 @@ usePngImage = false; return; } - sprintf(dirspec, "/Extra/Themes/%s/boot.png", theme_name); + sprintf(dirspec, "bt(0.0)/Extra/Themes/%s/boot.png", theme_name); if (loadPngImage(dirspec, &bootImageWidth, &bootImageHeight, &bootImageData) != 0) { #ifdef EMBED_THEME if ((loadEmbeddedPngImage(__boot_png, __boot_png_len, &bootImageWidth, &bootImageHeight, &bootImageData)) != 0) @@ -1850,65 +1850,57 @@ // drawBootGraphics void drawBootGraphics(void) { - int pos; - int length, count; - const char *dummyVal; - int oldScreenWidth, oldScreenHeight; bool legacy_logo; + const char *dummyVal; + int pos;//, count; + int length, oldScreenWidth, oldScreenHeight; uint16_t x, y; - if (getBoolForKey(kLegacyLogoKey, &legacy_logo, &bootInfo->bootConfig) && legacy_logo) { + if (getBoolForKey(kLegacyLogoKey, &legacy_logo, &bootInfo->bootConfig) && legacy_logo) + { usePngImage = false; - } else if (bootImageData == NULL) { + } + else if (bootImageData == NULL) + { loadBootGraphics(); } + + // Save current screen resolution. + oldScreenWidth = gui.screen.width; + oldScreenHeight = gui.screen.height; /* - * AutoResolution - Azi: check this later; resolution on theme.plist overrides the native one! + * AutoResolution */ if (gAutoResolution == true) { - // Get Resolution from Graphics Mode key - count = getNumberArrayFromProperty(kGraphicsModeKey, screen_params, 4); //Azi: this is ok! - - // If no Graphics Mode key, get it from EDID - if ( count < 3 ) - { - getResolution(screen_params); //Azi: this returns default resolution (1024x768x32) if nothing found. - - //PRINT("Resolution : %dx%d (EDID)\n",screen_params[0], screen_params[1]); - } - /*else - { - PRINT("Resolution : %dx%d (Graphics Mode key)\n",screen_params[0], screen_params[1]); - }*/ - } + //Azi: if this stuff is working properly, resolution is set, Vbios is closed and + // most probably we want to use oldScreenWidth/Height so... + screen_params[0] = oldScreenWidth; + screen_params[1] = oldScreenHeight; + } else { - // parse display size parameters + // parse display size parameters if (getIntForKey("boot_width", &pos, &bootInfo->themeConfig) && pos > 0) { screen_params[0] = pos; } - /*else + else { screen_params[0] = DEFAULT_SCREEN_WIDTH; - }*/ + } if (getIntForKey("boot_height", &pos, &bootInfo->themeConfig) && pos > 0) { screen_params[1] = pos; } - /*else + else { screen_params[1] = DEFAULT_SCREEN_HEIGHT; - }*/ + } } - // Save current screen resolution. Azi: ... and this too.*** - oldScreenWidth = gui.screen.width; - oldScreenHeight = gui.screen.height; - gui.screen.width = screen_params[0]; gui.screen.height = screen_params[1]; @@ -1916,8 +1908,8 @@ getGraphicModeParams(screen_params); // Set graphics mode if the booter was in text mode or the screen resolution has changed. - if (bootArgs->Video.v_display == VGA_TEXT_MODE - || (screen_params[0] != oldScreenWidth && screen_params[1] != oldScreenHeight) ) + if (bootArgs->Video.v_display == VGA_TEXT_MODE || + (screen_params[0] != oldScreenWidth && screen_params[1] != oldScreenHeight) ) { setVideoMode(GRAPHICS_MODE, 0); } Index: branches/azimutz/Chazi/i386/boot2/options.c =================================================================== --- branches/azimutz/Chazi/i386/boot2/options.c (revision 566) +++ branches/azimutz/Chazi/i386/boot2/options.c (revision 567) @@ -1023,11 +1023,14 @@ params[3] = 0; //Has the target Resolution Changed ? int count = getNumberArrayFromProperty(kGraphicsModeKey, params, 4); + if ( count < 3 ) + { getResolution(params); + } - if ( (params[0] != 0) && (params[1] != 0) - && (params[0] != map->currentX) && (params[1] != map->currentY)) + if ((params[0] != 0) && (params[1] != 0) && + (params[0] != map->currentX) && (params[1] != map->currentY)) { //Go back to TEXT mode while we change the mode