Example #1
0
/*
============
Init_All
============
*/
void CInput::Init_All (void)
{
	Assert( !m_pCommands );
	m_pCommands = new CUserCmd[ MULTIPLAYER_BACKUP ];
	m_pVerifiedCommands = new CVerifiedUserCmd[ MULTIPLAYER_BACKUP ];

	m_fMouseInitialized	= false;
	m_fRestoreSPI		= false;
	m_fMouseActive		= false;
	Q_memset( m_rgOrigMouseParms, 0, sizeof( m_rgOrigMouseParms ) );
	Q_memset( m_rgNewMouseParms, 0, sizeof( m_rgNewMouseParms ) );
	Q_memset( m_rgCheckMouseParam, 0, sizeof( m_rgCheckMouseParam ) );

	m_rgNewMouseParms[ MOUSE_ACCEL_THRESHHOLD1 ] = 0;	// no 2x
	m_rgNewMouseParms[ MOUSE_ACCEL_THRESHHOLD2 ] = 0;	// no 4x
	m_rgNewMouseParms[ MOUSE_SPEED_FACTOR ] = 1;		// 0 = disabled, 1 = threshold 1 enabled, 2 = threshold 2 enabled

	m_fMouseParmsValid	= false;
	m_fJoystickAdvancedInit = false;
	m_fHadJoysticks = false;
	m_flLastForwardMove = 0.0;

	// Initialize inputs
	if ( IsPC() )
	{
		Init_Mouse ();
		Init_Keyboard();
	}
		
	// Initialize third person camera controls.
	Init_Camera();
}
Example #2
0
/**
 * @brief  Ö÷º¯Êý
 * @param  ÎÞ
 * @retval ÎÞ
 */
