Chameleon

Chameleon Commit Details

Date:2010-09-01 07:39:01 (13 years 8 months ago)
Author:Azimutz
Commit:467
Parents: 466
Message:graphics.c/h/-utils.h changes. By the way, this patch works with most ATI cards and some Intel too; it's nVidia cards that are out of luck. Ultimately, trying is the only real way to know if it works. I can't live without this anymore!
Changes:
M/branches/azimutz/Chazi/i386/boot2/graphics.c
M/branches/azimutz/Chazi/i386/boot2/graphic_utils.h
M/branches/azimutz/Chazi/i386/boot2/graphics.h

File differences

branches/azimutz/Chazi/i386/boot2/graphics.c
2626
2727
2828
29
30
29
30
31
3132
3233
3334
......
4344
4445
4546
46
47
4748
4849
4950
......
180181
181182
182183
183
184
184185
185186
186187
......
389390
390391
391392
393
394
392395
393396
394397
......
426429
427430
428431
432
433
434
435
429436
430
431437
432438
433439
434440
435441
442
443
444
445
446
436447
437448
438449
......
10401051
10411052
10421053
1043
1054
10441055
10451056
10461057
* 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"
#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
// 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,
break;
}
if (refreshRate != 60) refreshRate = 60;
//
// FIXME : generateCRTCTiming() causes crash.
//
// 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.
//==========================================================================
// getNumberArrayFromProperty
static int
int
getNumberArrayFromProperty( const char * propKey,
unsigned long numbers[],
unsigned long maxArrayCount )
branches/azimutz/Chazi/i386/boot2/graphic_utils.h
99
1010
1111
12
12
13
1314
1415
1516
#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 {
branches/azimutz/Chazi/i386/boot2/graphics.h
77
88
99
10
10
11
1112
1213
14
1315
1416
1517
......
3739
3840
3941
42
43
44
4045
4146
4247
48
49
50
51
52
53
54
55
4356
4457
4558
*
*/
#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
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 */

Archive Download the corresponding diff file

Revision: 467