X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=platform%2Fs60%2FS60v3video.inl;fp=platform%2Fs60%2FS60v3video.inl;h=00e65b624b0c919cd37178d9ebf176b731eaab1d;hb=cc68a136aa179a5f32fe40208371eb9c2b0aadae;hp=0000000000000000000000000000000000000000;hpb=2cadbd5e56966f8b7a4e9790aba2f719cfcc38e8;p=picodrive.git diff --git a/platform/s60/S60v3video.inl b/platform/s60/S60v3video.inl new file mode 100644 index 0000000..00e65b6 --- /dev/null +++ b/platform/s60/S60v3video.inl @@ -0,0 +1,371 @@ +static int EmulateScanFull16(unsigned int scan,unsigned short *data) +{ + unsigned short *ps=NULL,*end=NULL; + unsigned short *pd=NULL; + unsigned short *pdSrc1 = NULL; + unsigned short *pdSrc2 = NULL; + int screenScan; + + int index = 0; + int xpitch=0; + TInt retValue = 0; + if(scan<224) + retValue = 1-(gLineTable[scan+1]-gLineTable[scan]); + screenScan = gLineTable[scan]; + + if ((int)screenScan< 0) return 0; // Out of range + if ((int)screenScan>=Targ.view.iBr.iY) return 0; // Out of range + + pd=(unsigned short*)(Targ.screen+screenScan*2+Targ.screen_offset); + pdSrc1 = pd; + + xpitch=-(Targ.scanline_length>>1); + if((Pico.video.reg[12]&1)) + { + ps=data; end=ps+320; + do + { + if(gColumnStepTable[index]>1) + { + *pd = gColorMapTab[*ps]; + pd+=xpitch; + *pd = ((gColorMapTab[*ps]+gColorMapTab[*(ps+1)])>>1); + index++; + ps++; + } + else if(gColumnStepTable[index]>0) + { + *pd = gColorMapTab[*ps]; + index++; + ps++; + } + else + { + *pd = ((gColorMapTab[*ps]+gColorMapTab[*(ps+1)])>>1); + ps+=2; + index+=2; + } + pd+=xpitch; + } + while (ps1) + { + *pd = gColorMapTab[*ps]; + pd+=xpitch; + *pd = ((gColorMapTab[*ps]+gColorMapTab[*(ps+1)])>>1); + index++; + } + else if(gNarrowColumnStepTable[index]>0) + { + *pd = gColorMapTab[*ps]; + ps++; + index++; + } + else + { + *pd = ((gColorMapTab[*ps]+gColorMapTab[*(ps+1)])>>1); + ps+=2; + index+=2; + } + pd+=xpitch; + } + while (ps0 && screenScan != gLineTable[scan-1]+1) + { + pdSrc2 = pdSrc1-2; + pd = pdSrc1-1; + + for(TInt loop=0;loop>1); + pd+=xpitch; + pdSrc1+=xpitch; + pdSrc2+=xpitch; + } + + } + + return retValue; +} + +static int EmulateScanFullRight16(unsigned int scan,unsigned short *data) +{ + unsigned short *ps=NULL,*end=NULL; + unsigned short *pd=NULL; + unsigned short *pdSrc1 = NULL; + unsigned short *pdSrc2 = NULL; + int screenScan; + int xpitch=0; + int retValue = 0; + int index = 0; + if(scan<224) + retValue = 1-(gLineTable[scan+1]-gLineTable[scan]); + screenScan = gLineTable[scan]; + + if ((int)screenScan< 0) return 0; // Out of range + if ((int)screenScan>=Targ.view.iBr.iY) return 0; // Out of range + + pd=(unsigned short*)(Targ.screen+Targ.scanline_length-screenScan*2); + pdSrc1 = pd; + + xpitch=+(Targ.scanline_length>>1); + if((Pico.video.reg[12]&1)) + { + ps=data; end=ps+320; + do + { + if(gColumnStepTable[index]>1) + { + *pd = gColorMapTab[*ps]; + pd+=xpitch; + *pd = ((gColorMapTab[*ps]+gColorMapTab[*(ps+1)])>>1); + index++; + ps++; + } + else if(gColumnStepTable[index]>0) + { + *pd = gColorMapTab[*ps]; + index++; + ps++; + } + else + { + *pd = ((gColorMapTab[*ps]+gColorMapTab[*(ps+1)])>>1); + ps+=2; + index+=2; + } + pd+=xpitch; + } + while (ps1) + { + *pd = gColorMapTab[*ps]; + pd+=xpitch; + *pd = ((gColorMapTab[*ps]+gColorMapTab[*(ps+1)])>>1); + index++; + } + else if(gNarrowColumnStepTable[index]>0) + { + *pd = gColorMapTab[*ps]; + ps++; + index++; + } + else + { + *pd = ((gColorMapTab[*ps]+gColorMapTab[*(ps+1)])>>1); + ps+=2; + index+=2; + } + pd+=xpitch; + } + while (ps0 && screenScan != gLineTable[scan-1]+1) + { + pdSrc2 = pdSrc1+2; + pd = pdSrc1+1; + + for(TInt loop=0;loop>1); + pd+=xpitch; + pdSrc1+=xpitch; + pdSrc2+=xpitch; + } + + } + + return retValue; +} + + + +static int EmulateScan16(unsigned int scan,unsigned short *data) +{ + // int len=0; + unsigned short *ps=NULL,*end=NULL; + unsigned short *pd=NULL; + int xpitch=0; + int retValue = 0; + int index = 0; + + if(scan<224) + retValue = 1-(gLineTable[scan+1]-gLineTable[scan]); + scan = gLineTable[scan]; + + if ((int)scan< 0) return 0; // Out of range + if ((int)scan>=Targ.view.iBr.iY) return 0; // Out of range + + pd=(unsigned short*)(Targ.screen+scan*Targ.scanline_length); + + xpitch=2; + if((Pico.video.reg[12]&1)) + { + ps=data; end=ps+320; + do + { + if(gColumnStepTable[index]>0) + { + *pd = gColorMapTab[*ps]; + ps++; + + index++; + } + else + { + *pd = ((gColorMapTab[*ps]+gColorMapTab[*(ps+1)])>>1); + ps+=2; + index+=2; + } + pd++; + + } + while (ps0) + { + *pd = gColorMapTab[*ps]; + ps++; + index++; + } + else + { + *pd = ((gColorMapTab[*ps]+gColorMapTab[*(ps+1)])>>1); + ps+=2; + index+=2; + } + pd++; + } + while (ps=Targ.view.iBr.iY) + return 0; // Out of range + + pd=(unsigned short*)(Targ.screen+screenScan*Targ.scanline_length); + pdSrc1 = pd; + + if((Pico.video.reg[12]&1)) + { + ps=data; end=ps+320; + do + { + if(gColumnStepTable[index]>1) + { + *pd = gColorMapTab[*ps]; + pd++; + *pd = ((gColorMapTab[*ps]+gColorMapTab[*(ps+1)])>>1); + index++; + ps++; + } + else if(gColumnStepTable[index]>0) + { + *pd = gColorMapTab[*ps]; + index++; + ps++; + } + else + { + *pd = ((gColorMapTab[*ps]+gColorMapTab[*(ps+1)])>>1); + ps+=2; + index+=2; + } + pd++; + } + while (ps1) + { + *pd = gColorMapTab[*ps]; + pd++; + *pd = ((gColorMapTab[*ps]+gColorMapTab[*(ps+1)])>>1); + index++; + } + else if(gNarrowColumnStepTable[index]>0) + { + *pd = gColorMapTab[*ps]; + ps++; + index++; + } + else + { + *pd = ((gColorMapTab[*ps]+gColorMapTab[*(ps+1)])>>1); + ps+=2; + index+=2; + } + pd++; + } + while (ps0 && screenScan != gLineTable[scan-1]+1) + { + pdSrc2 = pdSrc1-Targ.scanline_length; + pd = pdSrc1-(Targ.scanline_length>>1); + + for(TInt loop=0;loop>1); + pd++; + pdSrc1++; + pdSrc2++; + } + + } + + return retValue; +}