コード例 #1
0
ファイル: main.c プロジェクト: KlopMHoGoSOP/laughing-ninja
int main()
{
	xenos_init(VIDEO_MODE_VGA_640x480);
	console_init();

	xenon_make_it_faster(XENON_SPEED_FULL);

	usb_init();
	usb_do_poll();

	xenon_ata_init();

	xenon_atapi_init();

	fatInitDefault();
	
	xenon_caps_init("uda:/video.avi");
	xenon_caps_start();
	
	int i = 20;
	while(i>0) {
		printf("I'm happy and you ?\n");
		delay(1);
		printf("Kick Ass !!\n");
		delay(1);
		printf("Real Time encoding !!!\n");
		i--;
	}
	
	xenon_caps_end();
	
	return 0;
}
コード例 #2
0
ファイル: main.c プロジェクト: IUNIXI/LxNAND
int main(void)
{
	xenos_init(VIDEO_MODE_AUTO);
        console_set_colors(0xD8444E00,0xFF96A300);
	console_init();

	usb_init();
	usb_do_poll();     
   
	printf("SFCX Init.\n");
        flashconfig = sfcx_readreg(SFCX_CONFIG);
	sfcx_init();
	if (sfc.initialized != SFCX_INITIALIZED)
        {
                printf(" ! Flashconfig: 0x%08X\n", flashconfig);
		printf(" ! sfcx initialization failure\n");
		printf(" ! nand related features will not be available\n");
		waitforexit();
        }

	printf("Xenon_config_init.\n");
	xenon_config_init();

        prompt(MAIN_MENU);
        
	return 0;
}
コード例 #3
0
ファイル: main.c プロジェクト: deado/buttons
void mainInit()
{ 
	//init
	xenos_init(VIDEO_MODE_AUTO);
	console_set_colors(CONSOLE_COLOR_BLUE,CONSOLE_COLOR_YELLOW);
	console_init();

	usb_init();
	usb_do_poll();
	xenon_make_it_faster(XENON_SPEED_FULL);

}
コード例 #4
0
void main (int argc, char **argv)
{
	// Init libxenon
	xenos_init(VIDEO_MODE_AUTO);
	console_init();

	xenon_make_it_faster(XENON_SPEED_FULL);

#if 0
	threading_init();
	network_init_sys();
#endif

	usb_init();
	usb_do_poll();

	xenon_ata_init();

	xenon_atapi_init();

	fatInitDefault();
#ifdef CAPS	
	fatMountSimple("udb", &usb2mass_ops_1);
	printf("CAPTURE BUILD !!!\n");
#endif	
	// Quake II
	
	char * newargv[] = {
		"uda:/q3.elf",
		//"+set", "game", "baseq2", "+set", "cddir", "uda:/baseq2/"
		"+set", "basedir" , "uda:/",
		"+set", "cddir", "uda:/baseq2/",
		"+set", "cl_maxfps", "400"
	};
	int newargc = sizeof (newargv) / sizeof (char *);
	
	Qcommon_Init (newargc, newargv);
	
	console_close();

	int	time, oldtime, newtime;
	oldtime = Sys_Milliseconds();
	while (1)
	{
		do {
			newtime = Sys_Milliseconds ();
			time = newtime - oldtime;
		} while (time < 1);
		Qcommon_Frame (time);
		oldtime = newtime;
	}
}
コード例 #5
0
ファイル: platform_xenon.c プロジェクト: Ced2911/RetroArch
static void frontend_xenon_init(void *data)
{
   (void)data;
   xenos_init(VIDEO_MODE_AUTO);
   console_init();
   xenon_make_it_faster(XENON_SPEED_FULL);
   usb_init();
   usb_do_poll();
   xenon_ata_init();
#if 0
   dvd_init();
#endif
}
コード例 #6
0
void Sys_PlatformInit( void )
{
	// Init libxenon
	xenos_init(VIDEO_MODE_AUTO);

	console_init();

	xenon_make_it_faster(XENON_SPEED_FULL);
	
	
	http_output_start();
		
#if 0
	threading_init();
	network_init_sys();
#endif	
	
	usb_init();
	usb_do_poll();

	xenon_ata_init();
	xenon_atapi_init();

	// fatInitDefault();
	// XTAFMount();	
	
	// fatInit(16, 1);
	
	fatMount ("uda", &usb2mass_ops_0, 0, 256, 64);
	
	ListDevices();
	
	Sys_SetEnv("HOME", "uda:/");
	
	console_close();
}
コード例 #7
0
ファイル: main.cpp プロジェクト: LibXenonProject/Tank360
int main(int argc, char **argv) {
#ifdef LIBXENON
    xenos_init(VIDEO_MODE_AUTO);
    Hw::SystemInit(INIT_USB|INIT_ATA|INIT_ATAPI|INIT_FILESYSTEM);
    usb_do_poll();

    xenon_smc_start_bootanim();

#endif

    if(argc != 0 && argv[0]) {
        char *tmp = argv_GetFilepath(argv[0]);
        strcpy(rootpath,tmp);
    } else {
        strcpy(rootpath,"uda0:");
    }

    cApp.Run();
    
    while (1) {
    }

    return 0;
}
コード例 #8
0
ファイル: main.c プロジェクト: AirBrowse/libxenon
int main(){
	const char * s;
	char path[256];
	
	int handle;
	struct controller_data_s pad;
	int pos=0,ppos=-1,start,count,i;

	xenos_init(VIDEO_MODE_AUTO);
	console_init();

	xenon_make_it_faster(XENON_SPEED_FULL);
	
	usb_init();
	usb_do_poll();
	
	xenon_ata_init();

	xenon_atapi_init();
	
	fatInitDefault();

	handle=-1;
    handle=bdev_enum(handle,&s);
    if(handle<0) return 0;

	strcpy(path,s);
	strcat(path,":/");	

	load_dir(path);
	
	for(;;){
 		usb_do_poll();		
 		get_controller_data(&pad, 0);
		
		if (pad.s1_y>STICK_THRESHOLD) --pos;
		if (pad.s1_y<-STICK_THRESHOLD) ++pos;
		
		if (entrycount && (pos<0 || pos>=entrycount)){
			pos=ppos;
			continue;
		}
		
		if (pad.logo) return 0;
		
		if (pad.a){
			if(entries[pos].d_type&DT_DIR){
				append_dir_to_path(path,entries[pos].d_name);
				load_dir(path);
				ppos=-1;
				pos=0;
			}else{
				char fn[256];
				strcpy(fn,path);
				strcat(fn,entries[pos].d_name);
				
				printf("%s\n",fn);

				if (strstr(entries[pos].d_name,".elf") || strstr(entries[pos].d_name,".elf32")) { // ugly
					elf_runFromDisk(fn);
				}else{
					FILE * f=fopen(fn,"rb");
					if(f){
						int size=1024*1024;
						int totred=0,red;

						void * buf=malloc(size);

						u64 beg=mftb();
						do{
							red=fread(buf,1,size,f);
							totred+=red;
							console_putch('.');
						}while(red==size);

						printf("\n%d bytes, %f KB/s\n",totred, (float)(totred/1024.0)/((float)(mftb()-beg)/PPC_TIMEBASE_FREQ));

						free(buf);

						fclose(f);
					}
				}
			}
		}
		
		if(pad.back){
			append_dir_to_path(path,"..");
			load_dir(path);
			ppos=-1;
			pos=0;
		}
		
		if(pad.b){
		    do{
				handle=bdev_enum(handle,&s);
			}while(handle<0);
			strcpy(path,s);
			strcat(path,":/");
			load_dir(path);
			ppos=-1;
			pos=0;
		}

		if (ppos==pos) continue;
		
		memset(&pad,0,sizeof(struct controller_data_s));
		
		console_set_colors(BG_COL,FG_COL);
		console_clrscr();
		printf("A: select, B: change disk, Back: parent dir, Logo: reload Xell\n\n%s\n\n",path);
		
		start=MAX(0,pos-MAX_DISPLAYED_ENTRIES/2);
		count=MIN(MAX_DISPLAYED_ENTRIES,entrycount-start);
		
		for(i=start;i<start+count;++i){
			struct dirent *de = &entries[i];

			if (i==pos){
				console_set_colors(FG_COL,BG_COL);
			}else{
				console_set_colors(BG_COL,FG_COL);
			}
			
			if (de->d_type&DT_DIR) console_putch('[');

			s=de->d_name;
			while(*s) console_putch(*s++);
			
			if (de->d_type&DT_DIR) console_putch(']');

			console_putch('\r');
			console_putch('\n');
		}
			
		ppos=pos;
		
		do{
	 		usb_do_poll();		
			get_controller_data(&pad, 0);
		}while(pad.a || pad.b || pad.back || pad.s1_y>STICK_THRESHOLD || pad.s1_y<-STICK_THRESHOLD);
	}
	
	
	return 0;
}
コード例 #9
0
ファイル: xenon.cpp プロジェクト: Cancerous/fceux-xenon
int main() {
    xenon_make_it_faster(XENON_SPEED_FULL);
    xenos_init(VIDEO_MODE_AUTO);

    console_init();
    xenon_sound_init();
    pAudioStart = pAudioBuffer = (uint16_t*) malloc(48000 * sizeof (uint16_t));
    memset(pAudioBuffer, 0, 48000 * sizeof (uint16_t));

    usb_init();
    usb_do_poll();
    SYSVideoInit();

    //    Allocates and initializes memory.  Should only be called once, before
    //    any calls to other FCEU functions.
    FCEUI_Initialize();

    //-------------------------------------------------------------------------------------
    // Set some setting
    //-------------------------------------------------------------------------------------
    //    Specifies the base FCE Ultra directory.  This should be called
    //    immediately after FCEUI_Initialize() and any time afterwards.
    std::string base = "uda:/";
    //FCEUI_SetBaseDirectory(base); // doesn't work ? newlib bug ?
    FCEUI_SetVidSystem(0);

    //Apply settings
    FCEUI_Sound(48000);
    FCEUI_SetSoundVolume(50);
    FCEUI_SetLowPass(0);


    if (FCEUI_LoadGame("uda:/Super Mario Bros. (Europe) (Rev 0A).zip", 0) != NULL) {
        FCEUI_SetInput(0, SI_GAMEPAD, (void*) &powerpadbuf, 0);
        FCEUI_SetInput(1, SI_GAMEPAD, (void*) &powerpadbuf, 0);

        //set to ntsc
        extern FCEUGI * GameInfo;
        GameInfo->vidsys = GIV_NTSC;
    }

    int32 * snd = NULL;
    int32 sndsize;

    //    Copy contents of XBuf over to video memory(or whatever needs to be 
    //    done to make the contents of XBuf visible on screen).
    //    Each line is 256 pixels(and bytes) in width, and there can be 240
    //    lines.  The pitch for each line is 272 bytes.
    //    XBuf will be 0 if the symbol FRAMESKIP is defined and this frame
    //    was skipped.

    uint8 * bitmap;
    while (1) {
        FCEUI_Emulate(&bitmap, &snd, &sndsize, 0);
        for (int i = 0; i < (256 * 240); i++) {
            //Make an ARGB bitmap
            nesBitmap[i] = ((pcpalette[bitmap[i]].r) << 16) | ((pcpalette[bitmap[i]].g) << 8) | (pcpalette[bitmap[i]].b) | (0xFF << 24);
        }
        SYSVideoUpdate();
        // Add Sound
        update_sound(snd,sndsize);
        // Add Input
        update_input();
    }

    return 0;
}
コード例 #10
0
ファイル: main.cpp プロジェクト: metalex10/pcsxr-xenon
int main() {

	printf("main\n");

	xenos_init(VIDEO_MODE_HDMI_720P);
	xenon_make_it_faster(XENON_SPEED_FULL);

	xenon_sound_init();
	//xenos_init(VIDEO_MODE_YUV_720P);
	//console_init();
	usb_init();
	usb_do_poll();
	xenon_ata_init();
	xenon_atapi_init();

	//fatInitDefault();
	
	//char mount[10];
	//sprintf(mount, "uda0");
	//fatMount(mount, &usb2mass_ops_0, 0, 2, 64);
	
	ntfs_md *mounts;
	//ntfsMountAll (&mounts, NTFS_READ_ONLY);
	
	
	XTAFMount();
	
	findDevices();
	
	init_miss();
	
	time_t rawtime;
	time ( &rawtime );
	printf ( "The current local time is: %s", ctime (&rawtime) );
	
	/*

	 */
	memset(&Config, 0, sizeof (PcsxConfig));

	//    network_init();
	//    network_print_config();

	//console_close();

	xenon_smc_start_bootanim(); // tell me that telnet or http are ready

	// telnet_console_init();
	// mdelay(5000);

	//httpd_start();

	// uart speed patch 115200 - jtag/freeboot
	// *(volatile uint32_t*)(0xea001000+0x1c) = 0xe6010000;

	//memset(&Config, 0, sizeof (PcsxConfig));
	strcpy(Config.Net, "Disabled");
	strcpy(Config.Cdr, "CDR");
	strcpy(Config.Gpu, "GPU");
	strcpy(Config.Spu, "SPU");
	strcpy(Config.Pad1, "PAD1");
	strcpy(Config.Pad2, "PAD2");

	strcpy(Config.Bios, "SCPH1001.BIN"); // Use actual BIOS
	//strcpy(Config.Bios, "scph7502.bin"); // Use actual BIOS
	//strcpy(Config.Bios, "HLE"); // Use HLE
	strcpy(Config.BiosDir, "sda0:/devkit/pcsxr/bios");
	strcpy(Config.PatchesDir, "sda0:/devkit/pcsxr/patches_/");

	Config.PsxAuto = 1; // autodetect system
	
	Config.Cpu = CPU_DYNAREC;
	//Config.Cpu =  CPU_INTERPRETER;

	strcpy(Config.Mcd1, "sda0:/devkit/pcsxr/memcards/card1.mcd");
	strcpy(Config.Mcd2, "sda0:/devkit/pcsxr/memcards/card2.mcd");

	// useSoftGpu();
	/*
		strcpy(Config.Mcd1, "sda:/hdd1/xenon/memcards/card1.mcd");
		strcpy(Config.Mcd2, "sda:/hdd1/xenon/memcards/card2.mcd");
	 */

	//InitVideo();

	SetIso(cdfile);
	if (LoadPlugins() == 0) {
		if (OpenPlugins() == 0) {
			if (SysInit() == -1) {
				printf("SysInit() Error!\n");
				return -1;
			}

			SysReset();
			// Check for hle ...
			if (Config.HLE == 1) {
				printf("Can't continue ... bios not found ...\r\n");
				//exit(0);
			}

			CheckCdrom();
			LoadCdrom();

			psxCpu->Execute();
		}
	}

	printf("Pcsx exit ...\r\n");
	return 0;
}
コード例 #11
0
ファイル: main.c プロジェクト: magicseb/RetroArch
int main(void)
{
   const char *s = NULL;
   char path[256];

   int handle;
   struct controller_data_s pad;
   int pos = 0, ppos = -1;

   xenos_init(VIDEO_MODE_AUTO);
   console_init();
   xenon_make_it_faster(XENON_SPEED_FULL);
   usb_init();
   usb_do_poll();
   xenon_ata_init();
   dvd_init();

   handle = -1;
   handle = bdev_enum(handle, &s);
   if (handle < 0)
      return 0;

   strcpy(path, s);
   strcat(path, ":/");	

   load_dir(path);

   for (;;)
   {
      usb_do_poll();		
      get_controller_data(&pad, 0);

      if (pad.s1_y > STICK_THRESHOLD || pad.up)
         pos--;
      if (pad.s1_y < -STICK_THRESHOLD || pad.down)
         pos++;

      if (entrycount && (pos < 0 || pos >= entrycount))
      {
         pos = ppos;
         continue;
      }

      if (pad.logo)
         return 0;

      if (pad.a)
      {
         if (entries[pos].d_type & DT_DIR)
         {
            append_dir_to_path(path,entries[pos].d_name);
            load_dir(path);
            ppos = -1;
            pos = 0;
         }
         else
         {
            char fn[256];
            strcpy(fn, path);
            strcat(fn, entries[pos].d_name);

            printf("%s\n", fn);

            start_ssnes(fn);
         }
      }

      if (pad.select)
      {
         append_dir_to_path(path, "..");
         load_dir(path);
         ppos = -1;
         pos = 0;
      }

      if (pad.b)
      {
         do
         {
            handle = bdev_enum(handle, &s);
         } while (handle < 0);

         strcpy(path, s);
         strcat(path, ":/");
         load_dir(path);
         ppos = -1;
         pos = 0;
      }

      if (ppos == pos)
         continue;

      memset(&pad, 0, sizeof(pad));

      console_set_colors(BG_COL, FG_COL);
      console_clrscr();
      printf("A: select, B: change disk, Back: parent dir, Logo: reload Xell\n\n%s\n\n", path);

      int start = MAX(0, pos - MAX_DISPLAYED_ENTRIES / 2);
      int count = MIN(MAX_DISPLAYED_ENTRIES, entrycount - start);

      for (int i = start; i < start + count; i++)
      {
         struct dirent *de = &entries[i];

         if (i == pos)
            console_set_colors(FG_COL, BG_COL);
         else
            console_set_colors(BG_COL, FG_COL);

         if (de->d_type & DT_DIR)
            console_putch('[');

         s = de->d_name;
         while (*s)
            console_putch(*s++);

         if (de->d_type & DT_DIR)
            console_putch(']');

         console_putch('\r');
         console_putch('\n');
      }

      ppos = pos;

      do
      {
         usb_do_poll();		
         get_controller_data(&pad, 0);
      } while (pad.a || pad.b || pad.select || pad.s1_y > STICK_THRESHOLD || pad.s1_y < -STICK_THRESHOLD);
   }

   return 0;
}