Index: branches/meklort/i386/modules/GUI/gui.c =================================================================== --- branches/meklort/i386/modules/GUI/gui.c (revision 641) +++ branches/meklort/i386/modules/GUI/gui.c (revision 642) @@ -716,16 +716,20 @@ } else { - // parse display size parameters - if (getIntForKey("screen_width", &val, &bootInfo->themeConfig) && val > 0) { + if (getIntForKey("screen_width", &val, &bootInfo->themeConfig) && val > 0) + { screen_params[0] = val; } - if (getIntForKey("screen_height", &val, &bootInfo->themeConfig) && val > 0) { + if (getIntForKey("screen_height", &val, &bootInfo->themeConfig) && val > 0) + { screen_params[1] = val; } + } + + // Initalizing GUI strucutre. bzero(&gui, sizeof(gui_t)); @@ -1865,24 +1869,27 @@ loadBootGraphics(); } + // parse screen size parameters if(is_module_loaded("Resolution.dylib")) { getResolution(&screen_params[0], &screen_params[1], &screen_params[2]); } else { - // parse screen size parameters - if (getIntForKey("boot_width", &pos, &bootInfo->themeConfig) && pos > 0) { + if (getIntForKey("boot_width", &pos, &bootInfo->themeConfig) && pos > 0) + { screen_params[0] = pos; } else { screen_params[0] = DEFAULT_SCREEN_WIDTH; } - if (getIntForKey("boot_height", &pos, &bootInfo->themeConfig) && pos > 0) { + 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. oldScreenWidth = gui.screen.width; Index: branches/meklort/i386/modules/GUI/GUI_module.c =================================================================== --- branches/meklort/i386/modules/GUI/GUI_module.c (revision 641) +++ branches/meklort/i386/modules/GUI/GUI_module.c (revision 642) @@ -23,6 +23,7 @@ void GUI_Kernel_Start_hook(void* kernelEntry, void* arg2, void* arg3, void* arg4); void GUI_PreBoot_hook(void* arg1, void* arg2, void* arg3, void* arg4); +void GUI_ModulesLoaded_hook(void* arg1, void* arg2, void* arg3, void* arg4); int GUI_getBootOptions(bool firstRun); @@ -106,16 +107,9 @@ } } -/** - ** Module startup code. Replace console only print functions as well as - ** replace various menu functions. Finaly, initialize the gui and hook - ** into important events. - **/ -void GUI_start() +void GUI_ModulesLoaded_hook(void* kernelEntry, void* arg2, void* arg3, void* arg4) { - // Start the gui - useGUI = true; // Override useGUI default getBoolForKey(kGUIKey, &useGUI, &bootInfo->bootConfig); @@ -137,11 +131,20 @@ replace_function("_stop", &GUI_stop); } +} + +/** + ** Module startup code. Replace console only print functions as well as + ** replace various menu functions. Finaly, initialize the gui and hook + ** into important events. + **/ +void GUI_start() +{ // Hoot for the boot screen //ExecKernel register_hook_callback("Kernel Start", &GUI_Kernel_Start_hook); register_hook_callback("ExecKernel", &GUI_ExecKernel_hook); register_hook_callback("PreBoot", &GUI_PreBoot_hook); - + register_hook_callback("ModulesLoaded", &GUI_ModulesLoaded_hook); } /** @@ -748,7 +751,7 @@ bool showBootBanner = false; // Check if "Boot Banner"=N switch is present in config file. - if (getBoolForKey(kBootBannerKey, &showBootBanner, &bootInfo->bootConfig) && !showBootBanner) + if (getBoolForKey(kBootBannerKey, &showBootBanner, &bootInfo->bootConfig) && showBootBanner) { // Display banner and show hardware info. gprintf(&gui.screen, bootBanner + 1, (bootInfo->convmem + bootInfo->extmem) / 1024);