Example #1
0
void version_upgrade_alpha_2_1_to_2_2() {
    *var_access(SGM_VER) = VERSION_ALPHA_2_2;
	*var_access(TRAINERSCHOOL_PROGRESS) = 10;
	*var_access(TRAINERSCHOOL_ALLOWED_TO_ENTER_GRASS) = 1;
	*var_access(TRAINERSCHOOL_GOODBYE_CNT) = 3;
	setflag(TRAINERSCHOOL_MAY_INSIDE);
	setflag(TRAINERSCHOOL_BLAISE_INSIDE);
	setflag(TRAINERSCHOOL_FELIX_INSIDE);
	setflag(TRAINERSCHOOL_MAY_OUTSIDE);
	setflag(TRAINERSCHOOL_BLAISE_OUTSIDE);
	setflag(TRAINERSCHOOL_FELIX_OUTSIDE);
	setflag(TRAINERSCHOOL_TALKED_TO_FELIX);
	setflag(TRAINERSCHOOL_FAUN_OUTSIDE);
	setflag(TRAINERSCHOOL_TALKED_TO_BLAISE);
	setflag(ROUTE_1_RIVAL);
	setflag(TRAINERSCHOOL_RIVAL);
	setflag(TRAINERSCHOOL_RIVAL_INSIDE);
	setflag(TRAINERSCHOOL_FAUN_INSIDE);
	setflag(ROUTE_2_FELIX);
    setflag(ROUTE_3_MAY);
    worldmap_flag_state_set(WM_ORINA_CITY);
    worldmap_flag_state_set(WM_AKTANIA);
    worldmap_flag_set(WM_ORINA_CITY);
    worldmap_flag_set(WM_AKTANIA);
	// Pick time system that works
	if (rtc_test()) {
		*var_access(TIME_TYPE) = TIME_TYPE_RTC;
	} else {
		*var_access(TIME_TYPE) = TIME_TYPE_INGAME_CLOCK;
	}
	time_reset_events();
	// Reorder pokedex flags
	version_transfer_pokedex();

	// Pokemon pid structure has changed as well
	// Update the party
	for (int i = 0; i < 6; i++) {
		version_alpha_2_2_fix_pid(&player_pokemon[i]);
		pokemon_calculate_stats(&player_pokemon[i]);
	}
	// Update the boxes
	for (int box_idx = 0; box_idx < 15; box_idx++) {
		for (int idx = 0; idx < 30; idx++) {
			version_alpha_2_2_fix_pid(pokemon_get_by_box(box_idx, idx));
		}
	}

}
/* start the main program */
void main() 
{
   UART_Init(9600);
   UART_TxString("\n\rTest menu Utra x51 v1.1\r\n 1:GPIO Blink\r\n 2:LCD \n\r 3:7-Segment\n\r 4:RTC\n\r 5:EEPROM\n\r 6:ADC\n\r 7:Keypad \n\r Enter option:");
   UART_TxString("\n\rReset the board after test is done");
   mm_option = UART_RxChar();
   while(1)
    {
 	  	switch(mm_option)
		{
		 case '1': gpio_test(); break;
		 case '2': LCD_test(); break;
		 case '3': seg_test(); break;
		 case '4': rtc_test(); break; 
		 case '5': eeprom_test(); break; //eeprom
		 case '6': adc_test(); break;
		 case '7': keypad_test();break;
		 default:break;
		}
	}
}
/* start the main program */
void main() 
{
   UART_Init(9600);
   UART_TxString("\n\rPIC Ultra baord menu v2.0\r\n 1:GPIO Blink\r\n 2:LCD 8-bit \n\r 3:LCD 4-bit\n\r 4:7-Segment\n\r 5:RTC\n\r 6:EEPROM\n\r 7:ADC\n\r 8:Keypad \n\r Enter option:");
   UART_TxString("\n\rReset the board after test is done");
   mm_option = UART_RxChar();
   while(1)
    {
 	  	switch(mm_option)
		{
		 case '1': gpio_test(); break;
		 case '2': LCD_8bit_test(); break;
		 case '3': LCD_4bit_test(); break;
		 case '4': seg_test(); break;
		 case '5': rtc_test(); break;
		 case '6': eeprom_test(); break; //eeprom
		 case '7': adc_test(); break;
		 case '8': keypad_test();break;
		 default:break;
		}
	}
}
Example #4
0
int main(int argc, char **argv)
{
	
	rtc_test(argc, argv);
	return 0;
}