Index: branches/azimutz/Chazi/i386/boot2/graphics.c =================================================================== --- branches/azimutz/Chazi/i386/boot2/graphics.c (revision 466) +++ branches/azimutz/Chazi/i386/boot2/graphics.c (revision 467) @@ -26,8 +26,9 @@ * All rights reserved. */ -#include "boot.h" -#include "vbe.h" +//Azi:include +//#include "boot.h" - included on graphics.h, which is included on gui.h +//#include "vbe.h" - same as above (needed if autoresolution is removed!) #include "appleClut8.h" #include "gui.h" #include "IOHibernatePrivate.h" @@ -43,7 +44,7 @@ #define VIDEO(x) (bootArgs->Video.v_ ## x) -#define MIN(x, y) ((x) < (y) ? (x) : (y)) +#define MIN(x, y) ((x) < (y) ? (x) : (y)) //Azi: take care of this in the process*** //========================================================================== // getVBEInfoString @@ -180,7 +181,7 @@ // Return the VESA mode that matches the properties specified. // If a mode is not found, then return the "best" available mode. -static unsigned short +unsigned short getVESAModeWithProperties( unsigned short width, unsigned short height, unsigned char bitsPerPixel, @@ -389,6 +390,8 @@ break; } + if (refreshRate != 60) refreshRate = 60; + // // FIXME : generateCRTCTiming() causes crash. // @@ -426,13 +429,21 @@ // err = setVBEMode( mode | kLinearFrameBufferBit, NULL ); // } +#ifdef AUTORES_DEBUG + printf("Is about to set mode #%d with resolution %dx%d\n", mode, minfo.XResolution, minfo.YResolution); + //getc(); //Azi: i get the hangs, like "old" Wait=y issue. +#endif // Set the mode with default refresh rate. - err = setVBEMode( mode | kLinearFrameBufferBit, NULL ); if ( err != errSuccess ) { break; +#ifdef AUTORES_DEBUG + printf("setVBEMode failed to set mode %d (%dx%d) with error #%d\n", + mode, minfo.XResolution, minfo.YResolution, err); + getc(); +#endif } // Set 8-bit color palette. @@ -1040,7 +1051,7 @@ //========================================================================== // getNumberArrayFromProperty -static int +int getNumberArrayFromProperty( const char * propKey, unsigned long numbers[], unsigned long maxArrayCount ) Index: branches/azimutz/Chazi/i386/boot2/graphic_utils.h =================================================================== --- branches/azimutz/Chazi/i386/boot2/graphic_utils.h (revision 466) +++ branches/azimutz/Chazi/i386/boot2/graphic_utils.h (revision 467) @@ -9,7 +9,8 @@ #ifndef GRAPHIC_UTILS_H #define GRAPHIC_UTILS_H -#include "boot.h" +//Azi:includes +//#include "boot.h" - "graphic_utils.h" included only on graphics.h atm, that already includes boot.h. typedef union { Index: branches/azimutz/Chazi/i386/boot2/graphics.h =================================================================== --- branches/azimutz/Chazi/i386/boot2/graphics.h (revision 466) +++ branches/azimutz/Chazi/i386/boot2/graphics.h (revision 467) @@ -7,9 +7,11 @@ * */ -#include "boot.h" +//Azi:include +#include "boot.h" // was included on graphic_utils.h #include "bootstruct.h" #include "graphic_utils.h" +#include "vbe.h" #ifndef __BOOT_GRAPHICS_H @@ -37,9 +39,20 @@ int loadEmbeddedPngImage(uint8_t *pngData, int pngSize, uint16_t *width, uint16_t *height, uint8_t **imageData); +int getNumberArrayFromProperty( const char * propKey, + unsigned long numbers[], + unsigned long maxArrayCount ); char *getVBEInfoString(); char *getVBEModeInfoString(); +unsigned short getVESAModeWithProperties( unsigned short width, + unsigned short height, + unsigned char bitsPerPixel, + unsigned short attributesSet, + unsigned short attributesClear, + VBEModeInfoBlock * outModeInfo, + unsigned short * vesaVersion ); + void getGraphicModeParams(unsigned long params[]); #endif /* !__BOOT_GRAPHICS_H */