Пример #1
0
bool ExitDemo()
{

#ifdef	__PLAT_NGPS__													  

	prepare_to_exit();													  

	while (1)
	{		
		sceSifExitCmd();			// Sony suggested fix to make LoadExecPS2 work more reliably. 
	
		if (Config::SonyBootstrap())
		{
			printf ("Exiting with sceDemoEnd\n");
			sceDemoEnd(demo_exit_reason);
		}
		else
		{
			sceSifExitCmd();			// Sony suggested fix to make LoadExecPS2 work more reliably. 
			char *args[] = {Config::gReturnString };
			printf ("Exiting with LoadExecPS2( %s [%s] )\n", Config::gReturnTo, Config::gReturnString); 
			LoadExecPS2(Config::gReturnTo, 1, args);
		}
		printf ("ERROR - Failed to exit!!!!!!! RETRYING\n");
	}		
#endif
   
	return true;		// actually will never get here
}
Пример #2
0
bool LoadExec( const char* pELFName )
{

#ifdef __PLAT_NGPS__
	char p_string[100];
	sprintf(p_string,"%s;1",pELFName);	   		// add on the ;1

	prepare_to_exit();
		
	sceSifExitCmd();			// Sony suggested fix to make LoadExecPS2 work more reliably. 
    
	char *args[4];
	args[0] =  "bootstrap";
	if (Config::NTSC())
	{
		args[1] =  "cdrom0:\\SLUS_207.31;1";
		args[2] = "";
		args[3] = "";
	}
	else
	{	
		switch (Config::GetLanguage())
		{
			case Config::LANGUAGE_FRENCH:
				args[1] =  "cdrom0:\\SLES_518.51;1";
				break;
			case Config::LANGUAGE_GERMAN:
				args[1] =  "cdrom0:\\SLES_518.52;1";
				break;
			case Config::LANGUAGE_ITALIAN:
				args[1] =  "cdrom0:\\SLES_518.53;1";
				break;
			case Config::LANGUAGE_SPANISH:
				args[1] =  "cdrom0:\\SLES_518.54;1";
				break;
			default:
				Dbg_MsgAssert(0,("Bad Language (%d)",(int)(Config::GetLanguage())));
				// allow drop through to english as a failsafe.  
			case Config::LANGUAGE_ENGLISH:
				args[1] =  "cdrom0:\\SLES_518.48;1";
				break;			
		}
		args[2] = "PAL";
		args[3] = "Framerate=50";
	}
    printf ("LoadExecPS2(%s) args = (%s,%s,%s,%s)\n",p_string, args[0], args[1], args[2], args[3] );
	LoadExecPS2(p_string, 4, args);
	printf ("LoadExecPS2 Failed - probably file not found, profiling on, or bad media type\n");
//    LoadExecPS2("cdrom0:\\demo\\slus_201.99;1", 2, args);
   

#endif		// __PLAT_NGC__
	return true;		// actually will never get here}
}
Пример #3
0
main(int argc, char *argv[])
{
    NODE *exec_list = NIL;
#ifdef MEM_DEBUG
    extern long int mem_allocated, mem_freed;
#endif

#ifdef x_window
    x_window_init(argc, argv);
#endif
#ifdef mac
    init_mac_memory();
#endif
    term_init();
    if (argc < 2) {
	if (isatty(1)) lcleartext();
	printf("Welcome to Berkeley Logo version 3.0.1");
	new_line(stdout);
    }
    init();
#ifdef ibm
    signal(SIGINT, SIG_IGN);
#ifdef __ZTC__
    _controlc_handler = do_ctrl_c;
    controlc_open();
#endif
#else
    signal(SIGINT, logo_stop);
#endif
    signal(SIGQUIT, logo_pause);
    /* SIGQUITs never happen on the IBM */
    argv++;
    while (--argc > 0 && NOT_THROWING) {
	silent_load(NIL,*argv++);
    }
    for (;;) {
	if (NOT_THROWING) {
#ifdef MEM_DEBUG
	    printf("alloc=%d, freed=%d, used=%d\n",
		   mem_allocated, mem_freed, mem_allocated-mem_freed);
#endif
	    current_line = reref(current_line, reader(stdin,"? "));
	    if (feof(stdin) && !isatty(0)) lbye();
	    exec_list = parser(current_line, TRUE);
	    val_status = 0;
	    if (exec_list != NIL) eval_driver(exec_list);
	}
	if (stopping_flag == THROWING) {
	    if (compare_node(throw_node, Error, TRUE) == 0) {
		err_print();
	    } else if (compare_node(throw_node, System, TRUE) == 0)
		break;
	    else if (compare_node(throw_node, Toplevel, TRUE) != 0) {
		err_logo(NO_CATCH_TAG, throw_node);
		err_print();
	    }
	    stopping_flag = RUN;
	}
	if (stopping_flag == STOP || stopping_flag == OUTPUT) {
	    print_node(stdout, make_static_strnode(
		"You must be in a procedure to use OUTPUT or STOP.\n"));
	    stopping_flag = RUN;
	}
    }
    prepare_to_exit(TRUE);
}