Exemplo n.º 1
0
	virtual void DumpRegisters()
        {
                printf("Dumping Registers for device at Address %#04x\n", m_Addr);

                MakeActive();
                unsigned char regs[] = {0,1,2,3,4,5,6,7,8,9,10};
                int nRegs = 11;
                unsigned char buff;

		if( !WriteByte(0x00) )
			printf("WriteError\n");

		unsigned char buffs[nRegs];
		read(m_Fd, &buffs, nRegs);

                for( int ii = 0; ii < nRegs; ii++ )
                {
                        //if( ReadByte( &buff ) )
                                printf("@[%#04x] = %#04x\n", regs[ii], buffs[ii]);
                        //else
                         //       printf("@[%#04x] Read Error", regs[ii]);
                }
		
		//sleep(1);
		//MakeActive();
		//{
		//unsigned char ddts[] = {0x07, 0x01, 0x00};
		//write(m_Fd, &ddts,2);
		//}
//		WriteAddressByte(0x07, 0x01);
        }
Exemplo n.º 2
0
void
TMagnify::StartSave()
{
	fImageFrozenOnSave = Active();
	if (fImageFrozenOnSave)
		MakeActive(false);
}
OpenGLWindowRenderTarget::OpenGLWindowRenderTarget(Window& window) :
	WindowRenderTarget(window.GetSize()),
	mWindowHandle(window.GetWindowHandle())
{
	XLibWindow *xLibWindow = dynamic_cast<XLibWindow*>(&window);
	mWindowDisplay = xLibWindow->GetDisplay();

	mContext = glXCreateContext(mWindowDisplay, xLibWindow->GetVisualInfo(), NULL, GL_TRUE);

	MakeActive();
}
void OpenGLWindowRenderTarget::Clear(const Colorf& color)
{
	MakeActive();
	GLuint existingBuffer;
	glGetIntegerv(GL_FRAMEBUFFER_BINDING, (GLint*)&existingBuffer);

	glBindFramebuffer(GL_FRAMEBUFFER, 0);
	glClearColor(color.r, color.g, color.b, color.a);
	glClear(GL_COLOR_BUFFER_BIT);

	glBindFramebuffer(GL_FRAMEBUFFER, existingBuffer);
}
OpenGLWindowRenderTarget::OpenGLWindowRenderTarget(Window& window) :
	WindowRenderTarget(window.GetSize(), DataFormat(DataFormat::Int8UNorm, 4)),
	mHDC(GetDC(window.GetWindowHandle()))
{
	PIXELFORMATDESCRIPTOR pfd;
	ZeroMemory( &pfd, sizeof( pfd ) );
	pfd.nSize = sizeof( pfd );
	pfd.nVersion = 1;
	pfd.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER;
	pfd.iPixelType = PFD_TYPE_RGBA;
	pfd.cColorBits = 32;
	pfd.cDepthBits = 0;
	pfd.iLayerType = PFD_MAIN_PLANE;
	int iFormat = ChoosePixelFormat( mHDC, &pfd );
	SetPixelFormat( mHDC, iFormat, &pfd );

	mHGLRenderContext = wglCreateContext(mHDC);

	MakeActive();
}
Exemplo n.º 6
0
	virtual void DumpRegisters()
	{
		printf("Dumping Registers for device at Address %#04x\n", m_Addr);

		MakeActive();
		unsigned char regs[] = {0,1,2,3,4,5,6,7,8,9,10,11,12,49,50};
		int nRegs = 15;
		unsigned char buff;

		for( int ii = 0; ii < nRegs; ii++ )
		{
			if( ReadAddressByte( regs[ii], &buff ) )
				printf("@[%#04x] = %#04x\n", regs[ii], buff);	
			else
				printf("@[%#04x] Read Error", regs[ii]);
		}

		//MakeActive();
		//unsigned char ddt[] = {0x02,0x00};
		//write(m_Fd, &ddt, 2);
		//WriteAddressByte(0x02, 0x00);

	}
Exemplo n.º 7
0
void
TMagnify::EndSave()
{
	if (fImageFrozenOnSave)
		MakeActive(true);
}