Exemplo n.º 1
0
/***********************************************************************
Main
***********************************************************************/
void main(void) {
  DisableInterrupts;
	initializations(); 		  			 		  		
	EnableInterrupts;
	
	//enables external xirq after vSync IRQ
	vSyncFlag = 0;
	while((vSyncFlag != 1) & (hCnt == 0)) {}	      
  asm andcc #$BF 

//////////////////////////////////////////////////////////////
//;  START OF CODE FOR Spring 2012 MINI-PROJECT
//////////////////////////////////////////////////////////////
  
	// Load/Display Spalsh Screen
	displaySplash();

  for(;;) {
   // write code here (Insert Code down here because we need an infinite loop.)

	// Display Menu Screen
	displayMenu(selection);
	// Check for Menu Selection
	checkMenuInputs(joy0vert);
	// Use case statement to branch to appropriate selection.
	// Don't branch unless the user has triggered the 'select' button.
	if (select == 1)
	{
			select = 0;
			switch (selection)
			{
			// Sub Function
			// Menu:
			case 1:
					//	Select Character
					selectCharacter();
					break;
			case 2:
					//	Select Field
					selectField();
					break;
			case 3:
					//	Start Match
					startMatch();
					break;
			// the default case is '-1' if nothing has been selected
			default:
					break;
			}
	}
    
	 // We don't need the watchdog timer, but I don't think it can hurt to feed it anyway.
	 // The watchdog was disabled in the initialization code.
    _FEED_COP(); /* feeds the dog */
  } /* loop forever */
  /* please make sure that you never leave main */
}
Exemplo n.º 2
0
int main(int argc, const char *argv[]) {
	uint8 i;
	uint8 track[4];
	uint8 player[4];

	// Init system clock & disable WDT
	//
	CLKPR = 0x80;
	CLKPR = 0x00;
	MCUSR &= ~(1 << WDRF);
	wdt_disable();

	srand(12345);

	// Init LCD
	//
	lcdInit();

	for ( ; ; ) {
		if ( PIND & 0x80 ) {
			initSelector(32);
			for ( i = 0; i < 4; i++ ) {
				track[i] = selectItem();
			}
			initSelector(NUM_CHARACTERS);
			for ( i = 0; i < 4; i++ ) {
				player[i] = selectItem();
			}
			lcdSetCursor(0,0);
			for ( i = 0; i < 4; i++ ) {
				lcdPrintFlashString(selectCharacter(player[i]));
				lcdPrintFlashString(selectTrack(track[i]));
			}
			while ( PIND & 0x80 );
		} else {
			lcdClearScreen();
			do {
				rand();
			} while ( !(PIND & 0x80) );
		}
	}
}