Пример #1
0
/**************************************************************
        Инициализация дисплея  
        void InitDisplay(void)
***************************************************************/
void InitDisplay(void)
{
  InitDataPortsOut();
  
  RES_out;
  E_WR_out;
  K_out;
  RES_0;
  RD_WR_out;
  K_0;
  
  FunctionSet(1,1,0);
  ClearDisplay();
  EntryModeSet(1,0);
  DisplayONOFControlBit(1,0,0);
  ClearDisplay();
  CursorOrDisplayShift(0,1);  
  OUT1("ПРОШИВКА");
  OUT2("ЗАПУЩЕНА...");
  
  /*
  SetDDRAMAddress(0x00);//В начало первой строки
  WriteDataToRam('0');
  WriteDataToRam('1');
  WriteDataToRam('2');
  WriteDataToRam('3');
  WriteDataToRam('4');
  WriteDataToRam('5');
  WriteDataToRam('6');
  WriteDataToRam('7');
  WriteDataToRam('8');
  WriteDataToRam('9');
  WriteDataToRam('A');
  WriteDataToRam('B');
  WriteDataToRam('C');
  WriteDataToRam('D');
  WriteDataToRam('E');
  WriteDataToRam('F');
  SetDDRAMAddress(0x40);//В начало второй строки
  WriteDataToRam('0');
  WriteDataToRam('1');
  WriteDataToRam('2');
  WriteDataToRam('3');
  WriteDataToRam('4');
  WriteDataToRam('5');
  WriteDataToRam('6');
  WriteDataToRam('7');
  WriteDataToRam('8');
  WriteDataToRam('9');
  WriteDataToRam('A');
  WriteDataToRam('B');
  WriteDataToRam('C');
  WriteDataToRam('D');
  WriteDataToRam('E');
  WriteDataToRam('F');*/
}
void CDBPickView::Stop()
	{
	ScreenBitmapCriticalSection.Lock();
	ClearWaveformInfo();
	ScreenBitmapCriticalSection.Unlock();
	ClearDisplay();
	}
Пример #3
0
void LCDDisplay::ResetSequence()
{
	// Send Reset function to init 4-bit interface
	// Table 12 from HD44780U spec

	Send4BitInstruction(b0011);
	Sleep(4);
	Send4BitInstruction(b0011);
	Send4BitInstruction(b0011);

	// Function set (Set interface to be 4 bits long.) Interface is 8 bits in length.
	Send4BitInstruction(b0010);

	// Set number of lines and font
	Send4BitInstruction(b0010);
	Send4BitInstruction(b1000);	// NF**

	// Turn on display.  No cursor
	Send4BitInstruction(b0000);
	Send4BitInstruction(b1100);

	// Entry mode set - increment addr by 1, shift cursor by right.
	Send4BitInstruction(b0000);
	Send4BitInstruction(b0110);

	ClearDisplay();
}
Пример #4
0
//==============================================================================================
// FUNCTION: OnRequest
// PURPOSE:  
//
void CMCTeleClientDlg::OnRequest() 
{
   ASSERT(m_hWnd != NULL);

   // pack up serial number and channel data 
   UINT uSerialNum = atoi(m_mctdCurrentState.szSerialNumber);
   UINT uChannelID = m_mctdCurrentState.uChannelID;
   LPARAM lparamSignalIDs = MCTG_Pack700BSignalIDs( uSerialNum,
                                                    uChannelID  );
   ClearDisplay();

   m_bRequestPending = TRUE;

   // post telegraph packet request message
   TRACE1("client(0x%08X): ",  m_hWnd);
   TRACE ("post packet request message\n");
   if( !::PostMessage( HWND_BROADCAST,
                       s_uMCTGRequestMessage,
                       (WPARAM) m_hWnd,
                       lparamSignalIDs        ) )
   {
      ASSERT(FALSE);
      AfxMessageBox("Failed to request telegraph packet!");
   }

   // set a timer event for the request timeout
   UINT uRetVal = SetTimer( s_cuRequestTimerEventID,
                            s_cuRequestTimerInterval,
                           (TIMERPROC) NULL              );	
   ASSERT( uRetVal != 0 );
   
   // the window procedure will handle the rest
}
Пример #5
0
/*
* ��גמה םא ‎ךנאם םאסענמיךט "���������� �������"
*/
void print_level3_tuning_packages(void){
  unsigned char temp[LEN];
  ClearDisplay();
  OUT1(kolvo_pkts);
  itoa(tuned_packages, temp);
  OUT2_mod(temp);
}
Пример #6
0
/*
* ��גמה םא ‎ךנאם םאסענמיךט "����������� ����������� �������"
*/
void print_level3_tuning_heat_transv(void){
  unsigned char temp[LEN];
  ClearDisplay();
  OUT1(pop_nagrev);
  itoa(tuned_heat_transv, temp);
  OUT2_mod(temp);
}
Пример #7
0
static short QL_memory(void)
{	short j;

	j=AllocateMemory();
	if(j!=0) return j;
	RTOP=131072l+(long)qc.ram*1024;
	ramTop=(w32*)((Ptr)theROM+RTOP);

/* codici RamMap: 1=ROM 3=RAM 7=VIDEO 8=HW 0=niente
	ovvero:	bit 0=read permission
			bit 1=write permission
			bit 2=video memory
			bit 3=hardware register
			bit 6=hardware expansion (unused)
*/
	for(j=5;j<128;j++) RamMap[j]=0;		/* empty	*/
	RamMap[0]=RamMap[1]=1;          	/* QL ROM	*/
	RamMap[2]=1;				/* hidden emulator add-on */
	RamMap[3]=8;     			/* QL I/O	*/
	RamMap[4]=7;				/* QL video buffer */
	for(j=5;j<(RTOP>>15);j++) RamMap[j]=3;		/* QL RAM */

	ClearDisplay();

	return 0;
}
Пример #8
0
/*
* ��גמה םא ‎ךנאם םאסענמיךט "����������� ����������� �������"
*/
void print_level3_tuning_heat_long(void){
  unsigned char temp[LEN];
  ClearDisplay();
  OUT1(prod_nagrev);
  itoa(tuned_heat_long, temp);
  OUT2_mod(temp);
}
Пример #9
0
// Destructor
CMainWnd::~CMainWnd()
{
	// Delete the Pointer to the Main Window
	delete this;

	// Free the Global Regional DIBs
	ClearDisplay(m_hWnd);
}
Пример #10
0
// An area of the screen/image needs to be redrawn.
// Called from the MHEG engine.
// We always redraw the whole scene.
void MHIContext::RequireRedraw(const QRegion &)
{
    m_display_lock.lock();
    ClearDisplay();
    m_display_lock.unlock();
    // Always redraw the whole screen
    m_engine->DrawDisplay(QRegion(0, 0, StdDisplayWidth, StdDisplayHeight));
    m_updated = true;
}
Пример #11
0
MHIContext::~MHIContext()
{
    StopEngine();
    delete(m_engine);
    delete(m_dsmcc);
    if (m_face_loaded) FT_Done_Face(m_face);

    ClearDisplay();
    ClearQueue();
}
Пример #12
0
/*
 * ��גמה םא ‎ךנאם ןונגמדמ ןףםךעא  לום‏
 */
