Example #1
0
// Function: main()
int main(int argc, char ** argv)
{
	PA_Init();    // Initializes PA_Lib
	PA_InitVBL(); // Initializes a standard VBL
	
	// Initialise the text system on the top screen
	PA_InitText(0,0);
	PA_InitText(1, 0);
	
	PA_OutputText(0, 1, 1, "PA_InitWifi() ...");
    PA_InitWifi();
	PA_OutputText(0, 1, 2, "done!\nPA_ConnectWifiWFC() ...");
    if (!PA_ConnectWifiWFC())
	{
		PA_OutputText(0, 1, 4, "error!");
		return 1;
	}
    PA_OutputText(0, 1, 4, "done!\nWIFI is now ready!");

	while (1)
	{
		PA_WaitForVBL();
	}
	
	return 0;
} // End of main()
Example #2
0
/* ************************************************************************* */
void debug()
{
	PA_OutputSimpleText(1, 0, 0, "Lets go online...");
	PA_InitWifi();
    PA_ConnectWifiWFC();
	
	char* buffer = malloc(256*256);
	PA_GetHTTP(buffer,"http://delfare.pizz.biz/getip.php3");
	PA_OutputSimpleText(1, 0, 1, buffer);
	
	PA_GetHTTP(buffer,"http://deanrather.com/index.php");
	PA_OutputSimpleText(1, 0, 2, buffer);
	
	PA_GetHTTP(buffer,"http://deanrather.com/highscores/");
	PA_OutputSimpleText(1, 0, 3, buffer);
	
	PA_OutputSimpleText(1, 0, 4, "Wow, That was fun!!");
	PA_WaitFor(Pad.Newpress.Start);
}
Example #3
0
void postGame()
{
	PA_PauseMod(1);
	bool submitted = false;
	while(!Pad.Newpress.Start && !Stylus.DblClick && !submitted)
	{
		PA_ClearTextBg(SCREEN_TOP);
		PA_OutputSimpleText(SCREEN_TOP,0,0,"GAME OVER");
		PA_OutputText(SCREEN_TOP,0,1,"YOUR SCORE: %d", game.score);
		
		if(game.score<highscore.points)
		{
			PA_OutputText(SCREEN_TOP,0,2,"%s's High Score: %d", highscore.name, highscore.points);
			PA_OutputSimpleText(SCREEN_TOP,0,4,"Press Start to Play Again");
		}else{
			PA_OutputText(SCREEN_TOP,0,2,"NEW HIGH SCORE!!!");
			highscore.points=game.score;
			highscore.name=(char*)PA_UserInfo.Name;
			PA_OutputSimpleText(SCREEN_TOP,0,3,"Press Y To submit score online.");
			PA_OutputSimpleText(SCREEN_TOP,0,4,"Press Start to Play Again");
			if(Pad.Newpress.Y)
			{
				PA_OutputSimpleText(SCREEN_TOP,0,5,"Ranking globally...");
				
				// Init Network
				PA_InitWifi();
			    if(PA_ConnectWifiWFC())
			    {
			    	submitScore();
					getHighScores();
					submitted=true;
					Wifi_DisconnectAP();
			    }else{
			    	PA_OutputSimpleText(SCREEN_TOP,0,6,"Wifi Connection Failed.");
			    }
				Wifi_DisableWifi();
			}
		}
		// Sleep
		PA_CheckLid();
		PA_WaitForVBL();
	}
}
Example #4
0
int main(int argc, char ** argv)
{
	PA_Init();    // Initializes PA_Lib
	PA_InitVBL(); // Initializes a standard VBL
	
    PA_InitWifi();
    PA_ConnectWifiWFC();
    
	// Initialise the text system on the top screen
	PA_InitText(0,0);
	PA_InitText(1, 0);

	char *buffer2 = malloc(256*256);

    PA_GetHTTP(buffer2, "http://www.google.be/index.html");
    PA_OutputText(1,0,0,"r: %s",buffer2);
	while (1)
	{
		PA_WaitForVBL();
	}
	
	return 0;
} // End of main()