Exemple #1
0
void exitToXMB()
{
	sceIoRemove("ipl_update.prx");
	sceIoRemove("batman.prx");
	sceIoRemove("kuman.prx");
	sceKernelExitGame();
}
Exemple #2
0
static void MemoryError()
{
	pspIoLock();
	pspIoCloseAllAlive();

	sceKernelExitGame();
}
Exemple #3
0
void nge_debug_quitgame()
{
#if defined NGE_PSP
	sceKernelExitGame();
#endif
	exit(-1);
}
Exemple #4
0
// 24MB to use
int main(int argc, char** argv) {
    unsigned int sum;
    int n, m;
    unsigned int *buffers[NUM_BUFFERS];
    unsigned int *buffer;
    char *temp;
    Kprintf("STARTED\n");
    {
        for (n = 0; n < NUM_BUFFERS; n++) {
            buffers[n] = calloc(BUFFER_SIZE, sizeof(unsigned int));
            buffer = buffers[n];
            Kprintf("%s\n", (buffer == NULL) ? "NULL" : "NOT NULL");
            for (m = 0; m < BUFFER_SIZE; m++) buffer[m] = n;
        }
        for (n = 0; n < NUM_BUFFERS; n++) {
            sum = 0;
            buffer = buffers[n];
            for (m = 0; m < BUFFER_SIZE; m++) sum += buffer[m];
            Kprintf("%d: %d\n", n, sum);
        }
        temp = malloc(10 * 1024 * 1024);
        Kprintf("%s\n", (temp == NULL) ? "NULL" : "NOT NULL");
        for (n = 0; n < NUM_BUFFERS; n++) {
            free(buffers[n]);
        }
        temp = malloc(10 * 1024 * 1024);
        Kprintf("%s\n", (temp == NULL) ? "NULL" : "NOT NULL");
    }
    Kprintf("ENDED\n");

    sceKernelExitGame();
    return 0;
}
Exemple #5
0
int main()
{
  callbacks_setup();

  int size = 42, x=0, y=0, dx=2, dy=2;

  while (1)
  {
    x += dx;
    y += dy;
    if (x < 0 || x+size > G2D_SCR_W) dx = -dx;
    if (y < 0 || y+size > G2D_SCR_H) dy = -dy;

    g2dClear(WHITE);

    g2dBeginRects(NULL); // No texture
    g2dSetColor(AZURE);
    g2dSetScaleWH(size,size);
    g2dSetCoordXY(x,y);
    g2dSetAlpha(x*255/G2D_SCR_W); // Useless alpha effect ;)
    g2dAdd();
    g2dEnd();

    g2dFlip(G2D_VSYNC);
  }

  sceKernelExitGame();
  return 0;
}
Exemple #6
0
/* Entry point */
int main(int argc, char **argv)
{
	if(!triAt3Init()) triError("Error starting atrac3 playback");
	
	if(!triNetInit()) triError("Error starting net");

	// Set up callbacks
	SetupCallbacks();
	
	// Game inits
	if(!triLogInit()) triError("Error starting Logging");
	triInit( GU_PSM_8888 );
	tri3dInit();
	if(!triInputInit()) triError("Error starting input");
	triModelManagerInit();
	if(!triWavInit()) triError("Error starting WAV playback");
	
	if(!gameLoadModels()) triError("Error loading models");
	
	while (gameRunning)
	{
		// Game state stuff
	}
	
	// Game shutdown
	triModelManagerFreeAll();
	triInputShutdown();
	triClose();
	tri3dClose();
	triMemoryShutdown();

	sceKernelExitGame();
	
	return 0;
}
Exemple #7
0
/**
 * mode: 0 - OFW mode, 1 - CFW mode
 */