void print_level3_menu() {
  ClearDisplay();
  OUT1( blokirovka );
  if ( settingsState.stateword.a0 == 1 ) {
    OUT2( "[���.] ����." );
  }
  else {
    OUT2( "���. [����.]" );
  }

}
Пример #13
0
// Handle WM_COMMAND
void CMainWnd::OnCommand(HWND hWnd,int iId,HWND hWndCtl,UINT iCodeNotify)
{
	if (iId == IDM_EXIT)
	{
		// Terminate the Thread
		if (hThread)
		{
			// Close the Listener Socket
			closesocket(Listen);

			// Do Socket Cleanup
			WSACleanup();
		}

		// Quit the Program
		PostQuitMessage(0);
	}
	else if (iId == IDM_STARTSERVER)
	{
		// Minimize the Window
		ShowWindow(hWnd,SW_MINIMIZE);

		// Cause a WM_PAINT
		RedrawWindow(hWnd,NULL,NULL,RDW_ERASE|RDW_INVALIDATE);

		// Start the Server as a new Thread
		hThread = CreateThread(NULL,0,LoadWinsock,(LPVOID)NULL,0,&dwThreadId);
		if (hThread == NULL)
			MessageBox(hWnd,"Failed to Create Socket Thread","Remote Control Server",MB_ICONEXCLAMATION|MB_OK);
		else
		{
			// Initialize the Display Variables
			InitDisplay(hWnd);
			hServerWnd = hWnd;
			EnableMenuItem(m_hMenu,IDM_STARTSERVER,MF_BYCOMMAND|MF_GRAYED);
			EnableMenuItem(m_hMenu,IDM_STOPSERVER,MF_BYCOMMAND|MF_ENABLED);
		}
	}
	else if (iId == IDM_STOPSERVER)
	{
		EnableMenuItem(m_hMenu,IDM_STARTSERVER,MF_BYCOMMAND|MF_ENABLED);
		EnableMenuItem(m_hMenu,IDM_STOPSERVER,MF_BYCOMMAND|MF_GRAYED);

		// Clear the Display Variables
		ClearDisplay(hWnd);

		// Terminate the Thread
		if (hThread)
		{
			// Close the Listener Socket
			closesocket(Listen);
		}
	}
}
Пример #14
0
int main(void)
	{
	static struct {int a[8], b[8], sum ; } testcase[] =
		{
		{{0,0,0,0,0,0,0,1},{0,0,0,0,0,0,0,1},0},
		{{1,1,1,1,1,1,1,1},{1,0,0,0,0,0,0,0},0},
		{{1,0,1,0,1,0,1,0},{1,0,1,0,1,0,1,0},-86},
		{{1,1,0,1,0,0,0,0},{0,1,1,0,1,1,1,1},1},
		{{1,0,1,0,1,0,1,0},{0,1,0,1,0,1,0,1},-1}
		} ;
	int k ;

	InitializeHardware(HEADER, PROJECT_NAME) ;

	for (;;)
		{
		for (k = 0; k < ENTRIES(testcase); k++)
			{
			int *a = testcase[k].a ;
			int *b = testcase[k].b ;
			int sum[8] ;
			uint32_t before, after, cycles ;

			printf(" Test Case %d: ", k+1) ;
			PrintBits(a) ;
			printf("+") ;
			PrintBits(b) ;
			printf("\n") ;

			printf("   Correct Sum: ") ;
			PrintByte(testcase[k].sum) ;
			printf("\n") ;

            before = GetClockCycleCount() ;
			AddBinary(a, b, sum) ;
            after  = GetClockCycleCount() ;
            cycles = after - before ;

			printf("      Your Sum: ") ;
			if (PrintBits(sum) != (uint8_t) testcase[k].sum) printf(" %s", ERROR_FLAG) ;
			printf("\n") ;
			printf("  Clock Cycles: %lu\n", cycles) ;

			printf("\n") ;

			WaitForPushButton() ;
			}

		printf("Press button to start over.\n") ;
		WaitForPushButton() ;
		ClearDisplay() ;
		}
	}
