Ejemplo n.º 1
0
void gp2x_init(void)
{
	printf("KEYBOARD = %d\n", OpenKeyboard());
	printf("GRAPHICS = %d\n", EnterGraphicsMode());
	printf("entering init()\n"); fflush(stdout);    
	gp2x_screen = malloc(320*240*2 + 320*2);
	memset(gp2x_screen, 0, 320*240*2 + 320*2);

	struct fb_var_screeninfo vinfo;
	struct fb_fix_screeninfo finfo;

	// Open the file for reading and writing
	fbfd = open("/dev/fb0", O_RDWR);
	if (!fbfd) {
		printf("Error: cannot open framebuffer device.\n");
		exit(1);
	}
	printf("The framebuffer device was opened successfully.\n");

	// Get fixed screen information
	if (ioctl(fbfd, FBIOGET_FSCREENINFO, &finfo)) {
		printf("Error reading fixed information.\n");
		exit(2);
	}

	// Get variable screen information
	if (ioctl(fbfd, FBIOGET_VSCREENINFO, &vinfo)) {
		printf("Error reading variable information.\n");
		exit(3);
	}

	printf("%dx%d, %dbpp\n", vinfo.xres, vinfo.yres, vinfo.bits_per_pixel );

	// Figure out the size of the screen in bytes
	screensize = vinfo.xres * vinfo.yres * vinfo.bits_per_pixel / 8;

	// Map the device to memory
	fbp = (unsigned short *)mmap(0, screensize, PROT_READ | PROT_WRITE, MAP_SHARED,
				fbfd, 0);
	if ((int)fbp == -1) {
		printf("Error: failed to map framebuffer device to memory.\n");
		exit(4);
	}
	printf("The framebuffer device was mapped to memory successfully.\n");
	memset(fbp, 0, screensize);

	inputfd = open("/dev/event0", O_RDWR | O_NONBLOCK);

	// snd
	ao_initialize();

	//while(jz_lcdregl[0xa8>>2] & 1);
	//jz_lcdregl[0xa4>>2] = 0;
	
	//printf("PGIOD = %x\n", jz_gpioregl[0x300>>2]);
}
Ejemplo n.º 2
0
int PBLineEdit::MainHandler(int type, int par1, int par2)
{
	int fcX1, fcX2, fcY1, fcY2;
	int flags;
	int result = 0;

	if (IsVisible() && type == EVT_POINTERUP)
	{
	    PBPoint clientPoint =  m_pParent->ScreenToClient(PBPoint(par1, par2));

	    fcX1 = GetClientLeft() + PBEDIT_BORDER;
	    fcX2 = fcX1 + GetClientWidth() - (PBEDIT_BORDER << 1);
	    fcY1 = GetClientTop() + PBEDIT_BORDER;
	    fcY2 = fcY1 + GetClientHeight() - (PBEDIT_BORDER << 1);

	    if (clientPoint.GetX() > fcX1 && clientPoint.GetX() < fcX2 &&
		clientPoint.GetY() > fcY1 && clientPoint.GetY() < fcY2)
	    {
		    switch(m_enterstyle)
		    {
		    case PBES_PHONE:
			    flags = KBD_PHONE;
			    break;
		    case PBES_NUMERIC:
			    flags = KBD_NUMERIC;
			    break;
		    case PBES_IPADDR:
			    flags = KBD_IPADDR;
			    break;
		    case PBES_URL:
			    flags = KBD_URL;
			    break;
		    case PBES_DATETIME:
			    flags = KBD_DATETIME;
			    break;
		    case PBES_TEXT:
		    default:
			    flags = KBD_ENTEXT;
			    break;
		    }

		    s_pThis = this;
		    m_pParent->OnChildFocusChanged(this);

		    OpenKeyboard("VK", m_text, PBEDIT_MAXENTER, flags, enttext_handler);

		    result = 1;
	    }
	    else result = PBWindow::MainHandler(type, par1, par2);

	}
	return result;
}
Ejemplo n.º 3
0
BOOLEAN
NTAPI
InitializeWrapper(
	)
{
//	KdPrint(("Initializing wrapper.\n"));

	if (bWrapperInitialized)
	{
		KdPrint(("Already initialized.\n"));
		return TRUE;
	}

//	KdPrint(("Creating heap\n"));

	heap = RtlCreateHeap (HEAP_GROWABLE|HEAP_NO_SERIALIZE, 0, 0, 0, 0, 0);

	if (heap == NULL)
	{
		KdPrint(("RtlCreateHeap failed!\n"));
		return FALSE;
	}

	SetProcessHeap (heap);

//	KdPrint(("heap = %08x\n", heap));

	for (int i=0; i<10; i++)
	{
		if (hKeyboard = OpenKeyboard (i))
		{
//			KdPrint(("Found keyboard class N%u\n", i));
			break;
		}
	}

//	KdPrint(("hKeyboard = %08x\n", hKeyboard));

	if (hKeyboard == NULL)
	{
		KdPrint(("Could not open keyboard.\n"));
		return FALSE;
	}

//	KdPrint(("Initialization successful\n"));

	bWrapperInitialized = TRUE;
	return TRUE;
}
Ejemplo n.º 4
0
static int pwd_query_handler(int type, int par1, int par2)
{
	if (type == EVT_INIT) OpenKeyboard("@Password", kbdbuffer, 63, KBD_PASSWORD, pwd_query_kbdhandler);
	return 0;
}