Index: branches/azimutz/Chazi/doc-azi/CHANGES.txt =================================================================== --- branches/azimutz/Chazi/doc-azi/CHANGES.txt (revision 471) +++ branches/azimutz/Chazi/doc-azi/CHANGES.txt (revision 472) @@ -280,7 +280,7 @@ ---------------//---------------//--------------- -- (revs 465 --> ??) +- (revs 465 --> 467, 469 --> 471) Change: added AutoResolution patch, by Lebidou (AutoResolution branch). The main intention of this patch, is allowing native resolution after boot, even without graphics acceleration (qe/ci). The "side effect" is that it also enables native resolution at boot prompt (Gui). Index: branches/azimutz/Chazi/i386/libsaio/saio_types.h =================================================================== --- branches/azimutz/Chazi/i386/libsaio/saio_types.h (revision 471) +++ branches/azimutz/Chazi/i386/libsaio/saio_types.h (revision 472) @@ -231,13 +231,8 @@ DEV_EN = 3 }; -#ifndef max #define max(a,b) ((a) > (b) ? (a) : (b)) -#endif - -#ifndef min #define min(a,b) ((a) < (b) ? (a) : (b)) -#endif #define round2(x, m) (((x) + (m / 2)) & ~(m - 1)) #define roundup2(x, m) (((x) + m - 1) & ~(m - 1)) Index: branches/azimutz/Chazi/i386/boot2/graphics.c =================================================================== --- branches/azimutz/Chazi/i386/boot2/graphics.c (revision 471) +++ branches/azimutz/Chazi/i386/boot2/graphics.c (revision 472) @@ -43,8 +43,6 @@ uint8_t *previewSaveunder = 0; #define VIDEO(x) (bootArgs->Video.v_ ## x) - -#define MIN(x, y) ((x) < (y) ? (x) : (y)) //Azi: take care of this in the process*** //========================================================================== // getVBEInfoString @@ -612,8 +610,8 @@ uint16_t drawWidth; uint8_t *vram = (uint8_t *) VIDEO(baseAddr) + VIDEO(rowBytes) * y + 4 * x; - drawWidth = MIN(width, VIDEO(width) - x); - height = MIN(height, VIDEO(height) - y); + drawWidth = min(width, VIDEO(width) - x); + height = min(height, VIDEO(height) - y); while (height--) { switch (VIDEO (depth)) { @@ -792,8 +790,8 @@ vram = (char *) VIDEO(baseAddr) + VIDEO(rowBytes) * y + pixelBytes * x; - width = MIN(width, VIDEO(width) - x); - height = MIN(height, VIDEO(height) - y); + width = min(width, VIDEO(width) - x); + height = min(height, VIDEO(height) - y); while ( height-- ) { @@ -818,8 +816,8 @@ unsigned char * vram = (unsigned char *) VIDEO(baseAddr) + VIDEO(rowBytes) * y + pixelBytes * x; - drawWidth = MIN(width, VIDEO(width) - x); - height = MIN(height, VIDEO(height) - y); + drawWidth = min(width, VIDEO(width) - x); + height = min(height, VIDEO(height) - y); while ( height-- ) { bcopy( data, vram, drawWidth * pixelBytes ); vram += VIDEO(rowBytes); Index: branches/azimutz/Chazi/i386/boot2/gui.c =================================================================== --- branches/azimutz/Chazi/i386/boot2/gui.c (revision 471) +++ branches/azimutz/Chazi/i386/boot2/gui.c (revision 472) @@ -22,9 +22,6 @@ #define LOADPNG(img, alt_img) if (loadThemeImage(#img, alt_img) != 0) { return 1; } -#define MIN(x, y) ((x) < (y) ? (x) : (y)) //Azi: take care of this in the process.*** -#define MAX(x, y) ((x) > (y) ? (x) : (y)) - #define VIDEO(x) (bootArgs->Video.v_ ## x) #define vram VIDEO(baseAddr) @@ -469,7 +466,7 @@ const char *string; if(getIntForKey("devices_max_visible", &val, theme )) - gui.maxdevices = MIN( val, gDeviceCount ); + gui.maxdevices = min( val, gDeviceCount ); if(getIntForKey("devices_iconspacing", &val, theme )) gui.devicelist.iconspacing = val; @@ -484,7 +481,7 @@ switch (gui.layout) { case VerticalLayout: - gui.devicelist.height = ((images[iSelection].image->height + font_console.chars[0]->height + gui.devicelist.iconspacing) * MIN(gui.maxdevices, gDeviceCount) + (images[iDeviceScrollPrev].image->height + images[iDeviceScrollNext].image->height) + gui.devicelist.iconspacing); + gui.devicelist.height = ((images[iSelection].image->height + font_console.chars[0]->height + gui.devicelist.iconspacing) * min(gui.maxdevices, gDeviceCount) + (images[iDeviceScrollPrev].image->height + images[iDeviceScrollNext].image->height) + gui.devicelist.iconspacing); gui.devicelist.width = (images[iSelection].image->width + gui.devicelist.iconspacing); if(getDimensionForKey("devices_pos_x", &pixel, theme, gui.screen.width , images[iSelection].image->width ) ) @@ -496,7 +493,7 @@ case HorizontalLayout: default: - gui.devicelist.width = ((images[iSelection].image->width + gui.devicelist.iconspacing) * MIN(gui.maxdevices, gDeviceCount) + (images[iDeviceScrollPrev].image->width + images[iDeviceScrollNext].image->width) + gui.devicelist.iconspacing); + gui.devicelist.width = ((images[iSelection].image->width + gui.devicelist.iconspacing) * min(gui.maxdevices, gDeviceCount) + (images[iDeviceScrollPrev].image->width + images[iDeviceScrollNext].image->width) + gui.devicelist.iconspacing); gui.devicelist.height = (images[iSelection].image->height + font_console.chars[0]->height + gui.devicelist.iconspacing); if(getDimensionForKey("devices_pos_x", &pixel, theme, gui.screen.width , gui.devicelist.width ) ) @@ -540,10 +537,10 @@ gui.screen.bgcolor = (color & 0x00FFFFFF); if(getIntForKey("screen_textmargin_h", &val, theme)) - gui.screen.hborder = MIN( gui.screen.width , val ); + gui.screen.hborder = min( gui.screen.width , val ); if(getIntForKey("screen_textmargin_v", &val, theme)) - gui.screen.vborder = MIN( gui.screen.height , val ); + gui.screen.vborder = min( gui.screen.height , val ); /* * Parse background parameters @@ -590,10 +587,10 @@ * Parse infobox parameters */ if(getIntForKey("infobox_width", &val, theme)) - gui.infobox.width = MIN( screen_width , val ); + gui.infobox.width = min( screen_width , val ); if(getIntForKey("infobox_height", &val, theme)) - gui.infobox.height = MIN( screen_height , val ); + gui.infobox.height = min( screen_height , val ); if(getDimensionForKey("infobox_pos_x", &pixel, theme, screen_width , gui.infobox.width ) ) gui.infobox.pos.x = pixel; @@ -602,10 +599,10 @@ gui.infobox.pos.y = pixel; if(getIntForKey("infobox_textmargin_h", &val, theme)) - gui.infobox.hborder = MIN( gui.infobox.width , val ); + gui.infobox.hborder = min( gui.infobox.width , val ); if(getIntForKey("infobox_textmargin_v", &val, theme)) - gui.infobox.vborder = MIN( gui.infobox.height , val ); + gui.infobox.vborder = min( gui.infobox.height , val ); if(getColorForKey("infobox_bgcolor", &color, theme)) gui.infobox.bgcolor = (color & 0x00FFFFFF); @@ -633,10 +630,10 @@ gui.menu.pos.y = pixel; if(getIntForKey("menu_textmargin_h", &val, theme)) - gui.menu.hborder = MIN( gui.menu.width , val ); + gui.menu.hborder = min( gui.menu.width , val ); if(getIntForKey("menu_textmargin_v", &val, theme)) - gui.menu.vborder = MIN( gui.menu.height , val ); + gui.menu.vborder = min( gui.menu.height , val ); if(getColorForKey("menu_bgcolor", &color, theme)) gui.menu.bgcolor = (color & 0x00FFFFFF); @@ -651,7 +648,7 @@ gui.bootprompt.width = pixel; if(getIntForKey("bootprompt_height", &val, theme)) - gui.bootprompt.height = MIN( screen_height , val ); + gui.bootprompt.height = min( screen_height , val ); if(getDimensionForKey("bootprompt_pos_x", &pixel, theme, screen_width , gui.bootprompt.width ) ) gui.bootprompt.pos.x = pixel; @@ -660,10 +657,10 @@ gui.bootprompt.pos.y = pixel; if(getIntForKey("bootprompt_textmargin_h", &val, theme)) - gui.bootprompt.hborder = MIN( gui.bootprompt.width , val ); + gui.bootprompt.hborder = min( gui.bootprompt.width , val ); if(getIntForKey("bootprompt_textmargin_v", &val, theme)) - gui.bootprompt.vborder = MIN( gui.bootprompt.height , val ); + gui.bootprompt.vborder = min( gui.bootprompt.height , val ); if(getColorForKey("bootprompt_bgcolor", &color, theme)) gui.bootprompt.bgcolor = (color & 0x00FFFFFF); @@ -845,7 +842,7 @@ extern bool showBootBanner; // || position_t p, p_prev, p_next; - //uint8_t maxDevices = MIN( gui.maxdevices, menucount ); + //uint8_t maxDevices = min( gui.maxdevices, menucount ); fillPixmapWithColor( gui.devicelist.pixmap, gui.devicelist.bgcolor); @@ -1108,8 +1105,8 @@ int i; int character; - origin.x = MAX( window->cursor.x, window->hborder ); - origin.y = MAX( window->cursor.y, window->vborder ); + origin.x = max( window->cursor.x, window->hborder ); + origin.y = max( window->cursor.y, window->vborder ); bounds.x = ( window->width - window->hborder ); bounds.y = ( window->height - window->vborder ); @@ -1193,8 +1190,8 @@ int i; int character; - origin.x = MAX( gui.debug.cursor.x, window->hborder ); - origin.y = MAX( gui.debug.cursor.y, window->vborder ); + origin.x = max( gui.debug.cursor.x, window->hborder ); + origin.y = max( gui.debug.cursor.y, window->vborder ); bounds.x = ( window->width - window->hborder ); bounds.y = ( window->height - window->vborder ); @@ -1273,8 +1270,8 @@ prf(fmt, ap, sputc, &pi); *pi.str = '\0'; - origin.x = MAX( window->cursor.x, window->hborder ); - origin.y = MAX( window->cursor.y, window->vborder ); + origin.x = max( window->cursor.x, window->hborder ); + origin.y = max( window->cursor.y, window->vborder ); bounds.x = ( window->width - ( window->hborder * 2 ) ); bounds.y = ( window->height - ( window->vborder * 2 ) ); cursor = origin; @@ -1931,8 +1928,8 @@ drawColorRectangle(0, 0, screen_params[0], screen_params[1], 0x01); } if ((bootImageData) && (usePngImage)) { - x = (screen_params[0] - MIN(bootImageWidth, screen_params[0])) / 2; - y = (screen_params[1] - MIN(bootImageHeight, screen_params[1])) / 2; + x = (screen_params[0] - min(bootImageWidth, screen_params[0])) / 2; + y = (screen_params[1] - min(bootImageHeight, screen_params[1])) / 2; // Draw the image in the center of the display. blendImage(x, y, bootImageWidth, bootImageHeight, bootImageData); @@ -1947,8 +1944,8 @@ if (appleBootPict) { convertImage(bootImageWidth, bootImageHeight, appleBootPict, &bootImageData); if (bootImageData) { - x = (screen_params[0] - MIN(kAppleBootWidth, screen_params[0])) / 2; - y = (screen_params[1] - MIN(kAppleBootHeight, screen_params[1])) / 2; + x = (screen_params[0] - min(kAppleBootWidth, screen_params[0])) / 2; + y = (screen_params[1] - min(kAppleBootHeight, screen_params[1])) / 2; drawDataRectangle(x, y, kAppleBootWidth, kAppleBootHeight, bootImageData); free(bootImageData); } Index: branches/azimutz/Chazi/i386/libsa/qsort.c =================================================================== --- branches/azimutz/Chazi/i386/libsa/qsort.c (revision 471) +++ branches/azimutz/Chazi/i386/libsa/qsort.c (revision 472) @@ -58,11 +58,11 @@ #include #include +#include "saio_types.h" //Azi: min/max + static inline char *med3 __P((char *, char *, char *, int (*)())); static inline void swapfunc __P((char *, char *, int, int)); -#define min(a, b) (a) < (b) ? a : b - /* * Qsort routine from Bentley & McIlroy's "Engineering a Sort Function". */