Пример #15
0
/*******************************************MAIN PROGRAM*******************************************/
int main() {
	init();
	SetDisplay();								// Setup the display
	ClearDisplay();
	while (1) {
		_delay_ms(60); 							// To allow sufficient time between queries (60ms min)

		PORTC |= (1<<PC4);						// Set trigger high
		_delay_us(10);							// for 10uS
		PORTC &= ~(1<<PC4);						// to trigger the ultrasonic module
	}
}
void ElementStyleCache::Clear()
{
	ClearBorder();
	ClearMargin();
	ClearPadding();
	ClearDimensions();
	ClearOverflow();
	ClearPosition();
	ClearFloat();
	ClearDisplay();
	ClearWhitespace();
}
int main(void)
	{
	static struct
		{
		uint32_t	word ;
		int			lsb ;
		int			width ;
		uint32_t	value ;
		} testcase[] =
		{
		{0xFFFFFFFF,  5, 7,  0},
		{0x00000000, 22, 5, -1}
		} ;
	int k ;

	InitializeHardware(HEADER, PROJECT_NAME) ;

	for (;;)
		{
		for (k = 0; k < ENTRIES(testcase); k++)
			{
			uint32_t	word	= testcase[k].word ;
			int			lsb		= testcase[k].lsb ;
			int			width	= testcase[k].width ;
			uint32_t	value	= testcase[k].value ;
			uint32_t	result, answer	= BFI(word, lsb, width, value) ;
			uint32_t    before, after, cycles ;

            before = GetClockCycleCount() ;
			result = BitFieldInsert(word, lsb, width, value) ;
            after  = GetClockCycleCount() ;
            cycles = after - before ;

			printf("   Test Case %d: %08X,%d,%d,%d\n", k+1,
				(unsigned) word, lsb, width, (int) value) ;

			printf("Correct Result: %08X\n", (unsigned) answer) ;

			printf("   Your Result: %08X", (unsigned) result) ;
			if (result != answer) printf(" %s", ERROR_FLAG) ;
			printf("\n") ;

			printf("  Clock Cycles: %lu\n\n", cycles) ;

			WaitForPushButton() ;
			}

		printf("Press button to start over.\n") ;
		WaitForPushButton() ;
		ClearDisplay() ;
		}
	}
Пример #18
0
BOOL cGraphics::Clear(long Color, float ZBuffer)
{
  if(m_pD3DDevice == NULL)
    return FALSE;

  // Only clear screen if no zbuffer
  if(m_ZBuffer == FALSE)
    return ClearDisplay(Color);

  // Clear display and zbuffer
  if(FAILED(m_pD3DDevice->Clear(0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, Color, ZBuffer, 0)))
    return FALSE;

  return TRUE; 
}
Пример #19
0
void LoadBoard(char *loadfile)
{
   FILE *load;
   SAVERESTORE *Restore;

   Restore = new SAVERESTORE;

   if (!Restore)
      {
      MessageBox(hWndMain, "Not enough memory to perform operation",
         "OWL Chess", MB_OK | MB_ICONHAND);
      return;
      }

    if ((load = fopen(loadfile, "rb")) == NULL)
        Error("File not found");
    else
    {
        fread(Restore, sizeof(SAVERESTORE), 1, load);
        fread(Board, sizeof(Board), 1, load);
        fclose(load);
        Player = Restore->Player;
        Opponent = Restore->Opponent;
        ProgramColor = Restore->ProgramColor;
        Turned = Restore->Turned;
        MultiMove = Restore->MultiMove;
        AutoPlay = Restore->AutoPlay;
        SingleStep = Restore->SingleStep;
        Level = Restore->Level;
        AverageTime = Restore->AverageTime;
        MaxLevel = Restore->MaxLevel;
        MoveNo = Restore->MoveNo;
        ChessClock.totaltime = Restore->ChessClockTotalTime;
        ChessTime[black].totaltime = Restore->BlackTotalTime ;
        ChessTime[white].totaltime = Restore->WhiteTotalTime;
        memcpy(PieceValue, Restore->PieceValue, 7 * sizeof(int));
        ClearDisplay();
        InitDisplay();
        InvalidateRect(hWndMain, NULL, TRUE);
        PrintCurLevel();
        ResetNewPos();
    }
   delete Restore;
}
int main(void)
    {
	static uint32_t testcase[] =
		{
		0x12345678,	0x0000FFFF,	0x00FF00FF
		} ;

	InitializeHardware(HEADER, PROJECT_NAME) ;

	for (;;)
		{
		int k ;

		for (k = 0; k < ENTRIES(testcase); k++)
			{
			uint32_t word = testcase[k] ;
			uint32_t result, answer = REV(word) ;
			uint32_t before, after, cycles ;

            before = GetClockCycleCount() ;
			result = ReverseByteOrder(word) ;
            after  = GetClockCycleCount() ;
            cycles = after - before ;

			printf("   Test Case %d: %08X (hex)\n", k+1, (unsigned) word) ;

			printf("Correct Result: %08X\n", (unsigned) answer) ;

			printf("   Your Result: %08X", (unsigned) result) ;
			if (result != answer) printf(" %s", ERROR_FLAG) ;
			printf("\n") ;

			printf("  Clock Cycles: %lu\n\n", cycles) ;

			WaitForPushButton() ;
			}

		printf("Press button to start over.\n") ;
		WaitForPushButton() ;
		ClearDisplay() ;
		}
    }
