⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ati.cpp

📁 PocketMVP V0.8082503 source for Pocket 的程序源代码
💻 CPP
📖 第 1 页 / 共 2 页
字号:
						srcRect.Height = nHeight;
						AtiCore_SetRopOperation( ROP3_SRCCOPY );
						AtiCore_SetDstType( DSTTYPE_8BPP );
						AtiCore_SetSrcType( SRCTYPE_EQU_DST );


						// Setting clipping rectangle for stretching.  Note that Src and Dst will have different sizes
						ATI_CLIPRECT clipRect;
						clipRect.X_Top_Left = 0;
						clipRect.Y_Top_Left = 0;
						clipRect.X_Bottom_Right = (S16)(g_nWidth<DisplayWidth?g_nWidth:DisplayWidth);
						clipRect.Y_Bottom_Right = (S16)nHeight;
						AtiCore_SetSrcClippingRect( &clipRect );
						clipRect.X_Bottom_Right = (S16)DisplayWidth;
						clipRect.Y_Bottom_Right = (S16)DisplayHeight;
						AtiCore_SetDstClippingRect( &clipRect );

						U32 y=(U32)OvlWinProp.lpSrcBitmap; 
						dpPoint.XCoord = xStart;
						dpPoint.YCoord =yStart;

						AtiCore_SetSrcPitchOffset( nWidth, (U32)VRAMoffset2 );
						AtiCore_SetDstPitchOffset( DisplayWidth, y);
						AtiCore_StretchBlt( &stretchOptions, &dpPoint, &srcRect );
        
						dpPoint.XCoord >>=1;
						dpPoint.YCoord >>=1;

						srcRect.Width >>=1;
						srcRect.Height>>=1;
						// U & V
						AtiCore_SetSrcPitchOffset( nWidth/2, (U32)VRAMoffset2 + nWidth * nHeight );
						AtiCore_SetDstPitchOffset( DisplayWidth/2, (U32)y + DisplayWidth * DisplayHeight );
						AtiCore_StretchBlt( &stretchOptions, &dpPoint, &srcRect );

						AtiCore_SetSrcPitchOffset( nWidth/2, (U32)VRAMoffset2 + nWidth * nHeight * 5 / 4 );
						AtiCore_SetDstPitchOffset( DisplayWidth/2, (U32)y + DisplayWidth * DisplayHeight * 5 / 4 );
						AtiCore_StretchBlt( &stretchOptions, &dpPoint, &srcRect );


					}
				}
			}
			else
			{
				if (ForceFit)
				{
					ATI_RECT srcRect;
					ATI_RECT dstRect;
					ATI_CLIPRECT clipRect;
					ATI_POINT dpPoint;
					U32 y=(U32)VRAMoffset2;
					U32 VRAMTemp=VRAMoffset+(320*120);
					int nWidth;
					int nHeight;
					int row;
					int step=g_nWidth<320?320:g_nWidth;
					clipRect.X_Top_Left = 0;
					clipRect.Y_Top_Left = 0;
					clipRect.X_Bottom_Right = (S16)step<DisplayHeight?DisplayHeight:step;
					clipRect.Y_Bottom_Right = (S16)DisplayWidth;
					AtiCore_SetSrcClippingRect( &clipRect );
					clipRect.X_Bottom_Right = (S16)DisplayWidth;
					clipRect.Y_Bottom_Right = (S16)step<DisplayHeight?DisplayHeight:step;
					AtiCore_SetDstClippingRect( &clipRect );
					srcRect.XCoord=0;
					srcRect.YCoord=0;
					dstRect.XCoord=0;
					dstRect.YCoord=0;
					for (row=0;row<=(g_nHeight/64);row++)
					{
						int size=64;
						if (row==g_nHeight/64)
						{
							size=g_nHeight%64;
							size-=size%16;
							if (!size)
								continue;
						}
						srcRect.Width=step;
						srcRect.Height=size;
						dstRect.Width=size;
						dstRect.Height=step;
						AtiCore_SetupMemoryTransfer(VRAMoffset,&regdata);
						convert_yuv(avpict.data[0]+(avpict.linesize[0]*64*row), avpict.linesize[0],
						avpict.data[1], avpict.data[2], avpict.linesize[1],
						(unsigned char*) regdata, g_nWidth,size,step,0,PlayerOptions.Brightness,avpict.last_picture[0],avpict.last_picture[1],avpict.last_picture[2],0, 2);

						AtiCore_TerminateMemoryTransfer();


						AtiCore_SetDstPitchOffset(dstRect.Width,VRAMTemp);
						AtiCore_SetSrcPitchOffset(step,VRAMoffset);
						AtiCore_BitBltFilpRotate( blt090Rotate, &dstRect, &srcRect );


						srcRect.Width = size;
						srcRect.Height = g_nWidth;

						dpPoint.YCoord =yStart;

						dpPoint.XCoord=DisplayWidth-((xStart-1)+((16*64*(row)+(16*size))/stretchOptions.ScaleXFactor));
						AtiCore_SetSrcPitchOffset( srcRect.Width, (U32)VRAMTemp );
						AtiCore_SetDstPitchOffset( OvlWinProp.SrcPitch, y);
						AtiCore_StretchBlt( &stretchOptions, &dpPoint, &srcRect );

						srcRect.Width=step;
						dstRect.Height=step;
						srcRect.Height=size>>1;
						dstRect.Width=size>>1;

						AtiCore_SetupMemoryTransfer(VRAMoffset,&regdata);
						convert_yuv(avpict.data[0], avpict.linesize[0],
							avpict.data[1]+(avpict.linesize[1]*32*row), avpict.data[2]+(avpict.linesize[1]*32*row), avpict.linesize[1],
							(unsigned char*) regdata, g_nWidth,size,step,0,PlayerOptions.Brightness,avpict.last_picture[0],avpict.last_picture[1],avpict.last_picture[2],0, 3);

						AtiCore_TerminateMemoryTransfer();

						AtiCore_SetDstPitchOffset(dstRect.Width,VRAMTemp);
						AtiCore_SetSrcPitchOffset(step,VRAMoffset);
						AtiCore_BitBltFilpRotate( blt090Rotate, &dstRect, &srcRect );


						srcRect.Width = size>>1;
						srcRect.Height = g_nWidth>>1;

						dpPoint.YCoord =yStart>>1;
        
						dpPoint.XCoord >>=1;

						AtiCore_SetSrcPitchOffset( srcRect.Width, (U32)VRAMTemp);
						AtiCore_SetDstPitchOffset( OvlWinProp.SrcPitch>>1, (U32)y + OvlWinProp.SrcPitch * OvlWinProp.SrcHeight );
						AtiCore_StretchBlt( &stretchOptions, &dpPoint, &srcRect );

						AtiCore_SetSrcPitchOffset( srcRect.Width, (U32)VRAMTemp + srcRect.Width * (step>>1));
						AtiCore_SetDstPitchOffset( OvlWinProp.SrcPitch>>1, (U32)y + OvlWinProp.SrcPitch * OvlWinProp.SrcHeight * 5 / 4 );
						AtiCore_StretchBlt( &stretchOptions, &dpPoint, &srcRect );
					}


				}
				else
				{
					ATI_RECT srcRect;
					ATI_RECT dstRect;
					srcRect.XCoord=0;
					srcRect.YCoord=0;
					dstRect.XCoord=0;
					dstRect.YCoord=0;
					srcRect.Width=320;
					srcRect.Height=g_nHeight<240?g_nHeight:240;
					dstRect.Width=g_nHeight<240?g_nHeight:240;
					if (dstRect.Width%16) dstRect.Width-=(dstRect.Width%16);
					srcRect.Height=dstRect.Width;
					dstRect.Height=320;
					AtiCore_SetupMemoryTransfer(VRAMoffset,&regdata);
					convert_yuv(avpict.data[0], avpict.linesize[0],
					avpict.data[1], avpict.data[2], avpict.linesize[1],
					(unsigned char*) regdata, g_nWidth,g_nHeight,320,0,PlayerOptions.Brightness,avpict.last_picture[0],avpict.last_picture[1],avpict.last_picture[2],0, 0);

					AtiCore_TerminateMemoryTransfer();

					ATI_CLIPRECT clipRect;
					clipRect.X_Top_Left = 0;
					clipRect.Y_Top_Left = 0;
					clipRect.X_Bottom_Right = (S16)DisplayHeight;//nHeight;
					clipRect.Y_Bottom_Right = (S16)DisplayWidth;
					AtiCore_SetSrcClippingRect( &clipRect );
					clipRect.X_Bottom_Right = (S16)DisplayWidth;
					clipRect.Y_Bottom_Right = (S16)DisplayHeight;
					AtiCore_SetDstClippingRect( &clipRect );

					AtiCore_SetDstPitchOffset(dstRect.Width,VRAMoffset2);
					AtiCore_SetSrcPitchOffset(320,VRAMoffset);
					AtiCore_BitBltFilpRotate( blt090Rotate, &dstRect, &srcRect );

					srcRect.Height>>=1;
					dstRect.Width>>=1;

					AtiCore_SetupMemoryTransfer(VRAMoffset,&regdata);
					convert_yuv(avpict.data[0], avpict.linesize[0],
						avpict.data[1], avpict.data[2], avpict.linesize[1],
						(unsigned char*) regdata, g_nWidth,g_nHeight,320,0,PlayerOptions.Brightness,avpict.last_picture[0],avpict.last_picture[1],avpict.last_picture[2],0, 1);

					AtiCore_TerminateMemoryTransfer();

					AtiCore_SetDstPitchOffset(dstRect.Width,VRAMoffset2+ 320 * (dstRect.Width<<1));
					AtiCore_SetSrcPitchOffset(320,VRAMoffset);
					AtiCore_BitBltFilpRotate( blt090Rotate, &dstRect, &srcRect );

					if (PlayerOptions.Double)
					{
						ATI_POINT dpPoint;
						ATI_RECT srcRect;
						int nWidth=(g_nHeight<DisplayWidth?g_nHeight:DisplayWidth);
						int nHeight=(g_nWidth<DisplayHeight?g_nWidth:DisplayHeight);
						 dpPoint.XCoord = dpPoint.YCoord = 0;
						//AtiCore_SetOverlayPos(OverlayHandle,0,0); 
						if (nWidth%16) nWidth-=(nWidth%16);


						srcRect.XCoord = srcRect.YCoord = 0;
						srcRect.Width = nWidth;
						srcRect.Height = nHeight;
						AtiCore_SetRopOperation( ROP3_SRCCOPY );
						AtiCore_SetDstType( DSTTYPE_8BPP );
						AtiCore_SetSrcType( SRCTYPE_EQU_DST );

						// Setting clipping rectangle for stretching.  Note that Src and Dst will have different sizes

						U32 y=(U32)OvlWinProp.lpSrcBitmap; // + (xStart + DisplayWidth*yStart);
						dpPoint.XCoord = xStart;
						dpPoint.YCoord =yStart;

						AtiCore_SetSrcPitchOffset( nWidth, (U32)VRAMoffset2 );
						AtiCore_SetDstPitchOffset( DisplayWidth, y);
						AtiCore_StretchBlt( &stretchOptions, &dpPoint, &srcRect );
        
						dpPoint.XCoord >>=1;
						dpPoint.YCoord >>=1;

						srcRect.Width >>=1;
						srcRect.Height >>=1;
						// U & V
						AtiCore_SetSrcPitchOffset( nWidth/2, (U32)VRAMoffset2 + nWidth * 320 );
						AtiCore_SetDstPitchOffset( DisplayWidth/2, (U32)y + DisplayWidth * DisplayHeight );
						AtiCore_StretchBlt( &stretchOptions, &dpPoint, &srcRect );

						AtiCore_SetSrcPitchOffset( nWidth/2, (U32)VRAMoffset2 + nWidth * 320 * 5 / 4 );
						AtiCore_SetDstPitchOffset( DisplayWidth/2, (U32)y + DisplayWidth * DisplayHeight * 5 / 4 );
						AtiCore_StretchBlt( &stretchOptions, &dpPoint, &srcRect );

					}
				}
				
			}
			AtiCore_SetOverlayOnOff(OverlayHandle,1);

		}
	}

	else if (Extra==-1)
	{
			while(AtiCore_SetOverlayOnOff(OverlayHandle,0)!=SUCCESS);
	}
	LeaveCriticalSection(&cs);
	return render_flag;
}

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -