Changeset 15169 for titan/titan


Ignore:
Timestamp:
04/07/12 01:02:53 (12 years ago)
Author:
nit
Message:

[titan] add mipsel port

Location:
titan/titan
Files:
3 added
6 edited

Legend:

Unmodified
Added
Removed
  • titan/titan/fb.h

    r15145 r15169  
    8888        newnode->fd = fd;
    8989        newnode->fixfbsize = fixfbsize;
     90       
    9091        if(ostrcmp(name, FB) == 0)
    91         {
    92 #ifdef NOHWBLIT
    9392                newnode->varfbsize = newnode->width * newnode->height * newnode->colbytes;
    94 #else
    95                 newnode->varfbsize = 1920 * 1080 * newnode->colbytes;
    96 #endif
    97         }
    9893        else if(ostrcmp(name, FB1) == 0)
    99         {
    10094                newnode->varfbsize = 720 * 576 * newnode->colbytes;
    101         }
    10295        else
    103         {
    10496                newnode->varfbsize = width * height * newnode->colbytes;
    105         }
    10697
    10798        /*eigener Buffer zB fuer LCD*/
     
    286277}
    287278
    288 //flag 0 = no animation
    289 //flag 1 = animation
    290 void blitfb2(struct fb* fbnode, int flag)
    291 {
    292         int i = 0, max = 1, wstep = 0, hstep = 0, ret = 0;
    293         unsigned char buf[10];
    294 
    295         if(fbnode == NULL) return;
    296 #ifndef NOHWBLIT
    297         if(fbnode == fb) return;
    298 
    299         if(status.rguidfd > -1)
    300         {
    301                 m_lock(&status.accelfbmutex, 16);
    302                
    303                 int zlen = 0;
    304                 char* zbuf = NULL;
    305                 blitscale(0, 0, fbnode->width, fbnode->height, 440, 330, 1);
    306                 ret = zip((char*)accelfb->fb, 440 * 330 * 4, &zbuf, &zlen, 1);
    307 
    308                 if(ret == 0)
    309                 {
    310                         memset(buf, 0, 10);
    311                         char* tmpnr = oitoa(zlen);
    312                         memcpy(buf, tmpnr, strlen(tmpnr));
    313                         free(tmpnr); tmpnr = NULL;
    314                         socksend(&status.rguidfd, buf, 10, 5000 * 1000);
    315                         socksend(&status.rguidfd, (unsigned char*)zbuf, zlen, 5000 * 1000);
    316                 }
    317                 free(zbuf); zbuf = NULL;
    318                 zlen = 0;
    319 
    320                 m_unlock(&status.accelfbmutex, 16);
    321         }
    322 
    323         if(status.write_png == 1 && status.infobaraktiv == 0)
    324         {
    325                 m_lock(&status.accelfbmutex, 16);
    326                 blitscale(0, 0, fbnode->width, fbnode->height, 320, 240, 1);
    327                 if(writeFBfile.ActBuf == NULL)
    328                 {
    329                         writeFBfile.buf1 = malloc(4 * 320 * 240);
    330                         writeFBfile.ActBuf = writeFBfile.buf1;
    331                         memcpy(writeFBfile.buf1, accelfb->fb, 4 * 320 * 240);
    332                         addtimer(&fb2png_thread, START, 10000, 1, NULL, NULL, NULL);
    333                 }
    334                 else if(writeFBfile.buf1 == writeFBfile.ActBuf)
    335                 {
    336                         if(writeFBfile.buf2 == NULL)
    337                                 writeFBfile.buf2 = malloc(4 * 320 * 240);
    338                         memcpy(writeFBfile.buf2, accelfb->fb, 4 * 320 * 240);
    339                 }
    340                 else if(writeFBfile.buf2 == writeFBfile.ActBuf)
    341                 {
    342                         if(writeFBfile.buf1 == NULL)
    343                                 writeFBfile.buf1 = malloc(4 * 320 * 240);
    344                         memcpy(writeFBfile.buf1, accelfb->fb, 4 * 320 * 240);
    345                 }
    346                 m_unlock(&status.accelfbmutex, 16);
    347         }
    348 
    349         int mode3d = 0;
    350         char* mode3dstr = NULL;
    351 
    352         if(status.leftoffset != 0) blitrect(0, 0, status.leftoffset, fb->height, 0, 255, 2);
    353         if(status.rightoffset != 0) blitrect(fb->width - status.rightoffset, 0, status.rightoffset, fb->height, 0, 255, 2);
    354         if(status.topoffset != 0) blitrect(0, 0, fb->width, status.topoffset, 0, 255, 2);
    355         if(status.bottomoffset != 0) blitrect(0, fb->height - status.bottomoffset, fb->width, status.bottomoffset, 0, 255, 2);
    356 
    357         mode3dstr = getconfig("av_mode3d", NULL);
    358         if(ostrcmp(mode3dstr, "sbs") == 0)
    359                 mode3d = 1;
    360         else if(ostrcmp(mode3dstr, "tab") == 0)
    361                 mode3d = 2;
    362 
    363         STMFBIO_BLT_DATA  bltData;
    364         memset(&bltData, 0, sizeof(STMFBIO_BLT_DATA));
    365 
    366         bltData.operation  = BLT_OP_COPY;
    367         bltData.srcOffset  = fbnode->fb - fb->fb;
    368         bltData.srcPitch   = fbnode->pitch;
    369         bltData.src_top    = 0;
    370         bltData.src_left   = 0;
    371         bltData.src_right  = fbnode->width;
    372         bltData.src_bottom = fbnode->height;
    373         bltData.srcFormat  = SURF_BGRA8888;
    374         bltData.srcMemBase = STMFBGP_FRAMEBUFFER;
    375 
    376         bltData.dstOffset  = 0;
    377         bltData.dstPitch   = fb->pitch;
    378         bltData.dst_left   = status.leftoffset;
    379         bltData.dst_top    = status.topoffset;
    380         if(mode3d == 1)
    381                 bltData.dst_right = (fb->width - status.rightoffset) / 2;
    382         else
    383                 bltData.dst_right = fb->width - status.rightoffset;
    384         if(mode3d == 2)
    385                 bltData.dst_bottom = (fb->height - status.bottomoffset) / 2;
    386         else
    387                 bltData.dst_bottom = fb->height - status.bottomoffset;
    388         bltData.dstFormat  = SURF_BGRA8888;
    389         bltData.dstMemBase = STMFBGP_FRAMEBUFFER;
    390 
    391         if(flag == 1 && status.screenanim > 0 && mode3d == 0)
    392         {
    393                 int width = (fb->width - status.rightoffset) - status.leftoffset;
    394                 int height = (fb->height - status.topoffset) - status.bottomoffset;
    395                 max = 25;
    396                 if(status.screenanim == 1 || status.screenanim == 3)
    397                 {
    398                         bltData.dst_left = (width / 2) - 1;
    399                         bltData.dst_right = (width / 2) + 1;
    400                 }
    401                 if(status.screenanim == 2 || status.screenanim == 3)
    402                 {
    403                         bltData.dst_top = (height / 2) - 1;
    404                         bltData.dst_bottom = (height / 2) + 1;
    405                 }
    406                 wstep = width / max;
    407                 hstep = height / max;
    408         }
    409 
    410         for(i = 0; i < max; i++)
    411         {
    412 
    413                 if(status.screenanim == 1 || status.screenanim == 3)
    414                 {
    415                         int tmpleft = bltData.dst_left - wstep;
    416                         int tmpright = bltData.dst_right + wstep;
    417                         if(tmpleft < status.leftoffset)
    418                                 tmpleft = status.leftoffset;
    419                         if(tmpright > fb->width - status.rightoffset)
    420                                 tmpright = fb->width - status.rightoffset;
    421                         bltData.dst_left = tmpleft;
    422                         bltData.dst_right = tmpright;
    423                 }
    424 
    425                 if(status.screenanim == 2 || status.screenanim == 3)
    426                 {
    427                         int tmptop = bltData.dst_top - hstep;
    428                         int tmpbottom = bltData.dst_bottom + hstep;
    429                         if(tmptop < status.topoffset)
    430                                 tmptop = status.topoffset;
    431                         if(tmpbottom > fb->height - status.bottomoffset)
    432                                 tmpbottom = fb->height - status.bottomoffset;
    433                         bltData.dst_top = tmptop;
    434                         bltData.dst_bottom = tmpbottom;
    435                 }
    436 
    437                 if(status.screenanim > 0) usleep(status.screenanimspeed * 1000);
    438 
    439                 if (ioctl(fb->fd, STMFBIO_BLT, &bltData) < 0)
    440                 {
    441                         perr("ioctl STMFBIO_BLT");
    442                 }
    443                 if(ioctl(fb->fd, STMFBIO_SYNC_BLITTER) < 0)
    444                 {
    445                         perr("ioctl STMFBIO_SYNC_BLITTER");
    446                 }
    447 
    448                 if(mode3d != 0)
    449                 {
    450                         if(mode3d == 1)
    451                                 bltData.dst_left = 0 + status.leftoffset + ((fb->width - status.rightoffset) / 2);
    452                         if(mode3d == 2)
    453                                 bltData.dst_top = 0 + status.topoffset + ((fb->height - status.bottomoffset) / 2);
    454                         bltData.dst_right  = fb->width - status.rightoffset;
    455                         bltData.dst_bottom = fb->height - status.bottomoffset;
    456 
    457                         if (ioctl(fb->fd, STMFBIO_BLT, &bltData) < 0)
    458                         {
    459                                 perr("ioctl STMFBIO_BLT");
    460                         }
    461                         if(ioctl(fb->fd, STMFBIO_SYNC_BLITTER) < 0)
    462                         {
    463                                 perr("ioctl STMFBIO_SYNC_BLITTER");
    464                         }
    465                 }
    466         }
    467 #else
    468 #ifdef NOFB
    469         if(status.rguidfd > -1)
    470         {
    471                 char* buf = NULL;
    472                 buf = scale(fbnode->fb, fbnode->width, fbnode->height, 4, 320, 240, 0);
    473                 if(buf != NULL)
    474                 {
    475                         socksend(&status.rguidfd, (unsigned char*)buf, 320 * 240 * 4, 5000 * 1000);
    476                         free(buf); buf = NULL;
    477                 }
    478         }
    479         if(status.write_png == 1 && status.infobaraktiv == 0)
    480         {
    481                 char* buf = NULL;
    482                 buf = scale(fbnode->fb, fbnode->width, fbnode->height, 4, 320, 240, 0);
    483                 if(buf != NULL)
    484                 {
    485                         if(writeFBfile.ActBuf == NULL)
    486                         {
    487                                 writeFBfile.buf1 = malloc(4 * 320 * 240);
    488                                 writeFBfile.ActBuf = writeFBfile.buf1;
    489                                 memcpy(writeFBfile.buf1, (unsigned char*)buf, 4 * 320 * 240);
    490                                 addtimer(&fb2png_thread, START, 10000, 1, NULL, NULL, NULL);
    491                         }
    492                         else if(writeFBfile.buf1 == writeFBfile.ActBuf)
    493                         {
    494                                 if(writeFBfile.buf2 == NULL)
    495                                         writeFBfile.buf2 = malloc(4 * 320 * 240);
    496                                 memcpy(writeFBfile.buf2, (unsigned char*)buf, 4 * 320 * 240);
    497                         }
    498                         else if(writeFBfile.buf2 == writeFBfile.ActBuf)
    499                         {
    500                                 if(writeFBfile.buf1 == NULL)
    501                                         writeFBfile.buf1 = malloc(4 * 320 * 240);
    502                                 memcpy(writeFBfile.buf1, (unsigned char*)buf, 4 * 320 * 240);
    503                         }
    504                         //fb2png((unsigned char*)buf, 320, 240, "/tmp/titanlcd.png");
    505                         free(buf); buf = NULL;
    506                 }
    507         }
    508 
    509         if(fbnode != fb)
    510         {
    511                 for(i = 0; i < fbnode->height; i++)
    512                 {
    513                         memcpy(fb->fb + (i * fb->pitch), fbnode->fb + (i * fbnode->pitch), fbnode->width * fbnode->colbytes);
    514                 }
    515         }
    516         system("killall -9 xloadimage");
    517 
    518         FILE *fd;
    519         fd=fopen("titan.png", "w");
    520         fwrite(fb->fb, fb->varfbsize, 1, fd);
    521         fclose(fd);
    522 
    523         system("fbgrab -f titan.png -w 1280 -h 720 -b 32 titan1.png > /dev/null");
    524         system("xloadimage titan1.png > /dev/null &");
    525 #endif
    526 #endif
    527 }
    528 
    529279void blitfb(int flag)
    530280{
     
    569319        clearfb(fb);
    570320        clearfb(skinfb);
    571 }
    572 
    573 void setfbtransparent(int value)
    574 {
    575 #ifndef SIMULATE
    576         struct stmfbio_var_screeninfo_ex varEx = {0};
    577 
    578         varEx.layerid  = 0;
    579         varEx.activate = STMFBIO_ACTIVATE_IMMEDIATE;
    580         varEx.caps = STMFBIO_VAR_CAPS_OPACITY;
    581         varEx.opacity = value;
    582 
    583 
    584         if(ioctl(fb->fd, STMFBIO_SET_VAR_SCREENINFO_EX, &varEx) < 0)
    585                 perr("STMFBIO_SET_VAR_SCREENINFO_EX");
    586 #endif
    587321}
    588322
  • titan/titan/global.h

    r15155 r15169  
    26402640}
    26412641
    2642 void sighandler(int sig, struct sigcontext ctx)
    2643 {
    2644         debug(1000, "in");
    2645         switch(sig)
    2646         {
    2647                 case SIGUSR1:
    2648                 {
    2649                         //todo all configs
    2650                         reloadconfig(status.configfile);
    2651                         reloadconfig(getconfig("ownconfig", NULL));
    2652                         break;
    2653                 }
    2654                 case SIGSEGV:
    2655                 case SIGBUS:
    2656                 case SIGABRT:
    2657                 {
    2658 #ifdef SIMULATE
    2659                         //intel
    2660                         debugstack((void *)ctx.eip, NULL);
    2661                         err("got signal %d, fault address 0x%lx from 0x%lx", sig, ctx.cr2, ctx.eip);
    2662 #else
    2663                         /* sh4
    2664                         unsigned long sc_regs[16];
    2665                         unsigned long sc_pc; //programm counter register
    2666                         unsigned long sc_pr; //procedure register
    2667                         unsigned long sc_sr; //status register
    2668                         unsigned long sc_gbr;
    2669                         unsigned long sc_mach;
    2670                         unsigned long sc_macl; */
    2671 
    2672                         debugstack((void *)ctx.sc_pr, (void *)ctx.sc_pc);
    2673                         err("got signal %d, programm counter reg: 0x%lx,  procedure reg: 0x%lx", sig, ctx.sc_pc, ctx.sc_pr);
    2674 #endif
    2675                         if(getconfigint("saverun", NULL) == 1 && status.longjumpbuf != NULL)
    2676                                 siglongjmp(status.longjumpbuf, 1);
    2677                         else
    2678                                 exit(100);
    2679                         break;
    2680                 }
    2681         }
    2682         debug(1000, "out");
    2683 }
    2684 
    26852642void calctext(char* buf, char* buf1, unsigned int* linecount, unsigned int* pagecount, unsigned int* poscount, int pagelen, int page)
    26862643{
  • titan/titan/ipkg.h

    r15164 r15169  
    11#ifndef OIPKG_H
    22#define OIPKG_H
    3 
    4 #define IPKG_LIB
    5 #include "../libipkg/config.h"
    6 #include "../libipkg/libipkg.h"
    7 #include "../libipkg/args.h"
    8 #include "../libipkg/ipkg_cmd.h"
    93
    104struct ipkg
  • titan/titan/skin.h

    r15168 r15169  
    13361336}
    13371337
    1338 int readjpg(const char* filename, unsigned long* width, unsigned long* height, unsigned long* rowbytes, int* channels, unsigned char **mem, int *memfd)
    1339 {
    1340 #ifndef SIMULATE
    1341         FILE *fp;
    1342         unsigned int temp1, temp2;
    1343 
    1344         if(filename == NULL) return -1;
    1345 
    1346         debug(200, "hardware decode picture (%s)...", filename);
    1347 
    1348         if (!(fp = fopen(filename, "rb")))
    1349                 return -1;
    1350          
    1351         if(get_jpeg_img_size(fp, &temp1, &temp2) != LIBMMEIMG_SUCCESS)
    1352                 return -1;
    1353        
    1354         *width = temp1;
    1355         *height = temp2;
    1356         *channels = 3;
    1357         *rowbytes = *channels * temp1;
    1358        
    1359         if(allocbpamem(temp1 * temp2 * (*channels), memfd, mem) != 0)
    1360         {
    1361                 fclose(fp);
    1362                 return -1;
    1363         }
    1364                
    1365         if(decode_jpeg_noalloc(fp, temp1, temp2, temp1, temp2, (char *)*mem, 1) == LIBMMEIMG_SUCCESS)
    1366         {
    1367                 fclose(fp);
    1368                 return 0;
    1369         }
    1370        
    1371         fclose(fp);
    1372         freebpamem(*memfd, *mem, temp1 * temp2 * (*channels));
    1373         err("hardware decode error");
    1374 #endif
    1375         return -1;
    1376 }
    1377 
    13781338struct jpgerror
    13791339{
     
    13811341        jmp_buf setjmpbuf;
    13821342};
    1383 
    1384 //flag 0: blit from accelfb to skinfb
    1385 //flag 1: blit from skinfb to accelfb
    1386 void blitscale(int posx, int posy, int width, int height, int scalewidth, int scaleheight, int flag)
    1387 {
    1388 #ifndef SIMULATE
    1389         STMFBIO_BLT_DATA  blt_data;
    1390         memset(&blt_data, 0, sizeof(STMFBIO_BLT_DATA));
    1391 
    1392         if(scalewidth == 0) scalewidth = width;
    1393         if(scaleheight == 0) scaleheight = height;
    1394 
    1395         if(posx < 0) posx = 0;
    1396         if(posx > skinfb->width) posx = skinfb->width;
    1397         if(posy < 0) posy = 0;
    1398         if(posy > skinfb->height) posy = skinfb->height;
    1399         if(posx + scalewidth > skinfb->width) scalewidth = skinfb->width - posx;
    1400         if(posy + scaleheight > skinfb->height) scaleheight = skinfb->height - posy;
    1401        
    1402         if(width <= 0 || height <= 0 || scalewidth <= 0 || scaleheight <= 0) return;
    1403        
    1404         if(flag == 1 && (scalewidth * scaleheight * 4) > accelfb->varfbsize)
    1405         {
    1406                 err("accelfb to small %d -> %lu ", scalewidth * scaleheight * 4, accelfb->varfbsize);
    1407                 return;
    1408         }
    1409 
    1410         blt_data.operation  = BLT_OP_COPY;
    1411        
    1412         if(flag == 0)
    1413         {
    1414                 if(status.usedirectfb == 1)
    1415                         blt_data.srcOffset  = fb->varfbsize;
    1416                 else
    1417                         blt_data.srcOffset  = fb->varfbsize + skinfb->varfbsize;
    1418         }
    1419         else
    1420         {
    1421                 if(status.usedirectfb == 1)
    1422                         blt_data.srcOffset  = 0;
    1423                 else
    1424                         blt_data.srcOffset  = fb->varfbsize;
    1425         }
    1426        
    1427         blt_data.srcPitch   = width * 4;
    1428         blt_data.src_top    = 0;
    1429         blt_data.src_left   = 0;
    1430         blt_data.src_right  = width;
    1431         blt_data.src_bottom = height;
    1432         blt_data.srcFormat  = SURF_ARGB8888;
    1433         blt_data.srcMemBase = STMFBGP_FRAMEBUFFER;
    1434        
    1435         if(flag == 0)
    1436         {
    1437                 if(status.usedirectfb == 1)
    1438                 {
    1439                         blt_data.dstOffset  = 0;
    1440                         blt_data.dstPitch   = fb->pitch;
    1441                 }
    1442                 else
    1443                 {
    1444                         blt_data.dstOffset  = fb->varfbsize;
    1445                         blt_data.dstPitch   = skinfb->pitch;
    1446                 }
    1447         }
    1448         else
    1449         {
    1450                 if(status.usedirectfb == 1)
    1451                 {
    1452                         blt_data.dstOffset  = fb->varfbsize;
    1453                         blt_data.dstPitch   = skinfb->pitch;
    1454                 }
    1455                 else
    1456                 {
    1457                         blt_data.dstOffset  = fb->varfbsize + skinfb->varfbsize;
    1458                         blt_data.dstPitch   = scalewidth * 4;
    1459                 }
    1460         }
    1461        
    1462         blt_data.dst_left   = posx;
    1463         blt_data.dst_top    = posy;
    1464         blt_data.dst_right  = posx + scalewidth;
    1465         blt_data.dst_bottom = posy + scaleheight;
    1466         blt_data.dstFormat  = SURF_ARGB8888;
    1467         blt_data.dstMemBase = STMFBGP_FRAMEBUFFER;
    1468        
    1469         if (ioctl(fb->fd, STMFBIO_BLT, &blt_data) < 0)
    1470         {
    1471                 perr("ioctl STMFBIO_BLT");
    1472         }
    1473         if(ioctl(fb->fd, STMFBIO_SYNC_BLITTER) < 0)
    1474         {
    1475                 perr("ioctl STMFBIO_SYNC_BLITTER");
    1476         }
    1477 #endif
    1478 }
    1479 
    1480 void blitjpg(unsigned char* buf, int posx, int posy, int width, int height, int scalewidth, int scaleheight)
    1481 {
    1482 #ifndef SIMULATE
    1483         STMFBIO_BLT_EXTERN_DATA blt_data;
    1484         memset(&blt_data, 0, sizeof(STMFBIO_BLT_EXTERN_DATA));
    1485 
    1486         blt_data.operation  = BLT_OP_COPY;
    1487         blt_data.ulFlags    = 0;
    1488         blt_data.srcOffset  = 0;
    1489         blt_data.srcPitch   = width * 3;
    1490         blt_data.dstOffset  = 0;
    1491         blt_data.dstPitch   = skinfb->pitch;
    1492         blt_data.src_top    = 0;
    1493         blt_data.src_left   = 0;
    1494         blt_data.src_right  = width;
    1495         blt_data.src_bottom = height;
    1496         blt_data.dst_left   = posx;
    1497         blt_data.dst_top    = posy;
    1498        
    1499         if(scalewidth == 0)  scalewidth = width;
    1500         if(scaleheight == 0) scaleheight = height;
    1501        
    1502         blt_data.dst_right  = posx + scalewidth;
    1503         blt_data.dst_bottom = posy + scaleheight;
    1504         blt_data.srcFormat  = SURF_BGR888;
    1505         blt_data.dstFormat  = SURF_ARGB8888;
    1506         blt_data.srcMemBase = (char *)buf;
    1507         blt_data.dstMemBase = (char *)skinfb->fb;
    1508         blt_data.srcMemSize = width * height * 3;
    1509         blt_data.dstMemSize = skinfb->pitch * skinfb->height;
    1510        
    1511         if(ioctl(skinfb->fd, STMFBIO_BLT_EXTERN, &blt_data) < 0)
    1512         {
    1513                 err("ioctl STMFBIO_BLT_EXTERN");
    1514         }
    1515         if(ioctl(fb->fd, STMFBIO_SYNC_BLITTER) < 0)
    1516         {
    1517                 perr("ioctl STMFBIO_SYNC_BLITTER");
    1518         }
    1519 #endif
    1520 }
    15211343
    15221344void jpgswerror(j_common_ptr cinfo)
     
    25202342//*************** GOST LCD
    25212343
    2522 
    2523 #ifndef SIMULATE
    2524 
    25252344/*
    25262345void fillrect(int posx, int posy, int width, int height, long color, int transparent)
     
    25532372*/
    25542373
    2555 //mode 0: with fill (draw to skinfb)
    2556 //mode 1: without fill (draw to skinfb)
    2557 //mode 2: with fill (draw to fb)
    2558 //mode 3: without fill (draw to fb)
    2559 void blitrect(int posx, int posy, int width, int height, long color, int transparent, int mode)
    2560 {
    2561         unsigned long tmpcol;
    2562 
    2563         transparent = (transparent - 255) * -1;
    2564         tmpcol = color | ((transparent & 0xff) << 24);
    2565 
    2566         STMFBIO_BLT_DATA  bltData;
    2567         memset(&bltData, 0, sizeof(STMFBIO_BLT_DATA));
    2568 
    2569         if(posx < 0) posx = 0;
    2570         if(posy < 0) posy = 0;
    2571         if(mode < 2)
    2572         {
    2573                 if(posx > skinfb->width) posx = skinfb->width;
    2574                 if(posy > skinfb->height) posy = skinfb->height;
    2575                 if(posx + width > skinfb->width) width = skinfb->width - posx;
    2576                 if(posy + height > skinfb->height) height = skinfb->height - posy;
    2577         }
    2578         else
    2579         {
    2580                 if(posx > fb->width) posx = fb->width;
    2581                 if(posy > fb->height) posy = fb->height;
    2582                 if(posx + width > fb->width) width = fb->width - posx;
    2583                 if(posy + height > fb->height) height = fb->height - posy;
    2584         }
    2585 
    2586         if(width <= 0 || height <= 0) return;
    2587 
    2588         if(mode == 0 || mode == 2)
    2589                 bltData.operation  = BLT_OP_FILL;
    2590         else if(mode == 1 || mode == 3)
    2591                 bltData.operation  = BLT_OP_DRAW_RECTANGLE;
    2592         bltData.colour     = tmpcol;
    2593         bltData.srcFormat  = SURF_ARGB8888;
    2594         bltData.srcMemBase = STMFBGP_FRAMEBUFFER;
    2595 
    2596         if(status.usedirectfb == 1)
    2597                 bltData.dstOffset  = 0;
    2598         else
    2599         {
    2600                 if(mode < 2)
    2601                         bltData.dstOffset  = fb->varfbsize;
    2602                 else
    2603                         bltData.dstOffset  = 0;
    2604         }
    2605         if(mode < 2)
    2606                 bltData.dstPitch   = skinfb->pitch;
    2607         else
    2608                 bltData.dstPitch   = fb->pitch;
    2609         bltData.dst_top    = posy;
    2610         bltData.dst_left   = posx;
    2611         bltData.dst_bottom = posy + height;
    2612         bltData.dst_right  = posx + width;
    2613         bltData.dstFormat  = SURF_ARGB8888;
    2614         bltData.dstMemBase = STMFBGP_FRAMEBUFFER;
    2615 
    2616         if(ioctl(fb->fd, STMFBIO_BLT, &bltData) < 0)
    2617         {
    2618                 perr("ioctl STMFBIO_BLT");
    2619         }
    2620         if(ioctl(fb->fd, STMFBIO_SYNC_BLITTER) < 0)
    2621         {
    2622                 perr("ioctl STMFBIO_SYNC_BLITTER");
    2623         }
    2624 }
    2625 
    26262374void fillrect(int posx, int posy, int width, int height, long color, int transparent)
    26272375{
     
    26392387                lcd_drawrect(posx, posy, width, height, color, transparent);
    26402388}
    2641 #else
    2642 void fillrect(int posx, int posy, int width, int height, long color, int transparent)
    2643 {
    2644         debug(1000, "in");
    2645         int y, x;
    2646         unsigned long tmpcol;
    2647        
    2648         if(posx < 0) posx = 0;
    2649         if(posx > skinfb->width) posx = skinfb->width;
    2650         if(posy < 0) posy = 0;
    2651         if(posy > skinfb->height) posy = skinfb->height;
    2652         if(posx + width > skinfb->width) width = skinfb->width - posx;
    2653         if(posy + height > skinfb->height) height = skinfb->height - posy;
    2654 
    2655         if(width <= 0 || height <= 0) return;
    2656 
    2657         transparent = (transparent - 255) * -1;
    2658         tmpcol = color | ((transparent & 0xff) << 24);
    2659 
    2660         for(y = 0; y < height; y++)
    2661         {
    2662                 for(x = 0; x < width; x++)
    2663                 {
    2664                         drawpixel(posx + x, posy + y, tmpcol);
    2665                 }
    2666         }
    2667         debug(1000, "out");
    2668 }
    2669 
    2670 void drawrect(int posx, int posy, int width, int height, long color, int transparent)
    2671 {
    2672         debug(1000, "in");
    2673         fillrect(posx, posy, width, 1, color, transparent);
    2674         fillrect(posx, posy + height - 1, width, 1, color, transparent);
    2675         fillrect(posx, posy, 1, height, color, transparent);
    2676         fillrect(posx + width - 1, posy, 1, height, color, transparent);
    2677         debug(1000, "out");
    2678 }
    2679 #endif
    26802389
    26812390void clearrect(int posx, int posy, int width, int height)
  • titan/titan/struct.h

    r15159 r15169  
    1818#include <sys/ioctl.h>
    1919#include <sys/mman.h>
    20 #include <bpamem.h>
    2120#include <png.h>
    2221#include <jpeglib.h>
    23 #include <libmmeimage.h>
    2422#include <libintl.h>
    2523#include <locale.h>
     
    5654#include <sys/utsname.h>
    5755
    58 #ifndef SIMULATE
    59 #include <linux/stmfb.h>
    60 #endif
     56#define IPKG_LIB
     57#include "libipkg/config.h"
     58#include "libipkg/libipkg.h"
     59#include "libipkg/args.h"
     60#include "libipkg/ipkg_cmd.h"
    6161
    6262//for freetype
  • titan/titan/titan.c

    r15143 r15169  
    4242struct caservice caservice[MAXCASERVICE];
    4343struct channelhistory channelhistory[MAXCHANNELHISTORY];
     44
     45#ifdef SH4
     46#include "sh4port.h"
     47#endif
     48
     49#ifdef MIPSEL
     50#include "mipselport.h"
     51#endif
     52
     53#ifdef I386
     54#include "i386port.h"
     55#endif
    4456
    4557#include "ipkg.h"
     
    481493                return 100;
    482494        clearfball();
     495        enablemanualblit();
    483496
    484497        tmpstr = getconfig("fb1dev", NULL);
Note: See TracChangeset for help on using the changeset viewer.