Пример #21
0
//==============================================================================================
// FUNCTION: OnInitDialog
// PURPOSE:  
//
BOOL CMCTeleClientDlg::OnInitDialog()
{
	CDialog::OnInitDialog();

	// Set the icon for this dialog.  The framework does this automatically
	//  when the application's main window is not a dialog
	SetIcon(m_hIcon, TRUE);			// Set big icon
	SetIcon(m_hIcon, FALSE);		// Set small icon
	

   // initialize combo box selections
   int nRetVal = 0;

   // serial num init
   m_cbxSerialNum.ResetContent();
   m_cbxSerialNum.AddString( s_cszNoDevice );
   m_cbxSerialNum.SetItemData( m_cbxSerialNum.GetCurSel(), s_cdwNoDevice );
   m_cbxSerialNum.EnableWindow( FALSE );
   m_cbxSerialNum.SetCurSel( 0 );

   // -1 ( channel IDs start with 1 )
   nRetVal = m_cbxChannel.SetCurSel(m_mctdCurrentState.uChannelID - 1);
   ASSERT(nRetVal != CB_ERR);

   // -1 ( no device selection)
   m_lbxDeviceList.ResetContent();

   ClearDisplay();

   // get the file version
   char pszFileVer[128];
   GetFileVersion(pszFileVer, sizeof(pszFileVer));
   
   // create dialog title
   char pszTitle[128];
   sprintf(pszTitle, "MultiClamp Telegraph Client %s", pszFileVer);
   SetWindowText(pszTitle);

	return TRUE;  // return TRUE  unless you set the focus to a control
}
Пример #22
0
void MHIContext::NetworkBootRequested(void)
{
    QMutexLocker locker(&m_dsmccLock);
    if (m_nbiData.size() >= 2 && m_nbiData[0] != m_lastNbiVersion)
    {
        m_lastNbiVersion = m_nbiData[0]; // Update the saved version
        switch (m_nbiData[1])
        {
        case 1:
            m_dsmcc->Reset();
            m_engine->SetBooting();
            ClearDisplay();
            m_updated = true;
            break;
        case 2:
            m_engine->EngineEvent(9); // NetworkBootInfo EngineEvent
            break;
        default:
            LOG(VB_MHEG, LOG_INFO, QString("[mhi] Unknown NetworkBoot type %1")
                .arg(m_nbiData[1]));
            break;
        }
    }
}
Пример #23
0
void Op_00E0(Display* disp)
{
	ClearDisplay(disp);
}
Пример #24
0
void ezioEmulator::OnEventInput(struct ezioEventInput *input)
{
	char *text;
	switch (input->cmd) {
	case EZIO_TEXT:
		text = new char[input->length + 1];
		memset(text, 0, input->length + 1);
		memcpy(text, (char *)input->data, input->length);
		printf("text len %d: \"%s\"\n", input->length, text);
		delete [] text;

		memcpy(display, input->data,
			(input->length > display_size) ? display_size : input->length);
		UpdateDisplay();
		break;
	case EZIO_CLEAR:
		printf("clear\n");
		ClearDisplay();
		break;
	case EZIO_HOME:
		printf("home\n");
		cp = 0;
		UpdateDisplay(0);
		break;
	case EZIO_BLANK:
		printf("blank\n");
		cvis = false;
		break;
	case EZIO_HIDE:
		printf("hide\n");
		cvis = false;
		UpdateDisplay(0);
		break;
	case EZIO_SHOW_BLOCK:
		printf("show block\n");
		cvis = true;
		ct = EZIO_CT_BLOCK;
		UpdateDisplay(0);
		break;
	case EZIO_SHOW_USCORE:
		printf("show underscore\n");
		cvis = true;
		ct = EZIO_CT_USCORE;
		UpdateDisplay(0);
		break;
	case EZIO_MOVE_LEFT:
		printf("move cursor left\n");
		if (cp > 0) cp--;
		if (cvis) UpdateDisplay(0);
		break;
	case EZIO_MOVE_RIGHT:
		printf("move cursor right\n");
		if (cp < device->GetCharactersPerLine() - 1) cp++;
		if (cvis)
		if (cvis) UpdateDisplay(0);
		break;
	case EZIO_SCROLL_LEFT:
		sd--;
		printf("scroll delta: %d\n", sd);
		UpdateDisplay(0);
		break;
	case EZIO_SCROLL_RIGHT:
		sd++;
		printf("scroll delta: %d\n", sd);
		UpdateDisplay(0);
		break;
	case EZIO_INIT:
		printf("init\n");
		cvis = false; cp = sd = 0;
		ClearDisplay();
		break;
	case EZIO_STOP:
		printf("stop\n");
		break;
	case EZIO_MOVE_ROW1:
		cp = device->GetCharactersPerLine() + input->param;
		printf("move row1: %u, cp: %d\n", input->param, cp);
		if (cvis) UpdateDisplay(0);
		break;
	case EZIO_MOVE_ROW0:
		cp = input->param;
		printf("move row0: %u, cp: %d\n", input->param, cp);
		if (cvis) UpdateDisplay(0);
		break;
	default:
		printf("unhandled cmd: %02x, length: %d\n",
			(Uint8)input->cmd, input->length);
		throw ezioException(EZIOEX_EMUL_UNHANDLED_CMD);
	}
}
Пример #25
0
//==============================================================================================
// FUNCTION: OnConnect
// PURPOSE:  
//
void CMCTeleClientDlg::OnConnect() 
{
   ASSERT(m_hWnd != NULL);

   // pack up serial number and channel data 
   UINT uSerialNum = atoi(m_mctdCurrentState.szSerialNumber);
   UINT uChannelID = m_mctdCurrentState.uChannelID;
   LPARAM lparamSignalIDs = MCTG_Pack700BSignalIDs( uSerialNum,
                                                    uChannelID  );
   if( m_bIsConnected )
   {
      // we are already connected
      // this is a request to disconnect

      // post telegraph close message
      TRACE1("client(0x%08X): ",  m_hWnd);
      TRACE ("post close message\n");
      if( !::PostMessage( HWND_BROADCAST,
                          s_uMCTGCloseMessage,
                          (WPARAM) m_hWnd,
                          lparamSignalIDs      ) )
      {
         ASSERT(FALSE);
         AfxMessageBox("Failed to close connection!");
      }

      m_bIsConnected = FALSE;
      m_btnScan.EnableWindow( TRUE );
      ClearDisplay();
   }
   else
   {
      // we are not connected
      // this is a request to connect
      m_bIsConnecting = TRUE;

      // post telegraph open message
      TRACE1("client(0x%08X): ",  m_hWnd);
      TRACE ("post open message\n");
      if( !::PostMessage( HWND_BROADCAST,
                          s_uMCTGOpenMessage,
                          (WPARAM) m_hWnd,
                          lparamSignalIDs     ) )
      {
         ASSERT(FALSE);
         m_bIsConnecting = FALSE;
         m_btnScan.EnableWindow( TRUE );
         AfxMessageBox("Failed to open connection!");
      }

      // set a timer event for the connection timeout
      UINT uRetVal = SetTimer( s_cuConnectionTimerEventID,
                               s_cuConnectionTimerInterval,
                              (TIMERPROC) NULL              );	
      ASSERT( uRetVal != 0 );
      m_btnScan.EnableWindow( FALSE );
      
      // the window procedure will handle the rest
   }

}
/** Missions() will draw the future missions among other things
 * 
 * \param plr Player
 * \param X screen coord for mission name string
 * \param Y screen coord for mission name string
 * \param val mission number
 * \param bub if set to 0 or 3 the function will not draw stuff
 */
void Missions(char plr,int X,int Y,int val,char bub)
{
  TRACE5("->Missions(plr, X %d, Y %d, val %d, bub %c)", X, Y, val, bub);
  
  if (bub==1 || bub==3) {
    PianoKey(val);
    Bub_Count=0;   // set the initial bub_count
    ClearDisplay();
    RectFill(6,31,182,46,3);
    RectFill(80,25,175,30,3);grSetColor(5);
    PrintAt(55,30,"TYPE: ");DispNum(0,0,val);
    grSetColor(5);
    if (V[val].E>0) {
      if (F5 > V[val].E && Mis.Dur==1) DurPri(F5);
	     else DurPri(V[val].E);}
	      else DurPri(F5);
  } else grSetColor(1);
  MissionName(val,X,Y,24);
  if (bub==3) GetMinus(plr);
  if (bub==0 || bub==3) {return;}
  
    
	MSteps=sOpen("missSteps.dat","r",FT_DATA);
	if (fgets(missStep, 1024, MSteps) == NULL)
		memset (missStep, 0, sizeof missStep);

	while (!feof(MSteps)&&((missStep[0]-0x30)*10+(missStep[1]-0x30))!=val) {
		if (fgets(missStep, 1024, MSteps) == NULL)
			break;
	}
	fclose(MSteps);

  int n;
	for (n=2;missStep[n]!='Z';n++)
		switch (missStep[n]) {
			case 'A': Draw_IJ	(B_Mis(++n));	break;
			case 'B': Draw_IJV	(B_Mis(++n));	break;
			case 'C': OrbOut	(B_Mis(n+1),B_Mis(n+2),B_Mis(n+3));	n+=3;	break;
			case 'D': LefEarth	(B_Mis(n+1),B_Mis(n+2));	n+=2; 	break;
			case 'E': OrbIn		(B_Mis(n+1),B_Mis(n+2),B_Mis(n+3));	n+=3; 	break;
			case 'F': OrbMid	(B_Mis(n+1),B_Mis(n+2),B_Mis(n+3),B_Mis(n+4));	n+=4;	break;
			case 'G': LefOrb	(B_Mis(n+1),B_Mis(n+2),B_Mis(n+3),B_Mis(n+4));	n+=4;	break;
			case 'H': Draw_LowS	(B_Mis(n+1),B_Mis(n+2),B_Mis(n+3),B_Mis(n+4),B_Mis(n+5),B_Mis(n+6));	n+=6;	break;
			case 'I': Fly_By	();		break;
			case 'J': VenMarMerc	(B_Mis(++n));	break;
			case 'K': Draw_PQR	();		break;
			case 'L': Draw_PST	();		break;
			case 'M': Draw_GH	(B_Mis(n+1),B_Mis(n+2));	n+=2;	break;
			case 'N': Q_Patch	();		break;
			case 'O': RghtMoon	(B_Mis(n+1),B_Mis(n+2));	n+=2; 	break;
			case 'P': DrawLunPas	(B_Mis(n+1),B_Mis(n+2),B_Mis(n+3),B_Mis(n+4));	n+=4;	break;
			case 'Q': DrawLefMoon	(B_Mis(n+1),B_Mis(n+2)); 	n+=2;	break;
			case 'R': DrawSTUV	(B_Mis(n+1),B_Mis(n+2),B_Mis(n+3),B_Mis(n+4));	n+=4;	break;
			case 'S': Draw_HighS	(B_Mis(n+1),B_Mis(n+2),B_Mis(n+3));	n+=3;	break;
			case 'T': DrawMoon	(B_Mis(n+1),B_Mis(n+2),B_Mis(n+3),B_Mis(n+4),B_Mis(n+5),B_Mis(n+6),B_Mis(n+7));	n+=7;	break;
			case 'U': LefGap	(B_Mis(++n));	break;
			case 'V': S_Patch	(B_Mis(++n));	break;
			case 'W': DrawZ		();		break;
			default : break;
		}
  gr_sync ();
  MissionCodes(plr,MisType,Pad);
  TRACE1("<-Missions()");
}  // end function missions
Пример #27
0
    int main(void)
    {
    DDRA=0xff;


    DDRB=0xb3;
	PORTB |= 0xff;// Control UAB

    DDRC=0xfc;
    PORTC |=0xff;/*VT3=off*/

    DDRD=0xbf;
    PORTD=0xff;/*imp=off,Reset=off*/
//    PORTD=0xef;/*Reset=on*/
	ICR1=200;//20KH
    TCCR1A=0xb2;
    TCCR1B=0x11;
	Alfa=(ICR1>>1)-80;//-24;

	LoadAlfaStart();

 	/*InitCpi*/

	TCCR0=5;// /1024
 	TIMSK |=0x1;//enable int overlow T0
	ASSR=0;
	SPCR=0x70;//0x73;
//SPDR=0x55;
    Test=1;
	SPCR |=0x80;


 	SPDR=0;//RegSPI;

        //INIT TWI;
        TWBR=0x7f;//F TWI
    TWAR=(NumberLink<<1)+4;   
   TWCR =(1<<TWEA)|(1<<TWEN);

    CtStart=200;
	while(CtStart--)	_WDR();

	LoadRegInd(); 
	CtSetka=0;
	CtByteAnod=0;
	LoadRegSPI(CtSetka,CtByteAnod);
	CtErrorLink[0]=CtErrorLink0[0];
	CtErrorLink[1]=CtErrorLink0[1];
	Error=0;
	NumberIndicator=2;
    _SEI();

 	ClearDisplay();
	RomReceive[1]=2;    
  /*Work program*/     	 
    while(1)
	    {
    _WDR();
	ReadKn();
	if(!RomReceive[1])
			{
	IndicatorTest();

			}
	else
			{



//	if(RomReceive[NumberIndicator] !=19)
//	ClearDisplay2();
	switch(RomReceive[NumberIndicator])
				{


	case 1:
	IndOtkazLuk();

	RegInd[15]=0x31;
	break;
	case 2:
	IndOtkazLuk();

	RegInd[15]=0x32;
	break;

	case 3:
	IndGotovDU();
	break;
	case 4:
	IndRabota();
	break;
	case 5:
	IndOtkazLuk();
	RegInd[15]=0x33;
	break;

	case 6:
	IndNoLinkSHU();
	break;
	case 7:
	IndNoLinkMSHU();
	break;
	case 8:
	IndOtkazSHSN();
	break;
	case 9:
	IndRegimMSHU();
	break;

	case 10:
	IndOtkazLuk();

	RegInd[15]=0x34;
	break;
	case 11:
	IndOtkazLuk();

	RegInd[15]=0x35;
	break;

	case 12:
	IndOtkazLukDG();

	RegInd[14]=0x31;
	break;
	case 13:
	IndOtkazLukDG();

	RegInd[14]=0x32;
	break;
	case 14:
	IndOtkazLukLR();

	RegInd[14]=0x31;
	break;
	case 15:
	IndOtkazLukLR();

	RegInd[14]=0x32;
	break;
	case 16:
	IndGotovMU();
	break;
	case 17:
	IndGotovSystem();
	break;
	case 18:
	IndOtkazFVU();
	break;
	case 19:
	IndOtkazLukPCH();
	RegInd[14]=0x31;
	break;
	case 20:
	IndOtkazLukPCH();
	RegInd[14]=0x32;
	break;
	case 21:
	IndOtkazDT();
	break;
	default:
	break;
				}
			}
	if(EnableLoad)
		{
    LoadRegTransmit();
    LoadControlSum();
		}
	if(TWCR & 0x80)
			{

  ReceiveTransmitSlave();

		}

	if(!CtErrorLink[0])//ErrorLink;
			{

//INIT TWI;
    TWBR=0;//F TWI
   TWAR=0;
   TWCR =0;
	TWSR=0xf8;
    CtStart=50;
	while(CtStart--)	_WDR();
    TWBR=0x7f;//F TWI
    TWAR=(NumberLink<<1)+4;
   TWCR =(1<<TWEA)|(1<<TWEN);
 //   TWCR |=(1<<TWINT);
	CtErrorLink[0]=CtErrorLink0[0];

    CtStart=200;
	while(CtStart--)	_WDR();
			}


        }

 
 }
void
CMSourceDirector::Receive
	(
	JBroadcaster*	sender,
	const Message&	message
	)
{
	if (IsMainSourceWindow() &&
		sender == itsLink && message.Is(CMLink::kDebuggerStarted))
		{
		ClearDisplay();
		}
	else if (sender == itsLink && message.Is(CMLink::kPrepareToLoadSymbols))
		{
		if (!itsCurrentFile.IsEmpty())		// reload file, in case it changed
			{
			const JString fileName = itsCurrentFile;
			const JIndex lineIndex = itsText->HasSelection() ?
									 itsText->GetLineForChar(itsText->GetInsertionIndex()) :
									 itsTable->GetCurrentLine();
			itsCurrentFile.Clear();			// force reload
			DisplayFile(fileName, lineIndex);
			}
		}
	else if (IsMainSourceWindow() &&
			 sender == itsLink && message.Is(CMLink::kSymbolsLoaded))
		{
		const CMLink::SymbolsLoaded* info =
			dynamic_cast<const CMLink::SymbolsLoaded*>(&message);
		assert( info != NULL );
		UpdateWindowTitle(info->GetProgramName());
		}
	else if (IsMainSourceWindow() &&
			 sender == itsLink && message.Is(CMLink::kProgramStopped))
		{
		const CMLink::ProgramStopped* info =
			dynamic_cast<const CMLink::ProgramStopped*>(&message);
		assert( info != NULL);
		const CMLocation* loc;
		const JBoolean hasFile = info->GetLocation(&loc);
		if (itsType == kMainSourceType && hasFile)
			{
			DisplayFile(loc->GetFileName(), loc->GetLineNumber());
			}
		else if (itsType == kMainAsmType &&
				 !loc->GetFunctionName().IsEmpty() &&
				 !loc->GetMemoryAddress().IsEmpty())
			{
			DisplayDisassembly(*loc);
			}
		else if (itsType == kMainAsmType)
			{
			// wait for kProgramStopped2
			}
		else
			{
			#ifdef _J_OLD_OSX
			itsTable->SetCurrentLine(0);	// we get blank location the first time
			#else
			ClearDisplay();
			(CMGetCommandDirector())->GetStackDir()->Activate();
			#endif
			}
		}
	else if (itsType == kMainAsmType && sender == itsLink &&
			 message.Is(CMLink::kProgramStopped2))
		{
		const CMLink::ProgramStopped2* info =
			dynamic_cast<const CMLink::ProgramStopped2*>(&message);
		assert( info != NULL);
		const CMLocation* loc;
		info->GetLocation(&loc);
		if (!loc->GetFunctionName().IsEmpty() &&
			!loc->GetMemoryAddress().IsEmpty())
			{
			DisplayDisassembly(*loc);
			}
		else
			{
			ClearDisplay();
			}
		}

	else if (sender == itsLink &&
			 (message.Is(CMLink::kProgramFinished) ||
			  message.Is(CMLink::kCoreCleared)     ||
			  message.Is(CMLink::kDetachedFromProcess)))
		{
		if (itsSrcMainCmd != NULL)
			{
			itsSrcMainCmd->CMCommand::Send();
			}
		else if (itsType == kMainAsmType)
			{
			ClearDisplay();
			}
		}

	else if (sender == itsFileMenu && message.Is(JXMenu::kNeedsUpdate))
		{
		UpdateFileMenu();
		}
	else if (sender == itsFileMenu && message.Is(JXMenu::kItemSelected))
		{
		const JXMenu::ItemSelected* selection =
			dynamic_cast<const JXMenu::ItemSelected*>(&message);
		assert( selection != NULL );
		HandleFileMenu(selection->GetIndex());
		}

	else if (sender == itsDebugMenu && message.Is(JXMenu::kNeedsUpdate))
		{
		itsCommandDir->UpdateDebugMenu(itsDebugMenu, itsText, NULL);
		}
	else if (sender == itsDebugMenu && message.Is(JXMenu::kItemSelected))
		{
		const JXMenu::ItemSelected* selection =
			dynamic_cast<const JXMenu::ItemSelected*>(&message);
		assert( selection != NULL );
		itsCommandDir->HandleDebugMenu(itsDebugMenu, selection->GetIndex(), itsText, NULL);
		}

	else if (sender == itsPrefsMenu && message.Is(JXMenu::kNeedsUpdate))
		{
		UpdatePrefsMenu();
		}
	else if (sender == itsPrefsMenu && message.Is(JXMenu::kItemSelected))
		{
		const JXMenu::ItemSelected* selection =
			dynamic_cast<const JXMenu::ItemSelected*>(&message);
		assert( selection != NULL );
		HandlePrefsMenu(selection->GetIndex());
		}

	else if (sender == itsHelpMenu && message.Is(JXMenu::kItemSelected))
		{
		const JXMenu::ItemSelected* selection =
			dynamic_cast<const JXMenu::ItemSelected*>(&message);
		assert( selection != NULL );
		HandleHelpMenu(selection->GetIndex());
		}

	else if (sender == CMGetPrefsManager() && message.Is(CMPrefsManager::kFileTypesChanged))
		{
		UpdateFileType();
		}
	else if (sender == CMGetPrefsManager() && message.Is(CMPrefsManager::kCustomCommandsChanged))
		{
		itsCommandDir->AdjustDebugMenu(itsDebugMenu);
		}

	else
		{
		JXWindowDirector::Receive(sender,message);
		}
}
Пример #29
0
/*
 * ��גמה םא ‎ךנאם pos םמלונ ןףםךעא לום‏
 */