void start_reboot(int mode)
{
	int modid, ret;
	int delay = 0;
	char modpath[80];

	sprintf(modpath, "rebootex.prx");
	modid = kuKernelLoadModule(modpath, 0, 0);

	if (modid >= 0) {
		ret = sceKernelStartModule(modid, sizeof(mode), &mode, 0, NULL);

		if (ret < 0) {
			printf("start module error 0x%08x\n", ret);
			delay = 5000000;
		}
	} else {
		printf("load module error 0x%08x\n", modid);
		delay = 5000000;
	}

	cleanup_exit();
	sceKernelDelayThread(delay);
	sceKernelExitGame();
}
Exemple #8
0
void shutdownServer( int signal )
{
	if(hasShutdown)
		return;
	hasShutdown = true;
	serverRunning = false;
	serverSock.disconnect();
	saveWeapons("weapons.txt");
	serverFlags.save("serverflags.txt");
	for(int i = playerList.count()-1; i >= 0; i--)
		delete ((CPlayer*)playerList[i]);

	if(lsConnected)
		ListServer_End();

	for(int i = 0; i < levelList.count(); i++)
	{
		CLevel* level = (CLevel*)levelList[i];
		level->saveNpcs();
		delete level;
	}

	for(int i = 0; i < CMap::mapList.count(); i++)
		delete((CMap*)CMap::mapList[i]);

	for(int i = 0; i < weaponList.count(); i++)
		delete ((CWeapon*)weaponList[i]);

	errorOut("serverlog.txt", "Server shutdown.");

	#ifdef PSPSDK
		sceKernelExitGame();
	#endif
}
Exemple #9
0
int main(int argc, char* argv[])
{
	if( Initialize() )
	{
#ifdef DAEDALUS_BATCH_TEST_ENABLED
		if( argc > 1 )
		{
			BatchTestMain( argc, argv );
		}
#else
		//Makes it possible to load a ROM directly without using the GUI
		//There are no checks for wrong file name so be careful!!!
		//Ex. from PSPLink -> ./Daedalus.prx "Roms/StarFox 64.v64" //Corn
		if( argc > 1 )
		{
			printf("Loading %s\n", argv[1] );
			System_Open( argv[1] );
			CPU_Run();
			System_Close();
			Finalise();
			sceKernelExitGame();
			return 0;
		}
#endif
		//Translate_Init();
		bool show_splash = true;
		for(;;)
		{
			DisplayRomsAndChoose( show_splash );
			show_splash = false;

			//
			// Commit the preferences and roms databases before starting to run
			//
			CRomDB::Get()->Commit();
			CPreferences::Get()->Commit();

			CPU_Run();
			System_Close();
		}

		Finalise();
	}

	sceKernelExitGame();
	return 0;
}
Exemple #10
0
void psp_finish(void)
{
	lprintf("psp_finish..\n");
	sceGuTerm();

	//sceKernelSleepThread();
	sceKernelExitGame();
}
Exemple #11
0
int main (void)
{
    play_pmf("./data/INTRO.pmf");//To play a .pmf, locate the directory of the .pmf file.
    stop_pmf();//This function stop the video lecture by pressing whatever button.

    sceKernelExitGame();//Exit the Game.
    return 0;
}
Exemple #12
0
//*************************************************************************************
//Set up the Exit Callback (Used to allow the Home Button to work)
//*************************************************************************************
static int ExitCallback( int arg1, int arg2, void * common )
{
#ifdef DAEDALUS_PSP_GPROF
	gprof_cleanup();
#endif
	sceKernelExitGame();
	return 0;
}
Exemple #13
0
static int xUserThread(SceSize args, void* argp)
{
    remove("./xlog.txt");
    X_LOG("Logging started.",0);
    xMain();
    X_LOG("Logging finished.",0);
    sceKernelExitGame();
    return 0;
}
Exemple #14
0
/* Exit callback */
int exit_callback (int arg1, int arg2, void *common)
{
  int status;
  printf ("Stopping modules...\n");
  sceKernelStopModule (modid, 0, NULL, &status, NULL);
  sceKernelUnloadModule (modid);
  sceKernelExitGame ();
  return 0;
}
Exemple #15
0
/* Exit callback */
int exit_callback(void) {

#ifdef ENABLE_PROFILING
	gprof_cleanup();
#endif

	sceKernelExitGame();
	return 0;
}
Exemple #16
0
int ExitCallback (void)
{
	S9xShutdownPSP ();

	if (g_bFatalError)
		sceKernelExitGame ();
	
	return 1;
}
Exemple #17
0
static void frontend_psp_shutdown(bool unused)
{
   (void)unused;
#ifdef VITA
   return;
#else
   sceKernelExitGame();
#endif
}
Exemple #18
0
static void system_deinit(void)
{
#ifdef HAVE_FILE_LOGGER
    if (g_extern.log_file)
        fclose(g_extern.log_file);
    g_extern.log_file = NULL;
#endif

    sceKernelExitGame();
}
Exemple #19
0
int main(int argc, char **argv)
{
    xSetupCallbacks();
    remove("./xlog.txt");
    X_LOG("Logging started.",0);
    xMain();
    X_LOG("Logging finished.",0);
    sceKernelExitGame();
    return 0;
}
Exemple #20
0
void ErrorExit(int milisecs, char *fmt, ...) 
{
	va_list list;
	va_start(list, fmt);
	vsprintf(msg, fmt, list);
	va_end(list);
	printf(msg);
	sceKernelDelayThread(milisecs*1000);
	sceKernelExitGame(); 
}
Exemple #21
0
void App_Shutdown(void)
{
	// Free Memory
	free( dList );
	free( sceneList );
	free( fbp0 );
	
	sceGuTerm();			// Terminating the Graphics System
 
	sceKernelExitGame();
}
Exemple #22
0
int main(int argc, const char *argv[])
{
	MFInitParams initParams;
	initParams.argc = argc;
	initParams.argv = argv;

	int r = GameMain(&initParams);

	sceKernelExitGame();
	return r;
}
Exemple #23
0
int initiateMessage()
{
    char* nickname = (char*)malloc(100);
    int skip = 0;

    oslSetFont(Roboto);
	oslIntraFontSetStyle(Roboto, fontSize, BLACK, 0, INTRAFONT_ALIGN_LEFT);
	
    while(!osl_quit)
    {
       if (!skip)
       {
               oslStartDrawing();
               if (oslIsWlanPowerOn())
               {
                   oslDrawString(10, 10, "Please Enter nickname By Pressing X (Client)...");
                   oslDrawString(10, 25, "Please Press O To Act As Server...");
                   if (oslOskIsActive()){
                    oslDrawOsk();
                    if (oslGetOskStatus() == PSP_UTILITY_DIALOG_NONE)
                    {
                        if (oslOskGetResult() == OSL_OSK_CANCEL)
                        {
                            nickname = (char*)"Client";
                        }   
                        else
                        {
                            oslOskGetText(nickname);
                        }
                        oslEndOsk();
                    }
               }
               else
               {
                   oslDrawString(10, 40, "Please turn on the wlan switch!");
               }
               oslEndDrawing();
           }
           oslEndFrame();
           skip = oslSyncFrame();
           oslReadKeys();
           if (osl_keys->released.cross && oslIsWlanPowerOn())
           {
               oslInitOsk((char*)"Please enter nickname!", (char*)"Client", 99, 1, -1);

           }
      }

    }

    sceKernelExitGame();
    return 0;
}
//Exit back to xmb
static int lua_systemQuit(lua_State *L)
{
    int argc = lua_gettop(L);
    if (argc > 0)
    {
        return luaL_error(L, "System.quit() takes no arguments");
    }

    sceKernelExitGame();

    return 0;
}
Exemple #25
0
int main(int argc, const char *argv[])
{
	MFInitParams initParams;
	MFZeroMemory(&initParams, sizeof(MFInitParams));
	initParams.argc = argc;
	initParams.argv = argv;

	int r = GameMain(&initParams);

	sceKernelExitGame();
	return r;
}
Exemple #26
0
void gameOutro()
{
  setFadeMode(&main_fade,FADE_OUT,0);
  waitFadeDone();

  wait(30.f,0);

  setFadeMode(&main_fade,FADE_IN,0);
  waitFadeDone();

  sceKernelExitGame();
}
Exemple #27
0
void psplinkExitShell(void)
{
#if _PSP_FW_VERSION >= 200
	{
		sceKernelExitVSHVSH(NULL);
	}
#else
	{
		sceKernelExitGame();
	}
#endif
}
Exemple #28
0
static int exit_callback(int arg1, int arg2, void *common)
{
    g_extern.verbose = false;

#ifdef HAVE_FILE_LOGGER
    if (g_extern.log_file)
        fclose(g_extern.log_file);
    g_extern.log_file = NULL;
#endif

    sceKernelExitGame();
    return 0;
}
Exemple #29
0
int main(int argc, char** argv){
    #if PSP
    pspfpu_set_enable(0);
    #endif

	Application a;
	a.Run();

	#if PSP
    sceKernelExitGame();
    #endif
	return 0;
}
Exemple #30
0
void os_fb_end() {
	if (os_byte_fb == NULL)
		return;
//	free(os_byte_fb);
	os_byte_fb = NULL;

	sceGuTerm();

	sceKernelExitGame();
	return 0;

//	x11_display_close();
}