int main(void)
{
    uint16_t Buf[10], i;

    delay_init(72);
    /* USART1 config 9600 8-N-1 */
    USART1_Config();

    Init_Mouse();

    for(;;)
    {
        if(PS2_Status&0x80)
        {
            Mouse_Data_Pro();
            PS2_Status=MOUSE;
            printf("X = %d Y = %d    \r", MouseX.x_pos,  MouseX.y_pos);
            PS2_En_Data_Report();

        }
        else if(PS2_Status&0x40)
        {
            PS2_Status=MOUSE;
        }

        delay_ms(1);

    }
}
Example #3
0
/*
============
Init_All
============
*/
void CInput::Init_All (void)
{
	Assert( !m_pCommands );
	m_pCommands = new CUserCmd[ MULTIPLAYER_BACKUP ];
	m_pVerifiedCommands = new CVerifiedUserCmd[ MULTIPLAYER_BACKUP ];

	m_fMouseInitialized	= false;
	m_fRestoreSPI		= false;
	m_fMouseActive		= false;
	m_fCameraInterceptingMouse = false;
	Q_memset( m_rgOrigMouseParms, 0, sizeof( m_rgOrigMouseParms ) );
	Q_memset( m_rgNewMouseParms, 0, sizeof( m_rgNewMouseParms ) );
	Q_memset( m_rgCheckMouseParam, 0, sizeof( m_rgCheckMouseParam ) );

	m_rgNewMouseParms[ MOUSE_ACCEL_THRESHHOLD1 ] = 0; // no 2x
	m_rgNewMouseParms[ MOUSE_ACCEL_THRESHHOLD2 ] = 0; // no 4x
	m_rgNewMouseParms[ MOUSE_SPEED_FACTOR ] = 1; // slowest (10 default, 20 max)

	m_fMouseParmsValid	= false;
	m_fJoystickAdvancedInit = false;
	m_flLastForwardMove = 0.0;

	// Initialize inputs
	if ( IsPC() )
	{
		Init_Mouse ();
		Init_Keyboard();
	}
}
Example #4
0
File: start.c Project: caisan/mytos
void cinit()
{
	ticks=0;
	position=800;
	startposition=0;
	mouse_x=0;
	mouse_y=0;
	mouse_state=0;
	NR_user=0;
	NR_task=0;
	Disp_Machine_Info();
//	Init_Paging();
	Init_Mem();
	disp_str("Initializing Memory........\n");
	Init_IRQ();	
	disp_str("Enable IRQ........\n");
	Init_Prot();
	disp_str("Enable protection........\n");
	Init_Mouse();
	Init_Keyboard();
	disp_str("Enable Keyboard........\n");
	Init_Process();
	disp_str("Initializing Process........\n");
	Init_Clock();
	disp_str("Enable PIT........\n");
	Init_x87_FPU();
	Update_Cursor(position);
	Init_VM8086();
//	Init_Ne2k();

}
Example #5
0
 int main(void)
 { 
	u8 t;
	u8 errcnt=0;		
	delay_init();	    	 //延时函数初始化	
  NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2);// 设置中断优先级分组2
	uart_init(9600);	 	//串口初始化为9600
	LED_Init();		  		//初始化与LED连接的硬件接口
	LCD_Init();			   	//初始化LCD   
 	POINT_COLOR=RED;//设置字体为红色 
	LCD_ShowString(60,50,200,16,16,"Mini STM32");	
	LCD_ShowString(60,70,200,16,16,"Mouse TEST");	
	LCD_ShowString(60,90,200,16,16,"ATOM@ALIENTEK");
	LCD_ShowString(60,110,200,16,16,"2014/3/12");		  
 	while(Init_Mouse())	//检查鼠标是否在位.	
	{
		LCD_ShowString(60,130,200,16,16,"Mouse Error");
		delay_ms(400);
		LCD_Fill(60,130,239,130+16,WHITE);	 
		delay_ms(100);
	}								   
	LCD_ShowString(60,130,200,16,16,"Mouse OK");
 	LCD_ShowString(60,150,200,16,16,"Mouse ID:");
 	LCD_ShowNum(132,150,MOUSE_ID,3,16);//填充模式

	POINT_COLOR=BLUE;
 	LCD_ShowString(30,170,200,16,16,"BUF[0]:");
	LCD_ShowString(30,186,200,16,16,"BUF[1]:");
	LCD_ShowString(30,202,200,16,16,"BUF[2]:"); 
	if(MOUSE_ID==3)LCD_ShowString(30,218,200,16,16,"BUF[3]:"); 

	LCD_ShowString(90+30,170,200,16,16,"X  POS:");
	LCD_ShowString(90+30,186,200,16,16,"Y  POS:");
	LCD_ShowString(90+30,202,200,16,16,"Z  POS:"); 
	if(MOUSE_ID==3)LCD_ShowString(90+30,218,200,16,16,"BUTTON:"); 
	t=0;
	while(1)
	{
		if(PS2_Status&0x80)//得到了一次数据
		{		  
			LCD_ShowNum(56+30,170,PS2_DATA_BUF[0],3,16);//填充模式
			LCD_ShowNum(56+30,186,PS2_DATA_BUF[1],3,16);//填充模式
			LCD_ShowNum(56+30,202,PS2_DATA_BUF[2],3,16);//填充模式
			if(MOUSE_ID==3)LCD_ShowNum(56+30,218,PS2_DATA_BUF[3],3,16);//填充模式

			Mouse_Data_Pro();//处理数据

			Mouse_Show_Pos(146+30,170,MouseX.x_pos);				//X坐标
			Mouse_Show_Pos(146+30,186,MouseX.y_pos);				//Y坐标
			if(MOUSE_ID==3)Mouse_Show_Pos(146+30,202,MouseX.z_pos);	//滚轮位置

		    if(MouseX.bt_mask&0x01)LCD_ShowString(146+30,218,200,16,16,"LEFT"); 
			else LCD_ShowString(146+30,218,200,16,16,"    "); 
		    if(MouseX.bt_mask&0x02)LCD_ShowString(146+30,234,200,16,16,"RIGHT"); 
			else LCD_ShowString(146+30,234,200,16,16,"     "); 				    
			if(MouseX.bt_mask&0x04)LCD_ShowString(146+30,250,200,16,16,"MIDDLE"); 
			else LCD_ShowString(146+30,250,200,16,16,"      ");   		 
			PS2_Status=MOUSE;
			PS2_En_Data_Report();//使能数据报告
		}else if(PS2_Status&0x40)
		{
			errcnt++;
			PS2_Status=MOUSE;
			LCD_ShowNum(86+30,234,errcnt,3,16);//填充模式
		}
		t++;
		delay_ms(1);
		if(t==200)
		{
			t=0;
			LED0=!LED0;
		}
	} 
}