void print_level3_text_menu_by_position(unsigned char pos) {
  ClearDisplay();
  switch (pos) {
    case 1:
      OUT1( blokirovka );
      if ( settingsState.stateword.a0 == 1 ) {
        OUT2( "[���.] ����." );
      }
      else {
        OUT2( "���. [����.]" );
      }
      break;
    case 2:
      OUT1( product );
      if ( settingsState.stateword.a1 == 1 ) {
        OUT2( "[���.] ����." );
      }
      else {
        OUT2( "���. [����.]" );
      }
      break;
    case 3:
      OUT1( sirena );
      if ( settingsState.stateword.a2 == 1 ) {
        OUT2( "[���.] ����." );
      }
      else {
        OUT2( "���. [����.]" );
      }
      break;
    case 4:
      OUT1( naladka );
      if ( settingsState.stateword.a3 == 1 ) {
        OUT2( "[���.] ����." );
      }
      else {
        OUT2( "���. [����.]" );
      }
      break;
    case 5:
      OUT1( dozator );
      if ( settingsState.stateword.a4 == 1 ) {
        OUT2( "[���.] ����." );
      }
      else {
        OUT2( "���. [����.]" );
      }
      break;
    case 6:
      OUT1( vverh );
      if ( settingsState.stateword.a5 == 1 ) {
        OUT2( "[���.] ����." );
      }
      else {
        OUT2( "���. [����.]" );
      }
      break;
    case 7:
      OUT1( vakuum );
      if ( settingsState.stateword.a6 == 1 ) {
        OUT2( "[���.] ����." );
      }
      else {
        OUT2( "���. [����.]" );
      }
      break;
    case 8:
      OUT1( obduv );
      if ( settingsState.stateword.a7 == 1 ) {
        OUT2( "[���.] ����." );
      }
      else {
        OUT2( "���. [����.]" );
      }
      break;
    case 9:
      OUT1( transporter );
      if ( settingsState.stateword.a8 == 1 ) {
        OUT2( "[���.] ����." );
      }
      else {
        OUT2( "���. [����.]" );
      }
      break;
    case 10:
      OUT1( prijim_pop );
      if ( settingsState.stateword.a9 == 1 ) {
        OUT2( "[���.] ����." );
      }
      else {
        OUT2( "���. [����.]" );
      }
      break;
    case 11:
      OUT1( prijim_prod );
      if ( settingsState.stateword.a10 == 1 ) {
        OUT2( "[���.] ����." );
      }
      else {
        OUT2( "���. [����.]" );
      }
      break;
    case 12:
      OUT1( nagrev_pop );
      if ( settingsState.stateword.a11 == 1 ) {
        OUT2( "[���.] ����." );
      }
      else {
        OUT2( "���. [����.]" );
      }
      break;
    case 13:
      OUT1( nagrev_prod );
      if ( settingsState.stateword.a12 == 1 ) {
        OUT2( "[���.] ����." );
      }
      else {
        OUT2( "���. [����.]" );
      }
      break;
  }
}
Пример #30
0
// Start or restart the MHEG engine.
void MHIContext::Restart(int chanid, int sourceid, bool isLive)
{
    int tuneinfo = m_tuneinfo.isEmpty() ? 0 : m_tuneinfo.takeFirst();

    LOG(VB_MHEG, LOG_INFO,
        QString("[mhi] Restart ch=%1 source=%2 live=%3 tuneinfo=0x%4")
        .arg(chanid).arg(sourceid).arg(isLive).arg(tuneinfo,0,16));

    m_currentSource = sourceid;
    m_currentStream = chanid ? chanid : -1;
    if (!(tuneinfo & kTuneKeepChnl))
        m_currentChannel = m_currentStream;

    if (tuneinfo & kTuneKeepApp)
    {
        // We have tuned to the channel in order to find the streams.
        // Leave the MHEG engine running but restart the DSMCC carousel.
        // This is a bit of a mess but it's the only way to be able to
        // select streams from a different channel.
        if (!m_dsmcc)
            m_dsmcc = new Dsmcc();
        {
            QMutexLocker locker(&m_dsmccLock);
            if (tuneinfo & kTuneCarReset)
                m_dsmcc->Reset();
            ClearQueue();
        }

        if (tuneinfo & (kTuneCarReset|kTuneCarId))
            m_engine->EngineEvent(10); // NonDestructiveTuneOK
    }
    else
    {
        StopEngine();

        m_audioTag = -1;
        m_videoTag = -1;

        if (!m_dsmcc)
            m_dsmcc = new Dsmcc();

        {
            QMutexLocker locker(&m_dsmccLock);
            m_dsmcc->Reset();
            ClearQueue();
        }

        {
            QMutexLocker locker(&m_keyLock);
            m_keyQueue.clear();
        }

        if (!m_engine)
            m_engine = MHCreateEngine(this);

        m_engine->SetBooting();
        ClearDisplay();
        m_updated = true;
        m_stop = false;
        m_isLive = isLive;
        // Don't set the NBI version here.  Restart is called
        // after the PMT is processed.
        m_engineThread = new MThread("MHEG", this);
        m_engineThread->start();
    }
}