Chameleon

Chameleon Commit Details

Date:2011-12-11 03:07:40 (8 years 11 months ago)
Author:ErmaC
Commit:1717
Parents: 1716
Message:- Updated Korean language. - Sync with Trunk. - Update Ati/Nvidia supported card list.
Changes:
M/branches/ErmaC/Modules/package/Resources/ko.lproj/Localizable.strings
M/branches/ErmaC/Trunk/i386/boot2/gui.c
M/branches/ErmaC/Trunk/i386/libsaio/nvidia.c
M/branches/ErmaC/Modules/i386/boot2/gui.c
M/branches/ErmaC/Trunk/i386/boot2/gui.h
M/branches/ErmaC/Trunk/i386/libsaio/ati.c
M/branches/ErmaC/Trunk/package/Resources/ko.lproj/Localizable.strings
M/branches/ErmaC/Modules/i386/boot2/gui.h

File differences

branches/ErmaC/Trunk/i386/libsaio/nvidia.c
830830
831831
832832
833
833
834834
835835
836836
// 1020 - 102F
// 1030 - 103F
// 1040 - 104F
{ 0x10DE1040, "GeForce GT 520" },
{ 0x10DE1040, "GeForce GT 520" },
// 1050 - 105F
{ 0x10DE1050, "GeForce GT 520M" },
// 1060 - 106F
branches/ErmaC/Trunk/i386/libsaio/ati.c
506506
507507
508508
509
509
510510
511511
512512
......
527527
528528
529529
530
531
530532
531533
532534
......
560562
561563
562564
563
565
564566
567
568
565569
566570
567571
......
577581
578582
579583
584
580585
581
582586
583587
584588
......
612616
613617
614618
615
619
616620
617621
618622
619623
624
620625
621626
622627
{ 0x68B8,0x00CF106B, CHIP_FAMILY_JUNIPER,"ATI Radeon HD 5770",kHoolock},
{ 0x68B8,0x145821f6, CHIP_FAMILY_JUNIPER,"GigaByte HD5770 R577SL-1GD",kVervet}, // ErmaC
{ 0x68B8,0x21f61458, CHIP_FAMILY_JUNIPER,"GigaByte HD5770 R577SL-1GD",kVervet}, // ErmaC
{ 0x68B8,0x29901682, CHIP_FAMILY_JUNIPER,"ATI Radeon HD 5770",kVervet},
{ 0x68B8,0x29911682, CHIP_FAMILY_JUNIPER,"ATI Radeon HD 5770",kVervet},
{ 0x68C0,0x392717AA, CHIP_FAMILY_REDWOOD,"ATI Mobility Radeon HD 5730",kNull},
{ 0x68C0,0x395217AA, CHIP_FAMILY_REDWOOD,"ATI Mobility Radeon HD 5730",kNull}, // ErmaC
{ 0x68C1,0x033E1025, CHIP_FAMILY_REDWOOD,"ATI Mobility Radeon HD 5650",kNull},
{ 0x68C1,0x9071104D, CHIP_FAMILY_REDWOOD,"ATI Mobility Radeon HD 5650",kEulemur},
{ 0x68E1,0x1426103C, CHIP_FAMILY_CEDAR,"ATI Radeon HD 5430M",kEulemur},
{ 0x68F9,0x03741043, CHIP_FAMILY_CEDAR,"ASUS EAH5450",kNull}, // ErmaC
{ 0x68F9,0x010E1002, CHIP_FAMILY_CEDAR,"ATI Radeon HD 5450",kNull}, // ErmaC
{ 0x68F9,0x03741043, CHIP_FAMILY_CEDAR,"ASUS EAH5450", kNull}, // ErmaC
{ 0x68F9,0x5470174B, CHIP_FAMILY_CEDAR,"ATI Radeon HD 5470",kNull},
{ 0x68F9,0x5490174B, CHIP_FAMILY_CEDAR,"ATI Radeon HD 5490",kNull},
{ 0x68F9,0x5530174B, CHIP_FAMILY_CEDAR,"ATI Radeon HD 5530",kNull},
{ 0x68F9,0x301217AF, CHIP_FAMILY_CEDAR,"ATI Radeon HD 5490",kNull},
{ 0x68F9,0x301317AF, CHIP_FAMILY_CEDAR,"ATI Radeon HD 5470",kNull},
{ 0x68F9,0xE145174B, CHIP_FAMILY_CEDAR,"ATI Radeon HD 5450",kEulemur}, // ErmaC
{ 0x68F9,0xE153174B, CHIP_FAMILY_CEDAR,"ATI Radeon HD 5450",kEulemur}, // ErmaC
{ 0x68F9,0xE145174B, CHIP_FAMILY_CEDAR,"ATI Radeon HD 5450",kEulemur}, // ErmaC
/* Northen Islands */
{ 0x6718,0x0B001002, CHIP_FAMILY_CAYMAN,"AMD Radeon HD 6970",kNull},
{ 0x6738,0x23051787, CHIP_FAMILY_BARTS,"AMD Radeon HD 6870",kDuckweed},
{ 0x6739,0x67391002, CHIP_FAMILY_BARTS,"AMD Radeon HD 6850",kDuckweed},
{ 0x6739,0x21F81458, CHIP_FAMILY_BARTS,"AMD Radeon HD 6850",kDuckweed}, // ErmaC ?? kBulrushes ??
{ 0x6739,0x21F81458, CHIP_FAMILY_BARTS,"AMD Radeon HD 6850",kDuckweed}, // ErmaC ?? kBulrushes ??
{ 0x6739,0x24411462, CHIP_FAMILY_BARTS,"AMD Radeon HD 6850",kDuckweed},
{ 0x6739,0x31101682, CHIP_FAMILY_BARTS,"AMD Radeon HD 6850",kDuckweed},
{ 0x6739,0xE177174B, CHIP_FAMILY_BARTS,"AMD Radeon HD 6850",kDuckweed},
{ 0x6740,0x1D121043, CHIP_FAMILY_TURKS,"AMD Radeon HD 6730M",kNull}, // ErmaC
{ 0x6740,0x1657103C, CHIP_FAMILY_TURKS,"AMD Radeon HD 6770M",kNull},
{ 0x6740,0x165A103C, CHIP_FAMILY_TURKS,"AMD Radeon HD 6770M",kNull},
branches/ErmaC/Trunk/i386/boot2/gui.c
2727
2828
2929
30
31
3032
3133
3234
......
13121314
13131315
13141316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
13151337
13161338
13171339
1318
1319
1340
13201341
1321
1342
13221343
1323
1324
1325
1326
13271344
1328
1345
13291346
1330
1331
1347
1348
13321349
13331350
13341351
13351352
1336
1337
1353
1354
1355
1356
1357
13381358
1339
1340
1341
1342
1359
13431360
13441361
13451362
......
13471364
13481365
13491366
1367
13501368
13511369
1352
1353
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
13541384
1355
1385
13561386
13571387
13581388
1359
13601389
1361
13621390
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1391
13761392
13771393
13781394
......
13831399
13841400
13851401
1386
1402
13871403
1388
1404
13891405
13901406
13911407
......
14231439
14241440
14251441
1442
1443
1444
14261445
14271446
14281447
1448
1449
14291450
14301451
14311452
#define vram VIDEO(baseAddr)
#define TAB_PIXELS_WIDTH (font->chars[0]->width * 4) // tab = 4 spaces
int lasttime = 0; // we need this for animating maybe
return 1;
}
pixmap_t* charToPixmap(unsigned char ch, font_t *font) {
unsigned int cha = (unsigned int)ch - 32;
if (cha >= font->count)
// return ? if the font for the char doesn't exists
cha = '?' - 32;
return font->chars[cha] ? font->chars[cha] : NULL;
}
position_t drawChar(unsigned char ch, font_t *font, pixmap_t *blendInto, position_t p) {
pixmap_t* pm = charToPixmap(ch, font);
if (pm && ((p.x + pm->width) < blendInto->width))
{
blend(pm, blendInto, p);
return pos(p.x + pm->width, p.y);
}
else
return p;
}
void drawStr(char *ch, font_t *font, pixmap_t *blendInto, position_t p)
{
int i=0;
int y=0; // we need this to support multilines '\n'
int x=0;
position_t current_pos = pos(p.x, p.y);
for(i=0;i<strlen(ch);i++)
for (i=0; i < strlen(ch); i++)
{
int cha=(int)ch[i];
cha-=32;
// newline ?
if( ch[i] == '\n' )
if ( ch[i] == '\n' )
{
x = 0;
y += font->height;
current_pos.x = p.x;
current_pos.y += font->height;
continue;
}
// tab ?
if( ch[i] == '\t' )
x+=(font->chars[0]->width*5);
if ( ch[i] == '\t' )
{
current_pos.x += TAB_PIXELS_WIDTH;
continue;
}
if(font->chars[cha] && ((x + font->chars[cha]->width) < blendInto->width))
blend(font->chars[cha], blendInto, pos(p.x+x, p.y+y));
x += font->chars[cha]->width;
current_pos = drawChar(ch[i], font, blendInto, current_pos);
}
}
{
int i = 0;
int width = 0;
int max_width = 0;
// calculate the width in pixels
for(i=0;i<strlen(text);i++)
width += font->chars[text[i]-32]->width;
for (i=0; i < strlen(text); i++) {
if (text[i] == '\n')
width = 0;
else if (text[i] == '\t')
width += TAB_PIXELS_WIDTH;
else
{
pixmap_t* pm = charToPixmap(text[i], font);
if (pm)
width += pm->width;
}
if (width > max_width)
max_width = width;
}
p.x = ( p.x - ( width / 2 ) );
p.x = ( p.x - ( max_width / 2 ) );
p.y = ( p.y - ( font->height / 2 ) );
if ( p.x == -6 )
{
p.x = 0;
}
for(i=0;i<strlen(text);i++)
{
int cha=(int)text[i];
cha-=32;
if(font->chars[cha])
{
blend(font->chars[cha], blendInto, p);
p.x += font->chars[cha]->width;
}
}
drawStr(text, font, blendInto, p);
}
int initFont(font_t *font, image_t *data)
bool monospaced = false;
font->height = data->image->height;
font->height = data->image->height;
for( x = 0; x < data->image->width; x++)
for( x = 0; x < data->image->width && count < CHARACTERS_COUNT; x++)
{
start = end;
}
}
for (x = count; x < CHARACTERS_COUNT; x++)
font->chars[x] = NULL;
if(monospaced)
font->width = 0;
font->count = count;
return 0;
}
branches/ErmaC/Trunk/i386/boot2/gui.h
6464
6565
6666
67
6768
6869
6970
uint16_theight;// Font Height
uint16_twidth;// Font Width for monospace font only
pixmap_t*chars[CHARACTERS_COUNT];
uint16_t count; // Number of chars in font
} font_t;
/*
branches/ErmaC/Modules/i386/boot2/gui.c
2727
2828
2929
30
31
3032
3133
3234
......
13121314
13131315
13141316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
13151337
13161338
13171339
1318
1319
1340
13201341
1321
1342
13221343
1323
1324
1325
1326
13271344
1328
1345
13291346
1330
1331
1347
1348
13321349
13331350
13341351
13351352
1336
1337
1353
1354
1355
1356
1357
13381358
1339
1340
1341
1342
1359
13431360
13441361
13451362
......
13471364
13481365
13491366
1367
13501368
13511369
1352
1353
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
13541384
1355
1385
13561386
13571387
13581388
1359
13601389
1361
13621390
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1391
13761392
13771393
13781394
......
13831399
13841400
13851401
1386
1402
13871403
1388
1404
13891405
13901406
13911407
......
14231439
14241440
14251441
1442
1443
1444
14261445
14271446
14281447
1448
1449
14291450
14301451
14311452
#define vram VIDEO(baseAddr)
#define TAB_PIXELS_WIDTH (font->chars[0]->width * 4) // tab = 4 spaces
int lasttime = 0; // we need this for animating maybe
return 1;
}
pixmap_t* charToPixmap(unsigned char ch, font_t *font) {
unsigned int cha = (unsigned int)ch - 32;
if (cha >= font->count)
// return ? if the font for the char doesn't exists
cha = '?' - 32;
return font->chars[cha] ? font->chars[cha] : NULL;
}
position_t drawChar(unsigned char ch, font_t *font, pixmap_t *blendInto, position_t p) {
pixmap_t* pm = charToPixmap(ch, font);
if (pm && ((p.x + pm->width) < blendInto->width))
{
blend(pm, blendInto, p);
return pos(p.x + pm->width, p.y);
}
else
return p;
}
void drawStr(char *ch, font_t *font, pixmap_t *blendInto, position_t p)
{
int i=0;
int y=0; // we need this to support multilines '\n'
int x=0;
position_t current_pos = pos(p.x, p.y);
for(i=0;i<strlen(ch);i++)
for (i=0; i < strlen(ch); i++)
{
int cha=(int)ch[i];
cha-=32;
// newline ?
if( ch[i] == '\n' )
if ( ch[i] == '\n' )
{
x = 0;
y += font->height;
current_pos.x = p.x;
current_pos.y += font->height;
continue;
}
// tab ?
if( ch[i] == '\t' )
x+=(font->chars[0]->width*5);
if ( ch[i] == '\t' )
{
current_pos.x += TAB_PIXELS_WIDTH;
continue;
}
if(font->chars[cha] && ((x + font->chars[cha]->width) < blendInto->width))
blend(font->chars[cha], blendInto, pos(p.x+x, p.y+y));
x += font->chars[cha]->width;
current_pos = drawChar(ch[i], font, blendInto, current_pos);
}
}
{
int i = 0;
int width = 0;
int max_width = 0;
// calculate the width in pixels
for(i=0;i<strlen(text);i++)
width += font->chars[text[i]-32]->width;
for (i=0; i < strlen(text); i++) {
if (text[i] == '\n')
width = 0;
else if (text[i] == '\t')
width += TAB_PIXELS_WIDTH;
else
{
pixmap_t* pm = charToPixmap(text[i], font);
if (pm)
width += pm->width;
}
if (width > max_width)
max_width = width;
}
p.x = ( p.x - ( width / 2 ) );
p.x = ( p.x - ( max_width / 2 ) );
p.y = ( p.y - ( font->height / 2 ) );
if ( p.x == -6 )
{
p.x = 0;
}
for(i=0;i<strlen(text);i++)
{
int cha=(int)text[i];
cha-=32;
if(font->chars[cha])
{
blend(font->chars[cha], blendInto, p);
p.x += font->chars[cha]->width;
}
}
drawStr(text, font, blendInto, p);
}
int initFont(font_t *font, image_t *data)
bool monospaced = false;
font->height = data->image->height;
font->height = data->image->height;
for( x = 0; x < data->image->width; x++)
for( x = 0; x < data->image->width && count < CHARACTERS_COUNT; x++)
{
start = end;
}
}
for (x = count; x < CHARACTERS_COUNT; x++)
font->chars[x] = NULL;
if(monospaced)
font->width = 0;
font->count = count;
return 0;
}
branches/ErmaC/Modules/i386/boot2/gui.h
6464
6565
6666
67
6768
6869
6970
uint16_theight;// Font Height
uint16_twidth;// Font Width for monospace font only
pixmap_t*chars[CHARACTERS_COUNT];
uint16_t count; // Number of chars in font
} font_t;
/*

Archive Download the corresponding diff file

Revision: 1717