This repository has been archived on 2025-06-06. You can view files and clone it, but cannot push or open issues or pull requests.
Files
android-g900/Start_WM/test6/test6.cpp
2010-10-16 00:02:07 +06:00

128 lines
3.1 KiB
C++
Executable File

// test6.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include "windows.h"
#include "wingdi.h"
#include "GF.h"
#include "GFGx.h"
#include "GFDx.h"
#include "GFVx.h"
#include "GFDiag.h"
#include <stdio.h>
#include <stdlib.h>
// Rotation related defines
#define H_FLIP_BIT 0x00000001
#define V_FLIP_BIT 0x00000002
#define XYSWAP_BIT 0x00000004
#define ROT_IDENTIY 0x0
#define ROT_90 (XYSWAP_BIT | H_FLIP_BIT)
#define ROT_180 (H_FLIP_BIT | V_FLIP_BIT)
#define ROT_270 (XYSWAP_BIT | V_FLIP_BIT)
#define ROT_H_FLIP (H_FLIP_BIT)
#define ROT_V_FLIP (V_FLIP_BIT)
#define ROT_XYSWAP (XYSWAP_BIT)
#define ROT_SWAP_X_Y (XYSWAP_BIT | H_FLIP_BIT | V_FLIP_BIT)
// Overlay options
#define NO_OVERLAY 0
#define RGB565_WITH_VXBLT 1
#define ARGB8888_WITH_VXBLT 2
#define YUV_WITH_FR 3 //(FR = fast rotate)
#define COLOR_KEY (255<<16 | 0<<8 | 255)//RGB888
//kbm gui 2.2 ¹Ý¿µ
#define BLEND_KEY (5<<16 | 18<<8 | 41)//RGB888
//#define BLEND_KEY (37<<16 | 54<<8 | 84)//RGB888
#define BACKGROUND_RGB565 (0<<11 | 0<<5 | 0)//RGB565
#define ALPHA_VALUE (165<<16 |165<<8 | 165)
#define OVERLAY_SURF 2
#define DBGERROR 1
#define DBGINFO 2
#define DEFAULT_LCD_WIDTH 800
#define DEFAULT_LCD_HEIGHT 480
FILE *fp;
int tpos=0;
void text_d(LPWSTR s){
fwprintf(fp, L"debug: %s \n",s);
HDC hd=GetDC(0);
RECT r;
r.left=0;
r.top=tpos;
r.right=480;
r.bottom=800;
if (!tpos){Rectangle(hd,0,0,480,800);}
tpos+=25;
DrawText(hd,s,wcslen(s),&r,0);
if (tpos>700){tpos=0;}
}
int _tmain(int argc, _TCHAR* argv[])
{
if (( fp= fopen("log10.txt", "w")) == NULL) {
printf("He óäàåòñÿ îòêðûòü ôàéë.\n");
}
text_d(L"Started");
GFRECT destRect;
GFRECT srcRect;
GFRECT srcXYRect; // src rect for an xyswapped src image
GF_RETTYPE status;
GFRMSURFACEREQUEST surfReq;
GFDXPROPERTY DxProp;// Dx Specific
NvU32 width, height, bpp, stride, startAddr;
GFRmHandle pm=GFRmOpen( NULL );
GFDxHandle px;
GFDxOpen(pm, &(px), GF_STATE_DEFAULT, NULL);
GFDxGetAttribute(px ,LCD_MAIN, GFDX_ATTR_STARTADDR, &startAddr);
WCHAR buff[200];
wsprintf(buff,L"%x",startAddr);
text_d(L"startAddr");
text_d(buff);
text_d(L"fix");
//GFDxSetAttributeWithCS
startAddr=0x2000000;
GFDxSetAttributeWithCS(px ,LCD_MAIN, GFDX_ATTR_STARTADDR, startAddr);
wsprintf(buff,L"%x",startAddr);
text_d(L"startAddr");
text_d(buff);
return 0;
text_d(L"Starting Haret\n");
SHELLEXECUTEINFO ShExecInfo = {0};
ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
ShExecInfo.fMask = SEE_MASK_NOCLOSEPROCESS;
ShExecInfo.hwnd = NULL;
ShExecInfo.lpVerb = L"open";
ShExecInfo.lpFile = L"\\Storage Card\\Android\\haret.exe";
ShExecInfo.lpParameters = NULL;
//WCHAR strExePath [MAX_PATH];
//GetModuleFileNameW (NULL, strExePath, MAX_PATH);
ShExecInfo.lpDirectory = NULL;
ShExecInfo.nShow = SW_SHOW;
ShExecInfo.hInstApp = NULL;
ShellExecuteEx(&ShExecInfo);
return 0;
}